From c45f8a5f6abcb0621ecdf816dd1bb71193dbe49a Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Sat, 31 Aug 2024 11:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95=E6=97=B6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AF=E5=8F=96=E5=8D=95=E5=B0=86=E5=8F=96?= =?UTF-8?q?=E5=88=B0=E8=AE=A2=E5=8D=95id=E4=B9=9F=E6=AD=98=E4=BC=A0?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/table/components/table-diancan.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/views/table/components/table-diancan.vue b/src/views/table/components/table-diancan.vue index 8f1d198..f773164 100644 --- a/src/views/table/components/table-diancan.vue +++ b/src/views/table/components/table-diancan.vue @@ -1060,6 +1060,7 @@ export default { total: 0, }, order: { + orderId:"", payType: "", masterId: "", allPack: false, @@ -1532,12 +1533,15 @@ export default { }, //生成订单 async toCreateOrder(isNowPay = false) { + console.log(this.order) + console.log(this.order.orderId) const res = await $createOrder({ masterId: this.order.masterId || this.masterId, vipUserId: this.vipUser.id, tableId: this.table.tableId, note: this.note.content, postPay: this.postPay, + orderld:this.order.orderId }); //后付款 console.log(this.postPay); @@ -1701,10 +1705,13 @@ export default { // masterId:order.carList[0].masterId // }) - const { masterId, tableId, userId, remark } = await $cacheOrder({ + const { masterId, tableId, userId, remark,id } = await $cacheOrder({ orderId: this.prveOrder.list[this.prveOrder.sel].orderId, isPending: false, }); + this.order.orderId = id; + console.log( this.order.orderId) + this.masterId = masterId; this.isPrverOrder = true; console.log(masterId); @@ -1724,6 +1731,9 @@ export default { //删除挂单 async delPrveOrder(isRequest = true) { const { sel } = this.prveOrder; + if(this.prveOrder.list<=0||sel<0){ + return + } const order = this.prveOrder.list[sel]; const orderMasterId = order.carList[0].masterId; //当前订单是否是当前挂单 @@ -1798,6 +1808,7 @@ export default { this.order.list = []; this.order.selIndex = -1; this.note.content = ""; + this.order.orderId="" this.$nextTick(() => { this.getCacheOrder(); }); @@ -2143,6 +2154,8 @@ export default { this.order.list = []; this.order.selIndex = -1; this.order.old.list = []; + this.prveOrder.list=[]; + this.prveOrder.selIndex=-1 this.order.old.selIndex = -1; this.isCreateOrder = false; this.note.content = ""; @@ -2151,7 +2164,9 @@ export default { this.note.content = ""; this.isPrverOrder = false; this.createOrder.discount = 1; + this.order.cacheNumber=1 this.key = ""; + this.order.orderId='' }, //获取购物车数据 async getCart() { @@ -2270,13 +2285,14 @@ export default { } else { //增加 console.log(item); + const num= item.specList[0].suit res = await addCart({ masterId: this.masterId, vipUserId: this.vipUser.id, productId: item.id, skuId: item.specList[0].id, tableId: this.table.tableId, - num: item.specList[0].suit, // 0会删除此商品 + num:num<=0?1:num, // 0会删除此商品 isPack: false, // 是否打包 }); this.orderListPush(res);