ソースを参照

修改统计分析

余思翰 6ヶ月前
コミット
2fb54cac70

+ 9
- 1
oa-ui/src/api/oa/car/car.js ファイルの表示

@@ -2,7 +2,7 @@
2 2
  * @Author: wrh
3 3
  * @Date: 2024-02-27 13:47:55
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-02-27 13:48:00
5
+ * @LastEditTime: 2024-10-16 11:30:58
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -48,3 +48,11 @@ export function delCar(carId) {
48 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 ファイルの表示

@@ -1,8 +1,8 @@
1 1
 /*
2 2
  * @Author: wrh
3 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 7
 import request from '@/utils/request'
8 8
 
@@ -65,3 +65,11 @@ export function delDevice(deviceId) {
65 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 ファイルの表示

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: wrh
3 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 7
 <template>
8 8
   <div v-loading="loading">

+ 23
- 14
oa-ui/src/views/flowable/form/projectProcess/inProgress.vue ファイルの表示

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 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 7
 <template>
8 8
   <div>
@@ -34,8 +34,9 @@
34 34
         <el-form-item label="使用车辆:">
35 35
           <el-tooltip class="item" effect="dark" content="直接获取用车申请中的车辆,若无车辆,则需要先提交项目的用车申请" placement="top-end">
36 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 40
               </el-option>
40 41
             </el-select>
41 42
           </el-tooltip>
@@ -44,7 +45,7 @@
44 45
           <el-tooltip class="item" effect="dark" content="直接获取设备申请中的设备,若无设备,则需要先提交项目的设备申请" placement="top-end">
45 46
             <el-select v-model="form.devices" multiple disabled style="width:90%">
46 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 49
               </el-option>
49 50
             </el-select>
50 51
           </el-tooltip>
@@ -337,19 +338,27 @@ export default {
337 338
     },
338 339
     // 暂存数据
339 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 357
         for (let progress of this.progressList) {
349 358
           progress.projectId = this.taskForm.formId;
350 359
           addProjectProgress(progress);
351 360
         }
352
-      }
361
+      })
353 362
       this.updateActualWorkList();
354 363
       this.form.projectId = this.taskForm.formId;
355 364
       this.form.cars = this.form.cars.length != 0 ? this.form.cars.join(',') : null;

+ 137
- 8
oa-ui/src/views/statistics/components/contractStatistics.vue ファイルの表示

@@ -13,6 +13,10 @@
13 13
       <div class="middle" v-loading="subLoading">
14 14
         <!-- <div class="middle-top" id="subAmountBar"></div> -->
15 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 20
       </div>
17 21
       <div class="right">
18 22
 
@@ -25,7 +29,7 @@
25 29
 import { ehcartsInit } from '@/utils/echarts'
26 30
 import { getContractStatistic } from '@/api/oa/contract/contract';
27 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 33
 export default {
30 34
   props: {
31 35
     datas: {
@@ -43,6 +47,8 @@ export default {
43 47
       contractYear: {},
44 48
       subAmount: {},
45 49
       subYearNum: {},
50
+      subCwAmount: {},
51
+      subSource: {},
46 52
       subYear: 0,
47 53
       sumAomunt: 0,
48 54
       sumSubAomunt: 0,
@@ -56,6 +62,12 @@ export default {
56 62
     },
57 63
     contractSource() {
58 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 73
   mounted() {
@@ -77,12 +89,17 @@ export default {
77 89
       }
78 90
       this.subLoading = true;
79 91
       let subDatas = await getSubContractStatistic();
92
+      console.log(subDatas.data);
80 93
       this.subAmount = subDatas.data.amount[0];
81 94
       this.subYearNum = subDatas.data.year[0];
95
+      this.subCwAmount = subDatas.data.cwAmount[0];
96
+      this.subSource = subDatas.data.source[0];
82 97
       let sum = Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
83 98
       this.sumSubAomunt = (sum / 100000000).toFixed(4) + '亿元';
84 99
       this.initAmountBar();
85 100
       this.initChartSubYear();
101
+      this.initChartSubCwAomunt('');
102
+      this.initChartSubCwSource('');
86 103
       this.subLoading = false;
87 104
     },
88 105
     initAmountBar() {
@@ -101,9 +118,7 @@ export default {
101 118
           height: '60%',
102 119
           containLabel: true
103 120
         },
104
-        legend: {
105
-
106
-        },
121
+        legend: {},
107 122
         graphic: [
108 123
           {
109 124
             type: 'text',
@@ -169,7 +184,7 @@ export default {
169 184
                 var value = params.value;
170 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,13 +212,17 @@ export default {
197 212
             that.contractSource = res.data.source[0];
198 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 222
     initChartCwAomunt(year) {
204 223
       let option = {
205 224
         title: {
206
-          text: year + '合同额分布情况',
225
+          text: year + '承接合同额分布情况',
207 226
         },
208 227
         tooltip: {
209 228
           trigger: 'item',
@@ -249,7 +268,7 @@ export default {
249 268
     initChartCwSource(year) {
250 269
       let option = {
251 270
         title: {
252
-          text: year + '合同来源分布',
271
+          text: year + '承接合同来源分布',
253 272
         },
254 273
         tooltip: {
255 274
           trigger: 'item',
@@ -418,6 +437,98 @@ export default {
418 437
       };
419 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 534
 </script>
@@ -466,13 +577,31 @@ export default {
466 577
   }
467 578
 
468 579
   .middle {
469
-    flex: 1;
580
+    flex: 1.5;
470 581
 
471 582
     .middle-top {
472 583
       height: 300px;
473 584
       padding: 10px;
474 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 607
   .right {

+ 0
- 2
oa-ui/src/views/statistics/components/projectStatistics.vue ファイルの表示

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

+ 0
- 2
oa-ui/src/views/statistics/components/topHead.vue ファイルの表示

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

+ 17
- 2
oa-ui/src/views/statistics/index.vue ファイルの表示

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

読み込み中…
キャンセル
保存