seimin 2 weeks ago
parent
commit
8158842240

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

@@ -12,34 +12,34 @@ export class ToolService {
12 12
 	changeInpSubject:any;
13 13
 	allSubject = new Subject();
14 14
 	allEndSubject = new Subject();
15
-	 
15
+
16 16
 	// 提供方法来触发事件
17 17
 	triggerEvent(data: any) {
18 18
 		this.allSubject.next(data);
19 19
 	}
20
-	
20
+
21 21
 	// 提供方法来触发事件
22 22
 	triggerEndEvent(data: any) {
23 23
 		this.allEndSubject.next(data);
24 24
 	}
25
-	
25
+
26 26
 	// 提供方法来订阅事件
27 27
 	getEventObservable() {
28 28
 		return this.allSubject.asObservable();
29 29
 	}
30
-	
30
+
31 31
 	// 提供方法来订阅事件
32 32
 	getEventEndObservable() {
33 33
 		return this.allEndSubject.asObservable();
34 34
 	}
35
-	
35
+
36 36
   // 附件类型
37 37
   // word,excel,pdf,txt,ppt
38 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 40
   constructor(private mainService: MainService) {}
41
-	
42
-	
41
+
42
+
43 43
   // 获取logoUrl和logoTitle
44 44
   getSysNameAndLogoAsync(hosId = ''){
45 45
     return this.mainService.getSysNameAndLogo(hosId);
@@ -382,7 +382,7 @@ export class ToolService {
382 382
 				case "collect":
383 383
 					coopBtns.collect = true; //设置核收
384 384
 					break;
385
-				
385
+
386 386
       }
387 387
     });
388 388
     console.log(coopBtns);
@@ -485,4 +485,32 @@ export class ToolService {
485 485
   generateNumberArray(start, end){
486 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 182
             <div class="updateTipsForNurses red">{{ updateTipsForNurses }}</div>
183 183
             <div class="queuingInformation" *ngIf="!updateTipsForNurses && inspectAndPatientTransportConfig.queuingInformation == 1">等待陪检:<span class="red">{{queuingInformationList[0]}}</span>&emsp;陪检中:<span class="red">{{queuingInformationList[1]}}</span></div>
184 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 187
             <div class="userInfo dropdown">
187 188
               <div class="user" (mouseenter)="showDropdown = true" (mouseleave)="showDropdown = false">
188 189
                 <img src="../../assets/images/icon_keshi.png" alt="">

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

@@ -5,6 +5,17 @@
5 5
   height: 100%;
6 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 19
   .transport-chaoshi{
9 20
     font-size: 16px;
10 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 291
   getCoopBtns(){
292 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 299
     let coopBtns:any = {};
294 300
     let nurseMenu = menu.find(v => v.link === 'nurse');
295 301
     let nurseMenuChildren = nurseMenu.childrens || [];
@@ -316,6 +322,9 @@ export class HushijiandanComponent implements OnInit {
316 322
         case "buildOrdersForOtherTasks":
317 323
           coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
318 324
           break;
325
+        case "newStatisticsNurse":
326
+          coopBtns.newStatisticsNurse = true; //护士端新版统计权限
327
+          break;
319 328
       }
320 329
     });
321 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 315
 											</nz-option>
316 316
 										</nz-select>
317 317
 									</div>
318
-									
318
+
319 319
 									<div class="col">
320 320
 										<span class="name required">故障现象:</span>
321 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 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 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 549
 	searchPatientListSubject = new Subject();
550 550
 	inspectSubject = new Subject();
551 551
 	changeAssetInpSubject = new Subject();
552
-	
552
+
553 553
 	// 运维相关
554 554
 	incidentModel:any = {};
555 555
 	incidentMsg:any = {};
@@ -1056,7 +1056,7 @@ export class MainComponent implements OnInit, OnDestroy {
1056 1056
 	      }
1057 1057
 	    });
1058 1058
 	}
1059
-	
1059
+
1060 1060
 	// 引入知识库
