Pārlūkot izejas kodu

修改统计分析

余思翰 6 mēnešus atpakaļ
vecāks
revīzija
5070ae6af9

+ 10
- 0
oa-ui/src/api/oa/contract/subContract.js Parādīt failu

@@ -42,3 +42,13 @@ export function delSubContract(subContractId) {
42 42
     method: 'delete'
43 43
   })
44 44
 }
45
+
46
+
47
+// 查询分包合同统计
48
+export function getSubContractStatistic(query) {
49
+  return request({
50
+    url: '/oa/subContract/statistic',
51
+    method: 'get',
52
+    params: query
53
+  })
54
+}

+ 8
- 4
oa-ui/src/views/flowable/form/components/flowBtn/returnBtn.vue Parādīt failu

@@ -2,18 +2,18 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-09-27 15:19:36
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-27 15:59:43
5
+ * @LastEditTime: 2024-10-15 15:30:48
6 6
 -->
7 7
 <template>
8 8
   <div>
9
-    <el-form ref="taskForm" :model="taskForm" label-width="80px">
9
+    <el-form ref="taskForm" :model="taskForm" :rules="rules" label-width="80px">
10 10
       <el-form-item label="退回节点" prop="targetKey">
11 11
         <el-radio-group v-model="taskForm.targetKey">
12 12
           <el-radio-button v-for="item in returnTaskList" :key="item.id" :label="item.id">{{ item.name }}
13 13
           </el-radio-button>
14 14
         </el-radio-group>
15 15
       </el-form-item>
16
-      <el-form-item label="退回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]">
16
+      <el-form-item label="退回意见" prop="comment">
17 17
         <el-input  type="textarea" v-model="taskForm.comment" placeholder="请输入意见" />
18 18
       </el-form-item>
19 19
     </el-form>
