Przeglądaj źródła

修改统计分析

余思翰 7 miesięcy temu
rodzic
commit
2fb54cac70

+ 9
- 1
oa-ui/src/api/oa/car/car.js Wyświetl plik

2
  * @Author: wrh
2
  * @Author: wrh
3
  * @Date: 2024-02-27 13:47:55
3
  * @Date: 2024-02-27 13:47:55
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-02-27 13:48:00
5
+ * @LastEditTime: 2024-10-16 11:30:58
6
  */
6
  */
7
 import request from '@/utils/request'
7
 import request from '@/utils/request'
8
 
8
 
48
     method: 'delete'
48
     method: 'delete'
49
   })
49
   })
50
 }
50
 }
51
+
52
+// 查询cmc车辆信息列表
53
+export function getCarStatistic() {
54
+  return request({
55
+    url: '/oa/car/statistic',
56
+    method: 'get',
57
+  })
58
+}

+ 10
- 2
oa-ui/src/api/oa/device/device.js Wyświetl plik

1
 /*
1
 /*
2
  * @Author: wrh
2
  * @Author: wrh
3
  * @Date: 2024-03-05 17:18:12
3
  * @Date: 2024-03-05 17:18:12
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-07-16 17:50:08
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-10-16 11:31:43
6
  */
6
  */
7
 import request from '@/utils/request'
7
 import request from '@/utils/request'
8
 
8
 
65
     method: 'delete'
65
     method: 'delete'
66
   })
66
   })
67
 }
67
 }
68
+
69
+// 设备统计
70
+export function getDeviceStatistic() {
71
+  return request({
72
+    url: '/oa/device/statistic',
73
+    method: 'get',
74
+  })
75
+}

+ 2
- 2
oa-ui/src/components/preview/index.vue Wyświetl plik

1
 <!--
1
 <!--
2
  * @Author: wrh
2
  * @Author: wrh
3
  * @Date: 2024-06-04 18:18:09
3
  * @Date: 2024-06-04 18:18:09
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-07-22 12:34:21
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-10-16 10:38:51
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div v-loading="loading">
8
   <div v-loading="loading">

+ 23
- 14
oa-ui/src/views/flowable/form/projectProcess/inProgress.vue Wyświetl plik

1
 <!--
1
 <!--
2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-06-21 18:51:54
3
  * @Date: 2024-06-21 18:51:54
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-10-09 09:57:41
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-10-16 14:37:52
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
8
   <div>
34
         <el-form-item label="使用车辆:">
34
         <el-form-item label="使用车辆:">
35
           <el-tooltip class="item" effect="dark" content="直接获取用车申请中的车辆,若无车辆,则需要先提交项目的用车申请" placement="top-end">
35
           <el-tooltip class="item" effect="dark" content="直接获取用车申请中的车辆,若无车辆,则需要先提交项目的用车申请" placement="top-end">
36
             <el-select v-model="form.cars" multiple disabled style="width:90%">
36
             <el-select v-model="form.cars" multiple disabled style="width:90%">
37
-              <el-option v-for="item in carList" :label="item.licensePlate + (item.brand ? item.brand : '') + (item.series ? item.series : '')" :value="item.carId"
38
-                :key="item.carId">
37
+              <el-option v-for="item in carList"
38
+                :label="item.licensePlate + (item.brand ? item.brand : '') + (item.series ? item.series : '')"
39
+                :value="item.carId" :key="item.carId">
39
               </el-option>
40
               </el-option>
40
             </el-select>
41
             </el-select>
41
           </el-tooltip>
42
           </el-tooltip>
44
           <el-tooltip class="item" effect="dark" content="直接获取设备申请中的设备,若无设备,则需要先提交项目的设备申请" placement="top-end">
45
           <el-tooltip class="item" effect="dark" content="直接获取设备申请中的设备,若无设备,则需要先提交项目的设备申请" placement="top-end">
45
             <el-select v-model="form.devices" multiple disabled style="width:90%">
