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;