From 98ae9c5e21dcfd2cab00dadeaf28da08720655ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Thu, 12 Dec 2024 11:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B6=E6=A1=8C=E8=BD=AC=E6=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Instead/components/transfertoPinpin.vue | 53 +++++++++++-------- src/views/tool/Instead/index.vue | 24 ++++++--- 2 files changed, 48 insertions(+), 29 deletions(-) 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) {