对接订单打印小票
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user