riku
2025-04-27 233a467167e2b363098cc7fa63e7f26d1d15507b
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
import { getClueStatistic } from '../../../model/clue/clueTask';
import { fetchClueTaskSummary } from '../../../services/clue/fetchClue';
 
 
/**
 * 线索任务统计相关信息获取逻辑
 */
export const useStatistic = Behavior({
  data: {
    clueCountRes: [],
  },
  methods: {
    fetchClueTaskSummary(page) {
      const options = this._getOptions();
      fetchClueTaskSummary(options).then(res => {
        const {
          totalCount,
          internalTaskCount,
          externalTaskCount,
          finishedCount,
          unfinishedCount,
          internalFinishedCount,
          internalUnFinishedCount,
          externalFinishedCount,
          externalUnFinishedCount,
        } = res.data;
        const p1 = Math.round((finishedCount / totalCount) * 1000) / 10;
        const p2 = Math.round((unfinishedCount / totalCount) * 1000) / 10;
        this.setData({
          clueCountRes: [
            {
              name: '总计',
              value: totalCount,
              diff: '',
              clickable: false,
            },
            {
              name: '已完成',
              value: finishedCount,
              diff: totalCount == 0 ? '0%' : `${p1}%`,
              clickable: false,
            },
            {
              name: '待完成',
              value: unfinishedCount,
              diff: totalCount == 0 ? '0%' : `${p2}%`,
              clickable: false,
            },
            // {
            //   name: '待完成',
            //   value: unfinishedCount,
            //   diff: totalCount == 0 ? '0%' : `${p2}%`,
            //   clickable: false,
            // },
          ],
        });
      });
    },
 
    /**
     * 计算线索巡查完成情况
     */
    // calClueCount() {
    //   this.setData({
    //     clueCountRes: getClueStatistic(this.data.clueTaskList),
    //   });
    // },
  },
});