1061 1061
 	importKnowage(item){
1062 1062
 	  console.log(item)
@@ -1069,11 +1069,11 @@ export class MainComponent implements OnInit, OnDestroy {
1069 1069
 	  this.coopData = data || {};
1070 1070
 	  this.isShowKnowledge = true;
1071 1071
 	}
1072
-	
1072
+
1073 1073
 	cancelKnowledgeModal(flag) {
1074 1074
 	  this.isShowKnowledge = false;
1075 1075
 	}
1076
-	
1076
+
1077 1077
 	// 获取患者信息
1078 1078
 	searchPatientList(id, searchWords) {
1079 1079
 	  this.searchPatientListSubject.next([id, searchWords]);
@@ -3915,11 +3915,11 @@ export class MainComponent implements OnInit, OnDestroy {
3915 3915
 		    this.getPatientByResidenceNo(v[1]);
3916 3916
 		  }
3917 3917
 		});
3918
-		
3918
+
3919 3919
 		this.changeAssetInpSubject.pipe(debounceTime(500)).subscribe((v) => {
3920 3920
 		  this.getAssetData(v);
3921 3921
 		});
3922
-		
3922
+
3923 3923
 		this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
3924 3924
 		  this.getTasktypeByPhone(v);
3925 3925
 		});
@@ -3990,7 +3990,7 @@ export class MainComponent implements OnInit, OnDestroy {
3990 3990
 									}else{
3991 3991
 										this.cmdbRepair = false
3992 3992
 									}
3993
-									break;	
3993
+									break;
3994 3994
 							}
3995 3995
 						});
3996 3996
 						if(this.eventData){
@@ -4012,7 +4012,7 @@ export class MainComponent implements OnInit, OnDestroy {
4012 4012
 							}
4013 4013
 							this.searchApplicationBuilding()
4014 4014
 						}
4015
-						
4015
+
4016 4016
 						if(this.cmdbRepair && this.hospitalModel==1){
4017 4017
 							this.getAssetData()
4018 4018
 						}
@@ -4020,11 +4020,11 @@ export class MainComponent implements OnInit, OnDestroy {
4020 4020
 				}
4021 4021
 			});
4022 4022
 	 }
4023
-	
4023
+
4024 4024
 	changeAsset(e){
4025 4025
 		this.changeAssetInpSubject.next(e);
4026 4026
 	}
4027
-	
4027
+
4028 4028
   // 获取资产列表
4029 4029
 	assetData:any = [];
4030 4030
 	getAssetData(name?){
@@ -4039,7 +4039,7 @@ export class MainComponent implements OnInit, OnDestroy {
4039 4039
 		    name: name
4040 4040
 		  },
4041 4041
 		};
4042
-		
4042
+
4043 4043
 		this.mainService
4044 4044
 		  .getFetchDataList("simple/data", "asset", data)
4045 4045
 		  .subscribe((data) => {
@@ -4048,7 +4048,7 @@ export class MainComponent implements OnInit, OnDestroy {
4048 4048
 		    }
4049 4049
 		  });
4050 4050
 	}
4051
-	
4051
+
4052 4052
 	// 新增报修
