fix:生产工单-"生成工单“功能优化(二级dialog关闭后,一级dialog不关闭)

This commit is contained in:
zhangxuanming
2025-01-17 11:16:16 +08:00
parent 6e5b8747d8
commit e47de51f09

View File

@@ -228,7 +228,7 @@
/>
<!-- 添加或修改生产工单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="960px" @close="cancel" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="16">
@@ -486,6 +486,10 @@ export default {
},
// 表单参数
form: {},
formStatus: "parent",
// 生成工单后的表单
secondaryForm: {},
primaryForm: {},
// 表单校验
rules: {
workorderCode: [
@@ -565,8 +569,26 @@ export default {
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
if (this.formStatus == 'parent') {
this.open = false;
this.reset();
} else {
this.reset()
this.formStatus = 'parent'
this.getTreeselect();
const workorderId = this.primaryForm.workorderId;
getWorkorder(workorderId).then(response => {
this.form = response.data
this.open = true;
this.$nextTick(() => {
this.$refs.barcodeImg.getBarcode();
})
this.title = "查看工单信息";
this.optType = "view";
});
}
},
// 表单重置
reset() {
@@ -615,6 +637,8 @@ export default {
},
//从BOM行中直接新增
handleSubAdd(row){
this.primaryForm = this.form
this.formStatus = "child"
this.open = false;
this.reset();
this.getTreeselect();
@@ -657,7 +681,6 @@ export default {
this.form = response.data
this.open = true;
this.$nextTick(() => {
console.log("2232",this.$refs.barcodeImg)
this.$refs.barcodeImg.getBarcode();
})
@@ -675,7 +698,6 @@ export default {
getWorkorder(row.workorderId).then(response => {
this.form = response.data;
console.log("3232",this.form)
this.form.workorderCode = response.data.workorderCode
this.form.workorderId = response.data.workorderId
this.open = true;