lijunjie 2 lat temu
rodzic
commit
c2d3f576c1

+ 173 - 96
CallCenterWeb.UI/RMYYAPP/pages/myTask/reportForm/reportForm.vue

@@ -11,7 +11,8 @@
11 11
 					:clear-icon="false" class="timebox" @change="changeClick" />
12 12
 				<view v-if="reportType==1" class="timebox">
13 13
 					<view @click="showPop()" class="show-time monthbox">
14
-						<uni-icons type="calendar" size="25" style="vertical-align: middle;color: #d6d6d6;line-height: 28px;margin-right: 10px;"></uni-icons>
14
+						<uni-icons type="calendar" size="25"
15
+							style="vertical-align: middle;color: #d6d6d6;line-height: 28px;margin-right: 10px;"></uni-icons>
15 16
 						{{defaultData.startTime}}
16 17
 					</view>
17 18
 					<lingfeng-timepicker ref="timePop" type="year-month" :defaultData="defaultData" :minDate="minDate"
@@ -65,8 +66,11 @@
65 66
 					<uni-icons type="arrow-up" size="10" class="iconbox" v-show="isup==1"></uni-icons>
66 67
 				</view>
67 68
 			</view>
69
+
68 70
 			<view class="contentbox">
69
-				<view class="middlebox">
71
+
72
+				
73
+				<!-- <view class="middlebox">
70 74
 					<view @click="gotoDetail(1)">
71 75
 						<text class="monicir cirone"></text><text class="contenttitle">硬件服务:</text><text
72 76
 							class="contentone">{{yjcon}}</text>
@@ -77,7 +81,9 @@
77 81
 						<text class="monicir cirtwo"></text><text class="contenttitle">软件服务:</text><text
78 82
 							class="contenttwo">{{rjcon}}</text>
79 83
 					</view>
80
-				</view>
84
+				</view> -->
85
+
86
+
81 87
 				<view style="display: flex;justify-content: space-between;">
82 88
 					<view class="allcountbox">
83 89
 						<view class="allcountTit">完成量</view>
@@ -92,6 +98,12 @@
92 98
 						<view class="allcountNum">{{backcon}}</view>
93 99
 					</view>
94 100
 				</view>
101
+				
102
+				<view style="height: 550rpx; width:100%" v-if="reportType!=2">
103
+					<qiun-data-charts  type="ring" :opts="yingRuanBieopts" :chartData="yingRuanBiechartData"    />
104
+				</view>
105
+
106
+
95 107
 				<!-- 饼图 -->
96 108
 				<view class="bieechart" v-if="reportType==2">
97 109
 					<qiun-data-charts type="ring" :opts="bieopts" :chartData="biechartData" />
@@ -280,6 +292,7 @@
280 292
 				items: ['周', '月', '年', '全'],
281 293
 				current: 0,
282 294
 				biechartData: {},
295
+				yingRuanBiechartData: {},
283 296
 				bieopts: {
284 297
 					rotate: false,
285 298
 					rotateLock: false,
@@ -319,6 +332,47 @@
319 332
 						}
320 333
 					}
321 334
 				},
335
+				yingRuanBieopts: {   
336
+					rotate: false,
337
+					rotateLock: false,
338
+					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#ff007f",
339
+						"#ea7ccc", "#aa557f", "#aaaa00", "#ff5500"
340
+					],
341
+					padding: [5, 5, 5, 5],
342
+					
343
+					dataLabel: true,
344
+					
345
+					enableScroll: false,
346
+					legend: {
347
+						show: true,
348
+						position: "bottom",
349
+						lineHeight: 20,
350
+						fontSize: 12
351
+					},
352
+					title: {
353
+						name: "接单类型",
354
+						fontSize: 15,
355
+						color: "#3f3f3f"
356
+					},
357
+					subtitle: {
358
+						name: "9999",
359
+						fontSize: 14,
360
+						color: "#3f3f3f"
361
+					},
362
+					extra: {
363
+						ring: { 
364
+							ringWidth: 25,
365
+							activeOpacity: 0.5,
366
+							activeRadius: 5,
367
+							offsetAngle: 0,
368
+							labelWidth: 10,
369
+							border: false,
370
+							borderWidth: 2,
371
+							borderColor: "#FFFFFF",
372
+							centerColor: "#d6ebff",
373
+						},
374
+					}
375
+				},
322 376
 				chartDatas: {},
