| | |
| | | <div class="block"> |
| | | <div class="title">待办事项</div> |
| | | |
| | | <div class="todo-items"> |
| | | <div class="todo-items" v-if="todos.length>0"> |
| | | <div |
| | | v-for="(item, index) in todos" |
| | | :key="index" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <el-empty > |
| | | <template #description> |
| | | <span class="custom-text">暂无数据</span> |
| | | </template> |
| | | </el-empty> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import st7 from '@/assets/images/workbench/st7.png'; |
| | | |
| | | import { getdaiban } from '@/api/home/index'; |
| | | import { onMounted } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | |
| | | const router = useRouter(); |
| | | const store = useStore(); |
| | | const permission = computed(() => store.getters.permission); |
| | | const userInfo = computed(() => store.getters.userInfo); |
| | | const todos = ref([]); |
| | | |
| | | const loading = ref(false); |
| | | const statusMap = { |
| | | 0: '待处理', |
| | | 2: '待审核', |
| | |
| | | } |
| | | }; |
| | | const getListMatter = async () => { |
| | | console.log('permission.value.o_and_m_p_jump', permission.value.o_and_m_p_jump); |
| | | |
| | | if (permission.value.o_and_m_p_jump === true) { |
| | | const res = await getdaiban(0); |
| | | todos.value = res.data.data?.slice(0, 5); |
| | | } else { |
| | | const res = await getdaiban(1); |
| | | todos.value = res.data.data?.slice(0, 5); |
| | | loading.value = true; |
| | | try { |
| | | if (permission.value.o_and_m_p_jump === true) { |
| | | const res = await getdaiban(0, userInfo.value.detail.areaCode); |
| | | todos.value = res.data.data?.slice(0, 5) || []; |
| | | loading.value = false; |
| | | } else { |
| | | const res = await getdaiban(1, userInfo.value.detail.areaCode); |
| | | todos.value = res.data.data?.slice(0, 5) || []; |
| | | loading.value = false; |
| | | } |
| | | } catch (error) {} |
| | | }; |
| | | const isDataReady = computed(() => { |
| | | return userInfo.value.detail?.areaCode && permission.value.o_and_m_p_jump; |
| | | }); |
| | | const autoFetchData = () => { |
| | | if (isDataReady.value) { |
| | | getListMatter(); |
| | | } |
| | | }; |
| | | watch( |
| | | () => [userInfo.value.detail?.areaCode, permission.value.o_and_m_p_jump], |
| | | () => autoFetchData(), |
| | | { immediate: true } |
| | | ); |
| | | |
| | | const jumporder = val => { |
| | | if (permission.value.o_and_m_p_jump === true) { |
| | | const id = val.id; |
| | | router.push({ |
| | | path: `/tickets/orderLog?id=${id}`, |
| | | path: `/tickets/orderLog`, |
| | | query: { |
| | | id: id, |
| | | id, |
| | | }, |
| | | }); |
| | | } else { |
| | | const orderNumber = val.event_num; |
| | | router.push({ |
| | | path: `/tickets/ticket?orderNumber=${orderNumber}`, |
| | | path: `/tickets/ticket`, |
| | | query: { |
| | | orderNumber, |
| | | }, |
| | | }); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | getListMatter(); |
| | | autoFetchData(); |
| | | }); |
| | | </script> |
| | | |
| | |
| | | .block { |
| | | margin: 11px 21px 13px 22px; |
| | | .title { |
| | | font-family: 'Source Han Sans CN'; |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | color: #363636; |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-text { |
| | | font-size: 14px; |
| | | color: #7C8091; |
| | | } |
| | | } |
| | | </style> |