fix:标签模板优化
This commit is contained in:
parent
d91db25ed6
commit
7ed39bb24a
|
|
@ -105,13 +105,16 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.printer_commands = str;
|
obj.printer_commands = str;
|
||||||
obj.printer_name = that.printer_name;
|
obj.printer_name = that.printer_name;
|
||||||
if(that.$INTERVAL == null){
|
let printerInterval = that.$TOOL.data.get('printerInterval');
|
||||||
that.$INTERVAL = setInterval(() => {
|
if(printerInterval==null){
|
||||||
|
let intervalID = setInterval(() => {
|
||||||
that.printLabel(obj)
|
that.printLabel(obj)
|
||||||
}, 2000);
|
}, 2000);
|
||||||
that.visible = false;
|
that.visible = false;
|
||||||
|
that.$TOOL.data.set('printerInterval',intervalID );
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
that.$message.warning("请等待当前打印任务完成")
|
that.$message.warning("请等待当前打印任务完成");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -123,8 +126,9 @@ export default {
|
||||||
that.$API.wpm.prints.req(obj).then((response) => {
|
that.$API.wpm.prints.req(obj).then((response) => {
|
||||||
that.count_printed ++
|
that.count_printed ++
|
||||||
if (that.count_printed >= that.print_count){
|
if (that.count_printed >= that.print_count){
|
||||||
clearInterval(that.$INTERVAL);
|
let printerInterval = that.$TOOL.data.get('printerInterval');
|
||||||
that.$INTERVAL = null;
|
clearInterval(printerInterval);
|
||||||
|
that.$TOOL.data.set('printerInterval',null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue