diff --git a/src/views/tool/table/index.vue b/src/views/tool/table/index.vue index 0020705..8170de1 100644 --- a/src/views/tool/table/index.vue +++ b/src/views/tool/table/index.vue @@ -40,15 +40,25 @@ --> -
-
- - {{ item.label }} +
+
+
+ + {{ item.label }} +
+
+
+ 未结账: + {{ totalOrder }}笔 + + {{ totalPerson }}人 + + ¥{{ totalMoney }}
@@ -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,33 @@ 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); +}); + // 区域 let areaMap = ref({}); const refAddEara = ref(null);