代客下单

创建订单时增加如果是取单将取到订单id也歘传参
This commit is contained in:
2024-08-31 11:09:37 +08:00
parent 3070a5a6b4
commit c45f8a5f6a

View File

@@ -1060,6 +1060,7 @@ export default {
total: 0, total: 0,
}, },
order: { order: {
orderId:"",
payType: "", payType: "",
masterId: "", masterId: "",
allPack: false, allPack: false,
@@ -1532,12 +1533,15 @@ export default {
}, },
//生成订单 //生成订单
async toCreateOrder(isNowPay = false) { async toCreateOrder(isNowPay = false) {
console.log(this.order)
console.log(this.order.orderId)
const res = await $createOrder({ const res = await $createOrder({
masterId: this.order.masterId || this.masterId, masterId: this.order.masterId || this.masterId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
tableId: this.table.tableId, tableId: this.table.tableId,
note: this.note.content, note: this.note.content,
postPay: this.postPay, postPay: this.postPay,
orderld:this.order.orderId
}); });
//后付款 //后付款
console.log(this.postPay); console.log(this.postPay);
@@ -1701,10 +1705,13 @@ export default {
// masterId:order.carList[0].masterId // 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, orderId: this.prveOrder.list[this.prveOrder.sel].orderId,
isPending: false, isPending: false,
}); });
this.order.orderId = id;
console.log( this.order.orderId)
this.masterId = masterId; this.masterId = masterId;
this.isPrverOrder = true; this.isPrverOrder = true;
console.log(masterId); console.log(masterId);
@@ -1724,6 +1731,9 @@ export default {
//删除挂单 //删除挂单
async delPrveOrder(isRequest = true) { async delPrveOrder(isRequest = true) {
const { sel } = this.prveOrder; const { sel } = this.prveOrder;
if(this.prveOrder.list<=0||sel<0){
return
}
const order = this.prveOrder.list[sel]; const order = this.prveOrder.list[sel];
const orderMasterId = order.carList[0].masterId; const orderMasterId = order.carList[0].masterId;
//当前订单是否是当前挂单 //当前订单是否是当前挂单
@@ -1798,6 +1808,7 @@ export default {
this.order.list = []; this.order.list = [];
this.order.selIndex = -1; this.order.selIndex = -1;
this.note.content = ""; this.note.content = "";
this.order.orderId=""
this.$nextTick(() => { this.$nextTick(() => {
this.getCacheOrder(); this.getCacheOrder();
}); });
@@ -2143,6 +2154,8 @@ export default {
this.order.list = []; this.order.list = [];
this.order.selIndex = -1; this.order.selIndex = -1;
this.order.old.list = []; this.order.old.list = [];
this.prveOrder.list=[];
this.prveOrder.selIndex=-1
this.order.old.selIndex = -1; this.order.old.selIndex = -1;
this.isCreateOrder = false; this.isCreateOrder = false;
this.note.content = ""; this.note.content = "";
@@ -2151,7 +2164,9 @@ export default {
this.note.content = ""; this.note.content = "";
this.isPrverOrder = false; this.isPrverOrder = false;
this.createOrder.discount = 1; this.createOrder.discount = 1;
this.order.cacheNumber=1
this.key = ""; this.key = "";
this.order.orderId=''
}, },
//获取购物车数据 //获取购物车数据
async getCart() { async getCart() {
@@ -2270,13 +2285,14 @@ export default {
} else { } else {
//增加 //增加
console.log(item); console.log(item);
const num= item.specList[0].suit
res = await addCart({ res = await addCart({
masterId: this.masterId, masterId: this.masterId,
vipUserId: this.vipUser.id, vipUserId: this.vipUser.id,
productId: item.id, productId: item.id,
skuId: item.specList[0].id, skuId: item.specList[0].id,
tableId: this.table.tableId, tableId: this.table.tableId,
num: item.specList[0].suit, // 0会删除此商品 num:num<=0?1:num, // 0会删除此商品
isPack: false, // 是否打包 isPack: false, // 是否打包
}); });
this.orderListPush(res); this.orderListPush(res);