46
             <el-select v-model="form.devices" multiple disabled style="width:90%">
46
               <el-option v-for="item in deviceList" :key="item.deviceId" :label="item.name + '【' + (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series + '】' : '')
47
               <el-option v-for="item in deviceList" :key="item.deviceId" :label="item.name + '【' + (item.brand != null ? item.brand : '') + (item.series != null ? '-' + item.series + '】' : '')
47
-        + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place" :value="item.deviceId">
48
+                + (item.code != null ? '(设备编号:' + item.code + ')' : '') + '📍' + item.place" :value="item.deviceId">
48
               </el-option>
49
               </el-option>
49
             </el-select>
50
             </el-select>
50
           </el-tooltip>
51
           </el-tooltip>
337
     },
338
     },
338
     // 暂存数据
339
     // 暂存数据
339
     preserve() {
340
     preserve() {
340
-      if (this.oldProgressList.length != 0) {
341
-        delProjectProgress([this.taskForm.formId]).then(res => {
342
-          for (let progress of this.progressList) {
343
-            progress.projectId = this.taskForm.formId;
344
-            addProjectProgress(progress);
345
-          }
346
-        });
347
-      } else {
341
+      // if (this.oldProgressList.length != 0) {
342
+      //   delProjectProgress([this.taskForm.formId]).then(res => {
343
+      //     for (let progress of this.progressList) {
344
+      //       progress.projectId = this.taskForm.formId;
345
+      //       addProjectProgress(progress);
346
+      //     }
347
+      //   });
348
+      // } else {
349
+      //   delProjectProgress([this.taskForm.formId]).then(res => {
350
+      //     for (let progress of this.progressList) {
351
+      //       progress.projectId = this.taskForm.formId;
352
+      //       addProjectProgress(progress);
353
+      //     }
354
+      //   })
355
+      // }
356
+      delProjectProgress([this.taskForm.formId]).then(res => {
348
         for (let progress of this.progressList) {
357
         for (let progress of this.progressList) {
349
           progress.projectId = this.taskForm.formId;
358
           progress.projectId = this.taskForm.formId;
350
           addProjectProgress(progress);
359
           addProjectProgress(progress);
351
         }
360
         }
352
-      }
361
+      })
353
       this.updateActualWorkList();
362
       this.updateActualWorkList();
354
       this.form.projectId = this.taskForm.formId;
363
       this.form.projectId = this.taskForm.formId;
355
       this.form.cars = this.form.cars.length != 0 ? this.form.cars.join(',') : null;
364
       this.form.cars = this.form.cars.length != 0 ? this.form.cars.join(',') : null;

+ 137
- 8
oa-ui/src/views/statistics/components/contractStatistics.vue Wyświetl plik

13
       <div class="middle" v-loading="subLoading">
13
       <div class="middle" v-loading="subLoading">
14
         <!-- <div class="middle-top" id="subAmountBar"></div> -->
14
         <!-- <div class="middle-top" id="subAmountBar"></div> -->
15
         <div class="middle-top" id="subYearLine"></div>
15
         <div class="middle-top" id="subYearLine"></div>
16
+        <div class="middle-bottom">
17
+          <div class="bottom-left" id="subCwAmountPie"></div>
18
+          <div class="bottom-right" id="subSourcePie"></div>
19
+        </div>
16
       </div>
20
       </div>
17
       <div class="right">
21
       <div class="right">
18
 
22
 
25
 import { ehcartsInit } from '@/utils/echarts'
29
 import { ehcartsInit } from '@/utils/echarts'
26
 import { getContractStatistic } from '@/api/oa/contract/contract';
30
 import { getContractStatistic } from '@/api/oa/contract/contract';
27
 import { getSubContractStatistic } from '@/api/oa/contract/subContract';
31
 import { getSubContractStatistic } from '@/api/oa/contract/subContract';
28
-let amountChart, cwAmountChart, cwSourceChart, subAmountChart, subYearChart
32
+let amountChart, cwAmountChart, cwSourceChart, subAmountChart, subYearChart, subCwAmountChart, subSourceChart
29
 export default {
33
 export default {
30
   props: {
34
   props: {
31
     datas: {
35
     datas: {
43
       contractYear: {},
47
       contractYear: {},
44
       subAmount: {},
48
       subAmount: {},
45
       subYearNum: {},
49
       subYearNum: {},
50
+      subCwAmount: {},
51
+      subSource: {},
46
       subYear: 0,
52
       subYear: 0,
47
       sumAomunt: 0,
53
       sumAomunt: 0,
48
       sumSubAomunt: 0,
54
       sumSubAomunt: 0,
56
     },
62
     },
57
     contractSource() {
63
     contractSource() {
58
       this.initChartCwSource(this.activeYear);
64
       this.initChartCwSource(this.activeYear);
65
+    },
66
+    subCwAmount() {
67
+      this.initChartSubCwAomunt(this.activeYear);
68
+    },
69
+    subSource() {
70
+      this.initChartSubCwSource(this.activeYear);
59
     }
71
     }
60
   },
72
   },
61
   mounted() {
73
   mounted() {
77
       }
89
       }
78
       this.subLoading = true;
90
       this.subLoading = true;
79
       let subDatas = await getSubContractStatistic();
91
       let subDatas = await getSubContractStatistic();
92
+      console.log(subDatas.data);
80
       this.subAmount = subDatas.data.amount[0];
93
       this.subAmount = subDatas.data.amount[0];
81
       this.subYearNum = subDatas.data.year[0];
94
       this.subYearNum = subDatas.data.year[0];
95
+      this.subCwAmount = subDatas.data.cwAmount[0];
96
+      this.subSource = subDatas.data.source[0];
82
       let sum = Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
97
       let sum = Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
83
       this.sumSubAomunt = (sum / 100000000).toFixed(4) + '亿元';
98
       this.sumSubAomunt = (sum / 100000000).toFixed(4) + '亿元';
84
       this.initAmountBar();
99
       this.initAmountBar();
85
       this.initChartSubYear();
100
       this.initChartSubYear();
101
+      this.initChartSubCwAomunt('');
102
+      this.initChartSubCwSource('');
86
       this.subLoading = false;
103
       this.subLoading = false;
87
     },
104
     },
88
     initAmountBar() {
105
     initAmountBar() {
101
           height: '60%',
118
           height: '60%',
102
           containLabel: true
119
           containLabel: true
103
         },
120
         },
104
-        legend: {
105
-
106
-        },
121
+        legend: {},
107
         graphic: [
122
         graphic: [
108
           {
123
           {
109
             type: 'text',
124
             type: 'text',
169
                 var value = params.value;
184
                 var value = params.value;
170
                 if (value >= 10000) {
185
                 if (value >= 10000) {
171
                   // 亿  
186
                   // 亿  
172
-                  return (value / 10000).toFixed(4) + '万元';
187
+                  return (value / 10000000).toFixed(4) + '万元';
173
                 }
188
                 }
174
               }
189
               }
175
             },
190
             },
197
             that.contractSource = res.data.source[0];
212
             that.contractSource = res.data.source[0];
198
             that.dataLoading = false
213
             that.dataLoading = false
199
           })
