parent
5f1688173f
commit
d6836d240c
|
|
@ -417,3 +417,14 @@ export function $printDishes(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 就餐模式切换
|
||||||
|
export function $changeUseType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/choseModel',
|
||||||
|
method: "put",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1122,6 +1122,7 @@ import {
|
||||||
$returnCart,
|
$returnCart,
|
||||||
$printOrder,
|
$printOrder,
|
||||||
tbShopTableGet,
|
tbShopTableGet,
|
||||||
|
$changeUseType
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
import {
|
import {
|
||||||
|
|
@ -1422,6 +1423,7 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"useTypes.sel": function (newval, oldval) {
|
"useTypes.sel": function (newval, oldval) {
|
||||||
|
console.log(newval)
|
||||||
this.setPostPay();
|
this.setPostPay();
|
||||||
this.setUseType();
|
this.setUseType();
|
||||||
},
|
},
|
||||||
|
|
@ -1587,18 +1589,30 @@ export default {
|
||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeOrderUseType(useType){
|
||||||
|
if(useType&&this.order.list.length){
|
||||||
|
$changeUseType({
|
||||||
|
useType,
|
||||||
|
cartIds: this.order.list.map((v) => v.id),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
//设置用餐类型
|
//设置用餐类型
|
||||||
setUseType() {
|
setUseType() {
|
||||||
// 自取
|
// 自取
|
||||||
|
let useType='takeout'
|
||||||
if (this.useTypes.sel == "takeout") {
|
if (this.useTypes.sel == "takeout") {
|
||||||
localStorage.setItem("useType", "takeout");
|
localStorage.setItem("useType", "takeout");
|
||||||
} else {
|
} else {
|
||||||
//堂食
|
//堂食
|
||||||
|
useType=`dine-in-${this.postPay ? "after" : "before"}`
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"useType",
|
"useType",
|
||||||
`dine-in-${this.postPay ? "after" : "before"}`
|
useType
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
this.changeOrderUseType(useType)
|
||||||
|
|
||||||
},
|
},
|
||||||
//设置先付后付
|
//设置先付后付
|
||||||
setPostPay() {
|
setPostPay() {
|
||||||
|
|
@ -1627,6 +1641,7 @@ export default {
|
||||||
if(this.order.old.list.length > 0){
|
if(this.order.old.list.length > 0){
|
||||||
return this.$message('下单后不支持更改就餐方式');
|
return this.$message('下单后不支持更改就餐方式');
|
||||||
}
|
}
|
||||||
|
console.log(type);
|
||||||
this.useTypes.sel = type;
|
this.useTypes.sel = type;
|
||||||
},
|
},
|
||||||
//更改就餐人数
|
//更改就餐人数
|
||||||
|
|
@ -2487,7 +2502,7 @@ export default {
|
||||||
.filter((v) => v.specSnap.match(i))
|
.filter((v) => v.specSnap.match(i))
|
||||||
.every((v) => {
|
.every((v) => {
|
||||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||||
return isCanBuy(v);
|
return !isCanBuy(v);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue