From a30e7e0dccbbfb8dda9761ceb2702494a6997c5e Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 11 Sep 2025 14:08:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BD=A6=E9=97=B4=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=89=B9=E6=AC=A1&=E6=9D=BF=E6=AE=B5?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/inmIn.vue | 166 ++++++++++++++++++++++++++++++++++- src/views/wpm_bx/inmOut.vue | 168 +++++++++++++++++++++++++++++++++++- 2 files changed, 327 insertions(+), 7 deletions(-) diff --git a/src/views/wpm_bx/inmIn.vue b/src/views/wpm_bx/inmIn.vue index 5dad22e8..48b87f11 100644 --- a/src/views/wpm_bx/inmIn.vue +++ b/src/views/wpm_bx/inmIn.vue @@ -7,6 +7,15 @@ 合批
+ + + + + + + + + + + + + + + + + + + + + + { @@ -457,10 +543,11 @@ export default { }); }, //打印物料标签 - printMaterial(row){ + printMaterial(row,type){ let that = this; if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){ - let params = {}; + if(type=='wm'){ + let params = {}; params.tid = row.id; let materialname = row.material_.name + '|' + row.material_.process_name; let specification = row.material_.specification; @@ -517,6 +604,79 @@ export default { }); }) } + + }else if(type=='wpr'){ + that.ofromBatch = row.wm_batch; + that.ofromName = row.wm_material_ofrom_name; + let params = {}; + let name = row.material_name.split('|')[0]; + if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){ + console.log('that.route_code',that.route_code); + console.log('that.ofromName',that.ofromName); + that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { + let data = res[0].params_json; + data.number = row.number; + data.name=name; + data.ofrom_name=that.ofromName; + params.data = data; + if(that.route_code=='paiyicibang'){ + params.label_template_name = '排一次棒单件打印模板'; + }else{ + 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{ + 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:'',hengya:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofromName,ofrom_batch:that.ofromBatch}; + 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.hengya = 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("请先设置打印机"); } diff --git a/src/views/wpm_bx/inmOut.vue b/src/views/wpm_bx/inmOut.vue index 193d18c7..b4248808 100644 --- a/src/views/wpm_bx/inmOut.vue +++ b/src/views/wpm_bx/inmOut.vue @@ -8,6 +8,15 @@ 入库
+ - + + + + + + + + + + + + + + + + + + + + + + { @@ -492,7 +578,8 @@ export default { printMaterial(row,type){ let that = this; if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){ - let params = {}; + if(type=='wm'){ + let params = {}; params.tid = row.id; let materialname = row.material_.name + '|' + row.material_.process_name; let specification = row.material_.specification; @@ -563,6 +650,78 @@ export default { }); }) } + }else if(type=='wpr'){ + that.ofromBatch = row.wm_batch; + that.ofromName = row.wm_material_ofrom_name; + let params = {}; + let name = row.material_name.split('|')[0]; + if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){ + console.log('that.route_code',that.route_code); + console.log('that.ofromName',that.ofromName); + that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { + let data = res[0].params_json; + data.number = row.number; + data.name=name; + data.ofrom_name=that.ofromName; + params.data = data; + if(that.route_code=='paiyicibang'){ + params.label_template_name = '排一次棒单件打印模板'; + }else{ + 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{ + 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:'',hengya:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofromName,ofrom_batch:that.ofromBatch}; + 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.hengya = 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("请先设置打印机"); } @@ -579,4 +738,5 @@ export default { }, }; - +