Merge branch 'ymf' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into test
This commit is contained in:
commit
0e7f5885e0
|
|
@ -177,7 +177,7 @@
|
|||
<el-button-group>
|
||||
<el-button
|
||||
:class="{ active: item.value == useTypes.sel }"
|
||||
:disabled="order.old.list.length > 0||item.disabled"
|
||||
:disabled="order.old.list.length > 0 || item.disabled"
|
||||
v-for="(item, index) in useTypes.list"
|
||||
@click="changeUseType(item.value)"
|
||||
:key="index"
|
||||
|
|
@ -353,11 +353,12 @@
|
|||
<div class="flex mt-14">
|
||||
<template v-if="!postPay">
|
||||
<template v-if="isCreateOrder">
|
||||
<!-- <template v-if="false"> -->
|
||||
<button
|
||||
class="my-btn flex-1 default"
|
||||
@click="createOrderClose"
|
||||
>
|
||||
<span>加菜/返回</span>
|
||||
<span>点菜/返回</span>
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
|
@ -1191,17 +1192,17 @@ export default {
|
|||
shopInfo: {},
|
||||
//就餐饭方式
|
||||
useTypes: {
|
||||
list:[],
|
||||
list: [],
|
||||
list: [
|
||||
{
|
||||
name: "堂食",
|
||||
value: "dine-in",
|
||||
disabled:true
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
name: "自取",
|
||||
value: "takeout",
|
||||
disabled:true
|
||||
disabled: true,
|
||||
},
|
||||
],
|
||||
sel: "dine-in",
|
||||
|
|
@ -1647,7 +1648,14 @@ export default {
|
|||
this.order.extra.selIndex = index;
|
||||
},
|
||||
async morePayClick() {
|
||||
if (this.order.list.length <= 0) {
|
||||
return this.$message("请选择菜品");
|
||||
}
|
||||
// if(this.isCreateOrder){
|
||||
// return
|
||||
// }
|
||||
const res = await this.returnCreateOrderData();
|
||||
this.payBeforeClear();
|
||||
this.createOrder.data = res;
|
||||
this.order.payType = "";
|
||||
this.isCreateOrder = true;
|
||||
|
|
@ -1662,8 +1670,8 @@ export default {
|
|||
this.cachePay();
|
||||
});
|
||||
},
|
||||
returnCreateOrderData() {
|
||||
return $createOrder({
|
||||
async returnCreateOrderData() {
|
||||
const res = await $createOrder({
|
||||
masterId: this.order.masterId || this.masterId,
|
||||
vipUserId: this.vipUser.id,
|
||||
tableId: this.table.tableId,
|
||||
|
|
@ -1671,16 +1679,58 @@ export default {
|
|||
postPay: this.postPay,
|
||||
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() {
|
||||
const res = await this.returnCreateOrderData();
|
||||
this.createOrder.data = res;
|
||||
await this.returnCreateOrderData();
|
||||
this.payBeforeClear({});
|
||||
this.pays();
|
||||
},
|
||||
async scanPayClick() {
|
||||
const res = await this.returnCreateOrderData();
|
||||
this.createOrder.data = res;
|
||||
this.createOrder.discount = 1;
|
||||
await this.returnCreateOrderData();
|
||||
this.payBeforeClear();
|
||||
this.order.payType = "scanCode";
|
||||
this.payTypeItemClick({ payType: "scanCode" });
|
||||
},
|
||||
|
|
@ -2112,7 +2162,7 @@ export default {
|
|||
if (this.table.tableId) {
|
||||
return $getMasterId({
|
||||
tableId: this.table.tableId,
|
||||
orderId:this.table.orderId,
|
||||
orderId: this.table.orderId,
|
||||
vipUserId: this.vipUser.id,
|
||||
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
||||
});
|
||||
|
|
@ -2917,14 +2967,14 @@ export default {
|
|||
async open(params) {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const shopInfo = await tbShopInfo(shopId);
|
||||
for(let i in shopInfo.eatModel){
|
||||
let model=shopInfo.eatModel[i];
|
||||
model=model=='take-out'?model.replace(/-/g,""):model;
|
||||
for (let i in shopInfo.eatModel) {
|
||||
let model = shopInfo.eatModel[i];
|
||||
model = model == "take-out" ? model.replace(/-/g, "") : 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);
|
||||
if(item){
|
||||
item.disabled=false;
|
||||
if (item) {
|
||||
item.disabled = false;
|
||||
}
|
||||
}
|
||||
this.shopInfo = shopInfo;
|
||||
|
|
@ -2945,8 +2995,8 @@ export default {
|
|||
tableId: params.tableId,
|
||||
useType: params.useType,
|
||||
maxCapacity: params.maxCapacity * 1,
|
||||
masterId:params.masterId,
|
||||
orderId:params.orderId,
|
||||
masterId: params.masterId,
|
||||
orderId: params.orderId,
|
||||
},
|
||||
key = params.key,
|
||||
perpoleNumber = params.num;
|
||||
|
|
|
|||
Loading…
Reference in New Issue