diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index a33a1f6..6a8e2bd 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1721,6 +1721,9 @@ export default { }, //更改就餐人数 async changePerpole() { + if(!this.table.tableId){ + return + } const res = await $choseCount({ masterId: this.masterId, tableId: this.table.tableId, @@ -1734,7 +1737,7 @@ export default { const res = await this.getMasterId(); this.masterId = res.masterId; //空闲并且免餐位费设置默认就餐人数1 - if (this.table.status == "idle" && !this.shopInfo.isTableFee) { + if (!this.perpole&&this.table.status == "idle" && !this.shopInfo.isTableFee) { this.perpole = 1; await this.changePerpole(); } @@ -1755,8 +1758,9 @@ export default { const seatFee = await $choseCount({ masterId: this.masterId, tableId: this.table.tableId, - num: this.perpole, + num: res.seatFee?res.seatFee.totalNumber: this.perpole, }); + console.log(seatFee); this.order.seatFee = seatFee; this.perpole = seatFee.totalNumber; } @@ -2860,6 +2864,7 @@ export default { }, async getGoods() { const res = await getGoodsLists(this.goods.query); + let $goodsMap={} const goods = res.records.filter((v) => { if (!v) { return false; @@ -2868,8 +2873,12 @@ export default { if (v.typeEnum !== "sku") { isShow = v.specList.length >= 1; } + v.specList.map(spe=>{ + $goodsMap[`${v.id}_${spe.id}`]=spe; + }) return isShow; }); + console.log($goodsMap) this.goods.list = goods; this.goods.total = res.total; this.$goodsData = goods;