From f17c5f3606b41497001971cae85e2052800ecfdc Mon Sep 17 00:00:00 2001 From: shijing Date: Mon, 3 Aug 2026 13:57:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A6=85=E9=81=93453?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/inm.js | 9 +++++++++ src/views/wpm_bx/inmOut.vue | 28 +++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/api/model/inm.js b/src/api/model/inm.js index 4a4a4729..a87f7020 100644 --- a/src/api/model/inm.js +++ b/src/api/model/inm.js @@ -251,5 +251,14 @@ export default { `${config.API_URL}/inm/mioitemw/${id}/`); } }, + cquery: { + name: "查询", + req: async function(data){ + return await http.post( + `${config.API_URL}/inm/mioitemw/cquery/`, + data + ); + } + } }, } \ No newline at end of file diff --git a/src/views/wpm_bx/inmOut.vue b/src/views/wpm_bx/inmOut.vue index b0a047f2..4e3a8fe6 100644 --- a/src/views/wpm_bx/inmOut.vue +++ b/src/views/wpm_bx/inmOut.vue @@ -672,12 +672,34 @@ export default { params.label_template_name = '排一次棒打印模板'; that.printFun(params); }) - }else if(that.route_code=='qingxi'||that.route_code=='kunbang'||that.route_code=='ladansi'||that.route_code=='yicifusi'||that.route_code=='paiercibang'|| + }else if(that.route_code=='qingxi'||that.route_code=='kunbang'||that.route_code=='yicifusi'||that.route_code=='paiercibang'|| that.route_code=='ercifusi'||that.route_code=='qiesi'||that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'){ params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; params.label_template_name = '脱模测量前工序打印模板'; that.printFun(params); - }else{ + }else if(that.route_code=='ladansi'){ + this.$API.inm.mioitemw.cquery.req({querys:[[{field:'number',compare:"", value:row.number_from}]]}).then((res) => { + let ave = 0,sum = 0,cnt = 0; + let targetNames = ['管壁厚上1','管壁厚上2','管壁厚下1','管壁厚下2']; + res.results.forEach(item=>{ + if(item.ftest!=null&&item.ftest!==''){ + if(item.ftest.ftestitems&&item.ftest.ftestitems.length>0){ + item.ftest.ftestitems.forEach(it=>{ + if(targetNames.indexOf(it.testitem_name)>-1 && it.test_val_json!==null && it.test_val_json!==''&&it.test_val_json!==undefined){ + sum += Number(it.test_val_json); + cnt++; + } + }) + } + } + }) + ave = cnt>0 ? sum/cnt : 0; + console.log('ave',ave); + params.extra_data={orimaterial:row.material_ofrom_name,count:row.count,ave:ave}; + params.label_template_name = '拉单丝打印模板'; + that.printFun(params); + }) + } else{ let numbers = ['','','','','','','','','','','','','','']; let numberList = []; this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { @@ -787,7 +809,7 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => { obj.printer_commands = res.commands; obj.printer_name = that.printer_name; let printer_ip=localStorage.getItem("printer_ip")||'127.0.0.1'; -that.$API.wpm.prints.req(printer_ip, obj).then((response) => { + that.$API.wpm.prints.req(printer_ip, obj).then((response) => { that.$message.success("打印成功"); }); })