代客下单修改部分代码逻辑

This commit is contained in:
YeMingfei666 2024-09-25 09:58:38 +08:00
parent da70ad3aa6
commit 6f952970d6
1 changed files with 34 additions and 34 deletions

View File

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