statement.vue
20.8 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
<template>
<div class="app-container">
<div>
<div class="from-Card">
<el-form
v-show="showSearch" ref="queryRef" size="small" :model="queryParams" :inline="true"
label-position="top"
>
<div class="title">
{{ queryParams.year }}年{{ queryParams.month1 }}月~{{ queryParams.month2 }}月各单位业务收入TOP20排名
</div>
<el-row style="width: 100%;">
<el-col :span="8" style="display: flex;">
<el-form-item label="起始月份" prop="month1 " style="width:40%">
<el-select v-model="queryParams.month1" style="width: 100%">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
<el-form-item label="截止月份" prop="month2" style="width:40%">
<el-select v-model="queryParams.month2" style="width: 100%" @change="handleQuery">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="年份" prop="year">
<el-date-picker
v-model="queryParams.year"
type="year"
value-format="YYYY"
@change="handleQuery"
/>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button size="small" type="primary" @click="handleQuery">搜索</el-button>
<el-button size="small" @click="resetQuery">重置</el-button>
<el-button size="small" type="warning" @click="importData">导出</el-button>
<el-button size="small" type="warning" @click="handelPPT">导出PPT</el-button>
</div>
</el-row>
</el-form>
</div>
<div v-loading="loading" class="table">
<el-row>
<el-col :span="12">
<el-table border :data="infoList">
<el-table-column align="center" label="序号" prop="index">
<template #default="{row}">
<span style="color: #5A88BF;">top{{ row.index }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="shenName" min-width="160" />
<el-table-column label="业务金额" align="center" prop="allFee" min-width="120">
<template #default="{row}">
<span>{{ (row.allFee*1).toFixed(1) }}元</span>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<el-table border :data="infoList2">
<el-table-column align="center" label="序号" prop="index">
<template #default="{row}">
<span style="color: #5A88BF;">top{{ row.index }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="shenName" min-width="160" />
<el-table-column label="业务金额" align="center" prop="allFee" min-width="120">
<template #default="{row}">
<span>{{ (row.allFee*1).toFixed(1) }}元</span>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<br>
</div>
</div>
<div>
<div class="from-Card">
<div class="title">
{{ queryParams2.beginYear }}-{{ queryParams2.endYear }}年度会员业务综合分析表
</div>
<el-form
v-show="showSearch" ref="queryRef2" size="small" :model="queryParams2" :inline="true"
label-position="top"
>
<el-row style="width: 100%;">
<el-col :span="4">
<el-form-item label="年份" prop="year">
<el-date-picker
v-model="queryParams2.beginYear"
:clearable="false"
type="year"
value-format="YYYY"
placeholder=""
@change="handleQuery2"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label=" " prop="year">
<el-date-picker
v-model="queryParams2.endYear"
:clearable="false"
type="year"
value-format="YYYY"
@change="handleQuery2"
/>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button size="small" type="primary" @click="handleQuery2">搜索</el-button>
<el-button size="small" @click="resetQuery2">重置</el-button>
<el-button size="small" type="warning" @click="importData2">导出</el-button>
</div>
</el-row>
</el-form>
</div>
<div v-loading="loading2" class="table">
<el-table border :data="infoListYear">
<el-table-column align="center" label="序号" width="80" type="index" />
<el-table-column align="center" label="年份" prop="year" />
<el-table-column align="center" label="年度总收入" prop="personTotalFee">
<template #default="{row}">
{{ row.allFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="单位会员" prop="memberTotalFee">
<template #default="{row}">
{{ row.memberTotalFee }}元
</template>
</el-table-column>
<el-table-column
align="center" label="个人会员" prop="personTotalFee"
>
<template #default="{row}">
{{ row.personTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="级位" prop="jiTotalFee">
<template #default="{row}">
{{ row.jiTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="段位" prop="duanTotalFee">
<template #default="{row}">
{{ row.duanTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="单位会员数量" prop="memberDocCount">
<template #default="{row}">
{{ row.memberCount }}家
</template>
</el-table-column>
<el-table-column align="center" label="个人会员数量" prop="personDocCount">
<template #default="{row}">
{{ row.personCount }}人
</template>
</el-table-column>
</el-table>
<br>
</div>
</div>
<div>
<div class="from-Card">
<div class="title">
{{ queryParams3.year }}年{{ queryParams3.month1 }}~{{ queryParams3.month2 }}月会员业务收入情况表
</div>
<el-form
v-show="showSearch" ref="queryRef3" size="small" :model="queryParams3" :inline="true"
label-position="top"
>
<el-row style="width: 100%;">
<el-col :span="4">
<el-form-item label="起始月份" prop="month1">
<el-select v-model="queryParams3.month1" style="width: 100%">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="截止月份" prop="month2">
<el-select v-model="queryParams3.month2" style="width: 100%" @change="handleQuery3">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="年份" prop="year">
<el-date-picker
v-model="queryParams3.year"
type="year"
value-format="YYYY"
@change="handleQuery3"
/>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button size="small" type="primary" @click="handleQuery3">搜索</el-button>
<el-button size="small" @click="resetQuery3">重置</el-button>
<el-button size="small" type="warning" @click="importData3">导出</el-button>
</div>
</el-row>
</el-form>
</div>
<div v-loading="loading3" class="table">
<el-table border :data="infoListYearMenber">
<el-table-column align="center" label="序号" width="80" type="index" />
<el-table-column align="center" label="月份" prop="name" />
<el-table-column align="center" label="单位会员" prop="memberTotalFee">
<template #default="{row}">
{{ row.memberTotalFee }}元
</template>
</el-table-column>
<el-table-column
align="center" label="个人会员" prop="personTotalFee"
>
<template #default="{row}">
{{ row.personTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="级位" prop="jiTotalFee">
<template #default="{row}">
{{ row.jiTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="段位" prop="duanTotalFee">
<template #default="{row}">
{{ row.duanTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="小计" prop="allFee">
<template #default="{row}">
{{ row.allFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="上年同比" prop="lastYearTotalFee">
<template #default="{row}">
{{ row.lastYearTotalFee }}元
</template>
</el-table-column>
<el-table-column align="center" label="增减幅%" prop="percent">
<template #default="{row}">
{{ row.percent }}
</template>
</el-table-column>
</el-table>
<br>
</div>
</div>
<div>
<div class="from-Card">
<div class="title">
{{ queryParams4.year }}年{{ queryParams4.month1 }}~{{ queryParams4.month2 }}月业务增幅表
</div>
<el-form
v-show="showSearch" ref="queryRef4" size="small" :model="queryParams4" :inline="true"
label-position="top"
>
<el-row style="width: 100%;">
<el-col :span="4">
<el-form-item label="起始月份" prop="month1">
<el-select v-model="queryParams4.month1" clearable style="width: 100%" @change="handleQuery4">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="截止月份" prop="month2">
<el-select v-model="queryParams4.month2" clearable style="width: 100%" @change="handleQuery4">
<el-option v-for="val in monthList" :key="val" :label="`${val}月`" :value="val" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="年份" prop="year">
<el-date-picker
v-model="queryParams4.year"
type="year"
value-format="YYYY"
@change="handleQuery4"
/>
</el-form-item>
</el-col>
<div class="po-r-btns">
<el-button size="small" type="primary" @click="handleQuery4">搜索</el-button>
<el-button size="small" @click="resetQuery4">重置</el-button>
<el-button size="small" type="warning" @click="importData4">导出</el-button>
</div>
</el-row>
</el-form>
</div>
<div v-loading="loading4" class="table">
<el-table border :data="infoList4">
<el-table-column align="center" label="序号" width="80" type="index" />
<el-table-column align="center" label="月份" prop="name" />
<el-table-column align="center" label="单位会员数量" prop="memberCount" />
<el-table-column
align="center" label="上年同比" prop="lastYearMemberCount"
>
<template #default="{row}">
{{ row.lastYearMemberCount }}
</template>
</el-table-column>
<el-table-column align="center" label="增减幅%" prop="jiTotalFee">
<template #default="{row}">
{{ row.memberCountPercent }}
</template>
</el-table-column>
<el-table-column align="center" label="个人会员数" prop="personCount">
<template #default="{row}">
{{ row.personCount }}
</template>
</el-table-column>
<el-table-column align="center" label="上年同比" prop="lastYearPersonCount">
<template #default="{row}">
{{ row.lastYearPersonCount }}
</template>
</el-table-column>
<el-table-column align="center" label="增减幅" prop="lastYearTotalFee">
<template #default="{row}">
{{ row.personCountPercent }}
</template>
</el-table-column>
<el-table-column align="center" label="级别数量" prop="percent">
<template #default="{row}">
{{ row.jiCount }}
</template>
</el-table-column>
<el-table-column align="center" label="上年同比" prop="lastYearJiCount">
<template #default="{row}">
{{ row.lastYearJiCount }}
</template>
</el-table-column>
<el-table-column align="center" label="增减幅%" prop="percent">
<template #default="{row}">
{{ row.jiCountPercent }}
</template>
</el-table-column>
<el-table-column align="center" label="段位数量" prop="duanCount">
<template #default="{row}">
{{ row.duanCount }}
</template>
</el-table-column>
<el-table-column align="center" label="上年同比" prop="lastYearDuanCount">
<template #default="{row}">
{{ row.lastYearDuanCount }}
</template>
</el-table-column>
<el-table-column align="center" label="增减幅%" prop="percent">
<template #default="{row}">
{{ row.duanCountPercent }}
</template>
</el-table-column>
</el-table>
<br>
</div>
</div>
<exportPPT ref="exportPPTRef" />
</div>
</template>
<script setup name="Analysis_Rank">
import { getCurrentInstance, reactive } from 'vue'
import { onMounted, ref, toRefs } from 'vue'
import { getMemberStatisticsForLeaderBoard, getMemberStatisticsForYear, getMemberStatisticsForQuarter, getTotalDocStatistics2 } from '@/api/analysis/business'
import exportPPT from './components/dexportPPT.vue'
const { proxy } = getCurrentInstance()
const infoList = ref([])
const infoList2 = ref([])
const infoListYear = ref([])
const infoListYearMenber = ref([])
const infoList4 = ref([])
const loading = ref(true)
const loading2 = ref(true)
const loading3 = ref(true)
const loading4 = ref(true)
const showSearch = ref(true)
const monthList = ref(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'])
const data = reactive({
queryParams: {
month1: '1',
month2: '2',
year: new Date().getFullYear() + ''
},
queryParams2: {
endYear: new Date().getFullYear() + '',
beginYear: new Date().getFullYear() + ''
},
queryParams3: {
month1: '1',
month2: '2',
year: new Date().getFullYear() + ''
},
queryParams4: {
month1: '1',
month2: '2',
year: new Date().getFullYear() + ''
}
})
const { queryParams, queryParams2, queryParams3, queryParams4 } = toRefs(data)
onMounted(() => {
getList()
getList2()
getList3()
getList4()
})
/** 查询考段信息列表 */
async function getList() {
if (queryParams.value.month1 > queryParams.value.month2) {
return proxy.$modal.msgError('请选择正确的月份范围')
}
loading.value = true
const res = await getMemberStatisticsForLeaderBoard(queryParams.value)
infoList.value = res.data
infoList2.value = infoList.value.splice(Math.floor(infoList.value.length / 2))
loading.value = false
}
/** 查询考段信息列表 */
async function getList2() {
loading2.value = true
if (queryParams2.value.beginYear > queryParams2.value.endYear) {
const num = queryParams2.value.beginYear
queryParams2.value.beginYear = queryParams2.value.endYear
queryParams2.value.endYear = num
}
const res = await getMemberStatisticsForYear(queryParams2.value)
infoListYear.value = res.data
loading2.value = false
}
/** 查询考段信息列表 */
async function getList3() {
if (queryParams3.value.month1 > queryParams3.value.month2) {
return proxy.$modal.msgError('请选择正确的月份范围')
}
loading3.value = true
const res = await getMemberStatisticsForQuarter(queryParams3.value)
infoListYearMenber.value = res.data
for (let i = 0; i < infoListYearMenber.value.length; i++) {
infoListYearMenber.value[i].name = queryParams3.value.month1 * 1 + i + '月'
if (i == infoListYearMenber.value.length - 1) {
infoListYearMenber.value[i].name = `${queryParams3.value.month1}~${queryParams3.value.month2}月合计`
}
}
loading3.value = false
}
/** 查询考段信息列表 */
async function getList4() {
if (queryParams4.value.month1 > queryParams4.value.month2) {
return proxy.$modal.msgError('请选择正确的月份范围')
}
loading4.value = true
const res = await getTotalDocStatistics2(queryParams4.value)
infoList4.value = res.data
for (let i = 0; i < infoList4.value.length; i++) {
infoList4.value[i].name = queryParams4.value.month1 * 1 + i + '月'
if (i == infoList4.value.length - 1) {
infoList4.value[i].name = `${queryParams4.value.month1}~${queryParams4.value.month2}月合计`
}
}
loading4.value = false
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1
getList()
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
handleQuery()
}
/** 搜索按钮操作 */
function handleQuery2() {
queryParams2.value.pageNum = 1
getList2()
}
/** 重置按钮操作 */
function resetQuery2() {
proxy.resetForm('queryRef2')
handleQuery2()
}
/** 搜索按钮操作 */
function handleQuery3() {
queryParams3.value.pageNum = 1
getList3()
}
/** 重置按钮操作 */
function resetQuery3() {
proxy.resetForm('queryRef3')
handleQuery3()
}
/** 重置按钮操作 */
function resetQuery4() {
proxy.resetForm('queryRef4')
handleQuery4()
}
/** 搜索按钮操作 */
function handleQuery4() {
queryParams4.value.pageNum = 1
getList4()
}
/**
* 导出季度报表
*/
function importData() {
proxy.download('/common/home/exportMemberStatisticsForLeaderBoard', {
...queryParams.value
}, `${queryParams.value.year}年第${queryParams.value.month1}~${queryParams.value.month2}月各单位业务收入TOP20排名${new Date().getTime()}.xlsx`)
}
// 导出PPT
function handelPPT() {
proxy.$refs['exportPPTRef'].open()
}
/**
* 导出年报表
*/
function importData2() {
proxy.download('/common/home/exportMemberStatisticsForYear', {
...queryParams2.value
}, `${queryParams2.value.beginYear}年至${queryParams2.value.endYear}年度会员业务综合分析表
年份
2024
${new Date().getTime()}.xlsx`)
}
/**
* 导出年报表对比
*/
function importData3() {
proxy.download('/common/home/exportMemberStatisticsForQuarter', {
...queryParams3.value
}, `${queryParams3.value.year}年${queryParams3.value.month1}~${queryParams3.value.month2}月会员业务收入情况表${new Date().getTime()}.xlsx`)
}
/**
* 导出4
*/
function importData4() {
proxy.download('/common/home/exportTotalDocStatistics2', {
...queryParams4.value
}, `${queryParams4.value.year}年${queryParams4.value.month1}~${queryParams4.value.month2}月业务收入情况表${new Date().getTime()}.xlsx`)
}
</script>
<style>
.title{
width: 100%;
text-align: center;
font-size: 20px;
font-weight: 600;
}
</style>