seimin 2 weeks ago
parent
commit
8158842240

+ 36 - 8
src/app/services/tool.service.ts

@@ -12,34 +12,34 @@ export class ToolService {
12
 	changeInpSubject:any;
12
 	changeInpSubject:any;
13
 	allSubject = new Subject();
13
 	allSubject = new Subject();
14
 	allEndSubject = new Subject();
14
 	allEndSubject = new Subject();
15
-	 
15
+
16
 	// 提供方法来触发事件
16
 	// 提供方法来触发事件
17
 	triggerEvent(data: any) {
17
 	triggerEvent(data: any) {
18
 		this.allSubject.next(data);
18
 		this.allSubject.next(data);
19
 	}
19
 	}
20
-	
20
+
21
 	// 提供方法来触发事件
21
 	// 提供方法来触发事件
22
 	triggerEndEvent(data: any) {
22
 	triggerEndEvent(data: any) {
23
 		this.allEndSubject.next(data);
23
 		this.allEndSubject.next(data);
24
 	}
24
 	}
25
-	
25
+
26
 	// 提供方法来订阅事件
26
 	// 提供方法来订阅事件
27
 	getEventObservable() {
27
 	getEventObservable() {
28
 		return this.allSubject.asObservable();
28
 		return this.allSubject.asObservable();
29
 	}
29
 	}
30
-	
30
+
31
 	// 提供方法来订阅事件
31
 	// 提供方法来订阅事件
32
 	getEventEndObservable() {
32
 	getEventEndObservable() {
33
 		return this.allEndSubject.asObservable();
33
 		return this.allEndSubject.asObservable();
34
 	}
34
 	}
35
-	
35
+
36
   // 附件类型
36
   // 附件类型
37
   // word,excel,pdf,txt,ppt
37
   // word,excel,pdf,txt,ppt
38
   attachmentsTypes:string = 'text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.ms-excel,application/msword,application/vnd.openxmlformats-officedocument.presentationml.presentation';
38
   attachmentsTypes:string = 'text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.ms-excel,application/msword,application/vnd.openxmlformats-officedocument.presentationml.presentation';
39
 
39
 
40
   constructor(private mainService: MainService) {}
40
   constructor(private mainService: MainService) {}
41
-	
42
-	
41
+
42
+
43
   // 获取logoUrl和logoTitle
43
   // 获取logoUrl和logoTitle
44
   getSysNameAndLogoAsync(hosId = ''){
44
   getSysNameAndLogoAsync(hosId = ''){
45
     return this.mainService.getSysNameAndLogo(hosId);
45
     return this.mainService.getSysNameAndLogo(hosId);
@@ -382,7 +382,7 @@ export class ToolService {
382
 				case "collect":
382
 				case "collect":
383
 					coopBtns.collect = true; //设置核收
383
 					coopBtns.collect = true; //设置核收
384
 					break;
384
 					break;
385
-				
385
+
386
       }
386
       }
387
     });
387
     });
388
     console.log(coopBtns);
388
     console.log(coopBtns);
@@ -485,4 +485,32 @@ export class ToolService {
485
   generateNumberArray(start, end){
485
   generateNumberArray(start, end){
486
     return Array.from(new Array(end + 1).keys()).slice(start);
486
     return Array.from(new Array(end + 1).keys()).slice(start);
487
   }
487
   }
488
+
489
+  /**
490
+   * @description sessionStorage缓存新增,修改
491
+   * @param {number} key 名称
492
+   * @param {number} value 值
493
+   * @return {array}
494
+   */
495
+  setSessionStorage(key, value){
496
+    sessionStorage.setItem(key, JSON.stringify(value));
497
+  }
498
+
499
+  /**
500
+   * @description sessionStorage缓存获取
501
+   * @param {number} key 名称
502
+   * @return {array}
503
+   */
504
+  getSessionStorage(key){
505
+    return JSON.parse(sessionStorage.getItem(key));
506
+  }
507
+
508
+  /**
509
+   * @description sessionStorage缓存删除
510
+   * @param {number} key 名称
511
+   * @return {array}
512
+   */
513
+  removeSessionStorage(key){
514
+    sessionStorage.removeItem(key);
515
+  }
488
 }
516
 }

+ 2 - 1
src/app/views/hushijiandan/hushijiandan.component.html

@@ -182,7 +182,8 @@
182
             <div class="updateTipsForNurses red">{{ updateTipsForNurses }}</div>
182
             <div class="updateTipsForNurses red">{{ updateTipsForNurses }}</div>
183
             <div class="queuingInformation" *ngIf="!updateTipsForNurses && inspectAndPatientTransportConfig.queuingInformation == 1">等待陪检:<span class="red">{{queuingInformationList[0]}}</span>&emsp;陪检中:<span class="red">{{queuingInformationList[1]}}</span></div>
183
             <div class="queuingInformation" *ngIf="!updateTipsForNurses && inspectAndPatientTransportConfig.queuingInformation == 1">等待陪检:<span class="red">{{queuingInformationList[0]}}</span>&emsp;陪检中:<span class="red">{{queuingInformationList[1]}}</span></div>
184
           </div>
184
           </div>
185
-          <div class="right">
185
+          <div class="right nurseMenu">
186
+            <i class="icon_transport transport-tongji-2 green" *ngIf="coopBtns.newStatisticsNurse && newStatisticsRole" (click)="toNewStatistics()" nz-tooltip nzTooltipTitle="统计"></i>
186
             <div class="userInfo dropdown">
187
             <div class="userInfo dropdown">
187
               <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
188
               <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
188
                 <img src="../../assets/images/icon_keshi.png" alt="">
