From 075075ab460ffe2232affd6be2bf4ecf0b5055d1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 4 Aug 2026 14:32:25 +0800 Subject: [PATCH] feat(wpm): confirm output material renumbering --- src/views/wpm_bx/mlogbw_check.vue | 17 ++++++++++++++++- src/views/wpm_bx/mlogbw_check_table.vue | 25 +++++++++++++++++-------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index 69a963a6..4ef2fd2b 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -799,8 +799,19 @@ export default { }) }, //添加 - formTableSave(row) { + async formTableSave(row) { let that = this; + if (row.id && row.wpr && row._numberBeforeEdit !== undefined && row._numberBeforeEdit !== row.number) { + try { + await that.$confirm( + `物料编号将从“${row._numberBeforeEdit}”改为“${row.number}”,并同步修改关联的 WPR 及相关明细,是否继续?`, + "修改物料编号", + { type: "warning" } + ); + } catch (error) { + return; + } + } let obj = {}; obj.number = row.number; obj.mlogb = row.mlogb; @@ -879,6 +890,9 @@ export default { let that = this; that.mlogbwlist.forEach((item, index) => { if (item.id == row.id) { + if (item._numberBeforeEdit !== undefined) { + that.mlogbwlist[index].number = item._numberBeforeEdit; + } that.mlogbwlist[index].isEdit = false; if(that.mode == 'ins'&&that.route_code=='niuzhuan'&&(row.equip==''||row.equip==null)){ that.mlogbwlist[index].work_start_time = null; @@ -891,6 +905,7 @@ export default { let that = this; that.mlogbwlist.forEach((item, index) => { if (item.id == row.id) { + that.mlogbwlist[index]._numberBeforeEdit = that.mlogbwlist[index].number; that.mlogbwlist[index].isEdit = true; let date = new Date(); if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){ diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index d6057358..20384397 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -805,8 +805,19 @@ export default { } }, //添加 - formTableSave(row,index) { + async formTableSave(row,index) { let that = this; + if (row.id && row.wpr && row._numberBeforeEdit !== undefined && row._numberBeforeEdit !== row.number) { + try { + await that.$confirm( + `物料编号将从“${row._numberBeforeEdit}”改为“${row.number}”,并同步修改关联的 WPR 及相关明细,是否继续?`, + "修改物料编号", + { type: "warning" } + ); + } catch (error) { + return; + } + } let editIndex = 0; that.mlogbwlist.forEach((item,index) => { if(item.id==row.id){ @@ -867,13 +878,7 @@ export default { obj.id = row.id; that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => { that.$message.success("保存成功"); - that.mlogbwlist[editIndex].isEdit = false; - that.mlogbwlist[editIndex].equip_name = res.equip_name; - that.mlogbwlist[editIndex].equip_number = res.equip_number; - that.mlogbwlist[editIndex].tooling_name = res.tooling_name; - that.mlogbwlist[editIndex].tooling_number = res.tooling_number; - that.mlogbwlist[editIndex].work_start_time = res.work_start_time; - // that.getList(); + that.getList(); return res; }).catch((err) => { return err; @@ -901,12 +906,16 @@ export default { formTableCancel(row){ this.mlogbwlist.forEach((item, index) => { if (item.id == row.id) { + if (item._numberBeforeEdit !== undefined) { + this.mlogbwlist[index].number = item._numberBeforeEdit; + } this.mlogbwlist[index].isEdit = false; } }); }, formTableEdit(index) { let that = this; + that.mlogbwlist[index]._numberBeforeEdit = that.mlogbwlist[index].number; that.mlogbwlist[index].isEdit = true; if(that.mgroupName=='喷码'){ const wprTooling = that.mlogbwlist[index].wpr_pre_info?.tooling;