|
|
|
|
@ -480,38 +480,34 @@ function printTemp(row: any) {
|
|
|
|
|
let printData = row.printObj;
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
if (window.hiwebSocket?.opened) {
|
|
|
|
|
if (window.hiwebSocket.opened || window.hiwebSocket.printerList.length) {
|
|
|
|
|
if (!printData) {
|
|
|
|
|
window.$message?.error('补打数据为空,不可打印!');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let livePrint = printData.livePrint;
|
|
|
|
|
console.log("livePrint",livePrint);
|
|
|
|
|
|
|
|
|
|
if(!livePrint){
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
let printerList = window.hiwebSocket.printerList.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
label: item.name,
|
|
|
|
|
value: item.name
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
if (printerList && printerList.length) {
|
|
|
|
|
livePrint = this.$ls.get('livePrint') || printerList.find(item => item.name.indexOf("ZDesigner ZD888") > -1).value;
|
|
|
|
|
console.log("livePrint2",livePrint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const hiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse(printData?.templateJson) });
|
|
|
|
|
hiprintTemplate.print2(JSON.parse(printData?.templateData));
|
|
|
|
|
hiprintTemplate.print2(JSON.parse(printData?.templateData), { printer: livePrint});
|
|
|
|
|
} else {
|
|
|
|
|
window.$message?.error('客户端未连接,无法直接打印');
|
|
|
|
|
}
|
|
|
|
|
// getMdPrintData({bizId: id}).then(res => {
|
|
|
|
|
// console.log(res)
|
|
|
|
|
// })
|
|
|
|
|
// socketStore.setMsg(
|
|
|
|
|
// JSON.stringify({
|
|
|
|
|
// templateType: 'paintStorage',
|
|
|
|
|
// printValue: [rawMaterial1Row.value],
|
|
|
|
|
// reprintData: reprintDatas
|
|
|
|
|
// })
|
|
|
|
|
// );
|
|
|
|
|
// window.$message?.success('已发送打印命令');
|
|
|
|
|
// if (window.hiwebSocket.opened) {
|
|
|
|
|
// if (!printData) {
|
|
|
|
|
// window.$message?.error('补打数据为空,不可打印!');
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// const hiprintTemplate = new hiprint.PrintTemplate({ template: JSON.parse(printData?.templateJson) });
|
|
|
|
|
// hiprintTemplate.print2(JSON.parse(printData?.templateData));
|
|
|
|
|
// } else {
|
|
|
|
|
// window.$message?.error('客户端未连接,无法直接打印');
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
|