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-group>
|
||||||
<el-button
|
<el-button
|
||||||
:class="{ active: item.value == useTypes.sel }"
|
: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"
|
v-for="(item, index) in useTypes.list"
|
||||||
@click="changeUseType(item.value)"
|
@click="changeUseType(item.value)"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -1191,17 +1192,17 @@ export default {
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
//就餐饭方式
|
//就餐饭方式
|
||||||
useTypes: {
|
useTypes: {
|
||||||
list:[],
|
list: [],
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
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" });
|
||||||
},
|
},
|
||||||
|
|
@ -2112,7 +2162,7 @@ export default {
|
||||||
if (this.table.tableId) {
|
if (this.table.tableId) {
|
||||||
return $getMasterId({
|
return $getMasterId({
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
orderId:this.table.orderId,
|
orderId: this.table.orderId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
||||||
});
|
});
|
||||||
|
|
@ -2917,14 +2967,14 @@ export default {
|
||||||
async open(params) {
|
async open(params) {
|
||||||
const shopId = localStorage.getItem("shopId");
|
const shopId = localStorage.getItem("shopId");
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.shopInfo = shopInfo;
|
this.shopInfo = shopInfo;
|
||||||
|
|
@ -2945,8 +2995,8 @@ export default {
|
||||||
tableId: params.tableId,
|
tableId: params.tableId,
|
||||||
useType: params.useType,
|
useType: params.useType,
|
||||||
maxCapacity: params.maxCapacity * 1,
|
maxCapacity: params.maxCapacity * 1,
|
||||||
masterId:params.masterId,
|
masterId: params.masterId,
|
||||||
orderId:params.orderId,
|
orderId: params.orderId,
|
||||||
},
|
},
|
||||||
key = params.key,
|
key = params.key,
|
||||||
perpoleNumber = params.num;
|
perpoleNumber = params.num;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue