From 2a962e471e59e49b26efec424302bb124bdc5e6e Mon Sep 17 00:00:00 2001 From: xielue Date: Sat, 16 Sep 2023 11:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MoldProductionOrder/ComponentDetail.vue | 2 +- .../Middle/Mold/MoldProductionOrder/Edit.vue | 89 +++++++++++-------- 2 files changed, 52 insertions(+), 39 deletions(-) diff --git a/src/pages/Middle/Mold/MoldProductionOrder/ComponentDetail.vue b/src/pages/Middle/Mold/MoldProductionOrder/ComponentDetail.vue index 0cb2a17..c02a906 100644 --- a/src/pages/Middle/Mold/MoldProductionOrder/ComponentDetail.vue +++ b/src/pages/Middle/Mold/MoldProductionOrder/ComponentDetail.vue @@ -604,7 +604,7 @@ export default { { field: 'component_num', type: 'integer' }, { field: 'prepare_process_time', type: 'timestamp' }, { field: 'plan_complete_time', type: 'timestamp' }, - + { field: 'id', type: 'bigint' }, { field: 'update_uid', type: 'bigint' }, { field: 'complete_uid', type: 'bigint' }, diff --git a/src/pages/Middle/Mold/MoldProductionOrder/Edit.vue b/src/pages/Middle/Mold/MoldProductionOrder/Edit.vue index 23a7bc7..d57d220 100644 --- a/src/pages/Middle/Mold/MoldProductionOrder/Edit.vue +++ b/src/pages/Middle/Mold/MoldProductionOrder/Edit.vue @@ -9,7 +9,8 @@ 选择订单 保存 - 审批 + 审批 打印 @@ -33,7 +34,7 @@ - + @@ -57,7 +58,8 @@

出现问题及建议反馈

+ :title-align="formOptions2.titleAlign" :rules="formOptions2.rules" :items="formOptions2.items" :titleColon="false" + vertical> @@ -194,27 +196,27 @@ export default { { field: 'inlay_deep_hole_time', dataRule: { type: 'timestamp' }, title: '镶件深孔钻到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } }, { field: 'horizontal_frame_time', dataRule: { type: 'timestamp' }, title: '横架到厂日期预计', span: 8, itemRender: { name: '$input', props: { type: 'date' } } }, - + { field: 'problem', title: '出现问题及建议反馈', span: 8, itemRender: { name: '$input', props: {} } }, { - title: '模具师傅', span: 8, - field: 'mold_master_user_detail', - dataRule: { - fromField: "id", - saveField: "mold_master_uid" // 如果表单项存储的是对象,将从fromField中取得值保存到saveField - }, - itemRender: { - name: 'MkFormDataSelector', props: { - params: { - dataType: "object", - valueField: "id", - textField: "name", - listdataFieldName: 'MesStaff', - dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list` - } + title: '模具师傅', span: 8, + field: 'mold_master_user_detail', + dataRule: { + fromField: "id", + saveField: "mold_master_uid" // 如果表单项存储的是对象,将从fromField中取得值保存到saveField + }, + itemRender: { + name: 'MkFormDataSelector', props: { + params: { + dataType: "object", + valueField: "id", + textField: "name", + listdataFieldName: 'MesStaff', + dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list` } } - }, + } + }, { field: 'progress', title: '进度', span: 16, itemRender: { name: 'MkFormProgress', props: { @@ -230,7 +232,7 @@ export default { formOptions2: { - data: { + data: { }, // 标题宽度 titleWidth: 180, @@ -238,14 +240,14 @@ export default { titleAlign: 'top', // 表单校验规则 - rules: { + rules: { }, // 表单项 items: [ - - - { showTitle:false, field: 'problem', title: '', span: 24, itemRender: { name: '$textarea', props: {} } }, - + + + { showTitle: false, field: 'problem', title: '', span: 24, itemRender: { name: '$textarea', props: {} } }, + ] }, @@ -334,7 +336,7 @@ export default { }, - loadCount : 0, + loadCount: 0, }; @@ -390,7 +392,7 @@ export default { this.formOptions2.data = { - problem : a.data[this.detailDataFieldName].problem + problem: a.data[this.detailDataFieldName].problem } this.detailsData = JSON.parse(JSON.stringify(a.data[this.detailDataFieldName].mold_production_order_component || [])); @@ -432,7 +434,7 @@ export default { let keys = []; let infos = []; - this.loadCount ++; + this.loadCount++; this.detailsData.forEach(item => { if (!item.component_id) { @@ -600,9 +602,9 @@ export default { this.formOptions.data.horizontal_frame_time = this.getDateValue(detail.horizontal_frame_time); } - if(detail.mold_master_uid){ + if (detail.mold_master_uid) { this.formOptions.data.mold_master_uid = detail.mold_master_uid; - this.formOptions.data.mold_master_user_detail = {id:detail.mold_master_user_detail.id,name:detail.mold_master_user_detail.name}; + this.formOptions.data.mold_master_user_detail = { id: detail.mold_master_user_detail.id, name: detail.mold_master_user_detail.name }; } this.formOptions.data = JSON.parse(JSON.stringify(this.formOptions.data)) @@ -629,7 +631,7 @@ export default { let row = a.data.mold_scheme; - + let mold_scheme_processes = row.mold_scheme_processes || []; let currentAddRows1 = []; let currentAddRows2 = []; @@ -652,7 +654,7 @@ export default { }) }); - + this.clearInfos(); currentAddRows1.forEach(row => { this.addInfo({ @@ -660,7 +662,7 @@ export default { rows2: currentAddRows2.filter(a => a.component_id == row.component_id), header: row.component_detail.name }); - }) + }) } }); @@ -726,11 +728,11 @@ export default { let action = !this.isEdit ? this.actions.create : this.actions.update; // 如果是新增模式,提交的数据中加入id 如果是编辑模式,提交的数据中不加入id let postdata = Object.assign({}, this.formOptions.data, this.formOptions2.data); - + // 格式化提交的数据 this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items }); - + if (postdata.id) { postdata.id = this.$mk.toBigInt(postdata.id); } @@ -745,11 +747,22 @@ export default { postdata.mold_master_uid = this.$mk.toBigInt(postdata.mold_master_uid); } - + postdata.mold_production_order_component = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] }; postdata.mold_production_order_component_processes = !this.isEdit ? [] : { insertList: [], deleteList: [], updateList: [] }; + let componentDetails = this.$refs['componentDetail']; + + if (componentDetails) { + componentDetails.forEach(componentDetail => { + if (componentDetail.postDataUpdate) { + console.log("postDataUpdate"); + componentDetail.postDataUpdate(); + } + }) + } + this.infos.forEach(info => { if (!info.data.postdata) { return; @@ -786,7 +799,7 @@ export default { value: postdata.mold_production_order_component_processes }); } - + // 提交数据 this.$mk.post({ url: action,