214
           })
215
+          getSubContractStatistic({ signDate: year }).then(res => {
216
+            that.subCwAmount = res.data.cwAmount[0];
217
+            that.subSource = res.data.source[0];
218
+          })
200
         }
219
         }
201
       })
220
       })
202
     },
221
     },
203
     initChartCwAomunt(year) {
222
     initChartCwAomunt(year) {
204
       let option = {
223
       let option = {
205
         title: {
224
         title: {
206
-          text: year + '合同额分布情况',
225
+          text: year + '承接合同额分布情况',
207
         },
226
         },
208
         tooltip: {
227
         tooltip: {
209
           trigger: 'item',
228
           trigger: 'item',
249
     initChartCwSource(year) {
268
     initChartCwSource(year) {
250
       let option = {
269
       let option = {
251
         title: {
270
         title: {
252
-          text: year + '合同来源分布',
271
+          text: year + '承接合同来源分布',
253
         },
272
         },
254
         tooltip: {
273
         tooltip: {
255
           trigger: 'item',
274
           trigger: 'item',
418
       };
437
       };
419
       ehcartsInit(subYearChart, 'subYearLine', option);
438
       ehcartsInit(subYearChart, 'subYearLine', option);
420
     },
439
     },
440
+    initChartSubCwAomunt(year) {
441
+      let option = {
442
+        title: {
443
+          text: year + '分包合同额分布情况',
444
+        },
445
+        tooltip: {
446
+          trigger: 'item',
447
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
448
+        },
449
+        legend: {
450
+          top: 'bottom'
451
+        },
452
+        series: [
453
+          {
454
+            name: '占比',
455
+            type: 'pie',
456
+            radius: '40%',
457
+            avoidLabelOverlap: false,
458
+            data: Object.entries(this.subCwAmount).map(([key, value]) => {
459
+              return { name: key, value: value }
460
+            }),
461
+            emphasis: {
462
+              itemStyle: {
463
+                shadowBlur: 10,
464
+                shadowOffsetX: 0,
465
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
466
+              }
467
+            },
468
+            label: {
469
+              alignTo: 'none',
470
+              formatter: '{name|{b}}\n{value|{c}元}',
471
+              minMargin: 5,
472
+              edgeDistance: 8,
473
+              lineHeight: 15,
474
+              rich: {
475
+                time: {
476
+                  fontSize: 10,
477
+                  color: '#999'
478
+                }
479
+              }
480
+            },
481
+          }
482
+        ]
483
+      };
484
+      ehcartsInit(subCwAmountChart, 'subCwAmountPie', option);
485
+    },
486
+    initChartSubCwSource(year) {
487
+      let option = {
488
+        title: {
489
+          text: year + '分包合同来源分布',
490
+        },
491
+        tooltip: {
492
+          trigger: 'item',
493
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
494
+        },
495
+        legend: {
496
+          top: 'bottom'
497
+        },
498
+        series: [
499
+          {
500
+            name: '占比',
501
+            type: 'pie',
502
+            radius: '40%',
503
+            avoidLabelOverlap: false,
504
+            data: Object.entries(this.subSource).map(([key, value]) => {
505
+              return { name: key, value: value }
506
+            }),
507
+            emphasis: {
508
+              itemStyle: {
509
+                shadowBlur: 10,
510
+                shadowOffsetX: 0,
511
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
512
+              }
513
+            },
514
+            label: {
515
+              alignTo: 'none',
516
+              formatter: '{name|{b}}\n{value|{c}个}',
517
+              minMargin: 5,
518
+              edgeDistance: 8,
519
+              lineHeight: 15,
520
+              rich: {
521
+                time: {
522
+                  fontSize: 10,
523
+                  color: '#999'
524
+                }
525
+              }
526
+            },
527
+          }
528
+        ]
529
+      };
530
+      ehcartsInit(subSourceChart, 'subSourcePie', option);
531
+    },
421
   }
532
   }
422
 }
533
 }
423
 </script>
534
 </script>
466
   }
577
   }
467
 
578
 
468
   .middle {
579
   .middle {
469
-    flex: 1;
580
+    flex: 1.5;
470
 
581
 
471
     .middle-top {
582
     .middle-top {
472
       height: 300px;
583
       height: 300px;
473
       padding: 10px;
584
       padding: 10px;
474
       border: 1px solid #ececec;
585
       border: 1px solid #ececec;
475
     }
586
     }
587
+
588
+    .middle-bottom {
589
+      display: flex;
590
+
591
+      .bottom-left {
592
+        flex: 1.5;
593
+        height: 300px;
594
+        padding: 10px;
595
+        border: 1px solid #ececec;
596
+      }
597
+
598
+      .bottom-right {
599
+        flex: 1;
600
+        height: 300px;
601
+        padding: 10px;
602
+        border: 1px solid #ececec;
603
+      }
604
+    }
476
   }
605
   }
477
 
606
 
478
   .right {
607
   .right {

+ 0
- 2
oa-ui/src/views/statistics/components/projectStatistics.vue Wyświetl plik

69
     datas: {
69
     datas: {
70
       handler(newVal) {
70
       handler(newVal) {
71
         if (newVal) {
71
         if (newVal) {
72
-          console.log(newVal);
73
-          
74
           this.initDatas();
72
           this.initDatas();
75
         }
73
         }
76
       },
74
       },

+ 0
- 2
oa-ui/src/views/statistics/components/topHead.vue Wyświetl plik

231
           }
231
           }
232
         ]
232
         ]
233
       };
233
       };
