fix:光芯车间库存物料标签打印

This commit is contained in:
shijing 2025-05-08 17:24:48 +08:00
parent 25dd54a189
commit 1ff6a6f4b3
2 changed files with 34 additions and 12 deletions

View File

@ -280,6 +280,7 @@ export default {
visibleDrawer: false,
apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name"),
};
},
mounted() {
@ -423,12 +424,22 @@ export default {
//
printMaterial(row){
let that = this;
that.wmId = row.id;
that.wmtype = row.material_.type;
that.dialog.print_m = true;
this.$nextTick(() => {
this.$refs.printmaterial.open();
})
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
let params = {};
params.tid = row.id;
params.extra_data={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("打印成功");
});
})
}else{
that.$message.warning("请先设置打印机");
}
},
},
};

View File

@ -274,6 +274,7 @@ export default {
visibleDrawer: false,
apiObjPrint:this.$API.cm.labelmat.fromWm,
wmId:'',
printer_name:localStorage.getItem("printer_name"),
};
},
mounted() {
@ -422,12 +423,22 @@ export default {
//
printMaterial(row){
let that = this;
that.wmId = row.id;
that.wmtype = row.material_.type;
that.dialog.print_m = true;
this.$nextTick(() => {
this.$refs.printmaterial.open();
})
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
let params = {};
params.tid = row.id;
params.extra_data={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("打印成功");
});
})
}else{
that.$message.warning("请先设置打印机");
}
},
},
};