feat: 增加点歌配置列表页面,修复转桌报错导致页面无反应问题,去除添加耗材的库存数量以及弹窗关闭表单重置失败问题

This commit is contained in:
2025-03-17 10:55:01 +08:00
parent 6a37b53c8c
commit ed25a9c5e6
10 changed files with 451 additions and 13 deletions

View File

@@ -78,18 +78,22 @@ function getTableList() {
tableList.value = res.records.filter((v) => v.tableCode);
});
}
const emits = defineEmits(["success"]);
function confirm() {
refForm.value.validate((valid, fields) => {
if (valid) {
console.log("submit!");
const detailIds = refTable.value.getSelectionRows().map((v) => v.id);
const detailIds = !rottableType.value
? refTable.value.getSelectionRows().map((v) => v.id)
: props.cartGoods.map((v) => v.id);
orderApi
.mergeOrder({
...form,
detailIds,
})
.then((res) => {
emits("success", form.targetTableCode);
close();
ElNotification({
title: "成功",
message: "合并成功",

View File

@@ -5,12 +5,12 @@
<div class="box">
<h2 class="boxspan">{{ item.title }}</h2>
<h4 class="boxspan">本组菜品{{ item.count }}{{ item.number || 1 }}</h4>
<!-- <el-alert
<el-alert
v-if="item.alertshow"
title="错误:请按照规定选择套餐"
type="warning"
:closable="false"
></el-alert> -->
></el-alert>
</div>
<el-table
ref="refdialogpackagetable"

View File

@@ -217,7 +217,7 @@
<!-- 美团抖音核销 -->
<quan-hexiao ref="refQuanHexiao"></quan-hexiao>
<!-- 转桌 -->
<rottable ref="refRotTable" :cartGoods="carts.list"></rottable>
<rottable ref="refRotTable" :cartGoods="carts.list" @success="rottableSuccess"></rottable>
</div>
</template>
<script setup>
@@ -271,6 +271,11 @@ function rottableShow() {
sourceOrderId: carts.oldOrder.id,
});
}
async function rottableSuccess(tableCode) {
const res = await getTableDetail({ tableCode: tableCode });
table.value = res;
carts.changeTable(tableCode);
}
//美团抖音核销
const refQuanHexiao = ref();
@@ -734,7 +739,7 @@ onMounted(async () => {
user.value = userRes;
carts.changeUser(userRes);
}
//获取桌数据
//获取桌数据
if (res.tableCode) {
const tableRes = await tableApi.get({ tableCode: res.tableCode });
if (tableRes.tableCode) {