From aad13833343652a9200d9efc59975f01e5afff2b Mon Sep 17 00:00:00 2001 From: shijing Date: Wed, 24 Dec 2025 16:03:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=8E=BB=E7=BA=A4=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=88=86=E4=B8=BA=E5=9B=9B=E7=B1=BB=EF=BC=88?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=B8=A6=E6=9D=BF=E6=AE=B5=E5=8F=B7=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=A8=A1=E6=9D=BF=E3=80=81=E6=8E=92=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E6=A3=92=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF=E3=80=81=E8=84=B1?= =?UTF-8?q?=E6=A8=A1=E6=B5=8B=E9=87=8F=E5=89=8D=E5=B7=A5=E5=BA=8F=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=A8=A1=E6=9D=BF=E3=80=81=E5=85=B6=E4=BB=96=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E6=89=93=E5=8D=B0=E6=A8=A1=E6=9D=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/inmIn.vue | 80 +++++++++++++++++++++++++------------ src/views/wpm_bx/inmOut.vue | 69 +++++++++++++++++++------------- 2 files changed, 96 insertions(+), 53 deletions(-) diff --git a/src/views/wpm_bx/inmIn.vue b/src/views/wpm_bx/inmIn.vue index 43ec2af5..58bf8a2f 100644 --- a/src/views/wpm_bx/inmIn.vue +++ b/src/views/wpm_bx/inmIn.vue @@ -557,11 +557,11 @@ export default { if(type=='wm'){ let params = {}; params.tid = row.id; + that.wprParams.wm = row.id; let materialname = row.material_.name + '|' + row.material_.process_name; let specification = row.material_.specification; - if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='tuomoceliang'){ + if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'){ params.label_template_name = '工序带板段号打印模板'; - that.wprParams.wm = row.id; let totalcount = 0; let numbers = ['','','','','','','']; this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { @@ -588,41 +588,57 @@ export default { } } params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; - 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("打印成功"); - }); - }) + that.printFun(params); }) - }else{ - if(that.route_code=='paiyicibang'){ - params.extra_data={orimaterial:row.material_ofrom_name}; + }else if(that.route_code=='yicifusi'){ + 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}; + 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'|| + that.route_code=='ercifusi'||that.route_code=='qiesi'||that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'){ + params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; + params.label_template_name = '脱模测量前工序打印模板'; + that.printFun(params); + }else{ + let numbers = ['','','','','','','','','','','','','','']; + let numberList = []; + this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { + let leng = res.length; + if(leng>0){ + let mojuArr = res[0].number.match(/[a-zA-Z]/g) || []; + let mojuhao = mojuArr[0]; + res.forEach(item=>{ + let num = mojuhao+item.number.split(mojuhao)[1]; + numberList.push(num); + }) + numberList.forEach((item,index)=>{ + let index1 = Math.floor(index/6); + if(index1<14){ + numbers[index1]+=item+'、'; + } + }) + } + params.extra_data={orimaterial:row.material_ofrom_name,count:'—'+row.count,numbers0:numbers[0], + numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5], + numbers6:numbers[6],numbers7:numbers[7],numbers8:numbers[8],numbers9:numbers[9],numbers10:numbers[10], + numbers11:numbers[11],numbers12:numbers[12],numbers13:numbers[13]}; 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("打印成功"); - }); + that.printFun(params); }) } - }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; @@ -691,6 +707,18 @@ export default { that.$message.warning("请先设置打印机"); } }, + printFun(params){ + let that = this; + console.log('params',params) + 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("打印成功"); + }); + }) + }, inmCheck(row){ let that = this; that.checkItem = row; diff --git a/src/views/wpm_bx/inmOut.vue b/src/views/wpm_bx/inmOut.vue index 291a43df..f02743e9 100644 --- a/src/views/wpm_bx/inmOut.vue +++ b/src/views/wpm_bx/inmOut.vue @@ -613,14 +613,7 @@ export default { } } params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; - 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("打印成功"); - }); - }) + that.printFun(params); }) }else if(that.route_code=='paiyicibang'){ that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { @@ -631,25 +624,38 @@ export default { extra_data.orimaterial=row.material_ofrom_name; params.extra_data = extra_data; 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("打印成功"); - }); - }); + that.printFun(params); }) - }else{ + }else if(that.route_code=='qingxi'||that.route_code=='kunbang'||that.route_code=='ladansi'||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.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("打印成功"); - }); + params.label_template_name = '脱模测量前工序打印模板'; + that.printFun(params); + }else{ + let numbers = ['','','','','','','','','','','','','','']; + let numberList = []; + this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { + let leng = res.length; + if(leng>0){ + let mojuArr = res[0].number.match(/[a-zA-Z]/g) || []; + let mojuhao = mojuArr[0]; + res.forEach(item=>{ + let num = mojuhao+item.number.split(mojuhao)[1]; + numberList.push(num); + }) + numberList.forEach((item,index)=>{ + let index1 = Math.floor(index/6); + if(index1<14){ + numbers[index1]+=item+'、'; + } + }) + } + params.extra_data={orimaterial:row.material_ofrom_name,count:'—'+row.count,numbers0:numbers[0], + numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5], + numbers6:numbers[6],numbers7:numbers[7],numbers8:numbers[8],numbers9:numbers[9],numbers10:numbers[10], + numbers11:numbers[11],numbers12:numbers[12],numbers13:numbers[13]}; + params.label_template_name = '其他工序打印模板'; + that.printFun(params); }) } }else if(type=='wpr'){ @@ -658,8 +664,6 @@ export default { 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; @@ -728,6 +732,17 @@ export default { that.$message.warning("请先设置打印机"); } }, + printFun(params){ + let that = this; + 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("打印成功"); + }); + }) + }, inmCheck(row){ let that = this; that.checkItem = row;