优化打印 订单新增桌号和时间筛选
This commit is contained in:
@@ -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("接收心跳");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user