From e47de51f0921f40ba06d74ec7326abff6436dda3 Mon Sep 17 00:00:00 2001 From: zhangxuanming <2260476558@qq.com> Date: Fri, 17 Jan 2025 11:16:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=94=9F=E4=BA=A7=E5=B7=A5?= =?UTF-8?q?=E5=8D=95-"=E7=94=9F=E6=88=90=E5=B7=A5=E5=8D=95=E2=80=9C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=88=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?dialog=E5=85=B3=E9=97=AD=E5=90=8E=EF=BC=8C=E4=B8=80=E7=BA=A7dia?= =?UTF-8?q?log=E4=B8=8D=E5=85=B3=E9=97=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/pro/workorder/index.vue | 32 ++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/views/mes/pro/workorder/index.vue b/src/views/mes/pro/workorder/index.vue index d51f491..347ca22 100644 --- a/src/views/mes/pro/workorder/index.vue +++ b/src/views/mes/pro/workorder/index.vue @@ -228,7 +228,7 @@ /> - + @@ -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;