4053 4053
 	speedinessAdd(): void {
4054 4054
 		this.addOrder();
@@ -4123,6 +4123,7 @@ export class MainComponent implements OnInit, OnDestroy {
4123 4123
 	}
4124 4124
   // 统计
4125 4125
   toNewStatistics(): void {
4126
+    this.tool.setSessionStorage('newStatisticsFrom', 'main');//统计来源标识
4126 4127
     let menus = JSON.parse(localStorage.getItem("menu"));
4127 4128
     let firstMenu = menus.find((item) => item.type == "newStatistics");
4128 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 86
 	ngOnDestroy(){
87
-		// this.dateData1 = null 
87
+		// this.dateData1 = null
88 88
 		// this.dateData2 = null
89 89
 	}
90
-	
90
+
91 91
   // 根据时间区间重置
92 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 99
     setTimeout(() => {
109 100
       this.dateType = 'day';
110 101
       this.dateRange = dateRange;

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

@@ -8,10 +8,11 @@
8 8
           <nz-form-label [nzSpan]="4" nzRequired nzFor="queryType">查询范围</nz-form-label>
9 9
           <nz-form-control [nzSpan]="20" nzErrorTip="请选择查询范围!">
10 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 16
             </nz-radio-group>
16 17
           </nz-form-control>
17 18
         </nz-form-item>
@@ -41,16 +42,26 @@
41 42
               </nz-option>
42 43
             </nz-select>
43 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 49
         </nz-form-item>
45 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 53
 				    <nz-radio-group formControlName="parent">
49 54
 				      <label nz-radio [nzValue]="1">是</label>
50 55
 				      <label nz-radio [nzValue]="0">否</label>
51 56
 				    </nz-radio-group>
52 57
 				  </nz-form-control>
53 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 65
       </form>
55 66
     </div>
56 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 83
   &.add {
84 84
     .modalBody {
85
-      width: 578px;
85
+      width: 700px;
86 86
       padding: 0 24px;
87 87
 
88 88
       .content {
89 89
         width: 100%;
90
-        min-height: 166px;
91 90
         padding: 10px 24px 0;
92 91
         height: auto;
93 92
         overflow-y: auto;
94 93
 
95 94
         .addForm {
96 95
           .ant-form-item {
97
-            margin-bottom: 14px;
96
+            margin-bottom: 8px;
98 97
             .ant-form-item-label {
99 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 3
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
4 4
 import { EventEmitter } from '@angular/core';
5 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 9
 @Component({
8 10
   selector: 'app-query-range',
@@ -16,15 +18,27 @@ export class QueryRangeComponent implements OnInit {
16 18
   @Input() hospital: any;
17 19
   @Input() duty: any;
18 20
 	@Input() parent: any;
21
+	@Input() defaultDate: any = [];
22
+  // sign = largeScreen 大屏
23
+  // sign = main 管理端
24
+  // sign = nurse 护士端
25
+	@Input() sign: any = '';
19 26
 	@Input() hiddenParent: any = false;
27
+	@Input() hiddenDefaultDate: any = false;
20 28
   validateForm: FormGroup;//表单
29
+  currentDept:any = {};//当前登录人所在科室
21 30
   constructor(
22 31
     private fb: FormBuilder,
23 32
     private tool: ToolService,
24 33
     private mainService: MainService,
34
+    private dateService: DateService,
25 35
   ) { }
26 36
 
27 37
   ngOnInit() {
38
+    this.currentDept = this.tool.getCurrentUserDept();
39
+
40
+    console.log('this.sign:', this.sign)
41
+
28 42
     this.getHospitalList();
29 43
     this.queryType == 3 && this.getDutyList(this.hospital.id);
30 44
     this.getDutyOneList();
@@ -36,12 +50,15 @@ export class QueryRangeComponent implements OnInit {
36 50
   }
37 51
   // 初始化新增form表单
38 52
   initForm() {
53
+    let lastmonthstartdate = this.dateService.date().lastMonthStartDate;
54
+    let lastmonthenddate = this.dateService.date().lastMonthEndDate;
39 55
     this.validateForm = this.fb.group({
40 56
       queryType: [this.queryType, [Validators.required]],
41 57
       hospital: [(this.hospital && (this.queryType == 2 || this.queryType == 3)) ? this.hospital.id : null],
42 58
       duty: [(this.duty && this.queryType == 3) ? this.duty.id : null],
43 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 70
     if (this.validateForm.invalid) return;
54 71
     let queryType = this.validateForm.value.queryType;
55 72
 		let parent = this.validateForm.value.parent;
73
+		let defaultDate = this.validateForm.value.defaultDate;
56 74
     let hospital;
57 75
     let duty;
58 76
     switch (queryType) {
@@ -70,7 +88,7 @@ export class QueryRangeComponent implements OnInit {
70 88
         duty = this.dutyOneList.find(v => v.id == this.validateForm.value.dutyOne);
71 89
         break;
72 90
     }
73
-    this.submitQueryRange.emit({queryType, hospital, duty, parent});
91
+    this.submitQueryRange.emit({queryType, hospital, duty, parent, defaultDate});
74 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 69
       this.search();
70 70
     }, 0)
71 71
   }
72
-	
72
+
73 73
 	/*========= 数据下钻 ========*/
74
-	
74
+
75 75
 	// 汇总
76 76
 	viewDetail1(){
77 77
 		let query = {
78
-			
78
+
79 79
 		}
80 80
 		let path = '/newStatistics/maintenanceStatistics/incidentList'
81 81
 		let flag = this.tabService.tabs.some(v => v.path === path);
@@ -86,7 +86,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
86 86
 		this.router.navigate([path], { replaceUrl: true });
87 87
 		// this.router.navigateByUrl('/newStatistics/maintenanceStatistics/incidentList')
88 88
 	}
89
-	
89
+
90 90
 	// 挂起
91 91
 	viewDetail2(){
92 92
 		let query = {
@@ -108,7 +108,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
108 108
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
109 109
 		this.router.navigate([path], { replaceUrl: true });
110 110
 	}
111
-	
111
+
112 112
 	// 超时
113 113
 	viewDetail3(){
114 114
 		let query = {
@@ -130,7 +130,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
130 130
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
131 131
 		this.router.navigate([path], { replaceUrl: true });
132 132
 	}
133
-	
133
+
134 134
 	// 差评
135 135
 	viewDetail4(){
136 136
 		let query = {
@@ -157,7 +157,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
157 157
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
158 158
 		this.router.navigate([path], { replaceUrl: true });
159 159
 	}
160
-	
160
+
161 161
 	// 维修处理top5
162 162
 	viewMaintain1(data){
163 163
 		let query = {
@@ -196,7 +196,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
196 196
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
197 197
 		this.router.navigate([path], { replaceUrl: true });
198 198
 	}
199
-	
199
+
200 200
 	viewMaintain2(data){
201 201
 		let query = {
202 202
 			startDate: this.customChangeDateComponent.startDate,
@@ -214,7 +214,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
214 214
 				}
215 215
 			}
216 216
 		}
217
-		
217
+
218 218
 		if(this.activeIndex==0){
219 219
 			query.searchQuery.userId = data.userId ? data.userId : -1
220 220
 			query.searchQuery.userDTO = {
@@ -240,7 +240,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
240 240
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
241 241
 		this.router.navigate([path], { replaceUrl: true });
242 242
 	}
243
-	
243
+
244 244
 	// 课科室费用top5
245 245
 	viewDept(data){
246 246
 		let query = {
@@ -259,7 +259,7 @@ export class SynthesizeStatisticsComponent implements OnInit, AfterViewInit {
259 259
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
260 260
 		this.router.navigate([path], { replaceUrl: true });
261 261
 	}
262
-	
262
+
263 263
 	// 维修处理类型切换
264 264
 	selectCheck(type){
265 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 56
     }, 0)
57 57
   }
58
-	
58
+
59 59
 	// 数据下钻
60 60
 	viewDetail1(data, type){
61 61
 		let query = null
@@ -116,7 +116,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
116 116
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
117 117
 		this.router.navigate([path], { replaceUrl: true });
118 118
 	}
119
-	
119
+
120 120
 	// 数据下钻
121 121
 	viewDetail2(data, type){
122 122
 		let query = null
@@ -191,7 +191,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
191 191
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
192 192
 		this.router.navigate([path], { replaceUrl: true });
193 193
 	}
194
-	
194
+
195 195
 	// 数据下钻
196 196
 	viewDetail3(data, type){
197 197
 		let query = null
@@ -266,7 +266,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
266 266
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
267 267
 		this.router.navigate([path], { replaceUrl: true });
268 268
 	}
269
-	
269
+
270 270
 	// 数据下钻
271 271
 	viewDetail4(data, type){
272 272
 		let query = null
@@ -351,7 +351,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
351 351
 		sessionStorage.setItem('maintenanceData', JSON.stringify(query))
352 352
 		this.router.navigate([path], { replaceUrl: true });
353 353
 	}
354
-	
354
+
355 355
   getQueryParams(){
356 356
     let queryParams = this.tabService.getQueryParams();
357 357
     this.tabService.clearQueryParams();

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

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