优化打印 订单新增桌号和时间筛选

This commit is contained in:
gyq
2024-07-16 09:13:02 +08:00
parent 38366601d4
commit 5e7935bb53
14 changed files with 355 additions and 67 deletions

View File

@@ -14,6 +14,7 @@ export const useSocket = defineStore({
ws: null, // websocket实例
uuid: "", // 长连接唯一id
heartbeatTimer: null, // 心跳计时器
orderList: [],
}),
actions: {
// 创建uuid
@@ -92,7 +93,14 @@ export const useSocket = defineStore({
// 接收订单消息,打印小票
// printBill(data)
// 打印标签小票
printStore.labelPrint(data);
if (!this.orderList.some((el) => el == data.orderInfo.orderNo)) {
console.log("打印", data);
printStore.labelPrint(data);
this.orderList.push(data.orderInfo.orderNo);
if (this.orderList.length > 30) {
this.orderList.splice(0, 1);
}
}
} else if (data.type == "heartbeat") {
console.log("接收心跳");
}