189
                 <img src="../../assets/images/icon_keshi.png" alt="">

+ 11 - 0
src/app/views/hushijiandan/hushijiandan.component.less

@@ -5,6 +5,17 @@
5
   height: 100%;
5
   height: 100%;
6
   display: flex;
6
   display: flex;
7
 
7
 
8
+  .nurseMenu{
9
+    & > .icon_transport{
10
+      margin-left: 24px;
11
+      cursor: pointer;
12
+      font-size: 20px;
13
+      height: 48px;
14
+      line-height: 48px;
15
+      display: inline-block;
16
+    }
17
+  }
18
+
8
   .transport-chaoshi{
19
   .transport-chaoshi{
9
     font-size: 16px;
20
     font-size: 16px;
10
     margin-right: 4px;
21
     margin-right: 4px;

+ 18 - 0
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -290,6 +290,12 @@ export class HushijiandanComponent implements OnInit {
290
 
290
 
291
   getCoopBtns(){
291
   getCoopBtns(){
292
     let menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
292
     let menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
293
+    menu.forEach(v => {
294
+      if (v.type == "newStatistics") {
295
+        this.newStatisticsRole = true;
296
+        console.log("新版统计");
297
+      }
298
+    })
293
     let coopBtns:any = {};
299
     let coopBtns:any = {};
294
     let nurseMenu = menu.find(v => v.link === 'nurse');
300
     let nurseMenu = menu.find(v => v.link === 'nurse');
295
     let nurseMenuChildren = nurseMenu.childrens || [];
301
     let nurseMenuChildren = nurseMenu.childrens || [];
@@ -316,6 +322,9 @@ export class HushijiandanComponent implements OnInit {
316
         case "buildOrdersForOtherTasks":
322
         case "buildOrdersForOtherTasks":
317
           coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
323
           coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
318
           break;
324
           break;
325
+        case "newStatisticsNurse":
326
+          coopBtns.newStatisticsNurse = true; //护士端新版统计权限
327
+          break;
319
       }
328
       }
320
     });
329
     });
321
     this.coopBtns = coopBtns;
330
     this.coopBtns = coopBtns;
@@ -5767,4 +5776,13 @@ export class HushijiandanComponent implements OnInit {
5767
         });
5776
         });
5768
     }
5777
     }
5769
   }
5778
   }
5779
+
5780
+  // 统计
5781
+  newStatisticsRole: boolean = false; //新版统计权限
5782
+  toNewStatistics(): void {
5783
+    this.tool.setSessionStorage('newStatisticsFrom', 'nurse');//统计来源标识
5784
+    let menus = JSON.parse(localStorage.getItem("menu"));
5785
+    let firstMenu = menus.find((item) => item.type == "newStatistics");
5786
+    this.router.navigateByUrl(`newStatistics/${firstMenu.link}/${firstMenu.childrens[0].link}`);
5787
+  }
5770
 }
5788
 }

+ 2 - 2
src/app/views/main/main.component.html

@@ -315,7 +315,7 @@
315
 											</nz-option>
315
 											</nz-option>
316
 										</nz-select>
316
 										</nz-select>
317
 									</div>
317
 									</div>
318
-									
318
+
319
 									<div class="col">
319
 									<div class="col">
320
 										<span class="name required">故障现象:</span>
320
 										<span class="name required">故障现象:</span>
321
 										<nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)" (nzOpenChange)="openChangeApplyCategory($event)">
321
 										<nz-select class="w100" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCommonInp('category', $event)" nzPlaceHolder="请选择故障现象" [(ngModel)]="incidentModel.category" (ngModelChange)="changeApplyCategory($event)" (nzOpenChange)="openChangeApplyCategory($event)">
@@ -639,7 +639,7 @@
639
 </div>
639
 </div>
640
 
640
 
641
 <!-- 查询范围 -->
641
 <!-- 查询范围 -->
642
-<app-query-range [hospital]="hospital" [duty]="duty" [queryType]="queryType" [parent]="parent" [hiddenParent]="true" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>
642
+<app-query-range sign="largeScreen" [hospital]="hospital" [duty]="duty" [queryType]="queryType" [parent]="parent" [hiddenParent]="true" [hiddenDefaultDate]="true" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>
643
 
643
 
644
 <!-- 知识库查看 -->
644
 <!-- 知识库查看 -->
645
 <app-knowledge-look (cancelKnowledgeModal)="cancelKnowledgeModal()" *ngIf="isShowKnowledge" [knowledgeData]="coopData"></app-knowledge-look>
645
 <app-knowledge-look (cancelKnowledgeModal)="cancelKnowledgeModal()" *ngIf="isShowKnowledge" [knowledgeData]="coopData"></app-knowledge-look>

+ 13 - 12
src/app/views/main/main.component.ts

@@ -549,7 +549,7 @@ export class MainComponent implements OnInit, OnDestroy {
549
 	searchPatientListSubject = new Subject();
549
 	searchPatientListSubject = new Subject();
550
 	inspectSubject = new Subject();
550
 	inspectSubject = new Subject();
551
 	changeAssetInpSubject = new Subject();
551
 	changeAssetInpSubject = new Subject();
552
-	
552
+
553
 	// 运维相关
553
 	// 运维相关
554
 	incidentModel:any = {};
554
 	incidentModel:any = {};
555
 	incidentMsg:any = {};
555
 	incidentMsg:any = {};
@@ -1056,7 +1056,7 @@ export class MainComponent implements OnInit, OnDestroy {
1056
 	      }
1056
 	      }
1057
 	    });
1057
 	    });
1058
 	}
1058
 	}
1059
-	
1059
+
1060
 	// 引入知识库