@@ -36,7 +36,11 @@ export default {
36 36
   data() {
37 37
     return {
38 38
       form: {},
39
-      returnTaskList: []
39
+      returnTaskList: [],
40
+      rules:{
41
+        targetKey:[{ required: true, message: '请选择退回节点', trigger: 'change' }],
42
+        comment:[{ required: true, message: '请输入意见', trigger: 'blur' }],
43
+      }
40 44
     }
41 45
   },
42 46
   created() {

+ 209
- 20
oa-ui/src/views/statistics/components/contractStatistics.vue Parādīt failu

@@ -10,8 +10,9 @@
10 10
           <div class="pie2" id="cwSourcePie"></div>
11 11
         </div>
12 12
       </div>
13
-      <div class="middle">
14
-
13
+      <div class="middle" v-loading="subLoading">
14
+        <!-- <div class="middle-top" id="subAmountBar"></div> -->
15
+        <div class="middle-top" id="subYearLine"></div>
15 16
       </div>
16 17
       <div class="right">
17 18
 
@@ -22,7 +23,9 @@
22 23
 
23 24
 <script>
24 25
 import { ehcartsInit } from '@/utils/echarts'
25
-let amountChart, cwAmountChart, cwSourceChart
26
+import { getContractStatistic } from '@/api/oa/contract/contract';
27
+import { getSubContractStatistic } from '@/api/oa/contract/subContract';
28
+let amountChart, cwAmountChart, cwSourceChart, subAmountChart, subYearChart
26 29
 export default {
27 30
   props: {
28 31
     datas: {
@@ -38,35 +41,58 @@ export default {
38 41
       contractCwAmount: {},
39 42
       contractSource: {},
40 43
       contractYear: {},
44
+      subAmount: {},
45
+      subYearNum: {},
41 46
       subYear: 0,
42
-      sumAomunt: 0
47
+      sumAomunt: 0,
48
+      sumSubAomunt: 0,
49
+      activeYear: '',
50
+      subLoading: true,
51
+    }
52
+  },
53
+  watch: {
54
+    contractCwAmount() {
55
+      this.initChartCwAomunt(this.activeYear);
56
+    },
57
+    contractSource() {
58
+      this.initChartCwSource(this.activeYear);
43 59
     }
44 60
   },
45 61
   mounted() {
46 62
     this.initDatas();
47
-    this.initAmountBar();
63
+    // this.initAmountBar();
48 64
     this.initChartCwAomunt('');
49 65
     this.initChartCwSource('');
50 66
   },
51 67
   methods: {
52 68
     async initDatas() {
53
-      console.log(this.datas);
54 69
       if (Object.keys(this.datas).length !== 0) {
55 70
         this.contractAmount = this.datas.amount[0];
56
-        this.contractCwAmount = this.datas.cwAmount[0]
57
-        this.contractSource = this.datas.source[0]
58
-        this.contractYear = this.datas.year[0]
59
-        this.loading = false
60
-        let sum = Object.values(this.contractAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0)
71
+        this.contractCwAmount = this.datas.cwAmount[0];
72
+        this.contractSource = this.datas.source[0];
73
+        this.contractYear = this.datas.year[0];
74
+        this.loading = false;
75
+        let sum = Object.values(this.contractAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
61 76
         this.sumAomunt = (sum / 100000000).toFixed(4) + '亿元';
62 77
       }
78
+      this.subLoading = true;
79
+      let subDatas = await getSubContractStatistic();
80
+      this.subAmount = subDatas.data.amount[0];
81
+      this.subYearNum = subDatas.data.year[0];
82
+      let sum = Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
83
+      this.sumSubAomunt = (sum / 100000000).toFixed(4) + '亿元';
84
+      this.initAmountBar();
85
+      this.initChartSubYear();
86
+      this.subLoading = false;
63 87
     },
64 88
     initAmountBar() {
65 89
       let option = {
66 90
         title: {
67 91
           text: '各年合同额统计',
68
-          subtext: '共计合同额:' + Object.values(this.contractAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '元'
69
-            + '(约: ' + this.sumAomunt + ')'
92
+          subtext: '承接合同总额:' + Object.values(this.contractAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '元'
93
+            + '(约: ' + this.sumAomunt + ')\n' +
94
+            '分包合同总额:' + Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '元'
95
+            + '(约: ' + this.sumSubAomunt + ')'
70 96
         },
71 97
         grid: {
72 98
           left: '1%',
@@ -74,6 +100,9 @@ export default {
74 100
           bottom: '0%',
75 101
           height: '60%',
76 102
           containLabel: true
103
+        },
104
+        legend: {
105
+
77 106
         },
78 107
         graphic: [
79 108
           {
@@ -109,6 +138,7 @@ export default {
109 138
         },
110 139
         series: [
111 140
           {
141
+            name: '承接合同',
112 142
             data: Object.values(this.contractAmount),
113 143
             type: 'bar',
114 144
             smooth: true,
@@ -125,22 +155,50 @@ export default {
125 155
                   return (value / 10000000).toFixed(4) + '千万元';
126 156
                 }
127 157
               }
128
-            },
129
-            itemStyle: {
130
-              color: '#1C3F95'
131 158
             }
132 159
           },
133 160
           {
134
-            type: 'line',
135
-            data: Object.values(this.contractAmount),
161
+            name: '分包合同',
162
+            data: Object.values(this.subAmount),
163
+            type: 'bar',
136 164
             smooth: true,
165
+            label: {
166
+              show: true,
167
+              position: 'top',
168
+              formatter: function (params) {
169
+                var value = params.value;
170
+                if (value >= 10000) {
171
+                  // 亿  
172
+                  return (value / 10000).toFixed(4) + '万元';
173
+                }
174
+              }
175
+            },
137 176
             itemStyle: {
138
-              color: '#F89B30'
177
+
139 178
             }
140 179
           }
141 180
         ]
142 181
       };
143 182
       let charts = ehcartsInit(amountChart, 'amountBar', option);
183
+      this.clickYear(charts)
184
+    },
185
+    clickYear(charts) {
186
+      let that = this;
187
+      charts.on('click', function (event) {
188
+        if (event) {
189
+          that.activeYear = event.name;
190
+          let year = event.name + '-01-01'
191
+          if (event.name == "") {
192
+            year = ''
193
+          }
194
+          that.dataLoading = true
195
+          getContractStatistic({ signDate: year }).then(res => {
196
+            that.contractCwAmount = res.data.cwAmount[0];
197
+            that.contractSource = res.data.source[0];
198
+            that.dataLoading = false
199
+          })
200
+        }
201
+      })
144 202
     },
145 203
     initChartCwAomunt(year) {
146 204
       let option = {
@@ -234,6 +292,132 @@ export default {
234 292
       };
235 293
       ehcartsInit(cwSourceChart, 'cwSourcePie', option);
236 294
     },
295
+    initChartSubAmount() {
296
+      let option = {
297
+        title: {
298
+          text: '各年分包合同额统计',
299
+          subtext: '共计合同额:' + Object.values(this.subAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '元'
300
+            + '(约: ' + this.sumSubAomunt + ')'
301
+        },
302
+        grid: {
303
+          left: '1%',
304
+          right: '1%',
305
+          bottom: '0%',
306
+          height: '60%',
307
+          containLabel: true
308
+        },
309
+        tooltip: {
310
+          trigger: 'axis',
311
+          axisPointer: {
312
+            type: 'none',
313
+            label: {
314
+              backgroundColor: '#6a7985'
315
+            }
316
+          }
317
+        },
318
+        xAxis: {
319
+          name: '年',
320
+          type: 'category',
321
+          data: Object.keys(this.subAmount),
322
+        },
323
+        yAxis: {
324
+          type: 'value',
325
+          name: '单位:元'
326
+        },
327
+        series: [
328
+          {
329
+            data: Object.values(this.subAmount),
330
+            type: 'bar',
331
+            smooth: true,
332
+            label: {
333
+              show: true,
334
+              position: 'top',
335
+              formatter: function (params) {
336
+                var value = params.value;
337
+                if (value >= 10000) {
338
+                  // 亿  
339
+                  return (value / 10000).toFixed(4) + '万元';
340
+                }
341
+              }
342
+            },
343
+            itemStyle: {
344
+
345
+            }
346
+          },
347
+          {
348
+            type: 'line',
349
+            data: Object.values(this.subAmount),
350
+            smooth: true,
351
+            itemStyle: {
352
+
353
+            }
354
+          }
355
+        ]
356
+      };
357
+      ehcartsInit(subAmountChart, 'subAmountBar', option);
358
+    },
359
+    initChartSubYear() {
360
+      let option = {
361
+        title: {
362
+          text: '各年合同数统计',
363
+          subtext: '承接合同总数:' + Object.values(this.contractYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '个' + '\n' +
364
+            '分包合同总数:' + Object.values(this.subYearNum).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '个'
365
+        },
366
+        legend: {
367
+          right: 0
368
+        },
369
+        grid: {
370
+          left: '1%',
371
+          right: '1%',
372
+          bottom: '0%',
373
+          height: '60%',
374
+          containLabel: true
375
+        },
376
+        tooltip: {
377
+          trigger: 'axis',
378
+          axisPointer: {
379
+            type: 'cross',
380
+            label: {
381
+              backgroundColor: '#6a7985'
382
+            }
383
+          }
384
+        },
385
+        xAxis: {
386
+          name: '年',
387
+          type: 'category',
388
+          data: Object.keys(this.subYearNum),
389
+        },
390
+        yAxis: {
391
+          type: 'value',
392
+          name: '单位:元'
393
+        },
394
+        series: [
395
+          {
396
+            name: '承接合同',
397
+            data: Object.values(this.contractYear),
398
+            type: 'line',
399
+            areaStyle: {},
400
+            smooth: true,
401
+            label: {
402
+              show: true,
403
+              position: 'top',
404
+            },
405
+          },
406
+          {
407
+            name: '分包合同',
408
+            data: Object.values(this.subYearNum),
409
+            type: 'line',
410
+            areaStyle: {},
411
+            smooth: true,
412
+            label: {
413
+              show: true,
414
+              position: 'top',
415
+            },
416
+          }
417
+        ]
418
+      };
419
+      ehcartsInit(subYearChart, 'subYearLine', option);
420
+    },
237 421
   }
238 422
 }
239 423
 </script>
@@ -263,7 +447,6 @@ export default {
263 447
     .left-bottom {
264 448
       width: 100%;
265 449
       height: 300px;
266
-      padding: 10px;
267 450
       display: flex;
268 451
 
269 452
       .pie1 {
@@ -284,6 +467,12 @@ export default {
284 467
 
285 468
   .middle {
286 469
     flex: 1;
470
+
471
+    .middle-top {
472
+      height: 300px;
473
+      padding: 10px;
474
+      border: 1px solid #ececec;
475
+    }
287 476
   }
288 477
 
289 478
   .right {

+ 57
- 13
oa-ui/src/views/statistics/components/projectStatistics.vue Parādīt failu

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-10-11 16:41:17
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-10-14 15:16:36
5
+ * @LastEditTime: 2024-10-15 17:15:47
6 6
 -->
7 7
 <template>
8 8
   <div style="width:100%;" v-loading="loading">
@@ -45,6 +45,9 @@ export default {
45 45
       type: {},
46 46
       source: {},
47 47
       dept: {},
48
+      archive:{},
49
+      complete:{},
50
+      settle:{},
48 51
       loading: true,
49 52
       activeYear: '',
50 53
       dataLoading: false,
@@ -66,6 +69,8 @@ export default {
66 69
     datas: {
67 70
       handler(newVal) {
68 71
         if (newVal) {
72
+          console.log(newVal);
73
+          
69 74
           this.initDatas();
70 75
         }
71 76
       },
@@ -87,6 +92,9 @@ export default {
87 92
         this.type = this.datas.type[0];
88 93
         this.source = this.datas.source[0];
89 94
         this.dept = this.datas.dept[0];
95
+        this.archive = this.datas.archive[0];
96
+        this.complete = this.datas.complete[0];
97
+        this.settle = this.datas.settle[0];
90 98
         this.loading = false;
91 99
       }
92 100
 
@@ -104,6 +112,7 @@ export default {
104 112
           height: '60%',
105 113
           containLabel: true
106 114
         },
115
+        legend:{},
107 116
         graphic: [
108 117
           {
109 118
             type: 'text',
@@ -137,26 +146,63 @@ export default {
137 146
           name: '单位:个'
138 147
         },
139 148
         series: [
149
+          // {
150
+          //   data: Object.values(this.year),
151
+          //   type: 'bar',
152
+          //   smooth: true,
153
+          //   label: {
154
+          //     show: true,
155
+          //     position: 'top'
156
+          //   }
157
+          // },
140 158
           {
141
-            data: Object.values(this.year),
142
-            type: 'bar',
159
+            name:'已归档',
160
+            type: 'line',
161
+            data: Object.values(this.archive),
143 162
             smooth: true,
163
+            areaStyle: {},
144 164
             label: {
145 165
               show: true,
146
-              position: 'top'
166
+              position: 'top',
147 167
             },
148
-            itemStyle: {
149
-              color: '#1C3F95'
150
-            }
168
+            z:4
151 169
           },
152 170
           {
171
+            name:'已完成',
172
+            type: 'line',
173
+            data: Object.values(this.complete),
174
+            smooth: true,
175
+            areaStyle: {},
176
+            label: {
177
+              show: true,
178
+              position: 'top',
179
+            },
180
+            z:2
181
+          },
182
+          {
183
+            name:'已结算',
184
+            type: 'line',
185
+            data: Object.values(this.settle),
186
+            smooth: true,
187
+            areaStyle: {},
188
+            label: {
189
+              show: true,
190
+              position: 'top',
191
+            },
192
+            z:3
193
+          },
194
+          {
195
+            name:'总数',
153 196
             type: 'line',
154 197
             data: Object.values(this.year),
155 198
             smooth: true,
156
-            itemStyle: {
157
-              color: '#F89B30'
158
-            }
159
-          }
199
+            areaStyle: {},
200
+            label: {
201
+              show: true,
202
+              position: 'top',
203
+            },
204
+            z:1
205
+          },
160 206
         ]
161 207
       };
162 208
       let charts = ehcartsInit(barYearChart, 'yearNumber', option);
@@ -165,8 +211,6 @@ export default {
165 211
     clickYear(charts) {
166 212
       let that = this;
167 213
       charts.on('click', function (event) {
168
-        console.log(event);
169
-
170 214
         if (event) {
171 215
           that.activeYear = event.name;
172 216
           let projectNumber = event.name

+ 2
- 2
oa-ui/src/views/statistics/components/topHead.vue Parādīt failu

@@ -18,7 +18,7 @@
18 18
       </div>
19 19
       <div class="two item-box" @click="$emit('handleClick', 'contract')">
20 20
         <div class="data-left">
21
-          <div class="data-title">{{ thisYear }}年合同总数</div>
21
+          <div class="data-title">{{ thisYear }}年承接合同总数</div>
22 22
           <div class="number">{{ contractNum.toLocaleString('en-US') }}</div>
23 23
           <div>
24 24
             <span class="text-1">较去年</span>
@@ -317,7 +317,7 @@ export default {
317 317
   }
318 318
 
319 319
   .chart-box {
320
-    flex: 2;
320
+    flex: 1;
321 321
 
322 322
     div {
323 323
       width: 100%;

Notiek ielāde…
Atcelt
Saglabāt