diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index 9c2d8116..3b411156 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -47,6 +47,7 @@ 物料编号 生产设备 扭转日期 + 工装 {{ item.testitem_name }} {{ item.defect_name }} 备注 @@ -83,6 +84,14 @@
{{ row.work_start_time}}
+ + + + {{ getToolingName(row.wpr_pre_info?.tooling) || row.tooling_name }} {{ row[item.testitem_name] }} @@ -432,6 +441,7 @@ export default { }, optionsEq:[], + optionsTooling:[], defectlists:[], testitemlists:[], selectWprList:[], @@ -460,6 +470,9 @@ export default { if(that.route_code=='niuzhuan'){ that.getEquipment4(); } + if(that.mgroupName=='喷码'){ + that.getToolings(); + } if(that.qct!==''&&that.qct!==null){//输出 that.getdefects(); }else{ @@ -551,6 +564,31 @@ export default { that.optionsEq = res.reverse(); }) }, + getToolings() { + let that = this; + that.$API.em.equipment.list.req({page:0,type:10,cate__code:"7",query:"{id,name,number}"}).then((res) => { + that.optionsTooling = Array.isArray(res) ? res : (res.results || []); + }) + }, + getToolingName(id) { + if (!id) return ''; + const item = this.optionsTooling.find(t => t.id == id); + return item ? item.name : id; + }, + autoSyncTooling() { + const that = this; + if (that.mgroupName !== '喷码') return; + that.mlogbwlist.forEach((row) => { + const wprTooling = row.wpr_pre_info?.tooling; + if (wprTooling && row.tooling != wprTooling && row.id) { + that.$API.wpm.mlogbw.update.req(row.id, { tooling: wprTooling,number:row.number,mlogb:row.mlogb }).then((res) => { + row.tooling = res.tooling; + row.tooling_name = res.tooling_name; + row.tooling_number = res.tooling_number; + }).catch(() => {}); + } + }); + }, getEquipments(){ let that = this; that.$API.em.equipment.list.req({page:0,cate__code:"6"}).then((res) => { @@ -690,6 +728,9 @@ export default { that.mlogbwlist.push(obj); }) } + that.$nextTick(() => { + that.autoSyncTooling(); + }); }) }, widthFun(item){ @@ -719,6 +760,9 @@ export default { if(row.equip){ obj.equip = row.equip; } + if(row.tooling){ + obj.tooling = row.tooling; + } //qct不为空,有检验表 if((that.qct!==''&&that.qct!==null)||(that.qctId!==''&&that.qctId!==null)){ obj.ftest = {}; @@ -762,6 +806,8 @@ export default { 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(); return res; @@ -778,6 +824,8 @@ export default { 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(); return res; @@ -796,6 +844,12 @@ export default { formTableEdit(index) { let that = this; that.mlogbwlist[index].isEdit = true; + if(that.mgroupName=='喷码'){ + const wprTooling = that.mlogbwlist[index].wpr_pre_info?.tooling; + if(wprTooling && that.mlogbwlist[index].tooling != wprTooling){ + that.mlogbwlist[index].tooling = wprTooling; + } + } let date = new Date(); if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){ that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss'); diff --git a/src/views/wpm_bx/wprList.vue b/src/views/wpm_bx/wprList.vue index 37baa74b..5dc3e94d 100644 --- a/src/views/wpm_bx/wprList.vue +++ b/src/views/wpm_bx/wprList.vue @@ -69,7 +69,7 @@