From 6f03469152be00a2430cc5d0fca0fcde06bc4dec Mon Sep 17 00:00:00 2001 From: shijing Date: Thu, 24 Apr 2025 15:07:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8E=9F=E6=96=99=E5=BA=93=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E8=AE=B0=E5=BD=95=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E4=B8=AA=E7=89=A9=E6=96=99=E7=9A=84=E6=A0=87=E7=AD=BE=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inm/mioitem.vue | 74 ++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 9 deletions(-) diff --git a/src/views/inm/mioitem.vue b/src/views/inm/mioitem.vue index 699d35e3..32e17e3b 100644 --- a/src/views/inm/mioitem.vue +++ b/src/views/inm/mioitem.vue @@ -89,7 +89,11 @@ - + + @@ -195,7 +199,7 @@ 物料标签 @@ -233,6 +237,31 @@ + + + + + @@ -279,6 +308,7 @@ export default { params: {}, // mioId: "", mioObj: {}, + wprList:[], selection: [], tableData:[], stateDict: { @@ -303,6 +333,7 @@ export default { mioType:'', project_code:'', setNameVisible:false, + wprVisibleDrawer:false, printer_name:localStorage.getItem("printer_name") }; }, @@ -439,20 +470,45 @@ export default { that.printVisible = true; }) },//打印 + showWpr(row){ + let that = this; + that.wprList = row.mioitemw; + that.wprVisibleDrawer = true; + }, //打印物料标签 - printMaterial(row){ + printMaterial(row,type){ let that = this; if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){ - that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => { - let code = res.code_label; + if(type=='wm'){ + that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => { + let code = res.code_label; + let str = [ + "SIZE 40 mm,70 mm", + "GAP 7 mm,7 mm", + "CLS", + "REFERENCE 0,0", + 'QRCODE 30,400,H,5,A,0,"' +code +'"', + "WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name, + "WINTEXT 240,550,28,90,0,0,Simhei," + res.batch, + "PRINT 1", + ]; + let obj = {}; + obj.printer_commands = str; + obj.printer_name = that.printer_name; + that.$API.wpm.prints.req(obj).then((response) => { + that.$message.success("打印成功"); + }); + }) + }else{ + let code = row.number; let str = [ - "SIZE 40 mm,70 mm", + "SIZE 70 mm,100 mm", "GAP 7 mm,7 mm", "CLS", "REFERENCE 0,0", 'QRCODE 30,400,H,5,A,0,"' +code +'"', - "WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name, - "WINTEXT 240,550,28,90,0,0,Simhei," + res.batch, + "WINTEXT 200,550,28,90,0,0,Simhei," + row.material_name, + "WINTEXT 240,550,28,90,0,0,Simhei," + row.number, "PRINT 1", ]; let obj = {}; @@ -461,7 +517,7 @@ export default { that.$API.wpm.prints.req(obj).then((response) => { that.$message.success("打印成功"); }); - }) + } }else{ that.printSetting(); }