Ver código fonte

综合统计

seimin 1 mês atrás
pai
commit
471c1d2294

+ 1 - 1
src/app/views/home/home.component.html

@@ -210,7 +210,7 @@
210 210
                   </div>
211 211
                   <div nz-row class="title">
212 212
                     <div nz-col nzSpan="12">起点科室:{{data.startDept.dept}}</div>
213
-                    <div nz-col nzSpan="12">执行配送人员:{{data.workOrderObj.worker.name}}</div>
213
+                    <div nz-col nzSpan="12">执行配送人员:{{data.workOrderObj?.worker?.name}}</div>
214 214
                   </div>
215 215
                   <div [title]="data.evaluationDetails.remark"
216 216
                     [ngClass]="{'over':true,'noOver':(isOpen&&coopOpenId==data.id)}">

+ 1 - 1
src/app/views/new-statistics/distribution-inspection-statistics/date-quality-control-statistics/date-quality-control-statistics.component.ts

@@ -23,7 +23,7 @@ export class DateQualityControlStatisticsComponent implements OnInit, AfterViewI
23 23
   pageSize: number = 30; //表格每页展示条数
24 24
   listLength: number = 0; //表格总数据量
25 25
 
26
-  statisticsTypeId;//科室类型id
26
+  statisticsTypeId;//统计分类id
27 27
 
