Sfoglia il codice sorgente

修改统计分析

余思翰 10 mesi fa
parent
commit
5070ae6af9

+ 10
- 0
oa-ui/src/api/oa/contract/subContract.js Vedi File

42
     method: 'delete'
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 Vedi File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-09-27 15:19:36
3
  * @Date: 2024-09-27 15:19:36
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-27 15:59:43
5
+ * @LastEditTime: 2024-10-15 15:30:48
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
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
       <el-form-item label="退回节点" prop="targetKey">
10
       <el-form-item label="退回节点" prop="targetKey">
11
         <el-radio-group v-model="taskForm.targetKey">
11
         <el-radio-group v-model="taskForm.targetKey">
12
           <el-radio-button v-for="item in returnTaskList" :key="item.id" :label="item.id">{{ item.name }}
12
           <el-radio-button v-for="item in returnTaskList" :key="item.id" :label="item.id">{{ item.name }}
13
           </el-radio-button>
13
           </el-radio-button>
14
         </el-radio-group>
14
         </el-radio-group>
15
       </el-form-item>
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
         <el-input  type="textarea" v-model="taskForm.comment" placeholder="请输入意见" />
17
         <el-input  type="textarea" v-model="taskForm.comment" placeholder="请输入意见" />
18
       </el-form-item>
18
       </el-form-item>
19
     </el-form>
19
     </el-form>
