diff --git a/src/views/inm/good.vue b/src/views/inm/good.vue index e25133d8..18e30477 100644 --- a/src/views/inm/good.vue +++ b/src/views/inm/good.vue @@ -70,6 +70,11 @@ + + + @@ -143,6 +148,7 @@ export default { paramsWm: { count__gte: 1, material__type: 10 }, // processOptions: [], queryWm: {}, + printer_name:localStorage.getItem("printer_name") }; }, mounted() { @@ -169,6 +175,31 @@ export default { resetQuery() { this.query = {}; }, + //打印物料标签 + printMaterial(row){ + let that = this; + let code = ""; + that.$API.cm.labelmat.fromMb.req({tid:row.id}).then((res) => { + 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, + ]; + if(res.notok_sign!==null){ + str.push("WINTEXT 280,550,28,90,0,0,Simhei," +res.notok_sign_name,) + } + str.push("PRINT 1",) + let obj = {}; + obj.printer_commands = str; + obj.printer_name = that.printer_name; + this.$API.wpm.prints.req(obj).then((response) => {}); + }) + }, }, }; diff --git a/src/views/inm/halfgood.vue b/src/views/inm/halfgood.vue index d4ca76c2..f37a2bb5 100644 --- a/src/views/inm/halfgood.vue +++ b/src/views/inm/halfgood.vue @@ -70,6 +70,11 @@ + + + @@ -152,6 +157,7 @@ export default { paramsWm: { count__gte: 1 }, processOptions: [], queryWm: {}, + printer_name:localStorage.getItem("printer_name") }; }, mounted() { @@ -178,6 +184,32 @@ export default { resetQuery() { this.query = {}; }, + //打印物料标签 + printMaterial(row){ + let that = this; + let code = ""; + that.$API.cm.labelmat.fromMb.req({tid:row.id}).then((res) => { + 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, + ]; + if(res.notok_sign!==null){ + str.push("WINTEXT 280,550,28,90,0,0,Simhei," +res.notok_sign_name,) + } + str.push("PRINT 1",) + let obj = {}; + obj.printer_commands = str; + obj.printer_name = that.printer_name; + this.$API.wpm.prints.req(obj).then((response) => {}); + }) + + }, }, }; diff --git a/src/views/inm/helpso.vue b/src/views/inm/helpso.vue index fdfc3b5d..236c8a9a 100644 --- a/src/views/inm/helpso.vue +++ b/src/views/inm/helpso.vue @@ -57,6 +57,11 @@ + + + @@ -71,6 +76,7 @@ export default { selection: [], query: {}, warehouseOptions: [], + printer_name:localStorage.getItem("printer_name") }; }, mounted() { @@ -88,6 +94,32 @@ export default { resetQuery() { this.query = {}; }, + //打印物料标签 + printMaterial(row){ + let that = this; + let code = ""; + that.$API.cm.labelmat.fromMb.req({tid:row.id}).then((res) => { + 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, + ]; + if(res.notok_sign!==null){ + str.push("WINTEXT 280,550,28,90,0,0,Simhei," +res.notok_sign_name,) + } + str.push("PRINT 1",) + let obj = {}; + obj.printer_commands = str; + obj.printer_name = that.printer_name; + this.$API.wpm.prints.req(obj).then((response) => {}); + }) + + }, }, }; diff --git a/src/views/inm/mainso.vue b/src/views/inm/mainso.vue index 0618f940..f2400837 100644 --- a/src/views/inm/mainso.vue +++ b/src/views/inm/mainso.vue @@ -57,6 +57,11 @@ + + + @@ -71,6 +76,7 @@ export default { selection: [], query: {}, warehouseOptions: [], + printer_name:localStorage.getItem("printer_name") }; }, mounted() { @@ -88,6 +94,32 @@ export default { resetQuery() { this.query = {}; }, + //打印物料标签 + printMaterial(row){ + let that = this; + let code = ""; + that.$API.cm.labelmat.fromMb.req({tid:row.id}).then((res) => { + 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, + ]; + if(res.notok_sign!==null){ + str.push("WINTEXT 280,550,28,90,0,0,Simhei," +res.notok_sign_name,) + } + str.push("PRINT 1",) + let obj = {}; + obj.printer_commands = str; + obj.printer_name = that.printer_name; + this.$API.wpm.prints.req(obj).then((response) => {}); + }) + + }, }, };