|
@@ -13,14 +13,14 @@
|
|
|
<el-tab-pane name="0" v-if="auth('home:orderTodo')">
|
|
|
<template #label>
|
|
|
<div>
|
|
|
- 工单待办 <span>({{ state.total }})</span>
|
|
|
+ 工单待办 <span>({{ state.waitedTotal }})</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane name="1" v-if="auth('home:orderSeatTodo')">
|
|
|
<template #label>
|
|
|
<div>
|
|
|
- 工单坐席待办 <span>({{ state.total1 }})</span>
|
|
|
+ 工单坐席待办 <span>({{ state.signTotal }})</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-tab-pane>
|
|
@@ -63,9 +63,10 @@
|
|
|
import { defineAsyncComponent, onMounted, reactive, ref, watchEffect } from 'vue';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { orderListTodo, orderSign, seatsListTodo } from '@/api/todo/order';
|
|
|
+import { orderSign } from '@/api/todo/order';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
-import { auth, auths } from '@/utils/authFunction';
|
|
|
+import { auth, authAll, auths } from '@/utils/authFunction';
|
|
|
+import { getHomeList } from '@/api/home';
|
|
|
|
|
|
const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
|
|
|
const state = reactive({
|
|
@@ -75,8 +76,8 @@ const state = reactive({
|
|
|
PageIndex: 1,
|
|
|
PageSize: 10,
|
|
|
},
|
|
|
- total: 0,
|
|
|
- total1: 0,
|
|
|
+ waitedTotal: 0,
|
|
|
+ signTotal: 0,
|
|
|
});
|
|
|
const activeName = ref('0');
|
|
|
watchEffect(() => {
|
|
@@ -163,23 +164,22 @@ const seatsColumns = [
|
|
|
// tab切换
|
|
|
const handleChange = async (tab: any) => {
|
|
|
state.tableLoading = true;
|
|
|
+ const res = await getHomeList();
|
|
|
+ state.signTotal = res.result?.sign?.total ?? 0;
|
|
|
+ state.waitedTotal = res.result?.waited?.total ?? 0;
|
|
|
switch (tab) {
|
|
|
case '0': // 工单待办
|
|
|
try {
|
|
|
- const res: any = await orderListTodo({ ...state.queryParams, IsHandled: 'false' });
|
|
|
- state.tableData = res.result?.items ?? [];
|
|
|
+ state.tableData = res.result?.waited?.items ?? [];
|
|
|
columns.value = todoColumns;
|
|
|
- state.total = res.result?.total ?? 0;
|
|
|
state.tableLoading = false;
|
|
|
} catch (error) {
|
|
|
state.tableLoading = false;
|
|
|
}
|
|
|
break;
|
|
|
- case '1': // 工单待办
|
|
|
+ case '1': // 工单坐席待办
|
|
|
try {
|
|
|
- const res: any = await seatsListTodo({ ...state.queryParams, IsHandled: 'false' });
|
|
|
- state.tableData = res.result?.items ?? [];
|
|
|
- state.total1 = res.result?.total ?? 0;
|
|
|
+ state.tableData = res.result?.sign?.items ?? [];
|
|
|
columns.value = seatsColumns;
|
|
|
state.tableLoading = false;
|
|
|
} catch (error) {
|
|
@@ -195,14 +195,19 @@ const handleChange = async (tab: any) => {
|
|
|
const getTableAndNum = async () => {
|
|
|
state.tableLoading = true;
|
|
|
try {
|
|
|
- const [todo, seats] = await Promise.all([
|
|
|
- orderListTodo({ ...state.queryParams, IsHandled: 'false' }),
|
|
|
- seatsListTodo({ ...state.queryParams, IsHandled: 'false' }),
|
|
|
- ]);
|
|
|
- state.tableData = todo.result?.items ?? [];
|
|
|
- columns.value = todoColumns;
|
|
|
- state.total = todo.result?.total ?? 0;
|
|
|
- state.total1 = seats.result?.total ?? 0;
|
|
|
+ const res = await getHomeList();
|
|
|
+ if (authAll(['home:orderTodo', 'home:orderSeatTodo'])) {
|
|
|
+ state.tableData = res.result?.waited?.items ?? [];
|
|
|
+ columns.value = todoColumns;
|
|
|
+ } else if (auth('home:orderTodo')) {
|
|
|
+ state.tableData = res.result?.waited?.items ?? [];
|
|
|
+ columns.value = todoColumns;
|
|
|
+ } else {
|
|
|
+ state.tableData = res.result?.sign?.items ?? [];
|
|
|
+ columns.value = seatsColumns;
|
|
|
+ }
|
|
|
+ state.signTotal = res.result?.sign?.total ?? 0;
|
|
|
+ state.waitedTotal = res.result?.waited?.total ?? 0;
|
|
|
state.tableLoading = false;
|
|
|
} catch (error) {
|
|
|
state.tableLoading = false;
|