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(); }