| | |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from 'vue' |
| | | import { ElNotification } from 'element-plus' |
| | | import Echarts from "@/components/Echarts/echarts.vue"; |
| | | import * as echarts from 'echarts'; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | |
| | | getBusiness, |
| | | homeTodos, |
| | | qualityStatistics, |
| | | statisticsReceivablePayable |
| | | statisticsReceivablePayable, |
| | | approveAndDeviceTodos, |
| | | noticesCount |
| | | } from "@/api/viewIndex.js"; |
| | | import { getCurrentUserLatestScheduling } from "@/api/personnelManagement/scheduling.js"; |
| | | import dayjs from "dayjs"; |
| | |
| | | qualityStatisticsInfo() |
| | | getAmountHalfYearNum() |
| | | getCurrentUserSchedule() |
| | | getApproveAndDeviceTodos() |
| | | getOngoingAnnouncementNoticeNumber() |
| | | }) |
| | | // 数据统计 |
| | | const getBusinessData = () => { |
| | |
| | | } |
| | | ] |
| | | } |
| | | |
| | | // 协同待审批和报修待办事项 |
| | | const getApproveAndDeviceTodos = async () => { |
| | | try { |
| | | const res = await approveAndDeviceTodos() |
| | | const { approveTodo, deviceRepairTodo } = res.data |
| | | |
| | | // 显示通知 |
| | | ElNotification({ |
| | | title: '待办事项提醒', |
| | | message: `当前有${approveTodo}条待审批事项,${deviceRepairTodo}条待维修事项`, |
| | | type: 'warning', |
| | | duration: 5000 |
| | | }) |
| | | } catch (error) { |
| | | console.error('获取协同待办事项失败:', error) |
| | | } |
| | | } |
| | | // 进行中公告通知 |
| | | const getOngoingAnnouncementNoticeNumber = async () => { |
| | | try { |
| | | const res = await noticesCount() |
| | | // const { approveTodo, deviceRepairTodo } = res.data |
| | | const _noticesCount = res.data |
| | | if(!_noticesCount){ |
| | | return |
| | | } |
| | | // 显示通知 |
| | | ElNotification({ |
| | | title: '通知公告通知', |
| | | message: `当前有${_noticesCount}条公告通知,注意查看`, |
| | | type: 'warning', |
| | | duration: 5000 |
| | | }) |
| | | } catch (error) { |
| | | console.error('获取协同待办事项失败:', error) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |