diff --git a/src/views/tool/Instead/components/transfertoPinpin.vue b/src/views/tool/Instead/components/transfertoPinpin.vue index 1839e51..31eff79 100644 --- a/src/views/tool/Instead/components/transfertoPinpin.vue +++ b/src/views/tool/Instead/components/transfertoPinpin.vue @@ -12,8 +12,9 @@
- +

购物车商品

+ @@ -2891,16 +2891,25 @@ export default { // }); // }, clicktransfertoPinpin() { - if (this.order.list.length < 0) { + // 使用 reduce 方法统计指定值出现的次数 + const count = this.tableList.reduce((acc, cur) => { + if (cur.status == 'using') { + return acc + 1; + } + return acc; + }, 0); + console.log(count) + if (count >= 2) { + // console.log(this.order, this.masterId, this.table.tableId, this.tableList) + // 订单信息,取餐码,用餐类型,桌台号id,台桌列表 + this.$refs.refransfertoPinpin.open(this.order, this.masterId, this.table.tableId, this.tableList); + } else { this.$message({ - message: '请先选择商品!', + message: '暂无可转台桌!', type: 'warning' }) return false; } - console.log(this.order, this.masterId, this.table.tableId, this.tableList) - // 订单信息,取餐码,用餐类型,台桌列表,桌台号id - this.$refs.refransfertoPinpin.open(this.order, this.masterId, this.table.tableId, this.tableList); }, //右侧控制按钮点击事件 async orderBtnsClick(key) { @@ -3491,6 +3500,7 @@ export default { this.order.orderId = ""; this.perpole = ""; this.useTypes.sel = "dine-in"; + this.getTable() }, //设置购物车数据 setCart(res) {