From c54942ea5848c7035b3051b434570e4f6e2fb5d4 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 26 Aug 2025 14:30:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=8E=BB=E7=BA=A4=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E6=8E=92=E6=A3=92=E6=89=B9=E6=AC=A1=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E5=8D=95=E4=B8=AA=E6=89=93=E5=8D=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/inmOut.vue | 121 +++++++++++++++++++++++------------- 1 file changed, 77 insertions(+), 44 deletions(-) diff --git a/src/views/wpm_bx/inmOut.vue b/src/views/wpm_bx/inmOut.vue index 8e9885e1..3426f722 100644 --- a/src/views/wpm_bx/inmOut.vue +++ b/src/views/wpm_bx/inmOut.vue @@ -671,14 +671,27 @@ export default { }); }) }) - }else{ - if(that.route_code=='paiyicibang'){ - params.extra_data={orimaterial:row.material_ofrom_name}; + }else if(that.route_code=='paiyicibang'){ + that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { + let namearr = row.material_name.split('排一次棒'); + let extra_data = res[0].params_json; + extra_data.batch = row.batch; + extra_data.material_name=namearr[0]; + extra_data.orimaterial=row.material_ofrom_name; + params.extra_data = extra_data; params.label_template_name = '排一次棒打印模板'; - }else{ - params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; - params.label_template_name = '其他工序打印模板'; - } + that.apiObjPrint.req(params).then((res) => { + let obj = {}; + obj.printer_commands = res.commands; + obj.printer_name = that.printer_name; + that.$API.wpm.prints.req(obj).then((response) => { + that.$message.success("打印成功"); + }); + }); + }) + }else{ + params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; + params.label_template_name = '其他工序打印模板'; that.apiObjPrint.req(params).then((res) => { let obj = {}; obj.printer_commands = res.commands; @@ -691,45 +704,65 @@ export default { }else if(type=='wpr'){ let params = {}; let name = row.material_name.split('|')[0]; - if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'|| - that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo' - ){ - let oinfo = []; - for(let key in row.oinfo){ - oinfo.push(row.oinfo[key]) - } - let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch}; - if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){ - params.label_template_name = '脱膜测量单件标签模板'; - }else{ - params.label_template_name = '排扳单件打印模板'; - } - if(oinfo.length>0){ - oinfo.forEach((item)=>{ - if(item.name=="丝高"){ - data.sigao = item.val; - }else if(item.name=="对边"){ - data.duibian = item.val; - }else if(item.name=="模具号"){ - data.moban = item.val; - }else if(item.name=="实验板段"){ - data.istest = item.val?'是':'否'; - } - }) - } - params.data = data; + if(that.route_code=='paiyicibang'){ + that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { + console.log('排一次棒单件打印res',res); + let data = res[0].params_json; + data.number = row.number; + data.name=name; + data.ofrom_name=that.ofrom_name; + params.data = data; + params.label_template_name = '排一次棒单件打印模板'; + that.$API.cm.labeltemplate.commands.req(params).then((res) => { + let obj = {}; + obj.printer_commands = res.commands; + obj.printer_name = that.printer_name; + that.$API.wpm.prints.req(obj).then((response) => { + that.$message.success("打印成功"); + }); + }); + }) }else{ - params.label_template_name = '单件打印模板'; - params.data = {number:row.number,name:name}; - } - that.$API.cm.labeltemplate.commands.req(params).then((res) => { - let obj = {}; - obj.printer_commands = res.commands; - obj.printer_name = that.printer_name; - that.$API.wpm.prints.req(obj).then((response) => { - that.$message.success("打印成功"); + if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'|| + that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo' + ){ + let oinfo = []; + for(let key in row.oinfo){ + oinfo.push(row.oinfo[key]) + } + let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch}; + if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){ + params.label_template_name = '脱膜测量单件标签模板'; + }else{ + params.label_template_name = '排扳单件打印模板'; + } + if(oinfo.length>0){ + oinfo.forEach((item)=>{ + if(item.name=="丝高"){ + data.sigao = item.val; + }else if(item.name=="对边"){ + data.duibian = item.val; + }else if(item.name=="模具号"){ + data.moban = item.val; + }else if(item.name=="实验板段"){ + data.istest = item.val?'是':'否'; + } + }) + } + params.data = data; + }else{ + params.label_template_name = '单件打印模板'; + params.data = {number:row.number,name:name}; + } + that.$API.cm.labeltemplate.commands.req(params).then((res) => { + let obj = {}; + obj.printer_commands = res.commands; + obj.printer_name = that.printer_name; + that.$API.wpm.prints.req(obj).then((response) => { + that.$message.success("打印成功"); + }); }); - }); + } } }else{ that.$message.warning("请先设置打印机");