36
   data() {
36
   data() {
37
     return {
37
     return {
38
       form: {},
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
   created() {
46
   created() {

+ 209
- 20
oa-ui/src/views/statistics/components/contractStatistics.vue Vedi File

10
           <div class="pie2" id="cwSourcePie"></div>
10
           <div class="pie2" id="cwSourcePie"></div>
11
         </div>
11
         </div>
12
       </div>
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
       </div>
16
       </div>
16
       <div class="right">
17
       <div class="right">
17
 
18
 
22
 
23
 
23
 <script>
24
 <script>
24
 import { ehcartsInit } from '@/utils/echarts'
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
 export default {
29
 export default {
27
   props: {
30
   props: {
28
     datas: {
31
     datas: {
38
       contractCwAmount: {},
41
       contractCwAmount: {},
39
       contractSource: {},
42
       contractSource: {},
40
       contractYear: {},
43
       contractYear: {},
44
+      subAmount: {},
45
+      subYearNum: {},
41
       subYear: 0,
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
   mounted() {
61
   mounted() {
46
     this.initDatas();
62
     this.initDatas();
47
-    this.initAmountBar();
63
+    // this.initAmountBar();
48
     this.initChartCwAomunt('');
64
     this.initChartCwAomunt('');
49
     this.initChartCwSource('');
65
     this.initChartCwSource('');
50
   },
66
   },
51
   methods: {
67
   methods: {
52
     async initDatas() {
68
     async initDatas() {
53
-      console.log(this.datas);
54
       if (Object.keys(this.datas).length !== 0) {
69
       if (Object.keys(this.datas).length !== 0) {
55
         this.contractAmount = this.datas.amount[0];
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
         this.sumAomunt = (sum / 100000000).toFixed(4) + '亿元';
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
     initAmountBar() {
88
     initAmountBar() {
65
       let option = {
89
       let option = {
66
         title: {
90
         title: {
67
           text: '各年合同额统计',
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
         grid: {
97
         grid: {
72
           left: '1%',
98
           left: '1%',
74
           bottom: '0%',
100
           bottom: '0%',
75
           height: '60%',
101
           height: '60%',
76
           containLabel: true
102
           containLabel: true
103
+        },
104
+        legend: {
105
+
77
         },
106
         },
78
         graphic: [
107
         graphic: [
79
           {
108
           {
109
         },
138
         },
110
         series: [
139
         series: [
111
           {
140
           {
141
+            name: '承接合同',
112
             data: Object.values(this.contractAmount),
142
             data: Object.values(this.contractAmount),
113
             type: 'bar',
143
             type: 'bar',
114
             smooth: true,
144
             smooth: true,
125
                   return (value / 10000000).toFixed(4) + '千万元';
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
             smooth: true,
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
             itemStyle: {
176
             itemStyle: {
138
-              color: '#F89B30'
177
+
139
             }
178
             }
140
           }
179
           }
141
         ]
180
         ]
142
       };
181
       };
143
       let charts = ehcartsInit(amountChart, 'amountBar', option);
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
     initChartCwAomunt(year) {
203
     initChartCwAomunt(year) {
146
       let option = {
204
       let option = {
234
       };
292
       };
235
       ehcartsInit(cwSourceChart, 'cwSourcePie', option);
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
 </script>
423
 </script>
263
     .left-bottom {
447
     .left-bottom {
264
       width: 100%;
448
       width: 100%;
265
       height: 300px;
449
       height: 300px;
266
-      padding: 10px;
267
       display: flex;
450
       display: flex;
268
 
451
 
269
       .pie1 {
452
       .pie1 {
284
 
467
 
285
   .middle {
468
   .middle {
286
     flex: 1;
469
     flex: 1;
470
+
471
+    .middle-top {
472
+      height: 300px;
473
+      padding: 10px;
474
+      border: 1px solid #ececec;
475
+    }
287
   }
476
   }
288
 
477
 
289
   .right {
478
   .right {

+ 57
- 13
oa-ui/src/views/statistics/components/projectStatistics.vue Vedi File

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-10-11 16:41:17
3
  * @Date: 2024-10-11 16:41:17
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-10-14 15:16:36
5
+ * @LastEditTime: 2024-10-15 17:15:47
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div style="width:100%;" v-loading="loading">
8
   <div style="width:100%;" v-loading="loading">
45
       type: {},
45
       type: {},
46
       source: {},
46
       source: {},
47
       dept: {},
47
       dept: {},
48
+      archive:{},
49
+      complete:{},
50
+      settle:{},
48
       loading: true,
51
       loading: true,
49
       activeYear: '',
52
       activeYear: '',
50
       dataLoading: false,
53
       dataLoading: false,
66
     datas: {
69
     datas: {
67
       handler(newVal) {
70
       handler(newVal) {
68
         if (newVal) {
71
         if (newVal) {
72
+          console.log(newVal);
73
+          
69
           this.initDatas();
74
           this.initDatas();
70
         }
75
         }
71
       },
76
       },
87
         this.type = this.datas.type[0];
92
         this.type = this.datas.type[0];
88
         this.source = this.datas.source[0];
93
         this.source = this.datas.source[0];
89
         this.dept = this.datas.dept[0];
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
         this.loading = false;
98
         this.loading = false;
91
       }
99
       }
92
 
100
 
104
           height: '60%',
112
           height: '60%',
105
           containLabel: true
113
           containLabel: true
106
         },
114
         },
115
+        legend:{},
107
         graphic: [
116
         graphic: [
108
           {
117
           {
109
             type: 'text',
118
             type: 'text',
137
           name: '单位:个'
146
           name: '单位:个'
138
         },
147
         },
139
         series: [
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
             smooth: true,
162
             smooth: true,
163
+            areaStyle: {},
144
             label: {
164
             label: {
145
               show: true,
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
             type: 'line',
196
             type: 'line',
154
             data: Object.values(this.year),
197
             data: Object.values(this.year),
155
             smooth: true,
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
       let charts = ehcartsInit(barYearChart, 'yearNumber', option);
208
       let charts = ehcartsInit(barYearChart, 'yearNumber', option);
165
     clickYear(charts) {
211
     clickYear(charts) {
166
       let that = this;
212
       let that = this;
167
       charts.on('click', function (event) {
213
       charts.on('click', function (event) {
168
-        console.log(event);
169
-
170
         if (event) {
214
         if (event) {
171
           that.activeYear = event.name;
215
           that.activeYear = event.name;
172
           let projectNumber = event.name
216
           let projectNumber = event.name

+ 2
- 2
oa-ui/src/views/statistics/components/topHead.vue Vedi File

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

Loading…
Annulla
Salva