add: 优化台桌

This commit is contained in:
gyq
2025-09-29 13:44:39 +08:00
parent 610410afa6
commit 3174d24e30
3 changed files with 182 additions and 164 deletions

View File

@@ -5,7 +5,13 @@
@open="tbShopAreaGet"
@close="reset"
>
<el-form ref="refForm" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form
ref="refForm"
:model="form"
:rules="rules"
label-width="120px"
label-position="left"
>
<el-form-item label="选择区域" prop="areaId">
<el-select v-model="form.areaId" placeholder="请选择区域">
<el-option
@@ -19,9 +25,9 @@
<el-form-item label="台桌状态" prop="status" v-if="form.id">
<el-select v-model="form.status" placeholder="请选择台桌状态">
<el-option
:label="item.name"
:label="item.label"
:value="item.value"
v-for="item in status"
v-for="item in statusList"
:key="item.value"
></el-option>
</el-select>
@@ -43,7 +49,12 @@
</div>
<div
style="background-color: #d9d9d9; height: 1px; width: 32px; border-radius: 1px"
style="
background-color: #d9d9d9;
height: 1px;
width: 32px;
border-radius: 1px;
"
class="u-m-l-16 u-m-r-16"
></div>
<div class="u-flex">
@@ -74,7 +85,11 @@
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.id" label="网络预定开关">
<el-switch v-model="form.isPredate" :active-value="1" :inactive-value="2"></el-switch>
<el-switch
v-model="form.isPredate"
:active-value="1"
:inactive-value="2"
></el-switch>
</el-form-item>
<el-form-item v-if="form.id" label="网络预定台桌支付金额">
<el-input-number
@@ -87,7 +102,9 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" :loading="loading" @click="onSubmitHandle"> </el-button>
<el-button type="primary" :loading="loading" @click="onSubmitHandle">
</el-button>
</span>
</template>
</el-dialog>
@@ -96,19 +113,19 @@
<script setup>
import shopAreaApi from "@/api/account/shopArea";
import tableApi from "@/api/account/table";
import status from "../status.js";
let dialogVisible = ref(false);
let resetForm = {};
let loading = ref(false);
let status = [
{ value: "pending", name: "挂单中" },
{ value: "using", name: "开台中" },
{ value: "paying", name: "结算中" },
{ value: "idle", name: "空闲" },
{ value: "subscribe", name: "预定" },
{ value: "closed", name: "关台" },
// {value:'opening',name:'开台中'},
{ value: "cleaning", name: "台桌清理中" },
];
let statusList = Object.entries(status).map(([key, value]) => {
// key = 原对象的键(如 'unbound'value = 原对象的键值(如 {label: '未绑定', type: '#909090'}
return {
value: key, // 原键名作为新的 value
label: value.label, // 继承原 label
type: value.type, // 继承原 type
};
});
const form = reactive({
areaId: "",

View File

@@ -81,7 +81,7 @@
<span style="font-size: 14px; color: #333">
{{ item.bookingInfo.createUserName }}{{ item.bookingInfo.bookingPerson }}{{
item.bookingInfo.gender == 1 ? "先生" : "女士"
}}
}}
</span>
<div class="state" style="font-size: 12px; color: #666; display: flex; align-items: center">
<img style="width: 16px; height: 16px; filter: contrast(0.5)" src="@/assets/images/perpole.png"
@@ -143,8 +143,8 @@
<el-button type="info" :style="{
backgroundColor: status[item.status].type,
borderColor: status[item.status].type,
}" @click="cleanTableHandle(item)">
}">
理中
</el-button>
</template>
<template v-else>

View File

@@ -7,4 +7,5 @@ export default {
settled: { label: "待清台", type: "#FF9500" },
closed: { label: "关台", type: "#DDDDDD" },
subscribe: { label: "预定", type: "#58B22C" },
cleaning: { label: "清理中", type: "#909090" },
};