This commit is contained in:
helloDy
2023-11-27 09:38:31 +08:00
parent 7f5b9d5228
commit b0efd66a75
16 changed files with 392 additions and 144 deletions

View File

@@ -2,43 +2,45 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 10:32:10
* @LastEditTime: 2023-11-25 18:09:05
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门编码" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上级部门" prop="parentId">
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="部门名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入部门名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门编码" prop="code">
<el-input v-model="dataForm.code" clearable placeholder="请输入部门编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上级部门" prop="parentId">
<treeselect v-model="dataForm.parentId" :options="menuOptions" :normalizer="normalizer" :show-count="true" placeholder="选择上级部门" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="dataForm.remark"
placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</template>
<script>
@@ -68,6 +70,7 @@ export default {
},
departmentlList: [],
menuOptions: [],
isChoosed: false,
dataRule: {
code: [{ required: true, message: "部门编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "部门名称不能为空", trigger: "blur" }],
@@ -104,3 +107,9 @@ export default {
},
};
</script>
<style scoped>
.dialog {
min-height: 180px;
}
</style>

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-15 16:23:49
* @LastEditTime: 2023-11-25 11:25:23
* @Description:
-->
<template>
@@ -46,6 +46,9 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
</template>
@@ -70,7 +73,8 @@ export default {
code: undefined,
name: undefined,
unit: undefined,
dailyCost: undefined
dailyCost: undefined,
remark: undefined
},
departmentlList: [],
menuOptions: [],

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-15 15:41:44
* @LastEditTime: 2023-11-27 09:23:56
* @Description:
-->
<template>
@@ -253,8 +253,8 @@ export default {
isdetail: false,
idAttrShow: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]

View File

@@ -143,12 +143,6 @@ export default {
}
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:detail`)
? {
type: 'detail',
@@ -171,6 +165,12 @@ export default {
}
}
: undefined,
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '预使用原料信息',
}
: undefined,
{
type: 'active',
btnName: '激活',

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 08:55:37
* @LastEditTime: 2023-11-27 09:21:48
* @Description:
-->
<template>
@@ -43,7 +43,9 @@
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="dataForm.sort"
placeholder="排序" />
controls-position="right"
placeholder="排序"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>

View File

@@ -29,7 +29,7 @@
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>

View File

@@ -2,14 +2,14 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 11:22:38
* @LastEditTime: 2023-11-27 09:36:44
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="isdetail"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
@@ -156,12 +156,12 @@
@pagination="getList" />
</div>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">{{ isdetail ? '关闭' : '取消' }}</el-button>
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button v-if="!isdetail" type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
@@ -432,7 +432,7 @@ export default {
}
.action_btn {
float: right;
margin: -35px 15px;
margin: -40px 15px;
font-size: 14px;
}
.add {

View File

@@ -13,7 +13,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="220"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
@@ -85,25 +85,25 @@ export default {
},
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:material:queryAttr`)
? {
type: 'detail',
btnName: '查看属性',
}
: undefined,
this.$auth.hasPermi(`base:material:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:material:queryAttr`)
? {
type: 'search',
btnName: '查看属性',
}
: undefined,
this.$auth.hasPermi(`base:material:editAttr`)
? {
type: 'editAttr',
btnName: '编辑属性',
}
: undefined,
this.$auth.hasPermi(`base:material:delete`)
// this.$auth.hasPermi(`base:material:editAttr`)
// ? {
// type: 'editAttr',
// btnName: '编辑属性',
// }
// : undefined,
this.$auth.hasPermi(`base:material:delete`)
? {
type: 'delete',
btnName: '删除',
@@ -136,7 +136,7 @@ export default {
},
{
type: this.$auth.hasPermi('base:material:create') ? 'button' : '',
btnName: '新增物料',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
@@ -166,7 +166,7 @@ export default {
});
},
otherMethods(val) {
if (val.type === 'search') {
if (val.type === 'detail') {
this.addOrUpdateVisible = true;
this.addOrEditTitle = '详情';
this.$nextTick(() => {

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-23 15:00:00
* @LastEditTime: 2023-11-25 19:10:12
* @Description:
-->
<template>
@@ -85,28 +85,30 @@
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称">
<el-table-column prop="materialId" label="物料名称*">
<template slot-scope="scope">
<el-select
v-model="scope.row.materialId"
filterable
clearable
:disabled="!scope.row.isEdit"
placeholder="请选择物料"
@change="setCode(scope.row)">
<el-option
v-for="dict in materialList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
v-model="scope.row.materialId"
filterable
clearable
:disabled="!scope.row.isEdit"
placeholder="请选择物料"
@change="setCode(scope.row)">
<el-option
v-for="dict in materialList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
<span v-if="scope.row.isShow" style="color: red">物料不可为空</span>
</template>
</el-table-column>
<el-table-column prop="materialCode" label="物料编码" />
<el-table-column prop="mUnit" label="单位" />
<el-table-column prop="num" label="数量">
<el-table-column prop="num" label="数量*">
<template slot-scope="scope">
<el-input v-model="scope.row.num" :disabled="!scope.row.isEdit"></el-input>
<el-input v-model.number="scope.row.num" :disabled="!scope.row.isEdit" @input="changeNum(scope.row)"></el-input>
<span v-if="scope.row.isNum" style="color: red">数量不可为空</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
@@ -297,21 +299,35 @@ export default {
})
.catch(() => {});
},
setCode(row) {
const tempM = this.materialList.filter(item => {
if (row.materialId === item.id) {
row.materialCode = item.code
}
return row.materialId === item.id
})
if (tempM[0].unit) {
this.unitList.filter(u => {
if (tempM[0].unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
changeNum(row) {
if (row.num !== '') {
row.isNum = false
} else {
row.isNum = true
}
},
setCode(row) {
if (row.materialId) {
row.isShow = false
const tempM = this.materialList.filter(item => {
if (row.materialId === item.id) {
row.materialCode = item.code
}
return row.materialId === item.id
})
if (tempM[0].unit) {
this.unitList.filter(u => {
if (tempM[0].unit === u.value) {
row.unit = u.value
row.mUnit = u.label
}
})
} else {
row.unit = null
row.mUnit = ''
}
} else {
row.isShow = true
row.unit = null
row.mUnit = ''
}
@@ -322,6 +338,7 @@ export default {
row.isEdit = true
},
saveData(row) {
if (row.materialId) {
// this.$refs['dataForm'].validate((valid) => {
// if (valid) {
// 修改的提交
@@ -336,13 +353,16 @@ export default {
return;
}
// 添加的提交
createMaterialPBDet({
...row
}).then((response) => {
this.$modal.msgSuccess('新增成功');
// this.visible = false;
this.getList();
});
createMaterialPBDet({
...row
}).then((response) => {
this.$modal.msgSuccess('新增成功');
// this.visible = false;
this.getList();
});
} else {
this.$message.warning('请选择物料!')
}
// }
// });
},