234
-      console.log(1);
235
-
236
       ehcartsInit(contractYearChart, 'thisContract', option);
234
       ehcartsInit(contractYearChart, 'thisContract', option);
237
     },
235
     },
238
     getProjectYearSub(year) {
236
     getProjectYearSub(year) {

+ 17
- 2
oa-ui/src/views/statistics/index.vue Wyświetl plik

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-10-11 09:23:15
3
  * @Date: 2024-10-11 09:23:15
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-10-14 10:48:03
5
+ * @LastEditTime: 2024-10-16 15:30:12
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="app-container bg">
8
   <div class="app-container bg">
19
 <script>
19
 <script>
20
 import { getProjectStatistic } from '@/api/oa/project/project'
20
 import { getProjectStatistic } from '@/api/oa/project/project'
21
 import { getContractStatistic } from '@/api/oa/contract/contract';
21
 import { getContractStatistic } from '@/api/oa/contract/contract';
22
+import { getCarStatistic } from '@/api/oa/car/car';
23
+import { getDeviceStatistic } from '@/api/oa/device/device';
22
 import ProjectStatistics from './components/projectStatistics.vue';
24
 import ProjectStatistics from './components/projectStatistics.vue';
23
 import contractStatistics from './components/contractStatistics.vue';
25
 import contractStatistics from './components/contractStatistics.vue';
24
 import topHead from './components/topHead.vue';
26
 import topHead from './components/topHead.vue';
29
       isActive: 'project',
31
       isActive: 'project',
30
       contractInfo: {},
32
       contractInfo: {},
31
       projectInfo: {},
33
       projectInfo: {},
34
+      carInfo: {},
35
+      deviceInfo: {},
32
     }
36
     }
