2 Commits

Author SHA1 Message Date
51812fb0cc 台桌列表页面金额显示保持两位小数 2026-03-28 18:51:43 +08:00
6e39a94f01 台桌页面增加统计显示 2026-03-28 18:50:02 +08:00

View File

@@ -40,15 +40,25 @@
</el-button> -->
</div>
<div class="u-flex u-p-b-15 u-font-14 u-m-t-16">
<div v-for="(item, key) in status" :key="key" class="state u-m-r-24">
<span
class="dot"
:style="{
backgroundColor: status[key] ? status[key].type : '',
}"
/>
{{ item.label }}
<div class="u-flex" style="justify-content: space-between">
<div class="u-flex u-p-b-15 u-font-14 u-m-t-16">
<div v-for="(item, key) in status" :key="key" class="state u-m-r-24">
<span
class="dot"
:style="{
backgroundColor: status[key] ? status[key].type : '',
}"
/>
{{ item.label }}
</div>
</div>
<div style="color: #3f9eff; font-weight: 700; padding-right: 30px">
<span style="color: #333; font-weight: 400">未结账</span>
<span>{{ totalOrder }}</span>
<span></span>
<span>{{ totalPerson }}</span>
<span></span>
<span>¥{{ totalMoney }}</span>
</div>
</div>
@@ -363,7 +373,7 @@ function addTableShow(item) {
const tableList = ref([]);
const tablequery = reactive({
page: 1,
size: 100,
size: 300,
});
async function tableInit() {
@@ -371,6 +381,35 @@ async function tableInit() {
tableList.value = res.records;
}
const totalOrder = computed(() => {
return tableList.value.reduce((pre, cur) => {
if (cur.status == "unsettled") {
return pre + 1;
}
return pre;
}, 0);
});
const totalPerson = computed(() => {
return tableList.value.reduce((pre, cur) => {
if (cur.status == "unsettled") {
return pre + cur.personNum;
}
return pre;
}, 0);
});
const totalMoney = computed(() => {
return tableList.value
.reduce((pre, cur) => {
if (cur.status == "unsettled") {
return pre + cur.orderAmount;
}
return pre;
}, 0)
.toFixed(2);
});
// 区域
let areaMap = ref({});
const refAddEara = ref(null);