gaoluyang
2025-12-09 fc39f41acfcb9afb8d12f3ed3799b97352bb4178
src/views/index.vue
@@ -170,6 +170,7 @@
<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";
@@ -179,7 +180,8 @@
   getBusiness,
   homeTodos,
   qualityStatistics,
   statisticsReceivablePayable
   statisticsReceivablePayable,
   approveAndDeviceTodos
} from "@/api/viewIndex.js";
import { getCurrentUserLatestScheduling } from "@/api/personnelManagement/scheduling.js";
import dayjs from "dayjs";
@@ -370,6 +372,7 @@
   qualityStatisticsInfo()
   getAmountHalfYearNum()
   getCurrentUserSchedule()
   getApproveAndDeviceTodos()
})
// 数据统计
const getBusinessData = () => {
@@ -525,6 +528,24 @@
      }
   ]
}
// 协同待审批和报修待办事项
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)
   }
}
</script>
<style scoped>