gaoluyang
4 天以前 2075144baf459fe5ef89892d189784636f27f862
src/views/index.vue
@@ -161,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()
@@ -347,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) => {