src/views/index.vue
@@ -68,11 +68,11 @@
               <li v-for="item in todoList" :key="item.id">
                  <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 20px">
                     <div style="display: flex;justify-content: space-between;align-items: center;">
                        <div class="todo-title">流程编号:{{item.approveId}}</div>
                        <div class="todo-division">申请部门:{{item.approveDeptName}}</div>
                        <div class="todo-title">待办编号:{{item.approveId}}</div>
                        <div class="todo-division">部门:{{item.approveDeptName}}</div>
                        <div class="todo-time">{{item.approveTime}}</div>
                     </div>
                     <div class="todo-division">审批事由:{{item.approveReason}}</div>
                     <div class="todo-division">待办事由:{{item.approveReason}}</div>
                  </div>
               </li>
            </ul>
@@ -116,14 +116,6 @@
            </div>
         </div>
         <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>
            </div>
            <Echarts ref="chart"
                         :color="barColors2"
                         :chartStyle="chartStyle"
@@ -169,12 +161,14 @@
import Echarts from "@/components/Echarts/echarts.vue";
import * as echarts from 'echarts';
import useUserStore from "@/store/modules/user.js";
import { ElNotification } from 'element-plus'
import {
   analysisCustomerContractAmounts, getAmountHalfYear,
   getBusiness,
   homeTodos,
   qualityStatistics,
   statisticsReceivablePayable
   statisticsReceivablePayable,
   overdueReceivable
} from "@/api/viewIndex.js";
const userStore = useUserStore()
@@ -355,10 +349,31 @@
   getBusinessData()
   analysisCustomer()
   todoInfoS()
   notifyOverdueReceivable()
   statisticsReceivable()
   qualityStatisticsInfo()
   getAmountHalfYearNum()
})
// 待回款提醒
const notifyOverdueReceivable = async () => {
   try {
      const res = await overdueReceivable()
      const data = res.data
      if (data > 0) {
         ElNotification({
            title: '待回款提醒',
            message: `当前有${data}条待回款`,
            type: 'warning',
            duration: 6000,
         })
      }
   } catch (e) {
      // 不影响首页正常加载
      console.error('overdueReceivable error:', e)
   }
}
// 数据统计
const getBusinessData = () => {
   getBusiness().then((res) => {
@@ -386,7 +401,6 @@
}
// 应付应收统计
const statisticsReceivable = (type) => {
   console.log(type)
   statisticsReceivablePayable({type: radio1.value}).then((res) => {
      barSeries.value[0].data = [
         // { value: res.data.prepayMoney, itemStyle: { color: barColors2[0] } },