1060
 	// 引入知识库
1061
 	importKnowage(item){
1061
 	importKnowage(item){
1062
 	  console.log(item)
1062
 	  console.log(item)
@@ -1069,11 +1069,11 @@ export class MainComponent implements OnInit, OnDestroy {
1069
 	  this.coopData = data || {};
1069
 	  this.coopData = data || {};
1070
 	  this.isShowKnowledge = true;
1070
 	  this.isShowKnowledge = true;
1071
 	}
1071
 	}
1072
-	
1072
+
1073
 	cancelKnowledgeModal(flag) {
1073
 	cancelKnowledgeModal(flag) {
1074
 	  this.isShowKnowledge = false;
1074
 	  this.isShowKnowledge = false;
1075
 	}
1075
 	}
1076
-	
1076
+
1077
 	// 获取患者信息
1077
 	// 获取患者信息
1078
 	searchPatientList(id, searchWords) {
1078
 	searchPatientList(id, searchWords) {
1079
 	  this.searchPatientListSubject.next([id, searchWords]);
1079
 	  this.searchPatientListSubject.next([id, searchWords]);
@@ -3915,11 +3915,11 @@ export class MainComponent implements OnInit, OnDestroy {
3915
 		    this.getPatientByResidenceNo(v[1]);
3915
 		    this.getPatientByResidenceNo(v[1]);
3916
 		  }
3916
 		  }
3917
 		});
3917
 		});
3918
-		
3918
+
3919
 		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
3919
 		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
3920
 		  this.getAssetData(v);
3920
 		  this.getAssetData(v);
3921
 		});
3921
 		});
3922
-		
3922
+
3923
 		this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
3923
 		this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
3924
 		  this.getTasktypeByPhone(v);
3924
 		  this.getTasktypeByPhone(v);
3925
 		});
3925
 		});
@@ -3990,7 +3990,7 @@ export class MainComponent implements OnInit, OnDestroy {
3990
 									}else{
3990
 									}else{
3991
 										this.cmdbRepair = false
3991
 										this.cmdbRepair = false
3992
 									}
3992
 									}
3993
-									break;	
3993
+									break;
3994
 							}
3994
 							}
3995
 						});
3995
 						});
3996
 						if(this.eventData){
3996
 						if(this.eventData){
@@ -4012,7 +4012,7 @@ export class MainComponent implements OnInit, OnDestroy {
4012
 							}
4012
 							}
4013
 							this.searchApplicationBuilding()
4013
 							this.searchApplicationBuilding()
4014
 						}
4014
 						}
4015
-						
4015
+
4016
 						if(this.cmdbRepair && this.hospitalModel==1){
4016
 						if(this.cmdbRepair && this.hospitalModel==1){
4017
 							this.getAssetData()
4017
 							this.getAssetData()
4018
 						}
4018
 						}
@@ -4020,11 +4020,11 @@ export class MainComponent implements OnInit, OnDestroy {
4020
 				}
4020
 				}
4021
 			});
4021
 			});
4022
 	 }
4022
 	 }
4023
-	
4023
+
4024
 	changeAsset(e){
4024
 	changeAsset(e){
4025
 		this.changeAssetInpSubject.next(e);
4025
 		this.changeAssetInpSubject.next(e);
4026
 	}
4026
 	}
4027
-	
4027
+
4028
   // 获取资产列表
4028
   // 获取资产列表
4029
 	assetData:any = [];
4029
 	assetData:any = [];
4030
 	getAssetData(name?){
4030
 	getAssetData(name?){
@@ -4039,7 +4039,7 @@ export class MainComponent implements OnInit, OnDestroy {
4039
 		    name: name
4039
 		    name: name
4040
 		  },
4040
 		  },
4041
 		};
4041
 		};
4042
-		
4042
+
4043
 		this.mainService
4043
 		this.mainService
4044
 		  .getFetchDataList("simple/data", "asset", data)
4044
 		  .getFetchDataList("simple/data", "asset", data)
4045
 		  .subscribe((data) => {
4045
 		  .subscribe((data) => {
@@ -4048,7 +4048,7 @@ export class MainComponent implements OnInit, OnDestroy {
4048
 		    }
4048
 		    }
4049
 		  });
4049
 		  });
4050
 	}
4050
 	}
4051
-	
4051
+
4052
 	// 新增报修
4052
 	// 新增报修
