田源
2023-09-18 80cb8edcb5e5d8455532035950ef69dcb89cbbe4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<template>
  <div>
        <avue-data-box :option="option" :animation="true"></avue-data-box>
  </div>
</template>
 
<script>
import {validatenull} from "@/util/validate";
import {getList} from "@/api/system/statistic";
import {flowRoute} from "@/util/flow";
 
export default {
name: "Statistic",
  data(){
  return {
    countByServer:true,
    // listMyTask:[]
    option: {
      span:6,
      data: [
        {
          click: this.handleItemAClick,
          title: '物品主数据',
          count: 1723,
          icon: 'iconfont iconicon_doc',
          color: 'rgb(49, 180, 141)',
          uiUrl: "/MasterData/items?id=wupin@name=物品主数据",
          countUrl:'priceIndexController/countNeedConfirmPlan'
        },
        {
          click: this.handleItemBClick,
          title: '人员主数据',
          count: 1225,
          icon: 'iconfont iconicon_dispose',
          color: 'rgb(56, 161, 242)',
          uiUrl:'/MasterData/items?id=renyuan@@name=人员主数据',
          countUrl:'priceIndexController/countPricingPlan'
        },
        {
          click: this.handleItemCClick,
          title: '主题库定义',
          count: 523,
          icon: 'el-icon-setting',
          color: 'rgb(117, 56, 199)',
          uiUrl:'/modeling/classifyTree',
          countUrl:'priceIndexController/countNeedFeedbackPlan'
        },
        {
          click: this.handleItemDClick,
          title: '供应商主数据',
          count: 0,
          icon: 'iconfont iconicon_work',
          color: 'rgb(255, 102, 51)',
          uiUrl:'/MasterData/items?id=gongyingshang@@name=供应商主数据',
          countUrl:'priceIndexController/countMyUnCreatePricePlan'
        },
      ]
    },
  }
  },
  created() {
  this.getList();
  },
  computed(){
 
  },
  methods: {
    handleItemAClick() {
      this.$router.push({ path: "/MasterData/items?id=wupin@name=物品主数据"} );
    },
    handleItemBClick() {
      this.$router.push({ path: '/MasterData/items?id=renyuan@@name=人员主数据'} );
    },
    handleItemCClick() {
      this.$router.push({ path: '/modeling/classifyTree'} );
    },
    handleItemDClick() {
      this.$router.push({ path: '/MasterData/items?id=gongyingshang@@name=供应商主数据'} );
    },
    getList() {
      // debugger
      Object.values(this.option.data).map(record => {
        record.count = record.count || 0;
        if (!this.countByServer) {
          // 是前端查询
          getList(record.countUrl, {}).then(res => {
            console.log('res',res)
            if (res.data.data.success) {
              record.count = res.data.data.obj;
            } else {
              record.count = 0;
            }
          });
        }
        return {
          ...record
        };
      });
    },
  }
}
</script>
 
<style scoped>
 
</style>