fix: 修复历史订单切换就餐模式,修改代客下单就餐类型根据店铺信息做限制,修改店铺配置至少勾选一种就餐模式

This commit is contained in:
2025-03-18 16:59:06 +08:00
parent c722cd4c79
commit 4e835eb43d
4 changed files with 42 additions and 18 deletions

View File

@@ -84,6 +84,7 @@
<el-button
:class="{ active: index == diners.sel }"
v-for="(item, index) in diners.list"
:disabled="dinerDisabled(item, index)"
@click="changeDinersSel(index)"
:key="index"
>
@@ -308,7 +309,7 @@ async function refReturnCartConfirm(e) {
});
ElMessage({
type: res ? "success" : "error",
text: res ? "退菜成功" : "操作失败",
message: res ? "退菜成功" : "操作失败",
});
if (res) {
// 获取历史订单数据
@@ -578,7 +579,7 @@ const diners = reactive({
{ label: "堂食", value: 1 },
{ label: "自取", value: 2 },
],
sel: 0,
sel: shopUser.userInfo.eatModel.includes("dine-in") ? 0 : 1,
});
function changeDinersSel(index) {
@@ -593,6 +594,14 @@ watch(
}
);
function dinerDisabled(item, index) {
if (index == 0) {
return !shopUser.userInfo.eatModel.includes("dine-in");
}
if (index == 1) {
return !shopUser.userInfo.eatModel.includes("take-out");
}
}
// 商品分类
const category = reactive({
list: [],
@@ -717,7 +726,7 @@ watch(
function init() {
getTableList();
getCategoryList();
carts.init({ table_code: table.tableCode });
carts.init({ table_code: table.tableCode }, oldOrder.value);
}
onBeforeRouteLeave(() => {