323 377
 				opts: {
324 378
 					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
@@ -438,7 +492,7 @@
438 492
 			timeChange(val) {
439 493
 				this.defaultData.startTime = val
440 494
 				this.values = 0 //默认紧急列表
441
-				this.defaultStartTime = val + '-' + '01'//开始日期+01
495
+				this.defaultStartTime = val + '-' + '01' //开始日期+01
442 496
 				if (val.split("-")[1] == '01' || val.split("-")[1] == '03' || val.split("-")[1] == '05' ||
443 497
 					val.split("-")[1] == '07' || val.split("-")[1] == '08' || val.split("-")[1] == '10' || val.split("-")[
444 498
 						1] == '12') {
@@ -524,7 +578,7 @@
524 578
 				}
525 579
 				this.$http.get("FaultRepair/DoughnuChart", params).then((response) => {
526 580
 					const resdata = JSON.parse(response)
527
-					console.log(resdata,'DoughnuChart')
581
+					console.log(resdata, 'DoughnuChart')
528 582
 					this.bieopts.subtitle.name = resdata.total.toString()
529 583
 					if (resdata.dt.length > 0 && resdata.dt.length < 13) {
530 584
 						var data = resdata.dt
@@ -533,6 +587,7 @@
533 587
 								data: data
534 588
 							}]
535 589
 						}
590
+						console.group(JSON.parse(JSON.stringify(res)))
536 591
 						this.biechartData = JSON.parse(JSON.stringify(res))
537 592
 					} else if (resdata.dt.length > 12) {
538 593
 						var data = []
@@ -576,86 +631,107 @@
576 631
 				const params = {
577 632
 					starttime: this.defaultStartTime,
578 633
 					endtime: this.defaultEndTime,
634
+					// starttime: '2022-01-01',
635
+					// endtime: '2023-11-30',
579 636
 					type: option.reportType
580 637
 				}
581 638
 				this.$http.get("FaultRepair/DayReport", params).then((response) => {
582 639
 					// if (response.state.toLowerCase() === "success") {
583
-						const resdata = JSON.parse(response)
584
-						console.log(resdata,'responseresponse')
585
-						this.yjcon = resdata.yjtotal
586
-						this.rjcon = resdata.rjtotal
587
-						this.donecon = resdata.finishtotal
588
-						this.undonecon = resdata.unfinishtotal
589
-						this.backcon = resdata.tuihuitotal
590
-						if (resdata.total > resdata.zttotal) {
591
-							this.differcon = resdata.total - resdata.zttotal
592
-							this.isup = 1
593
-						}
594
-						if (resdata.total < resdata.zttotal) {
595
-							this.differcon = resdata.zttotal - resdata.total
596
-							this.isup = 0
597
-						}
598
-						var totalstr = String(resdata.total)
599
-						this.gecon = totalstr.slice(totalstr.length - 1, totalstr.length)
600
-						if (totalstr.length > 1) {
601
-							this.shicon = totalstr.slice(totalstr.length - 2, totalstr.length - 1)
602
-						}
603
-						if (totalstr.length > 2) {
604
-							this.baicon = totalstr.slice(totalstr.length - 3, totalstr.length - 2)
605
-						}
606
-						if (totalstr.length > 3) {
607
-							this.qiancon = totalstr.slice(totalstr.length - 4, totalstr.length - 3)
608
-						}
609
-						if (totalstr.length > 4) {
610
-							this.wancon = totalstr.slice(totalstr.length - 5, totalstr.length - 4)
611
-						}
612
-						if (totalstr.length > 5) {
613
-							this.shiwancon = totalstr.slice(totalstr.length - 6, totalstr.length - 5)
614
-						}
615
-						if (totalstr.length > 6) {
616
-							this.baiwancon = totalstr.slice(totalstr.length - 7, totalstr.length - 6)
617
-						}
618
-						var rowData = []
619
-						var colData = []
620
-						var res = {}
621
-						if (resdata.dt.length > 0) {
622
-							resdata.dt.forEach((item, index) => {
623
-								if (item.dateshownew.length == 10) { //日
624
-									rowData.push(item.dateshownew.substring(5, 10))
625
-									colData.push(Number(item.allcountnew))
626
-								} else if (this.reportType == 0) { //点
627
-									rowData.push(item.dateshownew.split(" ")[1].substring(0, 5))
628
-									colData.push(Number(item.allcountnew))
629
-								} else { //月,年
630
-									rowData.push(item.dateshownew)
631
-									colData.push(Number(item.allcountnew))
632
-								}
633
-							})
634
-							res = {
635
-								categories: rowData,
636
-								series: [{
637
-									name: "接单量",
638
-									data: colData
639
-								}]
640
+					const resdata = JSON.parse(response)
641
+					console.group(resdata, 'responseresponse')
642
+					this.yjcon = resdata.yjtotal
643
+					this.rjcon = resdata.rjtotal
644
+					this.donecon = resdata.finishtotal
645
+					this.undonecon = resdata.unfinishtotal
646
+					this.backcon = resdata.tuihuitotal
647
+					if (resdata.total > resdata.zttotal) {
648
+						this.differcon = resdata.total - resdata.zttotal
649
+						this.isup = 1
650
+					}
651
+					if (resdata.total < resdata.zttotal) {
652
+						this.differcon = resdata.zttotal - resdata.total
653
+						this.isup = 0
654
+					}
655
+					var totalstr = String(resdata.total)
656
+					this.gecon = totalstr.slice(totalstr.length - 1, totalstr.length)
657
+					if (totalstr.length > 1) {
658
+						this.shicon = totalstr.slice(totalstr.length - 2, totalstr.length - 1)
659
+					}
660
+					if (totalstr.length > 2) {
661
+						this.baicon = totalstr.slice(totalstr.length - 3, totalstr.length - 2)
662
+					}
663
+					if (totalstr.length > 3) {
664
+						this.qiancon = totalstr.slice(totalstr.length - 4, totalstr.length - 3)
665
+					}
666
+					if (totalstr.length > 4) {
667
+						this.wancon = totalstr.slice(totalstr.length - 5, totalstr.length - 4)
668
+					}
669
+					if (totalstr.length > 5) {
670
+						this.shiwancon = totalstr.slice(totalstr.length - 6, totalstr.length - 5)
671
+					}
672
+					if (totalstr.length > 6) {
673
+						this.baiwancon = totalstr.slice(totalstr.length - 7, totalstr.length - 6)
674
+					}
675
+					var rowData = []
676
+					var colData = []
677
+					var res = {}
678
+					if (resdata.dt.length > 0) {
679
+						resdata.dt.forEach((item, index) => {
680
+							if (item.dateshownew.length == 10) { //日
681
+								rowData.push(item.dateshownew.substring(5, 10))
682
+								colData.push(Number(item.allcountnew))
683
+							} else if (this.reportType == 0) { //点
684
+								rowData.push(item.dateshownew.split(" ")[1].substring(0, 5))
685
+								colData.push(Number(item.allcountnew))
686
+							} else { //月,年
687
+								rowData.push(item.dateshownew)
688
+								colData.push(Number(item.allcountnew))
640 689
 							}
641
-							this.chartDatas = JSON.parse(JSON.stringify(res))
642
-						} else {
643
-							rowData = ['0:00', '4:00', '8:00', '12:00']
644
-							colData = [{
690
+						})
691
+						res = {
692
+							categories: rowData,
693
+							series: [{
645 694
 								name: "接单量",
646
-								data: [0, 0, 0, 0]
695
+								data: colData
647 696
 							}]
648
-							res = {
649
-								categories: rowData,
650
-								series: colData
651
-							}
652
-							this.chartDatas = JSON.parse(JSON.stringify(res))
697
+						}
698
+						this.chartDatas = JSON.parse(JSON.stringify(res))
699
+					} else {
700
+						rowData = ['0:00', '4:00', '8:00', '12:00']
701
+						colData = [{
702
+							name: "接单量",
703
+							data: [0, 0, 0, 0]
704
+						}]
705
+						res = {
706
+							categories: rowData,
707
+							series: colData
708
+						}
709
+						this.chartDatas = JSON.parse(JSON.stringify(res))
653 710
 						// }
654 711
 					}
712
+
713
+					if (resdata.dtcate.length) {
714
+						this.yingRuanBiechartData = {
715
+							series: [{
716
+								data: resdata.dtcate.map(val => {
717
+									return {
718
+										name: val.catename,
719
+										value: val.cnt, 
720
+									}
721
+								})
722
+							}]
723
+						}
724
+					} else {
725
+						this.yingRuanBiechartData = {
726
+							series: []
727
+						}
728
+					}
729
+
730
+
655 731
 				}).catch((e) => {
656 732
 					console.log(e);
657 733
 				})
658
-			},
734
+			}, 
659 735
 			initRemainder(option) {
660 736
 				const params = {
661 737
 					starttime: this.defaultStartTime,
@@ -664,17 +740,17 @@
664 740
 				}
665 741
 				this.$http.get("FaultRepair/RemainderDayReport", params).then((response) => {
666 742
 					// if (response.state.toLowerCase() === "success") {
667
-						const data = JSON.parse(response)[0]
668
-						console.log(data,"RemainderDayReport")
669
-						this.chaoshiper = Number(data.overjd.substring(0, data.overjd.length - 1))
670
-						this.chaoqiper = Number(data.overtime.substring(0, data.overtime.length - 1))
671
-						this.undoneper = Number(data.overday.substring(0, data.overday.length - 1))
672
-						this.chaoshinum = data.overjdcount
673
-						this.chaoqinum = data.overcount
674
-						this.undonenum = data.overdaycount
675
-						this.averageReply = Number(data.responsetime).toFixed(1)
676
-						this.averageSolve = Number(data.solvetime).toFixed(1)
677
-						// console.log(this.chaoshiper,this.chaoqiper,this.undoneper)
743
+					const data = JSON.parse(response)[0]
744
+					console.log(data, "RemainderDayReport")
745
+					this.chaoshiper = Number(data.overjd.substring(0, data.overjd.length - 1))
746
+					this.chaoqiper = Number(data.overtime.substring(0, data.overtime.length - 1))
747
+					this.undoneper = Number(data.overday.substring(0, data.overday.length - 1))
748
+					this.chaoshinum = data.overjdcount
749
+					this.chaoqinum = data.overcount
750
+					this.undonenum = data.overdaycount
751
+					this.averageReply = Number(data.responsetime).toFixed(1)
752
+					this.averageSolve = Number(data.solvetime).toFixed(1)
753
+					// console.log(this.chaoshiper,this.chaoqiper,this.undoneper)
678 754
 					// }
679 755
 				}).catch((e) => {
680 756
 					console.log(e);
@@ -688,16 +764,16 @@
688 764
 				}
689 765
 				this.$http.get("FaultRepair/MYD", params).then((response) => {
690 766
 					// if (response.state.toLowerCase() === "success") {
691
-						const data = JSON.parse(response)[0]
692
-						console.log(data,"MYD")
693
-						this.pjmycon = data.mycount
694
-						this.morencon = data.defaultEvaluate
695
-						this.bmycon = data.bmycount
696
-						this.myper = Number(data.myrate.substring(0, data.myrate.length - 1))
697
-						this.morenper = Number(data.defaultrate.substring(0, data.defaultrate.length - 1))
698
-						// this.morenper = Number(data.defaultrate.substring(0, data.defaultrate.length - 1)) + this
699
-						// 	.myper
700
-						// console.log(this.myper, this.morenper)
767
+					const data = JSON.parse(response)[0]
768
+					console.log(data, "MYD")
769
+					this.pjmycon = data.mycount
770
+					this.morencon = data.defaultEvaluate
771
+					this.bmycon = data.bmycount
772
+					this.myper = Number(data.myrate.substring(0, data.myrate.length - 1))
773
+					this.morenper = Number(data.defaultrate.substring(0, data.defaultrate.length - 1))
774
+					// this.morenper = Number(data.defaultrate.substring(0, data.defaultrate.length - 1)) + this
775
+					// 	.myper
776
+					// console.log(this.myper, this.morenper)
701 777
 					// }
702 778
 				}).catch((e) => {
703 779
 					console.log(e);
@@ -959,7 +1035,8 @@
959 1035
 		right: 0;
960 1036
 		top: 0;
961 1037
 	}
962
-	.monthbox{
1038
+
1039
+	.monthbox {
963 1040
 		border: 1px solid #e5e5e5;
964 1041
 		background-color: white;
965 1042
 		font-size: 14px;
@@ -1043,7 +1120,7 @@
1043 1120
 	.bieechart {
1044 1121
 		margin-top: 0px;
1045 1122
 		width: 100%;
1046
-		height: 650rpx;
1123
+		height: 480rpx;
1047 1124
 	}
1048 1125
 
1049 1126
 	#echartbox {