From 6f952970d671fb447108c5c33c584014fe7d385c Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 25 Sep 2024 09:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/Instead/index.vue | 68 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 3e389ee..f597e7e 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1571,7 +1571,8 @@ export default { // this.refToggle('refScanCode',true) // this.refToggle("refDiscount", true); this.getShopInfo(); - this.open(this.$route.query||''); + console.log(this.$route.query.tableId) + this.open(this.$route.query.tableId?this.$route.query:''); }, methods: { changeOrderUseType(useType) { @@ -1645,6 +1646,8 @@ export default { await this.changePerpole(); } this.getCart(); + this.getCacheOrder(); + console.log(this.isCreateOrder) if (this.isCreateOrder) { this.toCreateOrder(true); } @@ -1884,12 +1887,12 @@ export default { this.$refs.refChooseUser.open(); }, createOrderClose() { + console.log('createOrderClose') this.isCreateOrder = false; }, //生成订单 toCreateOrderDebounce(isNowPay) { console.log(this.createOrder.status); - if ( this.createOrder.status != "" && this.createOrder.status != "success" @@ -2100,17 +2103,19 @@ export default { this.masterId = masterId; this.isPrverOrder = true; console.log(masterId); - const { records } = await getCart({ + const res = await getCart({ masterId, tableId, vipUserId: userId != "null" ? userId : "", }); - console.log(records); - this.order.list = []; - this.order.masterId = masterId; - this.order.list = records; + this.setCart(res); this.prveOrder.show = false; - this.note.content = remark || ""; + // this.order.list = []; + // this.order.masterId = masterId; + // this.order.list = records; + // this.prveOrder.show = false; + // this.note.content = remark || ""; + // this.delPrveOrder(false); }, //删除挂单 @@ -2171,7 +2176,6 @@ export default { }, //获取挂起订单 async getCacheOrder(isReturn = false) { - this.createOrderClose(); if (isReturn) { return $getCacheOrder({ tableId: this.table.tableId }); } @@ -2568,6 +2572,15 @@ export default { this.perpole = ""; this.useTypes.sel = "dine-in"; }, + //设置购物车数据 + setCart(res){ + this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee; + this.perpole = res.seatFee ? res.seatFee.totalNumber : 1; + const nowCart = res.records.find((v) => v.placeNum == 0); + this.order.list = nowCart ? nowCart.info : []; + const oldCart = res.records.filter((v) => v.placeNum != 0); + this.order.old.list = oldCart ? oldCart : []; + }, //获取购物车数据 async getCart() { console.log(this.table); @@ -2576,12 +2589,7 @@ export default { masterId: this.masterId, tableId: this.table.tableId, }); - this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee; - this.perpole = res.seatFee ? res.seatFee.totalNumber : 1; - const nowCart = res.records.find((v) => v.placeNum == 0); - this.order.list = nowCart ? nowCart.info : []; - const oldCart = res.records.filter((v) => v.placeNum != 0); - this.order.old.list = oldCart ? oldCart : []; + this.setCart(res); // if (this.key|| res.records.length) { // this.order.old.list = res.records; // } else { @@ -2735,6 +2743,7 @@ export default { this.getGoods(); this.getCategory(); this.getTable(); + console.log(params) if (!params) { //无台桌代客下单 return; @@ -2743,6 +2752,9 @@ export default { key = params.key, perpoleNumber = params.num; //有台桌时的代客下单 + this.key = key; + this.isCreateOrder =this.key == "isPayOrder"? true:false; + this.perpole = perpoleNumber; this.table = item; if (item && item.useType) { localStorage.setItem("useType", item.useType); @@ -2751,20 +2763,8 @@ export default { ? item.useType : item.useType.replace(/-after|-before/g, ""); } - this.key = key; - if (this.key == "isPayOrder") { - this.isCreateOrder = true; - } - this.informationdialogshow; - this.informationdialogshow = true; - if (item) { - const res = await this.getMasterId(); - this.masterId = res.masterId; - } - this.perpole = perpoleNumber; - if (this.key == "isPayOrder") { - this.toCreateOrder(true); - } + + if (!this.shopInfo.isTableFee && item&&this.perpole>0) { //不免餐位费 await $choseCount({ @@ -2774,11 +2774,10 @@ export default { }); } - this.getCart(); - this.getGoods(); - this.getCategory(); - this.getCacheOrder(); - this.getTable(); + // this.getCart(); + // this.getGoods(); + // this.getCategory(); + // this.getTable(); }, close() { this.$router.push({ path: "/table/table_list"}); @@ -3492,6 +3491,7 @@ input[type="number"]::-webkit-outer-spin-button { display: flex; flex: 1; margin-top: 10px; + max-height: calc(100vh - 280px); .choose-user { padding-bottom: 10px; border-bottom: 1px solid #ebebeb;