4053
 	speedinessAdd(): void {
4053
 	speedinessAdd(): void {
4054
 		this.addOrder();
4054
 		this.addOrder();
@@ -4123,6 +4123,7 @@ export class MainComponent implements OnInit, OnDestroy {
4123
 	}
4123
 	}
4124
   // 统计
4124
   // 统计
4125
   toNewStatistics(): void {
4125
   toNewStatistics(): void {
4126
+    this.tool.setSessionStorage('newStatisticsFrom', 'main');//统计来源标识
4126
     let menus = JSON.parse(localStorage.getItem("menu"));
4127
     let menus = JSON.parse(localStorage.getItem("menu"));
4127
     let firstMenu = menus.find((item) => item.type == "newStatistics");
4128
     let firstMenu = menus.find((item) => item.type == "newStatistics");
4128
     this.router.navigateByUrl(`newStatistics/${firstMenu.link}/${firstMenu.childrens[0].link}`);
4129
     this.router.navigateByUrl(`newStatistics/${firstMenu.link}/${firstMenu.childrens[0].link}`);

+ 6 - 15
src/app/views/new-statistics/components/custom-change-date/custom-change-date.component.ts

@@ -82,29 +82,20 @@ export class CustomChangeDateComponent implements OnInit, OnDestroy {
82
 		//     }
82
 		//     }
83
 		//   });
83
 		//   });
84
   }
84
   }
85
-	
85
+
86
 	ngOnDestroy(){
86
 	ngOnDestroy(){
87
-		// this.dateData1 = null 
87
+		// this.dateData1 = null
88
 		// this.dateData2 = null
88
 		// this.dateData2 = null
89
 	}
89
 	}
90
-	
90
+
91
   // 根据时间区间重置
91
   // 根据时间区间重置
92
   resetByDate(){
92
   resetByDate(){
93
-		setTimeout(_=>{
94
-			// console.log(2222,this.dateData1, this.dateData2)
95
-			// if(this.dateData1 && this.dateData2){
96
-			// 	this.dateRange = [this.dateData1, this.dateData2]
97
-			// }else{
98
-			// 	this.dateType = 'day';
99
-			// 	this.changeDateType(this.dateType, 6);
100
-			// }
101
-			this.dateType = 'day';
102
-			this.changeDateType(this.dateType, 6);
103
-		})
93
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
94
+		this.initByDate(newStatistics.defaultDate)
104
   }
95
   }
105
 
96
 
106
   // 根据时间区间初始化
97
   // 根据时间区间初始化
107
-  initByDate(dateRange:any[], dateNum:any= 6){
98
+  initByDate(dateRange:any[], dateNum:any = null){
108
     setTimeout(() => {
99
     setTimeout(() => {
109
       this.dateType = 'day';
100
       this.dateType = 'day';
110
       this.dateRange = dateRange;
101
       this.dateRange = dateRange;

+ 17 - 6
src/app/views/new-statistics/components/query-range/query-range.component.html

@@ -8,10 +8,11 @@
8
           <nz-form-label [nzSpan]="4" nzRequired nzFor="queryType">查询范围</nz-form-label>
8
           <nz-form-label [nzSpan]="4" nzRequired nzFor="queryType">查询范围</nz-form-label>
9
           <nz-form-control [nzSpan]="20" nzErrorTip="请选择查询范围!">
9
           <nz-form-control [nzSpan]="20" nzErrorTip="请选择查询范围!">
10
             <nz-radio-group formControlName="queryType" (ngModelChange)="changeQueryType($event)">
10
             <nz-radio-group formControlName="queryType" (ngModelChange)="changeQueryType($event)">
11
-              <label nz-radio [nzValue]="1">全院查询</label>
12
-              <label nz-radio [nzValue]="2">院区查询</label>
13
-              <label nz-radio [nzValue]="3">部门查询</label>
14
-              <label nz-radio [nzValue]="4">垂直部门查询</label>
11
+              <label nz-radio [nzValue]="1" *ngIf="sign !== 'nurse'">全院查询</label>
12
+              <label nz-radio [nzValue]="2" *ngIf="sign !== 'nurse'">院区查询</label>
13
+              <label nz-radio [nzValue]="3" *ngIf="sign !== 'nurse'">部门查询</label>
14
+              <label nz-radio [nzValue]="4" *ngIf="sign !== 'nurse'">垂直部门查询</label>
15
+              <label nz-radio [nzValue]="5" *ngIf="sign === 'nurse'">申请科室查询</label>
15
             </nz-radio-group>
16
             </nz-radio-group>
16
           </nz-form-control>
17
           </nz-form-control>
17
         </nz-form-item>
18
         </nz-form-item>
@@ -41,16 +42,26 @@
41
               </nz-option>
42
               </nz-option>
42
             </nz-select>
43
             </nz-select>
43
           </nz-form-control>
44
           </nz-form-control>
45
+        </nz-form-item>
46
+        <nz-form-item [hidden]="validateForm.value.queryType != 5">
47
+          <nz-form-label nzRequired [nzSpan]="4">申请科室</nz-form-label>
48
+          <nz-form-control [nzSpan]="20">{{currentDept.dept}}</nz-form-control>
44
         </nz-form-item>
49
         </nz-form-item>
45
 				<nz-form-item class="mb0" [ngStyle]="{ visibility: !hiddenParent ? 'visible' : 'hidden'}" style="visibility: hidden;">
50
 				<nz-form-item class="mb0" [ngStyle]="{ visibility: !hiddenParent ? 'visible' : 'hidden'}" style="visibility: hidden;">
46
-				  <nz-form-label [nzSpan]="7" nzRequired nzFor="parent">是否显示父级科室</nz-form-label>
47
-				  <nz-form-control [nzSpan]="15" nzErrorTip="请选择是否显示父级科室!">
51
+				  <nz-form-label [nzSpan]="6" nzRequired nzFor="parent">是否显示父级科室</nz-form-label>
52
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择是否显示父级科室!">
48
 				    <nz-radio-group formControlName="parent">
53
 				    <nz-radio-group formControlName="parent">
49
 				      <label nz-radio [nzValue]="1">是</label>
54
 				      <label nz-radio [nzValue]="1">是</label>
50
 				      <label nz-radio [nzValue]="0">否</label>
55
 				      <label nz-radio [nzValue]="0">否</label>
51
 				    </nz-radio-group>
56
 				    </nz-radio-group>
52
 				  </nz-form-control>
57
 				  </nz-form-control>
53
 				</nz-form-item>
58
 				</nz-form-item>
59
+				<nz-form-item class="mb0" [ngStyle]="{ visibility: !hiddenDefaultDate ? 'visible' : 'hidden'}" style="visibility: hidden;">
60
+				  <nz-form-label [nzSpan]="4" nzRequired nzFor="defaultDate">默认时间</nz-form-label>
61
+				  <nz-form-control [nzSpan]="20" nzErrorTip="请选择默认时间!">
62
+            <nz-range-picker [nzAllowClear]="false" formControlName="defaultDate" [nzAllowClear]='false'></nz-range-picker>
63
+				  </nz-form-control>
64
+				</nz-form-item>
54
       </form>
65
       </form>
55
     </div>
66
     </div>
56
     <div class="display_flex justify-content_flex-center">
67
     <div class="display_flex justify-content_flex-center">

+ 2 - 3
src/app/views/new-statistics/components/query-range/query-range.component.less

@@ -82,19 +82,18 @@
82
   // 新增
82
   // 新增
83
   &.add {
83
   &.add {
84
     .modalBody {
84
     .modalBody {
85
-      width: 578px;
85
+      width: 700px;
86
       padding: 0 24px;
86
       padding: 0 24px;
87
 
87
 
88
       .content {
88
       .content {
89
         width: 100%;
89
         width: 100%;
90
-        min-height: 166px;
91
         padding: 10px 24px 0;
90
         padding: 10px 24px 0;
92
         height: auto;
91
         height: auto;
93
         overflow-y: auto;
92
         overflow-y: auto;
94
 
93
 
95
         .addForm {
94
         .addForm {
96
           .ant-form-item {
95
           .ant-form-item {
97
-            margin-bottom: 14px;
96
+            margin-bottom: 8px;
98
             .ant-form-item-label {
97
             .ant-form-item-label {
99
               text-align: left;
98
               text-align: left;
100
             }
99
             }

+ 20 - 3
src/app/views/new-statistics/components/query-range/query-range.component.ts

@@ -3,6 +3,8 @@ import { Component, OnInit, Output, Input } from '@angular/core';
3
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
3
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
4
 import { EventEmitter } from '@angular/core';
4
 import { EventEmitter } from '@angular/core';
5
 import { MainService } from 'src/app/services/main.service';
5
 import { MainService } from 'src/app/services/main.service';
6
+import { DateService } from 'src/app/services/date.service';
7
+import { startOfDay, endOfDay, format } from 'date-fns';
6
 
8
 
7
 @Component({
9
 @Component({
8
   selector: 'app-query-range',
10
   selector: 'app-query-range',
@@ -16,15 +18,27 @@ export class QueryRangeComponent implements OnInit {
16
   @Input() hospital: any;
18
   @Input() hospital: any;
17
   @Input() duty: any;
19
   @Input() duty: any;
18
 	@Input() parent: any;
20
 	@Input() parent: any;
21
+	@Input() defaultDate: any = [];
22
+  // sign = largeScreen 大屏
23
+  // sign = main 管理端
24
+  // sign = nurse 护士端
25
+	@Input() sign: any = '';
19
 	@Input() hiddenParent: any = false;
26
 	@Input() hiddenParent: any = false;
27
+	@Input() hiddenDefaultDate: any = false;
20
   validateForm: FormGroup;//表单
28
   validateForm: FormGroup;//表单
29
+  currentDept:any = {};//当前登录人所在科室
21
   constructor(
30
   constructor(
22
     private fb: FormBuilder,
31
     private fb: FormBuilder,
23
     private tool: ToolService,
32
     private tool: ToolService,
24
     private mainService: MainService,
33
     private mainService: MainService,
34
+    private dateService: DateService,
25
   ) { }
35
   ) { }
26
 
36
 
27
   ngOnInit() {
37
   ngOnInit() {
38
+    this.currentDept = this.tool.getCurrentUserDept();
39
+
40
+    console.log('this.sign:', this.sign)
41
+
28
     this.getHospitalList();
42
     this.getHospitalList();
29
     this.queryType == 3 && this.getDutyList(this.hospital.id);
43
     this.queryType == 3 && this.getDutyList(this.hospital.id);
30
     this.getDutyOneList();
44
     this.getDutyOneList();
@@ -36,12 +50,15 @@ export class QueryRangeComponent implements OnInit {
36
   }
50
   }
37
   // 初始化新增form表单
51
   // 初始化新增form表单
38
   initForm() {
52
   initForm() {
53
+    let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
54
+    let lastmonthenddate = this.dateService.date().lastMonthEndDate;
39
     this.validateForm = this.fb.group({
55
     this.validateForm = this.fb.group({
40
       queryType: [this.queryType, [Validators.required]],
56
       queryType: [this.queryType, [Validators.required]],
41
       hospital: [(this.hospital && (this.queryType == 2 || this.queryType == 3)) ? this.hospital.id : null],
57
       hospital: [(this.hospital && (this.queryType == 2 || this.queryType == 3)) ? this.hospital.id : null],
42
       duty: [(this.duty && this.queryType == 3) ? this.duty.id : null],
58
       duty: [(this.duty && this.queryType == 3) ? this.duty.id : null],
43
       dutyOne: [(this.duty && this.queryType == 4) ? this.duty.id : null],
59
       dutyOne: [(this.duty && this.queryType == 4) ? this.duty.id : null],
44
-			parent :[this.parent?1:0, [Validators.required]]
60
+			parent :[this.parent?1:0, [Validators.required]],
61
+      defaultDate: [this.defaultDate.length ? this.defaultDate : [lastmonthstartdate, lastmonthenddate], [Validators.required]],
45
     });
62
     });
46
   }
63
   }
47
   // 表单提交
64
   // 表单提交
@@ -53,6 +70,7 @@ export class QueryRangeComponent implements OnInit {
53
     if (this.validateForm.invalid) return;
70
     if (this.validateForm.invalid) return;
54
     let queryType = this.validateForm.value.queryType;
71
     let queryType = this.validateForm.value.queryType;
55
 		let parent = this.validateForm.value.parent;
72
 		let parent = this.validateForm.value.parent;
73
+		let defaultDate = this.validateForm.value.defaultDate;
56
     let hospital;
74
     let hospital;
57
     let duty;
75
     let duty;
58
     switch (queryType) {
76
     switch (queryType) {
@@ -70,7 +88,7 @@ export class QueryRangeComponent implements OnInit {
70
         duty = this.dutyOneList.find(v => v.id == this.validateForm.value.dutyOne);
88
         duty = this.dutyOneList.find(v => v.id == this.validateForm.value.dutyOne);
71
         break;
89
         break;
72
     }
90
     }
73
-    this.submitQueryRange.emit({queryType, hospital, duty, parent});
91
+    this.submitQueryRange.emit({queryType, hospital, duty, parent, defaultDate});
74
     this.hideModal();
92
     this.hideModal();
75
   }
93
   }
76
 
94
 
@@ -184,5 +202,4 @@ export class QueryRangeComponent implements OnInit {
184
       }
202
       }
185
     });
203
     });
186
   }
204
   }
187
-
188
 }
205
 }

+ 11 - 11
src/app/views/new-statistics/maintenance-statistics/synthesize-statistics/synthesize-statistics.component.ts

@@ -69,13 +69,13 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
69
       this.search();
69
       this.search();
70
     }, 0)
70
     }, 0)
71
   }
71
   }
72
-	
72
+
73
 	/*========= 数据下钻 ========*/
73
 	/*========= 数据下钻 ========*/
74
-	
74
+
75
 	// 汇总
75
 	// 汇总
76
 	viewDetail1(){
76
 	viewDetail1(){
77
 		let query = {
77
 		let query = {
78
-			
78
+
79
 		}
79
 		}
80
 		let path = '/newStatistics/maintenanceStatistics/incidentList'
80
 		let path = '/newStatistics/maintenanceStatistics/incidentList'
81
 		let flag = this.tabService.tabs.some(v => v.path === path);
81
 		let flag = this.tabService.tabs.some(v => v.path === path);
@@ -86,7 +86,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
86
 		this.router.navigate([path], { replaceUrl: true });
86
 		this.router.navigate([path], { replaceUrl: true });
87
 		// this.router.navigateByUrl('/newStatistics/maintenanceStatistics/incidentList')
87
 		// this.router.navigateByUrl('/newStatistics/maintenanceStatistics/incidentList')
88
 	}
88
 	}
89
-	
89
+
90
 	// 挂起
90
 	// 挂起
91
 	viewDetail2(){
91
 	viewDetail2(){
92
 		let query = {
92
 		let query = {
@@ -108,7 +108,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
108
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
108
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
109
 		this.router.navigate([path], { replaceUrl: true });
109
 		this.router.navigate([path], { replaceUrl: true });
110
 	}
110
 	}
111
-	
111
+
112
 	// 超时
112
 	// 超时
113
 	viewDetail3(){
113
 	viewDetail3(){
114
 		let query = {
114
 		let query = {
@@ -130,7 +130,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
130
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
130
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
131
 		this.router.navigate([path], { replaceUrl: true });
131
 		this.router.navigate([path], { replaceUrl: true });
132
 	}
132
 	}
133
-	
133
+
134
 	// 差评
134
 	// 差评
135
 	viewDetail4(){
135
 	viewDetail4(){
136
 		let query = {
136
 		let query = {
@@ -157,7 +157,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
157
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
157
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
158
 		this.router.navigate([path], { replaceUrl: true });
158
 		this.router.navigate([path], { replaceUrl: true });
159
 	}
159
 	}
160
-	
160
+
161
 	// 维修处理top5
161
 	// 维修处理top5
162
 	viewMaintain1(data){
162
 	viewMaintain1(data){
163
 		let query = {
163
 		let query = {
@@ -196,7 +196,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
196
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
196
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
197
 		this.router.navigate([path], { replaceUrl: true });
197
 		this.router.navigate([path], { replaceUrl: true });
198
 	}
198
 	}
199
-	
199
+
200
 	viewMaintain2(data){
200
 	viewMaintain2(data){
201
 		let query = {
201
 		let query = {
202
 			startDate: this.customChangeDateComponent.startDate,
202
 			startDate: this.customChangeDateComponent.startDate,
@@ -214,7 +214,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
214
 				}
214
 				}
215
 			}
215
 			}
216
 		}
216
 		}
217
-		
217
+
218
 		if(this.activeIndex==0){
218
 		if(this.activeIndex==0){
219
 			query.searchQuery.userId = data.userId ? data.userId : -1
219
 			query.searchQuery.userId = data.userId ? data.userId : -1
220
 			query.searchQuery.userDTO = {
220
 			query.searchQuery.userDTO = {
@@ -240,7 +240,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
240
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
240
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
241
 		this.router.navigate([path], { replaceUrl: true });
241
 		this.router.navigate([path], { replaceUrl: true });
242
 	}
242
 	}
243
-	
243
+
244
 	// 课科室费用top5
244
 	// 课科室费用top5
245
 	viewDept(data){
245
 	viewDept(data){
246
 		let query = {
246
 		let query = {
@@ -259,7 +259,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
259
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
259
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
260
 		this.router.navigate([path], { replaceUrl: true });
260
 		this.router.navigate([path], { replaceUrl: true });
261
 	}
261
 	}
262
-	
262
+
263
 	// 维修处理类型切换
263
 	// 维修处理类型切换
264
 	selectCheck(type){
264
 	selectCheck(type){
265
 		this.activeIndex = type
265
 		this.activeIndex = type

+ 5 - 5
src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts

@@ -55,7 +55,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
55
 
55
 
56
     }, 0)
56
     }, 0)
57
   }
57
   }
58
-	
58
+
59
 	// 数据下钻
59
 	// 数据下钻
60
 	viewDetail1(data, type){
60
 	viewDetail1(data, type){
61
 		let query = null
61
 		let query = null
@@ -116,7 +116,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
116
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
116
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
117
 		this.router.navigate([path], { replaceUrl: true });
117
 		this.router.navigate([path], { replaceUrl: true });
118
 	}
118
 	}
119
-	
119
+
120
 	// 数据下钻
120
 	// 数据下钻
121
 	viewDetail2(data, type){
121
 	viewDetail2(data, type){
122
 		let query = null
122
 		let query = null
@@ -191,7 +191,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
191
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
191
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
192
 		this.router.navigate([path], { replaceUrl: true });
192
 		this.router.navigate([path], { replaceUrl: true });
193
 	}
193
 	}
194
-	
194
+
195
 	// 数据下钻
195
 	// 数据下钻
196
 	viewDetail3(data, type){
196
 	viewDetail3(data, type){
197
 		let query = null
197
 		let query = null
@@ -266,7 +266,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
266
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
266
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
267
 		this.router.navigate([path], { replaceUrl: true });
267
 		this.router.navigate([path], { replaceUrl: true });
268
 	}
268
 	}
269
-	
269
+
270
 	// 数据下钻
270
 	// 数据下钻
271
 	viewDetail4(data, type){
271
 	viewDetail4(data, type){
272
 		let query = null
272
 		let query = null
@@ -351,7 +351,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
351
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
351
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
352
 		this.router.navigate([path], { replaceUrl: true });
352
 		this.router.navigate([path], { replaceUrl: true });
353
 	}
353
 	}
354
-	
354
+
355
   getQueryParams(){
355
   getQueryParams(){
356
     let queryParams = this.tabService.getQueryParams();
356
     let queryParams = this.tabService.getQueryParams();
357
     this.tabService.clearQueryParams();
357
     this.tabService.clearQueryParams();

+ 2 - 1
src/app/views/new-statistics/new-statistics.component.html

@@ -6,10 +6,11 @@
6
     <ng-container *ngIf="queryType == 2">查询范围:{{hospital.hosName}}</ng-container>
6
     <ng-container *ngIf="queryType == 2">查询范围:{{hospital.hosName}}</ng-container>
7
     <ng-container *ngIf="queryType == 3">查询范围:{{hospital.hosName}}{{duty.hosName}}</ng-container>
7
     <ng-container *ngIf="queryType == 3">查询范围:{{hospital.hosName}}{{duty.hosName}}</ng-container>
8
     <ng-container *ngIf="queryType == 4">查询范围:垂直-{{hospital.hosName}}{{duty.hosName}}</ng-container>
8
     <ng-container *ngIf="queryType == 4">查询范围:垂直-{{hospital.hosName}}{{duty.hosName}}</ng-container>
9
+    <ng-container *ngIf="queryType == 5">查询范围:{{currentDept.dept}}</ng-container>
9
     <i class="icon_transport transport-jiantou_zuoyouqiehuan"></i>
10
     <i class="icon_transport transport-jiantou_zuoyouqiehuan"></i>
10
   </div>
11
   </div>
11
 </div>
12
 </div>
12
 <router-outlet></router-outlet>
13
 <router-outlet></router-outlet>
13
 
14
 
14
 <!-- 查询范围 -->
15
 <!-- 查询范围 -->
15
-<app-query-range [hospital]="hospital" [duty]="duty" [queryType]="queryType" [parent]="parent" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>
16
+<app-query-range [sign]="sign" [hospital]="hospital" [duty]="duty" [queryType]="queryType" [parent]="parent" [defaultDate]="defaultDate" (cancelQueryRange)="cancelQueryRange()" (submitQueryRange)="submitQueryRange($event)" *ngIf="queryRangeFlag"></app-query-range>

+ 38 - 11
src/app/views/new-statistics/new-statistics.component.ts

@@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
4
 import { TabService } from './services/tab.service';
4
 import { TabService } from './services/tab.service';
5
 import { NzMessageService } from "ng-zorro-antd/message";
5
 import { NzMessageService } from "ng-zorro-antd/message";
6
 import { SimpleReuseStrategy } from 'src/app/SimpleReuseStrategy';
6
 import { SimpleReuseStrategy } from 'src/app/SimpleReuseStrategy';
7
+import { DateService } from 'src/app/services/date.service';
7
 @Component({
8
 @Component({
8
   selector: "app-new-statistics",
9
   selector: "app-new-statistics",
9
   templateUrl: "./new-statistics.component.html",
10
   templateUrl: "./new-statistics.component.html",
@@ -16,10 +17,15 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
16
 		public msg: NzMessageService,
17
 		public msg: NzMessageService,
17
     public router: Router,
18
     public router: Router,
18
     public tabService: TabService,
19
     public tabService: TabService,
20
+    private dateService: DateService,
19
   ) {}
21
   ) {}
20
 
22
 
21
   menuList: any[] = [];
23
   menuList: any[] = [];
24
+  sign:string = '';//标识来源
25
+  currentDept:any = {};//当前登录人所在科室
22
   ngOnInit() {
26
   ngOnInit() {
27
+    this.currentDept = this.tool.getCurrentUserDept();
28
+    this.sign = this.tool.getSessionStorage('newStatisticsFrom');
23
     this.getMenuList();
29
     this.getMenuList();
24
     this.initHospitalAndDuty(this.tool.getCurrentHospital());
30
     this.initHospitalAndDuty(this.tool.getCurrentHospital());
25
     console.log('this.menuList:', this.menuList)
31
     console.log('this.menuList:', this.menuList)
@@ -39,6 +45,7 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
39
   duty;
45
   duty;
40
   queryType;//查询范围
46
   queryType;//查询范围
41
 	parent:any = 0;
47
 	parent:any = 0;
48
+	defaultDate:any = [];
42
   // 初始化院区、部门显示
49
   // 初始化院区、部门显示
43
   initHospitalAndDuty(hospitalOrDuty){
50
   initHospitalAndDuty(hospitalOrDuty){
44
     let sessionData = JSON.parse(sessionStorage.getItem('newStatistics'));
51
     let sessionData = JSON.parse(sessionStorage.getItem('newStatistics'));
@@ -48,8 +55,14 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
48
       this.duty = sessionData.duty;
55
       this.duty = sessionData.duty;
49
       this.queryType = sessionData.queryType;
56
       this.queryType = sessionData.queryType;
50
 			this.parent = sessionData.parent;
57
 			this.parent = sessionData.parent;
58
+			this.defaultDate = sessionData.defaultDate;
51
       return;
59
       return;
52
     }
60
     }
61
+
62
+    let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
63
+    let lastmonthenddate = this.dateService.date().lastMonthEndDate;
64
+    this.defaultDate = [lastmonthstartdate, lastmonthenddate];
65
+
53
     let type = 'hospital';//默认是院区
66
     let type = 'hospital';//默认是院区
54
     if(hospitalOrDuty.type){
67
     if(hospitalOrDuty.type){
55
       // 当前是责任部门
68
       // 当前是责任部门
@@ -69,26 +82,32 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
69
     console.log('this.duty:', this.duty)
82
     console.log('this.duty:', this.duty)
70
 
83
 
71
     // 查询范围单选框
84
     // 查询范围单选框
72
-    if(this.hospital){
73
-      if(this.duty){
74
-        if(this.duty.parentDeptId){
75
-          this.queryType = 3;
85
+    if(this.sign === 'nurse'){
86
+      // 护士端跳转到统计
87
+      this.queryType = 5;
88
+    }else{
89
+      if(this.hospital){
90
+        if(this.duty){
91
+          if(this.duty.parentDeptId){
92
+            this.queryType = 3;
93
+          }else{
94
+            this.queryType = 4;
95
+          }
76
         }else{
96
         }else{
77
-          this.queryType = 4;
97
+          this.queryType = 2;
78
         }
98
         }
79
       }else{
99
       }else{
80
-        this.queryType = 2;
100
+        this.queryType = 1;
81
       }
101
       }
82
-    }else{
83
-      this.queryType = 1;
84
     }
102
     }
85
 
103
 
104
+
86
     this.sessionSave();
105
     this.sessionSave();
87
   }
106
   }
88
 
107
 
89
   // 缓存数据
108
   // 缓存数据
90
   sessionSave(){
109
   sessionSave(){
91
-    sessionStorage.setItem('newStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined, hospital: this.hospital, duty: this.duty, parent: this.parent}));
110
+    sessionStorage.setItem('newStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined, hospital: this.hospital, duty: this.duty, parent: this.parent, defaultDate: this.defaultDate}));
92
   }
111
   }
93
 
112
 
94
   // 查询范围
113
   // 查询范围
@@ -96,14 +115,16 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
96
   queryRangeClick(){
115
   queryRangeClick(){
97
     this.queryRangeFlag = true;
116
     this.queryRangeFlag = true;
98
   }
117
   }
99
-  submitQueryRange({queryType, hospital, duty, parent}) {
118
+  submitQueryRange({queryType, hospital, duty, parent, defaultDate}) {
100
     console.log('queryType:', queryType)
119
     console.log('queryType:', queryType)
101
     console.log('hospital:', hospital)
120
     console.log('hospital:', hospital)
102
     console.log('duty:', duty)
121
     console.log('duty:', duty)
122
+    console.log('defaultDate:', defaultDate)
103
     this.queryType = queryType;
123
     this.queryType = queryType;
104
     this.hospital = hospital;
124
     this.hospital = hospital;
105
     this.duty = duty;
125
     this.duty = duty;
106
 		this.parent = parent;
126
 		this.parent = parent;
127
+		this.defaultDate = defaultDate;
107
     this.queryRangeFlag = false;
128
     this.queryRangeFlag = false;
108
 
129
 
109
     this.sessionSave();
130
     this.sessionSave();
@@ -123,6 +144,12 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
123
 
144
 
124
   // 返回
145
   // 返回
125
   goBack(){
146
   goBack(){
147
+    if(this.sign === 'nurse'){
148
+      // 护士端跳转到统计
149
+      sessionStorage.removeItem('maintenanceData')
150
+      this.router.navigate(['/nurse']);
151
+      return;
152
+    }
126
 		let roleMenus = JSON.parse(localStorage.getItem("user")).menu;
153
 		let roleMenus = JSON.parse(localStorage.getItem("user")).menu;
127
 		let sy = false;
154
 		let sy = false;
128
 		let gglb = false;
155
 		let gglb = false;
@@ -137,7 +164,7 @@ export class NewStatisticsComponent implements OnInit, OnDestroy {
137
 		    gzgd = true;
164
 		    gzgd = true;
138
 		  }
165
 		  }
139
 		});
166
 		});
140
-		
167
+
141
 		if(!gglb && !gzgd && !sy){
168
 		if(!gglb && !gzgd && !sy){
142
 			this.msg.error("暂无权限进入系统!", {
169
 			this.msg.error("暂无权限进入系统!", {
143
 			  nzDuration: 2000,
170
 			  nzDuration: 2000,