对接订单打印小票

This commit is contained in:
gyq
2025-03-05 09:35:34 +08:00
parent 573dd88b24
commit db3fc1f6dc
22 changed files with 838 additions and 206 deletions

View File

@@ -9,8 +9,7 @@ import lodopPrintWork from "@/components/lodop/lodopPrintWork.js";
import invoicePrint from "@/components/lodop/invoicePrint.js";
import refundPrint from "@/components/lodop/refundPrint.js";
export const usePrint = defineStore({
id: "print",
export const usePrint = defineStore("print", {
state: () => ({
localDevices: [], // 本地打印机列表
deviceNoteList: [], // 添加的打印机
@@ -129,9 +128,9 @@ export const usePrint = defineStore({
}
}, 800);
},
// 添加小票打印对列表数据
// 添加小票打印队列数据
pushReceiptData(props, isDevice = true) {
console.log("pushReceiptData===", props);
// console.log("pushReceiptData===", props);
if (!isDevice) {
// 测试打印,无需校验本地打印机
const store = useUser();
@@ -147,6 +146,17 @@ export const usePrint = defineStore({
this.receiptList.push(props);
this.startReceiptPrint();
} else {
props.deviceName = "MHT-POS58 2";
if (!props.orderInfo.masterId) {
props.orderInfo.masterId = props.orderInfo.tableName;
}
props.orderInfo.outNumber = props.outNumber;
if (!props.discountAmount) {
props.discountAmount = props.amount;
}
this.receiptList.push(props);
this.startReceiptPrint();
return;
if (
this.deviceNoteList.length &&
this.checkLocalPrint(this.deviceNoteList[0].config.deviceName)