28 28
   ngOnInit() {
29 29
     this.initSessionData();

+ 9 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts

@@ -9,6 +9,15 @@ const routes: Routes = [
9 9
     component: DistributionInspectionStatisticsComponent,
10 10
     children: [
11 11
       {
12
+        // 综合统计
13
+        path: 'distributionSynthesizeStatistics',
14
+        loadChildren: () => import('./distribution-synthesize-statistics/distribution-synthesize-statistics.module').then(m => m.DistributionSynthesizeStatisticsModule),
15
+        data: {
16
+          reuse: true,
17
+          title: '综合统计'
18
+        }
19
+      },
20
+      {
12 21
         // 日期业务统计
13 22
         path: 'dateBusinessStatistics',
14 23
         loadChildren: () => import('./date-business-statistics/date-business-statistics.module').then(m => m.DateBusinessStatisticsModule),

+ 14 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics-routing.module.ts

@@ -0,0 +1,14 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { DistributionSynthesizeStatisticsComponent } from './distribution-synthesize-statistics.component';
4
+
5
+
6
+const routes: Routes = [
7
+  { path: '', component: DistributionSynthesizeStatisticsComponent }
8
+];
9
+
10
+@NgModule({
11
+  imports: [RouterModule.forChild(routes)],
12
+  exports: [RouterModule]
13
+})
14
+export class DistributionSynthesizeStatisticsRoutingModule { }

+ 170 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.html

@@ -0,0 +1,170 @@
1
+<div class="synthesize-box" *ngIf="!isLoading">
2
+	<div class="searchDataWrap">
3
+		<div class="searchData">
4
+			<div class="searchDataItem">
5
+				<span class="label">选择日期</span>:
6
+				<nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
7
+				</nz-range-picker>
8
+			</div>
9
+		</div>
10
+		<div class="operation">
11
+			<button nz-button class="btn default" (click)="search()">搜索</button>
12
+			<button nz-button class="btn default ml8" (click)="reset()">重置</button>
13
+		</div>
14
+	</div>
15
+	<div class="top1-statistics">
16
+		<div class="top-list">
17
+			<div class="special-box">
18
+				<div class="num">{{workData.totalCount || 0}}</div>
19
+				<div class="describe">工单总数</div>
20
+			</div>
21
+			<div class="special-box-right">
22
+				<div class="sign-describe">已完成: <span class="sign-num">{{workData.doneCount || 0}}</span></div>
23
+				<div class="sign-describe">待接单: <span class="sign-num">{{workData.waitCount || 0}}</span></div>
24
+				<div class="sign-describe">处理中: <span class="sign-num">{{workData.doingCount || 0}}</span></div>
25
+			</div>
26
+			<div class="border"></div>
27
+		</div>
28
+		<div class="top-list">
29
+			<div class="special-box">
30
+				<div class="num">{{workData.workerCount || 0}}</div>
31
+				<div class="describe">总人数</div>
32
+			</div>
33
+			<div class="border"></div>
34
+		</div>
35
+		<div class="top-list">
36
+			<div class="special-box">
37
+				<div class="num">{{workData.totalGrade || 0}}</div>
38
+				<div class="describe">总积分</div>
39
+			</div>
40
+			<div class="border"></div>
41
+		</div>
42
+		<div class="top-list">
43
+			<div class="special-box">
44
+				<div class="num">{{workData.badCount || 0}}</div>
45
+				<div class="describe">差评单数</div>
46
+			</div>
47
+			<div class="border"></div>
48
+		</div>
49
+		<div class="top-list">
50
+			<div class="special-box">
51
+				<div class="num">{{workData.doneRate || 0}}%</div>
52
+				<div class="describe">按时完成率</div>
53
+			</div>
54
+		</div>
55
+	</div>
56
+  <div class="top0-statistics">
57
+    <div>标本<span class="num">{{businessData.specimenCount || 0}}</span></div>
58
+    <div>病理<span class="num">{{businessData.pathologyCount || 0}}</span></div>
59
+    <div>陪检<span class="num">{{businessData.inspectCount || 0}}</span></div>
60
+    <div>药品<span class="num">{{businessData.drugsCount || 0}}</span></div>
61
+    <div>静配<span class="num">{{businessData.drugsJpCount || 0}}</span></div>
62
+    <div>中药<span class="num">{{businessData.drugsHerbalCount || 0}}</span></div>
63
+    <div>血制品<span class="num">{{businessData.bloodCount || 0}}</span></div>
64
+  </div>
65
+	<div class="top2-statistics">
66
+    <div class="statistics width-60 mar-right-8">
67
+			<div class="statistics-box">
68
+				<div class="sign-green"></div>
69
+				<div class="statistics-title">业务分类</div>
70
+			</div>
71
+			<div class="echarts-repairs">
72
+				<div echarts class="echarts" [options]='businessOptions'></div>
73
+			</div>
74
+		</div>
75
+		<div class="statistics width-40">
76
+			<div class="statistics-box">
77
+				<div class="sign-green"></div>
78
+				<div class="statistics-title">申请来源</div>
79
+				<div class="more" *ngIf="showMore('sourceStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/sourceStatistics')">更多></div>
80
+			</div>
81
+			<div class="echarts-repairs">
82
+			  <div echarts class="echarts" [options]='applyOptions'></div>
83
+			</div>
84
+		</div>
85
+	</div>
86
+  <div class="top2-statistics">
87
+		<div class="statistics width-49 mar-right-8">
88
+			<div class="statistics-box">
89
+				<div class="sign-green"></div>
90
+				<div class="statistics-title">科室Top5</div>
91
+				<div class="more" *ngIf="showMore('departmentQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/departmentQualityControlStatistics')">更多></div>
92
+			</div>
93
+			<div class="table">
94
+				<div class="td">
95
+					<div class="table-td-4">排名</div>
96
+					<div class="table-td-4">科室名称</div>
97
+					<div class="table-td-4">工单量</div>
98
+					<div class="table-td-4">好评率</div>
99
+				</div>
100
+				<div class="th" *ngFor="let item of deptTopData; let index = index;">
101
+          <div class="table-list-4">
102
+						<img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
103
+						<img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
104
+						<img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
105
+						<span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
106
+					</div>
107
+					<div class="table-list-4 ellipsis-oneline" title="{{item.dept}}">{{item.dept}}</div>
108
+					<div class="table-list-4">{{item.sum || 0}}</div>
109
+					<div class="table-list-4">{{item.goodRate || '0%'}}</div>
110
+				</div>
111
+			</div>
112
+		</div>
113
+		<div class="statistics width-50">
114
+			<div class="statistics-box">
115
+				<div class="sign-green"></div>
116
+				<div class="statistics-title">人员Top5</div>
117
+				<div class="more" *ngIf="showMore('userQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/userQualityControlStatistics')">更多></div>
118
+			</div>
119
+			<div class="table">
120
+				<div class="td">
121
+					<div class="table-td-4">排名</div>
122
+					<div class="table-td-4">人员名称</div>
123
+					<div class="table-td-4">工单量</div>
124
+					<div class="table-td-4">积分总数</div>
125
+				</div>
126
+				<div class="th" *ngFor="let item of userTopData; let index = index;">
127
+					<div class="table-list-4">
128
+						<img src="../../assets/images/top1.png" alt="" class="img" *ngIf="index==0">
129
+						<img src="../../assets/images/top2.png" alt="" class="img" *ngIf="index==1">
130
+						<img src="../../assets/images/top3.png" alt="" class="img" *ngIf="index==2">
131
+						<span *ngIf="index !=0 && index !=1 && index !=2">{{index+1}}</span>
132
+					</div>
133
+					<div class="table-list-4 ellipsis-oneline" title="{{item.userName}}({{item.userAccount}})">{{item.userName}}<ng-container *ngIf="item.userAccount">({{item.userAccount}})</ng-container></div>
134
+					<div class="table-list-4">{{item.sum || 0}}</div>
135
+					<div class="table-list-4">{{item.totalGrade || 0}}</div>
136
+				</div>
137
+			</div>
138
+		</div>
139
+	</div>
140
+  <div class="top2-statistics">
141
+    <div class="statistics width-100">
142
+      <div class="statistics-box">
143
+        <div class="sign-green"></div>
144
+        <div class="statistics-title">日趋势图</div>
145
+        <div class="statistics-select">
146
+					<div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'day'}" (click)="selectCheck('day')">日</div>
147
+					<div class="statistics-select-list" [ngClass]="{'activeClass': activeIndex == 'hour'}" (click)="selectCheck('hour')">时</div>
148
+				</div>
149
+        <div class="searchDataItem ml8">
150
+          <span class="label">统计分类</span>:
151
+          <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (ngModelChange)="changeStatisticsType($event)">
152
+            <ng-container *ngFor="let option of statisticsTypeList">
153
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
154
+            </ng-container>
155
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
156
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
157
+            </nz-option>
158
+          </nz-select>
159
+        </div>
160
+        <div class="more" *ngIf="showMore('dateQualityControlStatistics')" (click)="toPath('/newStatistics/distributionInspectionStatistics/dateQualityControlStatistics')">更多></div>
161
+      </div>
162
+      <div class="echarts-repairs">
163
+        <div echarts class="echarts" [options]='trendOptions'></div>
164
+      </div>
165
+    </div>
166
+  </div>
167
+</div>
168
+<div class="mask-style" *ngIf="isLoading">
169
+	<nz-spin nzSimple class="spin-style"></nz-spin>
170
+</div>

+ 273 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.less

@@ -0,0 +1,273 @@
1
+@import "../../../../../../src/theme.less";
2
+:host{
3
+  position: absolute;
4
+  top: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  left: 0;
8
+	.synthesize-box{
9
+		background: #F0F2F5 !important;
10
+		height: calc((100vh - 92px));
11
+		overflow-y: auto;
12
+		overflow-x: hidden;
13
+		.searchDataWrap{
14
+		  display: flex;
15
+		  align-items: center;
16
+		  justify-content: space-between;
17
+			padding-right: 15px;
18
+			background: #fff;
19
+			margin-bottom: 8px;
20
+		  .searchData{
21
+		    padding: 16px;
22
+		    .searchDataItem{
23
+		      .label{
24
+		        font-size: 16px;
25
+		      }
26
+		    }
27
+		  }
28
+		}
29
+    .top0-statistics{
30
+      margin-bottom: 8px;
31
+      display: flex;
32
+      align-items: center;
33
+      justify-content: space-between;
34
+      padding: 0 24px;
35
+      height: 56px;
36
+      color: #8F8F8F;
37
+      font-size: 14px;
38
+      background-color: #fff;
39
+      .num{
40
+        font-size: 18px;
41
+        color: #000;
42
+        margin-left: 8px;
43
+        position: relative;
44
+        top: 1px;
45
+      }
46
+    }
47
+		.top1-statistics{
48
+			display: flex;
49
+			background: #fff;
50
+			padding: 10px 0;
51
+			margin-bottom: 8px;
52
+			.top-list{
53
+				display: flex;
54
+				align-items: center;
55
+				justify-content: center;
56
+				width: 20%;
57
+				position: relative;
58
+				.border{
59
+					width: 1px;
60
+					height: 42px;
61
+					background: #D9D9D9;
62
+					position: absolute;
63
+					right: 0;
64
+				}
65
+				.special-box{
66
+					text-align: center;
67
+					position: relative;
68
+					top: -5px;
69
+					.num{
70
+						font-size: 35px;
71
+						font-weight: 500;
72
+						color: #64BD7B;
73
+					}
74
+					.describe{
75
+						font-size: 14px;
76
+						color: #8F8F8F;
77
+					}
78
+				}
79
+				.special-box-right{
80
+					margin-left: 16px;
81
+					.sign-describe{
82
+						font-size: 12px;
83
+						color: #8F8F8F;
84
+						.sign-num{
85
+							font-size: 14px;
86
+							font-weight: 500;
87
+							color: #000;
88
+						}
89
+					}
90
+				}
91
+			}
92
+		}
93
+		.top2-statistics{
94
+			display: flex;
95
+			// flex-flow: row wrap;
96
+			// justify-content: space-between;
97
+			height: 318px;
98
+			margin-bottom: 8px;
99
+      &:last-of-type{
100
+        margin-bottom: 0;
101
+      }
102
+			.mar-right-8{
103
+				margin-right: 8px;
104
+			}
105
+			.statistics{
106
+				padding: 10px;
107
+				background: #fff;
108
+				.statistics-box{
109
+					height: 41px;
110
+					display: flex;
111
+					align-items: center;
112
+					position: relative;
113
+					.sign-green{
114
+						width: 6px;
115
+						height: 6px;
116
+						border-radius: 50%;
117
+						background: #64BD7B;
118
+						margin-right: 5px;
119
+					}
120
+					.statistics-title{
121
+						color: #000;
122
+						font-size: 16px;
123
+						font-weight: 500;
124
+						margin-right: 10px;
125
+					}
126
+					.statistics-select{
127
+						display: flex;
128
+						.statistics-select-list{
129
+							width: 58px;
130
+							height: 23px;
131
+							line-height: 23px;
132
+							text-align: center;
133
+							border-radius: 3px;
134
+							border: 1px solid #E2E2E2;
135
+							font-size: 12px;
136
+							margin-right: 3px;
137
+							cursor: pointer;
138
+						}
139
+						.activeClass{
140
+							color: #64BD7B !important;
141
+							border: 1px solid #64BD7B !important;
142
+							background: #E9F7E9 !important;
143
+						}
144
+					}
145
+          .searchDataItem{
146
+            .selectItem{
147
+              width: 224px;
148
+            }
149
+          }
150
+					.more{
151
+						position: absolute;
152
+						right: 0;
153
+						cursor: pointer;
154
+					}
155
+				}
156
+				.table{
157
+					width: 100%;
158
+					.td{
159
+						display: flex;
160
+						height: 45px;
161
+						border-bottom: 1px solid #D9D9D9;
162
+						.table-td{
163
+							line-height: 45px;
164
+							text-align: center;
165
+							width: 16.66%;
166
+							color: #000;
167
+						}
168
+						.table-td-4{
169
+							line-height: 45px;
170
+							text-align: center;
171
+							width: 25%;
172
+							color: #000;
173
+						}
174
+					}
175
+					.th{
176
+						display: flex;
177
+						height: 40px;
178
+						border-bottom: 1px solid #D9D9D9;
179
+						.table-list{
180
+							line-height: 40px;
181
+							text-align: center;
182
+							width: 16.66%;
183
+							color: #8F8F8F;
184
+							.img{
185
+								width: 25px;
186
+							}
187
+						}
188
+						.table-list-4{
189
+							line-height: 40px;
190
+							text-align: center;
191
+							width: 25%;
192
+							color: #8F8F8F;
193
+              .img{
194
+								width: 25px;
195
+							}
196
+						}
197
+					}
198
+				}
199
+			}
200
+      .width-100{
201
+				width: 100%;
202
+        background: #fff;
203
+				.echarts-repairs{
204
+					.echarts{
205
+						width: 100%;
206
+						height: 268px;
207
+					}
208
+				}
209
+			}
210
+			.width-60{
211
+				width: 60%;
212
+        background: #fff;
213
+				.echarts-repairs{
214
+					.echarts{
215
+						width: 100%;
216
+						height: 260px;
217
+					}
218
+				}
219
+			}
220
+			.width-50{
221
+				width: calc((100% - 8px)/2);
222
+				background: #fff;
223
+				.echarts-repairs{
224
+					.echarts{
225
+						width: 100%;
226
+						height: 260px;
227
+					}
228
+				}
229
+			}
230
+			.width-49{
231
+				width: calc((100% - 8px)/2);
232
+				background: #fff;
233
+				.echarts-repairs{
234
+					.echarts{
235
+						width: 100%;
236
+						height: 260px;
237
+					}
238
+				}
239
+			}
240
+			.width-40{
241
+				width: 40%;
242
+				background: #fff;
243
+				.echarts-repairs{
244
+					.echarts{
245
+						width: 100%;
246
+						height: 260px;
247
+					}
248
+				}
249
+			}
250
+		}
251
+		.top3-statistics{
252
+			// display: flex;
253
+			// height: 310px;
254
+			margin-bottom: 8px;
255
+		}
256
+	}
257
+}
258
+
259
+.mask-style{
260
+	width: 100%;
261
+	height: 100%;
262
+	position: fixed;
263
+	top: 0;
264
+	left: 0;
265
+	z-index: 999;
266
+	display: flex;
267
+	background: rgba(0,0,0,0.2);
268
+	align-items: center;
269
+	justify-content: center;
270
+}
271
+.spin-style{
272
+	z-index:9999;
273
+}

+ 515 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.component.ts

@@ -0,0 +1,515 @@
1
+import { Router } from '@angular/router';
2
+import { format, addMonths, startOfMonth, endOfMonth } from 'date-fns';
3
+import { Component, OnInit } from "@angular/core";
4
+import { MainService } from 'src/app/services/main.service';
5
+import { TabService } from '../../services/tab.service';
6
+@Component({
7
+  selector: "app-distribution-synthesize-statistics",
8
+  templateUrl: "./distribution-synthesize-statistics.component.html",
9
+  styleUrls: ["./distribution-synthesize-statistics.component.less"],
10
+})
11
+export class DistributionSynthesizeStatisticsComponent implements OnInit {
12
+  constructor(
13
+    private mainService: MainService,
14
+    private tabService: TabService,
15
+    public router: Router,
16
+  ) {}
17
+
18
+	isLoading:Boolean = false;
19
+	workData:any = []; //工单统计
20
+	businessData:any = []; //业务统计
21
+  listOfData: any[] = []; //表格数据
22
+  pageIndex: number = 1; //表格当前页码
23
+  pageSize: number = 10; //表格每页展示条数
24
+  listLength: number = 10; //表格总数据量
25
+	activeIndex:any = 'day';
26
+	applyOptions:any={} //申请来源 option
27
+	trendOptions:any={} //日趋势图 option
28
+  businessOptions:any={} //业务分类 option
29
+	deptTopData:any = [
30
+		{
31
+			name:'王'
32
+		},
33
+		{
34
+			name:'王'
35
+		},
36
+		{
37
+			name:'王'
38
+		},
39
+		{
40
+			name:'王'
41
+		},
42
+		{
43
+			name:'王'
44
+		}
45
+	] //科室top5
46
+	userTopData:any = [
47
+		{
48
+			name:'王'
49
+		},
50
+		{
51
+			name:'王'
52
+		},
53
+		{
54
+			name:'王'
55
+		},
56
+		{
57
+			name:'王'
58
+		},
59
+		{
60
+			name:'王'
61
+		}
62
+	] //人员top5
63
+  ngOnInit() {
64
+    this.search();
65
+  }
66
+
67
+	// 维修处理类型切换
68
+	selectCheck(type){
69
+		this.activeIndex = type
70
+		this.trendChart();
71
+	}
72
+
73
+	// 申请来源
74
+	applyChart() {
75
+		let postData:any = {
76
+	    startDate: this.dateRange[0],
77
+	    endDate: this.dateRange[1],
78
+			type: 'sourceCount',
79
+	    hosId: this.getHosId,
80
+	    businessType: 'hsms',
81
+	  };
82
+		this.mainService
83
+		  .getReportData(postData)
84
+		  .subscribe((result:any) => {
85
+		    let datas = result.data.map(i=>{
86
+					return{
87
+						name:i.name,
88
+						value:i.sum
89
+					}
90
+				});
91
+				this.applyOptions = {
92
+				  tooltip: {
93
+				    trigger: "item",
94
+				    formatter: "{b}: {c} ({d}%)",
95
+				  },
96
+				  legend: {
97
+				    data: datas,
98
+						left: 'left',
99
+				  },
100
+				  series: [
101
+				    {
102
+				      name: "",
103
+				      type: "pie",
104
+				      radius: ["30%", "50%"],
105
+							center:["50%","60%"],
106
+				      data: datas,
107
+							emphasis: {
108
+								itemStyle: {
109
+									shadowBlur: 10,
110
+									shadowOffsetX: 0,
111
+									shadowColor: 'rgba(0, 0, 0, 0.5)'
112
+								}
113
+							},
114
+							label: {
115
+									show: true,
116
+									formatter: '{b}: {c} {d}%'
117
+							},
118
+				      itemStyle: {
119
+				        normal: {
120
+				          //每根柱子颜色设置
121
+				          color: function (params) {
122
+				            let colorList = [
123
+				              "#33CC85",
124
+				              "#72C0DD",
125
+				              "#FAC958",
126
+											"#546FC6",
127
+											"#d35b7e",
128
+											"#778ccC",
129
+											"#fad354",
130
+											"#aldee0",
131
+											"#ee84a8",
132
+											"#8475c5",
133
+											"#b0d097",
134
+											"#ffadbb",
135
+											"#fd8c67",
136
+											"#d495e0",
137
+				            ];
138
+				            return colorList[params.dataIndex];
139
+				          },
140
+				        },
141
+				      },
142
+				    },
143
+				  ],
144
+				};
145
+		  });
146
+	}
147
+
148
+	// 日趋势图
149
+	trendChart(){
150
+		let postData:any = {
151
+	    startDate: this.dateRange[0],
152
+	    endDate: this.dateRange[1],
153
+			type: 'dateTimeTrend',
154
+	    hosId: this.getHosId,
155
+	    businessType: 'hsms',
156
+	    dateType: this.activeIndex,
157
+      statisticsTypeId: this.statisticsTypeId || undefined,
158
+	  };
159
+		this.mainService
160
+		  .getReportData(postData)
161
+		  .subscribe((result:any) => {
162
+		    let datas = []
163
+				let title = []
164
+				for(let i of result.data){
165
+					datas.push(i.sum)
166
+					title.push(i.date)
167
+				}
168
+				this.trendOptions = {
169
+					tooltip: {
170
+					    trigger: 'axis',
171
+					    axisPointer: {
172
+					      type: 'shadow'
173
+					    }
174
+					  },
175
+						grid: {
176
+							top: '10%',
177
+							left: '0%',  // grid布局设置适当调整避免X轴文字只能部分显示
178
+							right: '0%', // grid布局设置适当调整避免X轴文字只能部分显示
179
+							bottom: '2%',
180
+							containLabel: true,
181
+						},
182
+					  xAxis: [
183
+					    {
184
+					      type: 'category',
185
+					      data: title,
186
+					      axisTick: {
187
+									show:false,
188
+					        alignWithLabel: true
189
+					      },
190
+								axisLabel: {
191
+									show: true, // 是否显示刻度标签,默认显示
192
+									interval: 0, // 坐标轴刻度标签的显示间隔,在类目轴中有效;默认会采用标签不重叠的策略间隔显示标签;可以设置成0强制显示所有标签;如果设置为1,表示『隔一个标签显示一个标签』,如果值为2,表示隔两个标签显示一个标签,以此类推。
193
+									rotate: 0, // 刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠;旋转的角度从-90度到90度
194
+									inside: false, // 刻度标签是否朝内,默认朝外
195
+									margin: 6, // 刻度标签与轴线之间的距离
196
+								}
197
+					    }
198
+					  ],
199
+					  yAxis: [
200
+					    {
201
+					      type: 'value',
202
+								axisLine: {
203
+									show:false
204
+								},
205
+								axisTick:{
206
+									show:false
207
+								},
208
+                splitLine: {
209
+                  lineStyle: {
210
+                    type: 'dotted',
211
+                  }
212
+                }
213
+					    }
214
+					  ],
215
+					  series: [
216
+					    {
217
+					      type: 'line',
218
+								color: '#3AACFF',
219
+					      data: datas,
220
+								label:{
221
+									show: true,
222
+									position: "top",  // 展示在上方
223
+									color: "#333"
224
+								},
225
+					    }
226
+					  ]
227
+				}
228
+		  });
229
+	}
230
+
231
+  // 业务分类
232
+	businessChart(){
233
+    let postData:any = {
234
+	    startDate: this.dateRange[0],
235
+	    endDate: this.dateRange[1],
236
+			type: 'statisticsDateTypeTop5',
237
+	    hosId: this.getHosId,
238
+	    businessType: 'hsms',
239
+	  };
240
+		this.mainService
241
+		  .getReportData(postData)
242
+		  .subscribe((result:any) => {
243
+		    let datas = []
244
+		    let title = []
245
+		    for(let i of result.data){
246
+		    	datas.push(i.sum)
247
+		    	title.push(i.statisticsDateType)
248
+		    }
249
+		    this.businessOptions = {
250
+		    	tooltip: {
251
+		    	    trigger: 'axis',
252
+		    	    axisPointer: {
253
+		    	      type: 'shadow'
254
+		    	    }
255
+		    	  },
256
+						grid: {
257
+							top: '10%',
258
+							left: '0%',  // grid布局设置适当调整避免X轴文字只能部分显示
259
+							right: '0%', // grid布局设置适当调整避免X轴文字只能部分显示
260
+							bottom: '6%',
261
+							containLabel: true
262
+						},
263
+		    	  xAxis: [
264
+		    	    {
265
+		    	      type: 'category',
266
+		    	      data: title,
267
+		    	      axisTick: {
268
+		    	  			show:false,
269
+		    	        alignWithLabel: true
270
+		    	      },
271
+								axisLabel: {
272
+									show: true, // 是否显示刻度标签,默认显示
273
+									interval: 0, // 坐标轴刻度标签的显示间隔,在类目轴中有效;默认会采用标签不重叠的策略间隔显示标签;可以设置成0强制显示所有标签;如果设置为1,表示『隔一个标签显示一个标签』,如果值为2,表示隔两个标签显示一个标签,以此类推。
274
+									rotate: 0, // 刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠;旋转的角度从-90度到90度
275
+									inside: false, // 刻度标签是否朝内,默认朝外
276
+									margin: 6, // 刻度标签与轴线之间的距离
277
+								}
278
+		    	    }
279
+		    	  ],
280
+		    	  yAxis: [
281
+		    	    {
282
+		    	      type: 'value',
283
+		    	  		axisLine: {
284
+		    	  			show:false
285
+		    	  		},
286
+		    	  		axisTick:{
287
+		    	  			show:false
288
+		    	  		},
289
+                splitLine: {
290
+                  lineStyle: {
291
+                    type: 'dotted',
292
+                  }
293
+                }
294
+		    	    }
295
+		    	  ],
296
+		    	  series: [
297
+		    	    {
298
+		    	      type: 'bar',
299
+		    	      barWidth: 20,
300
+		    				color: '#FFD68D',
301
+		    	      data: datas,
302
+								label:{
303
+									show:true,
304
+									position: "top",  // 展示在柱子的上方
305
+									color: "#333"
306
+								}
307
+		    	    }
308
+		    	  ]
309
+		    }
310
+		  });
311
+	}
312
+
313
+	// 科室Top5
314
+	getDeptTopData() {
315
+	  let postData:any = {
316
+	    startDate: this.dateRange[0],
317
+	    endDate: this.dateRange[1],
318
+			type: 'deptTop5',
319
+	    hosId: this.getHosId,
320
+	    businessType: 'hsms',
321
+	  };
322
+	  this.mainService
323
+	    .getReportData(postData)
324
+	    .subscribe((result:any) => {
325
+	      this.deptTopData = result.data || [];
326
+	    });
327
+	}
328
+
329
+	// 人员Top5
330
+	getUserTopData() {
331
+	  let postData:any = {
332
+	    startDate: this.dateRange[0],
333
+	    endDate: this.dateRange[1],
334
+			type: 'userTop5',
335
+	    hosId: this.getHosId,
336
+	    businessType: 'hsms',
337
+	  };
338
+	  this.mainService
339
+	    .getReportData(postData)
340
+	    .subscribe((result:any) => {
341
+				this.isLoading = false;
342
+	      this.userTopData = result.data || [];
343
+	    });
344
+	}
345
+
346
+	// 更多跳转
347
+	toPath(path){
348
+    let flag = this.tabService.tabs.some(v => v.path === path);
349
+    flag && this.tabService.deleteRouteSnapshot(path);
350
+    this.tabService.setQueryParams('dateRange', this.dateRange);
351
+    this.router.navigate([path], { replaceUrl: true });
352
+	}
353
+
354
+  // 判断更多是否显示
355
+  showMore(path){
356
+    let menus = JSON.parse(localStorage.getItem("menu"));
357
+    return menus.find(v => v.link === 'distributionInspectionStatistics').childrens.some(v => v.link === path);
358
+  }
359
+
360
+  get getHosId(){
361
+    return this.parentDutyId || this.dutyId || this.hosId;
362
+  }
363
+
364
+  // 初始化缓存数据
365
+  queryType:any;
366
+  hosId:any;
367
+  dutyId:any;
368
+  parentDutyId:any;
369
+  initSessionData(){
370
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
371
+    let queryType:any = newStatistics.queryType;
372
+    let hosId:any = newStatistics.hospitalId;
373
+    let dutyId:any = newStatistics.dutyId;
374
+
375
+    queryType = queryType ? +queryType : undefined;
376
+    hosId = hosId ? +hosId : undefined;
377
+    dutyId = dutyId ? +dutyId : undefined;
378
+
379
+    this.queryType = queryType;
380
+    if(queryType == 1){
381
+      this.hosId = undefined;
382
+      this.dutyId = undefined;
383
+      this.parentDutyId = undefined;
384
+    }else if(queryType == 2){
385
+      this.hosId = hosId;
386
+      this.dutyId = undefined;
387
+      this.parentDutyId = undefined;
388
+    }else if(queryType == 3){
389
+      this.hosId = undefined;
390
+      this.dutyId = dutyId;
391
+      this.parentDutyId = undefined;
392
+    }else if(queryType == 4){
393
+      this.hosId = undefined;
394
+      this.dutyId = undefined;
395
+      this.parentDutyId = dutyId;
396
+    }
397
+
398
+		this.isLoading = true
399
+    this.getStatisticsTypeList();
400
+		this.getWorkData();
401
+		this.getBusinessData();
402
+		this.applyChart();
403
+		this.trendChart();
404
+    this.businessChart();
405
+		this.getDeptTopData();
406
+		this.getUserTopData();
407
+  }
408
+
409
+  // 表格数据
410
+  loading1 = false;
411
+  getList(num?: number, field?: string, sort?: string) {
412
+    if (num !== undefined) {
413
+      this.pageIndex = num;
414
+    }
415
+    let postData:any = {
416
+      idx: this.pageIndex - 1,
417
+      sum: this.pageSize,
418
+      startDate: this.dateRange[0],
419
+      endDate: this.dateRange[1],
420
+      hosId: this.hosId,
421
+      dutyId: this.dutyId,
422
+      parentDutyId: this.parentDutyId,
423
+    };
424
+    this.loading1 = true;
425
+    this.mainService
426
+      .postCustom("itsm/report", "incidentWorkOrder", postData)
427
+      .subscribe((result) => {
428
+        this.loading1 = false;
429
+        this.listOfData = result.dataList || [];
430
+        this.listLength = result.totalCount;
431
+      });
432
+  }
433
+
434
+	// 头部工单数据
435
+	getWorkData() {
436
+	  let postData:any = {
437
+	    startDate: this.dateRange[0],
438
+	    endDate: this.dateRange[1],
439
+			type: 'headerCount',
440
+	    hosId: this.getHosId,
441
+	    businessType: 'hsms',
442
+	  };
443
+	  this.mainService
444
+	    .getReportData(postData)
445
+	    .subscribe((result:any) => {
446
+	      this.workData = result.data[0] || [];
447
+	    });
448
+	}
449
+
450
+  // 头部业务数据
451
+	getBusinessData() {
452
+	  let postData:any = {
453
+	    startDate: this.dateRange[0],
454
+	    endDate: this.dateRange[1],
455
+			type: 'businessCount',
456
+	    hosId: this.getHosId,
457
+	    businessType: 'hsms',
458
+	  };
459
+	  this.mainService
460
+	    .getReportData(postData)
461
+	    .subscribe((result:any) => {
462
+	      this.businessData = result.data[0] || [];
463
+	    });
464
+	}
465
+
466
+	// 重置
467
+	reset(){
468
+		this.dateRange = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')];
469
+		this.activeIndex = 'day';
470
+		this.search();
471
+	}
472
+
473
+  // 搜索
474
+  search() {
475
+		this.initSessionData();
476
+  }
477
+
478
+  // 日期选择 日
479
+  dateRange: any = [format(startOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss'), format(endOfMonth(addMonths(new Date(), -1)), 'yyyy-MM-dd HH:mm:ss')]; //发起时间区间 天
480
+  changeDate(result?): void {
481
+    result[0] = format(result[0], 'yyyy-MM-dd') + ' ' + '00:00:00';
482
+    result[1] = format(result[1], 'yyyy-MM-dd') + ' ' + '23:59:59';
483
+    this.dateRange = result;
484
+    // this.search();
485
+		console.log(this.dateRange);
486
+  }
487
+
488
+  onCalendarChangeDate(dateArr){
489
+    // console.log(dateArr)
490
+    // if(dateArr.length == 2){
491
+    //   let dateStart = new Date(dateArr[0]);
492
+    //   let dateEnd = new Date(dateArr[1]);
493
+    //   dateStart.setHours(0,0,0);
494
+    //   dateEnd.setHours(23,59,59);
495
+    //   this.dateRange = [dateStart,dateEnd];
496
+    // }
497
+  }
498
+
499
+  // 获取统计分类列表
500
+  statisticsTypeList:any[] = [];
501
+  statisticsTypeId;//统计分类id
502
+  getStatisticsTypeList(keyword?) {
503
+    this.isLoading = true;
504
+    this.mainService
505
+      .getDictionary("list", "statistics_date_type")
506
+      .subscribe((data) => {
507
+        this.isLoading = false;
508
+        this.statisticsTypeList = data;
509
+      });
510
+  }
511
+
512
+  changeStatisticsType(id){
513
+    this.trendChart();
514
+  }
515
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-synthesize-statistics/distribution-synthesize-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { DistributionSynthesizeStatisticsComponent } from './distribution-synthesize-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { DistributionSynthesizeStatisticsRoutingModule } from './distribution-synthesize-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8
+import { NgxEchartsModule } from 'ngx-echarts';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    DistributionSynthesizeStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    DistributionSynthesizeStatisticsRoutingModule,
18
+    ShareModule,
19
+    VirtualScrollerModule,
20
+		NgxEchartsModule
21
+  ]
22
+})
23
+export class DistributionSynthesizeStatisticsModule { }