33
   },
37
   },
34
   created() {
38
   created() {
35
     this.getProjectInfo();
39
     this.getProjectInfo();
36
     this.getContractInfo();
40
     this.getContractInfo();
41
+    this.getCarInfo();
42
+    this.getDeviceInfo();
37
   },
43
   },
38
   mounted() {
44
   mounted() {
39
 
45
 
43
       let res1 = await getProjectStatistic();
49
       let res1 = await getProjectStatistic();
44
       if (res1.data) {
50
       if (res1.data) {
45
         this.projectInfo = res1.data
51
         this.projectInfo = res1.data
46
-
47
       }
52
       }
48
     },
53
     },
49
     async getContractInfo() {
54
     async getContractInfo() {
52
         this.contractInfo = res2.data;
57
         this.contractInfo = res2.data;
53
       }
58
       }
54
     },
59
     },
60
+    async getCarInfo() {
61
+      let res = await getCarStatistic();
62
+      this.carInfo = res.data;
63
+      
64
+    },
65
+    async getDeviceInfo() {
66
+      let res = await getDeviceStatistic();
67
+      this.deviceInfo = res.data;
68
+      
69
+    },
55
     changeClick(val) {
70
     changeClick(val) {
56
       this.isActive = val
71
       this.isActive = val
57
     }
72
     }

Ładowanie…
Anuluj
Zapisz