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);