代客下单增加根据店铺配置的就餐类型来判断该就餐类型是否可用
This commit is contained in:
parent
e6e0ecced6
commit
4056eae94f
|
|
@ -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"
|
: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"
|
||||||
|
|
@ -237,7 +237,10 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<el-button @click="clearCart" type="text" size="mini"
|
<el-button
|
||||||
|
@click="clearCart"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
:disabled="order.list.length <= 0"
|
:disabled="order.list.length <= 0"
|
||||||
>清空</el-button
|
>清空</el-button
|
||||||
>
|
>
|
||||||
|
|
@ -317,7 +320,6 @@
|
||||||
:selPlaceNum="order.selPlaceNum"
|
:selPlaceNum="order.selPlaceNum"
|
||||||
></cart-item>
|
></cart-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<div class="order_remark" v-if="note.content">
|
<div class="order_remark" v-if="note.content">
|
||||||
订单备注: {{ note.content }}
|
订单备注: {{ note.content }}
|
||||||
|
|
@ -519,9 +521,13 @@
|
||||||
prveOrder.list.length
|
prveOrder.list.length
|
||||||
}}</span>
|
}}</span>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="btn"
|
<div
|
||||||
|
class="btn"
|
||||||
:class="{ disabled: order.selIndex < 0 }"
|
:class="{ disabled: order.selIndex < 0 }"
|
||||||
@click="refNoteShow(true)">单品备注</div>
|
@click="refNoteShow(true)"
|
||||||
|
>
|
||||||
|
单品备注
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="btn" @click="refNoteShow(false)">整单备注</div>
|
<div class="btn" @click="refNoteShow(false)">整单备注</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -1185,14 +1191,17 @@ export default {
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
//就餐饭方式
|
//就餐饭方式
|
||||||
useTypes: {
|
useTypes: {
|
||||||
|
list:[],
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
name: "堂食",
|
name: "堂食",
|
||||||
value: "dine-in",
|
value: "dine-in",
|
||||||
|
disabled:true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "自取",
|
name: "自取",
|
||||||
value: "takeout",
|
value: "takeout",
|
||||||
|
disabled:true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sel: "dine-in",
|
sel: "dine-in",
|
||||||
|
|
@ -1360,7 +1369,10 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
disableTuicai() {
|
disableTuicai() {
|
||||||
return (
|
return (
|
||||||
this.order.placeNum==1 ||this.order.selIndex>=0||!this.order.selGoods||this.order.old.list.length<=0||
|
this.order.placeNum == 1 ||
|
||||||
|
this.order.selIndex >= 0 ||
|
||||||
|
!this.order.selGoods ||
|
||||||
|
this.order.old.list.length <= 0 ||
|
||||||
this.order.selGoods.status == "return"
|
this.order.selGoods.status == "return"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
@ -1420,7 +1432,12 @@ export default {
|
||||||
.reduce((a, b) => {
|
.reduce((a, b) => {
|
||||||
return a + b.number * b.salePrice;
|
return a + b.number * b.salePrice;
|
||||||
}, 0);
|
}, 0);
|
||||||
return (oldPrice + price + this.order.seatFee.totalAmount * (this.order.seatFee.status=='return'?0:1)).toFixed(2);
|
return (
|
||||||
|
oldPrice +
|
||||||
|
price +
|
||||||
|
this.order.seatFee.totalAmount *
|
||||||
|
(this.order.seatFee.status == "return" ? 0 : 1)
|
||||||
|
).toFixed(2);
|
||||||
},
|
},
|
||||||
allNumber() {
|
allNumber() {
|
||||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
|
|
@ -1619,7 +1636,6 @@ export default {
|
||||||
// this.getCategory();
|
// this.getCategory();
|
||||||
// this.refToggle('refScanCode',true)
|
// this.refToggle('refScanCode',true)
|
||||||
// this.refToggle("refDiscount", true);
|
// this.refToggle("refDiscount", true);
|
||||||
this.getShopInfo();
|
|
||||||
console.log(this.$route.query.tableId);
|
console.log(this.$route.query.tableId);
|
||||||
this.open(this.$route.query.tableId ? this.$route.query : "");
|
this.open(this.$route.query.tableId ? this.$route.query : "");
|
||||||
},
|
},
|
||||||
|
|
@ -1670,7 +1686,7 @@ export default {
|
||||||
},
|
},
|
||||||
changeOrderUseType(useType) {
|
changeOrderUseType(useType) {
|
||||||
if (useType && this.order.list.length) {
|
if (useType && this.order.list.length) {
|
||||||
const tableId = useType=='takeout'?undefined: this.table.tableId;
|
const tableId = useType == "takeout" ? undefined : this.table.tableId;
|
||||||
$changeUseType({
|
$changeUseType({
|
||||||
useType,
|
useType,
|
||||||
tableId,
|
tableId,
|
||||||
|
|
@ -1724,7 +1740,7 @@ export default {
|
||||||
//更改就餐人数
|
//更改就餐人数
|
||||||
async changePerpole() {
|
async changePerpole() {
|
||||||
if (!this.table.tableId) {
|
if (!this.table.tableId) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
const res = await $choseCount({
|
const res = await $choseCount({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
|
|
@ -1739,7 +1755,11 @@ export default {
|
||||||
const res = await this.getMasterId();
|
const res = await this.getMasterId();
|
||||||
this.masterId = res.masterId;
|
this.masterId = res.masterId;
|
||||||
//空闲并且免餐位费设置默认就餐人数1
|
//空闲并且免餐位费设置默认就餐人数1
|
||||||
if (!this.perpole&&this.table.status == "idle" && !this.shopInfo.isTableFee) {
|
if (
|
||||||
|
!this.perpole &&
|
||||||
|
this.table.status == "idle" &&
|
||||||
|
!this.shopInfo.isTableFee
|
||||||
|
) {
|
||||||
this.perpole = 1;
|
this.perpole = 1;
|
||||||
await this.changePerpole();
|
await this.changePerpole();
|
||||||
}
|
}
|
||||||
|
|
@ -1941,7 +1961,7 @@ export default {
|
||||||
async refOrderNoteConfirm(note) {
|
async refOrderNoteConfirm(note) {
|
||||||
//单品备注
|
//单品备注
|
||||||
if (this.isDanNote) {
|
if (this.isDanNote) {
|
||||||
const cart=this.order.list[this.order.selIndex]
|
const cart = this.order.list[this.order.selIndex];
|
||||||
const res = await $updateCart({
|
const res = await $updateCart({
|
||||||
cartId: cart.id,
|
cartId: cart.id,
|
||||||
productId: cart.productId,
|
productId: cart.productId,
|
||||||
|
|
@ -1962,7 +1982,9 @@ export default {
|
||||||
},
|
},
|
||||||
refNoteShow(isDan = false) {
|
refNoteShow(isDan = false) {
|
||||||
this.isDanNote = isDan;
|
this.isDanNote = isDan;
|
||||||
const note=isDan?this.order.list[this.order.selIndex].note:this.note.content;
|
const note = isDan
|
||||||
|
? this.order.list[this.order.selIndex].note
|
||||||
|
: this.note.content;
|
||||||
this.$refs.refOrderNote.open(note);
|
this.$refs.refOrderNote.open(note);
|
||||||
},
|
},
|
||||||
// 支付订单前的处理
|
// 支付订单前的处理
|
||||||
|
|
@ -2091,7 +2113,7 @@ export default {
|
||||||
return $getMasterId({
|
return $getMasterId({
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
useType:this.useTypes.sel=='takeout'?'takeout':'',
|
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// return $getMasterId({
|
// return $getMasterId({
|
||||||
|
|
@ -2872,7 +2894,7 @@ export default {
|
||||||
},
|
},
|
||||||
async getGoods() {
|
async getGoods() {
|
||||||
const res = await getGoodsLists(this.goods.query);
|
const res = await getGoodsLists(this.goods.query);
|
||||||
let $goodsMap={}
|
let $goodsMap = {};
|
||||||
const goods = res.records.filter((v) => {
|
const goods = res.records.filter((v) => {
|
||||||
if (!v) {
|
if (!v) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2881,23 +2903,38 @@ export default {
|
||||||
if (v.typeEnum !== "sku") {
|
if (v.typeEnum !== "sku") {
|
||||||
isShow = v.specList.length >= 1;
|
isShow = v.specList.length >= 1;
|
||||||
}
|
}
|
||||||
v.specList.map(spe=>{
|
v.specList.map((spe) => {
|
||||||
$goodsMap[`${v.id}_${spe.id}`] = spe;
|
$goodsMap[`${v.id}_${spe.id}`] = spe;
|
||||||
})
|
});
|
||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
console.log($goodsMap)
|
console.log($goodsMap);
|
||||||
this.goods.list = goods;
|
this.goods.list = goods;
|
||||||
this.goods.total = res.total;
|
this.goods.total = res.total;
|
||||||
this.$goodsData = goods;
|
this.$goodsData = goods;
|
||||||
},
|
},
|
||||||
async open(params) {
|
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;
|
||||||
|
console.log(model);
|
||||||
|
const item=this.useTypes.list.find(v=>v.value==model);
|
||||||
|
console.log(item);
|
||||||
|
if(item){
|
||||||
|
item.disabled=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.shopInfo = shopInfo;
|
||||||
|
this.setPostPay();
|
||||||
|
this.setUseType();
|
||||||
this.getGoods();
|
this.getGoods();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
this.getTable();
|
this.getTable();
|
||||||
console.log(params);
|
console.log(params);
|
||||||
const res=await this.getMasterId()
|
const res = await this.getMasterId();
|
||||||
console.log(res)
|
console.log(res);
|
||||||
if (!params) {
|
if (!params) {
|
||||||
//无台桌代客下单
|
//无台桌代客下单
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue