gaoluyang
2025-12-10 72981a4e85ebd605a9c9fc997d93111de9690d83
src/views/index.vue
@@ -122,11 +122,11 @@
         <div class="main-panel">
            <div style="display: flex;justify-content: space-between;">
               <div class="section-title">应收应付统计</div>
               <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">
                  <el-radio-button label="按周" :value="1" />
                  <el-radio-button label="按月" :value="2" />
                  <el-radio-button label="按季度" :value="3" />
               </el-radio-group>
<!--               <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">-->
<!--                  <el-radio-button label="按周" :value="1" />-->
<!--                  <el-radio-button label="按月" :value="2" />-->
<!--                  <el-radio-button label="按季度" :value="3" />-->
<!--               </el-radio-group>-->
            </div>
            <Echarts ref="chart"
                         :color="barColors2"
@@ -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>