代客下单修改
先付费模式下只要生成订单就清空购物车
This commit is contained in:
@@ -353,11 +353,12 @@
|
|||||||
<div class="flex mt-14">
|
<div class="flex mt-14">
|
||||||
<template v-if="!postPay">
|
<template v-if="!postPay">
|
||||||
<template v-if="isCreateOrder">
|
<template v-if="isCreateOrder">
|
||||||
|
<!-- <template v-if="false"> -->
|
||||||
<button
|
<button
|
||||||
class="my-btn flex-1 default"
|
class="my-btn flex-1 default"
|
||||||
@click="createOrderClose"
|
@click="createOrderClose"
|
||||||
>
|
>
|
||||||
<span>加菜/返回</span>
|
<span>点菜/返回</span>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -1196,12 +1197,12 @@ export default {
|
|||||||
{
|
{
|
||||||
name: "堂食",
|
name: "堂食",
|
||||||
value: "dine-in",
|
value: "dine-in",
|
||||||
disabled:true
|
disabled: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "自取",
|
name: "自取",
|
||||||
value: "takeout",
|
value: "takeout",
|
||||||
disabled:true
|
disabled: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sel: "dine-in",
|
sel: "dine-in",
|
||||||
@@ -1647,7 +1648,14 @@ export default {
|
|||||||
this.order.extra.selIndex = index;
|
this.order.extra.selIndex = index;
|
||||||
},
|
},
|
||||||
async morePayClick() {
|
async morePayClick() {
|
||||||
|
if (this.order.list.length <= 0) {
|
||||||
|
return this.$message("请选择菜品");
|
||||||
|
}
|
||||||
|
// if(this.isCreateOrder){
|
||||||
|
// return
|
||||||
|
// }
|
||||||
const res = await this.returnCreateOrderData();
|
const res = await this.returnCreateOrderData();
|
||||||
|
this.payBeforeClear();
|
||||||
this.createOrder.data = res;
|
this.createOrder.data = res;
|
||||||
this.order.payType = "";
|
this.order.payType = "";
|
||||||
this.isCreateOrder = true;
|
this.isCreateOrder = true;
|
||||||
@@ -1662,8 +1670,8 @@ export default {
|
|||||||
this.cachePay();
|
this.cachePay();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
returnCreateOrderData() {
|
async returnCreateOrderData() {
|
||||||
return $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,
|
||||||
@@ -1671,16 +1679,58 @@ export default {
|
|||||||
postPay: this.postPay,
|
postPay: this.postPay,
|
||||||
orderld: this.order.orderId,
|
orderld: this.order.orderId,
|
||||||
});
|
});
|
||||||
|
this.createOrder.data = res;
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
// const lastItem = this.order.old.list[this.order.old.list.length - 1];
|
||||||
|
// const nowPlaceNum = lastItem ? lastItem.placeNum : 0;
|
||||||
|
// this.order.old.list = [
|
||||||
|
// ...this.order.old.list,
|
||||||
|
// { info: this.order.list, placeNum: nowPlaceNum + 1 },
|
||||||
|
// ];
|
||||||
|
this.order.list = [];
|
||||||
|
this.order.old.list = [];
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
async payBeforeClear() {
|
||||||
|
this.getMasterId().then(res=>{
|
||||||
|
this.masterId = res.masterId;
|
||||||
|
})
|
||||||
|
this.loading = false;
|
||||||
|
this.order.list = [];
|
||||||
|
this.order.query.page = 1;
|
||||||
|
this.goods.total = 0;
|
||||||
|
this.order.list = [];
|
||||||
|
this.order.selIndex = -1;
|
||||||
|
this.order.selPlaceNum = -1;
|
||||||
|
this.order.selGoods = "";
|
||||||
|
this.order.seatFee = { totalAmount: 0 }; //餐位费
|
||||||
|
this.prveOrder.list = [];
|
||||||
|
this.prveOrder.selIndex = -1;
|
||||||
|
this.order.old.selIndex = -1;
|
||||||
|
this.isCreateOrder = false;
|
||||||
|
this.createOrder.status = "";
|
||||||
|
this.createOrder.code = "";
|
||||||
|
this.note.content = "";
|
||||||
|
this.vipUser = { id: "" };
|
||||||
|
this.order.masterId = "";
|
||||||
|
this.allPack = false;
|
||||||
|
this.note.content = "";
|
||||||
|
this.isPrverOrder = false;
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
this.order.cacheNumber = 1;
|
||||||
|
this.key = "";
|
||||||
|
this.order.orderId = "";
|
||||||
|
this.perpole = "";
|
||||||
|
this.useTypes.sel = "dine-in";
|
||||||
},
|
},
|
||||||
async cachePay() {
|
async cachePay() {
|
||||||
const res = await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
this.createOrder.data = res;
|
this.payBeforeClear({});
|
||||||
this.pays();
|
this.pays();
|
||||||
},
|
},
|
||||||
async scanPayClick() {
|
async scanPayClick() {
|
||||||
const res = await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
this.createOrder.data = res;
|
this.payBeforeClear();
|
||||||
this.createOrder.discount = 1;
|
|
||||||
this.order.payType = "scanCode";
|
this.order.payType = "scanCode";
|
||||||
this.payTypeItemClick({ payType: "scanCode" });
|
this.payTypeItemClick({ payType: "scanCode" });
|
||||||
},
|
},
|
||||||
@@ -2919,9 +2969,9 @@ export default {
|
|||||||
const shopInfo = await tbShopInfo(shopId);
|
const shopInfo = await tbShopInfo(shopId);
|
||||||
for (let i in shopInfo.eatModel) {
|
for (let i in shopInfo.eatModel) {
|
||||||
let model = shopInfo.eatModel[i];
|
let model = shopInfo.eatModel[i];
|
||||||
model=model=='take-out'?model.replace(/-/g,""):model;
|
model = model == "take-out" ? model.replace(/-/g, "") : model;
|
||||||
console.log(model);
|
console.log(model);
|
||||||
const item=this.useTypes.list.find(v=>v.value==model);
|
const item = this.useTypes.list.find((v) => v.value == model);
|
||||||
console.log(item);
|
console.log(item);
|
||||||
if (item) {
|
if (item) {
|
||||||
item.disabled = false;
|
item.disabled = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user