小票全部采用本地usb打印

This commit is contained in:
gyq
2024-07-30 18:04:53 +08:00
parent b2e450fd52
commit 49cabfed21
13 changed files with 459 additions and 291 deletions

View File

@@ -4,6 +4,8 @@ import { bySubType } from "@/api/device";
import { useUser } from "@/store/user.js";
import dayjs from "dayjs";
import receiptPrint from "@/components/lodop/receiptPrint.js";
import lodopPrintWork from "@/components/lodop/lodopPrintWork.js";
import invoicePrint from "@/components/lodop/invoicePrint.js";
export const usePrint = defineStore({
id: "print",
@@ -144,7 +146,7 @@ export const usePrint = defineStore({
this.receiptList.push(props);
this.startReceiptPrint();
} else {
console.log("没有小票打印机");
console.log("订单小票:没有小票打印机");
}
},
// 开始打印小票
@@ -160,5 +162,29 @@ export const usePrint = defineStore({
}
}, 800);
},
// 打印交班小票
printWork(data) {
if (
this.deviceNoteList.length &&
this.checkLocalPrint(this.deviceNoteList[0].config.deviceName)
) {
data.deviceName = this.deviceNoteList[0].config.deviceName;
lodopPrintWork(data);
} else {
console.log("交班小票:没有小票打印机");
}
},
// 打印订单发票
printInvoice(data) {
if (
this.deviceNoteList.length &&
this.checkLocalPrint(this.deviceNoteList[0].config.deviceName)
) {
data.deviceName = this.deviceNoteList[0].config.deviceName;
invoicePrint(data);
} else {
console.log("订单发票:没有小票打印机");
}
},
},
});