Kaynağa Gözat

电话统计

seimin 1 ay önce
ebeveyn
işleme
203bf3a760
20 değiştirilmiş dosya ile 754 ekleme ve 374 silme
  1. 1 1
      proxy.conf.json
  2. 3 3
      src/app/views/fuwutai/fuwutai.component.html
  3. 27 54
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.html
  4. 62 135
      src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.ts
  5. 9 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts
  6. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics-routing.module.ts
  7. 81 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.html
  8. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.less
  9. 276 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.ts
  10. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.module.ts
  11. 1 5
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.html
  12. 1 1
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.less
  13. 16 23
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts
  14. 2 0
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.module.ts
  15. 21 35
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.html
  16. 51 26
      src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.ts
  17. 26 41
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.html
  18. 2 2
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.less
  19. 63 48
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.ts
  20. 4 0
      src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.module.ts

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-		"target": "http://192.168.3.108",
3
+		"target": "http://192.168.4.163",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 3 - 3
src/app/views/fuwutai/fuwutai.component.html

@@ -787,7 +787,7 @@
787 787
       </div>
788 788
       <div class="fixedMenu">
789 789
         <div class="menuItems">
790
-          <div class="others" [ngStyle]="{ height: showLastItems ? mainRole ? 35 * 6 + 'px' : 35 * 5 + 'px' : 0 }">
790
+          <div class="others" [ngStyle]="{ height: showLastItems ? mainRole ? 35 * 5 + 'px' : 35 * 4 + 'px' : 0 }">
791 791
             <div [ngClass]="{ item: true, checked: fixedTab == 'orderScope' }" (click)="showOrderScope()">
792 792
               工单范围
793 793
             </div>
@@ -797,9 +797,9 @@
797 797
             <div [ngClass]="{ item: true, checked: fixedTab == 'nucleicAcidPrinting' }" (click)="checkFixedTab('nucleicAcidPrinting')" *ngIf="isShowNucleicAcidPrinting">
798 798
               核酸打印
799 799
             </div>
800
-            <div [ngClass]="{ item: true, checked: fixedTab == 'queueNum' }" (click)="checkFixedTab('queueNum')">
800
+            <!-- <div [ngClass]="{ item: true, checked: fixedTab == 'queueNum' }" (click)="checkFixedTab('queueNum')">
801 801
               叫号信息
802
-            </div>
802
+            </div> -->
803 803
             <div [ngClass]="{ item: true, checked: fixedTab == 'toSystem' }" *ngIf="mainRole" (click)="checkFixedTab('toSystem')">
804 804
               返回系统
805 805
             </div>

+ 27 - 54
src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.html

@@ -4,54 +4,13 @@
4 4
     </div>
5 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
-        <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8
-          <nz-form-label [nzSpan]="6" nzFor="groupId">分<span style="visibility: hidden;">囧囧</span>组</nz-form-label>
9
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择分组!">
10
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" formControlName="groupId" nzPlaceHolder="请选择分组" (nzOpenChange)="openChangeGroup($event)" (ngModelChange)="changeGroup($event)">
11
-              <ng-container *ngFor="let option of groupList">
12
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
13
-              </ng-container>
14
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
-              </nz-option>
17
-            </nz-select>
18
-          </nz-form-control>
19
-        </nz-form-item>
20
-
21
-        <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
22
-          <nz-form-label [nzSpan]="6" nzFor="userId">人<span style="visibility: hidden;">囧囧</span>员</nz-form-label>
23
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择人员!">
24
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择人员" (nzOpenChange)="openChangeUser($event)" (ngModelChange)="setIsSelecting(true)">
25
-              <ng-container *ngFor="let option of userList">
26
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
27
-              </ng-container>
28
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
29
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
30
-              </nz-option>
31
-            </nz-select>
32
-          </nz-form-control>
33
-        </nz-form-item>
34
-
35
-        <nz-form-item [hidden]="!fieldConfig.config.statisticsType">
36
-          <nz-form-label [nzSpan]="6" nzFor="statisticsTypeId">统计分类</nz-form-label>
37
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择统计分类!">
38
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear formControlName="statisticsTypeId" nzPlaceHolder="请选择统计分类">
39
-              <ng-container *ngFor="let option of statisticsTypeList">
40
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
41
-              </ng-container>
42
-              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
43
-                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
44
-              </nz-option>
45
-            </nz-select>
46
-          </nz-form-control>
47
-        </nz-form-item>
48 7
 
49
-        <nz-form-item [hidden]="!fieldConfig.config.taskType">
50
-          <nz-form-label [nzSpan]="6" nzFor="taskTypeId">任务类型</nz-form-label>
51
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择任务类型!">
52
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeTaskTypeInp($event)" formControlName="taskTypeId" nzPlaceHolder="请选择任务类型" (nzOpenChange)="openChangeTaskType($event)" (ngModelChange)="setIsSelecting(true)">
53
-              <ng-container *ngFor="let option of taskTypeList">
54
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosId.hosName + '-' + option.taskName" [nzValue]="option.id"></nz-option>
8
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
9
+          <nz-form-label [nzSpan]="6" nzFor="buildingId">楼<span style="visibility: hidden;">囧囧</span>栋</nz-form-label>
10
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼栋!">
11
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeBuildingInp($event)" formControlName="buildingId" nzPlaceHolder="请选择楼栋" (nzOpenChange)="openChangeBuilding($event)" (ngModelChange)="changeBuilding($event)">
12
+              <ng-container *ngFor="let option of buildingList">
13
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName + '-' + option.buildingName" [nzValue]="option.id"></nz-option>
55 14
               </ng-container>
56 15
               <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
57 16
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -60,12 +19,12 @@
60 19
           </nz-form-control>
61 20
         </nz-form-item>
62 21
 
63
-        <nz-form-item [hidden]="!fieldConfig.config.building">
64
-          <nz-form-label [nzSpan]="6" nzFor="buildingId">楼<span style="visibility: hidden;">囧囧</span>栋</nz-form-label>
65
-          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼!">
66
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeBuildingInp($event)" formControlName="buildingId" nzPlaceHolder="请选择楼栋" (nzOpenChange)="openChangeBuilding($event)" (ngModelChange)="setIsSelecting(true)">
67
-              <ng-container *ngFor="let option of buildingList">
68
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName + '-' + option.buildingName" [nzValue]="option.id"></nz-option>
22
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
23
+          <nz-form-label [nzSpan]="6" nzFor="floorId">楼<span style="visibility: hidden;">囧囧</span>层</nz-form-label>
24
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼!">
25
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeFloorInp($event)" formControlName="floorId" nzPlaceHolder="请选择楼层" (nzOpenChange)="openChangeFloor($event)" (ngModelChange)="setIsSelecting(true)">
26
+              <ng-container *ngFor="let option of floorList">
27
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
69 28
               </ng-container>
70 29
               <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
71 30
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -77,7 +36,7 @@
77 36
         <nz-form-item [hidden]="!fieldConfig.config.dept">
78 37
           <nz-form-label [nzSpan]="6" nzFor="deptId">科<span style="visibility: hidden;">囧囧</span>室</nz-form-label>
79 38
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室!">
80
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" formControlName="deptId" nzPlaceHolder="请选择科室" (nzOpenChange)="openChangeRepairDept($event)" (ngModelChange)="setIsSelecting(true)">
39
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" formControlName="deptId" nzPlaceHolder="请选择科室" (nzOpenChange)="openChangeDept($event)" (ngModelChange)="setIsSelecting(true)">
81 40
               <ng-container *ngFor="let option of deptList">
82 41
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
83 42
               </ng-container>
@@ -87,6 +46,20 @@
87 46
             </nz-select>
88 47
           </nz-form-control>
89 48
         </nz-form-item>
49
+
50
+				<nz-form-item [hidden]="!fieldConfig.config.deptType">
51
+				  <nz-form-label [nzSpan]="6" nzFor="deptTypeId">科室类型</nz-form-label>
52
+				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室类型!">
53
+				    <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzShowSearch formControlName="deptTypeId" nzPlaceHolder="请选择科室类型" (nzOpenChange)="openChangeDeptType($event)">
54
+				      <ng-container *ngFor="let option of deptTypeList">
55
+				        <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
56
+				      </ng-container>
57
+				      <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
58
+				        <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
59
+				      </nz-option>
60
+				    </nz-select>
61
+				  </nz-form-control>
62
+				</nz-form-item>
90 63
       </form>
91 64
     </div>
92 65
     <div class="display_flex justify-content_flex-center">

+ 62 - 135
src/app/views/new-statistics/components/phone-search-more/phone-search-more.component.ts

@@ -1,6 +1,6 @@
1 1
 import { Subject } from 'rxjs';
2 2
 import { debounceTime } from 'rxjs/operators';
3
-import { ToolService } from '../../../../services/tool.service';
3
+import { ToolService } from './../../../../services/tool.service';
4 4
 import { Component, OnInit, Output, Input } from '@angular/core';
5 5
 import { FormGroup, FormBuilder, Validators } from '@angular/forms';
6 6
 import { EventEmitter } from '@angular/core';
@@ -33,7 +33,6 @@ export class PhoneSearchMoreComponent implements OnInit {
33 33
       fun.call(this, v[1]);
34 34
     });
35 35
     this.initForm();
36
-    this.getSourceList();
37 36
   }
38 37
   // 隐藏模态框
39 38
   hideModal() {
@@ -41,21 +40,17 @@ export class PhoneSearchMoreComponent implements OnInit {
41 40
   }
42 41
   // 初始化form表单
43 42
   initForm() {
44
-    this.groupList = this.fieldConfig.fields.groupDTO ? [this.fieldConfig.fields.groupDTO] : [];
45
-    this.userList = this.fieldConfig.fields.userDTO ? [this.fieldConfig.fields.userDTO] : [];
46
-    this.statisticsTypeList = this.fieldConfig.fields.statisticsTypeDTO ? [this.fieldConfig.fields.statisticsTypeDTO] : [];
47 43
     this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
48
-    this.taskTypeList = this.fieldConfig.fields.taskTypeDTO ? [this.fieldConfig.fields.taskTypeDTO] : [];
44
+    this.floorList = this.fieldConfig.fields.floorDTO ? [this.fieldConfig.fields.floorDTO] : [];
49 45
     this.deptList = this.fieldConfig.fields.deptDTO ? [this.fieldConfig.fields.deptDTO] : [];
46
+		this.deptTypeList = this.fieldConfig.fields.deptTypeDTO ? [this.fieldConfig.fields.deptTypeDTO] : [];
50 47
 
51 48
     this.validateForm = this.fb.group({
52
-      groupId: [this.fieldConfig.fields.groupId || null],
53
-      userId: [this.fieldConfig.fields.userId === undefined ? null : this.fieldConfig.fields.userId],
54
-      statisticsTypeId: [this.fieldConfig.fields.statisticsTypeId || null],
55 49
       buildingId: [this.fieldConfig.fields.buildingId || null],
56
-      taskTypeId: [this.fieldConfig.fields.taskTypeDTO ? this.fieldConfig.fields.taskTypeDTO.id  : null],
50
+      floorId: [this.fieldConfig.fields.floorId === undefined ? null : this.fieldConfig.fields.floorId],
57 51
       deptId: [this.fieldConfig.fields.deptDTO ? this.fieldConfig.fields.deptDTO.id  : null],
58
-    });
52
+			deptTypeId: [this.fieldConfig.fields.deptTypeId || null],
53
+		});
59 54
   }
60 55
   // 表单提交
61 56
   submitForm(): void {
@@ -66,29 +61,21 @@ export class PhoneSearchMoreComponent implements OnInit {
66 61
     if (this.validateForm.invalid) return;
67 62
 
68 63
     let fields:any = {}
69
-    if(this.fieldConfig.config.groupAndUser){
70
-      fields.groupId = this.validateForm.value.groupId;
71
-      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
72
-      fields.userId = this.validateForm.value.userId;
73
-      fields.userDTO = this.userList.find(item => item.id == this.validateForm.value.userId);
74
-    }
75
-
76
-    if(this.fieldConfig.config.statisticsType){
77
-      fields.statisticsTypeId = this.validateForm.value.statisticsTypeId;
78
-      fields.statisticsTypeDTO = this.statisticsTypeList.find(item => item.id == this.validateForm.value.statisticsTypeId);
79
-    }
80
-    if(this.fieldConfig.config.building){
64
+    if(this.fieldConfig.config.buildingAndFloor){
81 65
       fields.buildingId = this.validateForm.value.buildingId;
82 66
       fields.buildingDTO = this.buildingList.find(item => item.id == this.validateForm.value.buildingId);
83
-    }
84
-    if(this.fieldConfig.config.taskType){
85
-      fields.taskTypeId = this.validateForm.value.taskTypeId;
86
-      fields.taskTypeDTO = this.taskTypeList.find(item => item.id == this.validateForm.value.taskTypeId);
67
+      fields.floorId = this.validateForm.value.floorId;
68
+      fields.floorDTO = this.floorList.find(item => item.id == this.validateForm.value.floorId);
87 69
     }
88 70
     if(this.fieldConfig.config.dept){
89 71
       fields.deptId = this.validateForm.value.deptId;
90 72
       fields.deptDTO = this.deptList.find(item => item.id == this.validateForm.value.deptId);
91 73
     }
74
+		if(this.fieldConfig.config.deptType){
75
+		  fields.deptTypeId = this.validateForm.value.deptTypeId;
76
+		  fields.deptTypeDTO = this.deptTypeList.find(item => item.id == this.validateForm.value.deptTypeId);
77
+		}
78
+
92 79
     this.submitEvent.emit(fields);
93 80
     this.hideModal();
94 81
   }
@@ -114,95 +101,24 @@ export class PhoneSearchMoreComponent implements OnInit {
114 101
     this.isSelecting = flag; // 设置标志
115 102
   }
116 103
 
117
-  // =================分组===================
118
-
119
-  // 分组搜索
120
-  changeGroupInp(e) {
121
-    this.searchTimer(this.getGroupList, e);
122
-  }
123
-
124
-  // 获取分组列表
125
-  groupList:any[] = [];
126
-  getGroupList(keyword?){
127
-    let postData: any = {
128
-      idx: 0,
129
-      sum: 20,
130
-      group2: {
131
-        statisticalHosId: this.getHosId,
132
-        groupName: keyword,
133
-        type: 1,
134
-      },
135
-    };
136
-    this.isLoading = true;
137
-    this.mainService.getFetchDataList("simple/data", "group2", postData).subscribe(result => {
138
-      this.isLoading = false;
139
-      if(result.status == 200){
140
-        this.groupList = result.list || [];
141
-      }else{
142
-        this.groupList = [];
143
-      }
144
-    });
145
-  }
146
-  openChangeGroup(flag){
147
-    flag && this.setIsSelecting(false);
148
-    flag && this.getGroupList();
149
-  }
150
-
151
-  changeGroup(id){
152
-    this.setIsSelecting(true);
153
-    this.userList = [];
154
-    this.validateForm.controls.userId.setValue(null);
155
-    this.getUserList();
156
-  }
104
+	// =================科室类型===================
157 105
 
158
-  // =================人员===================
106
+	// 科室类型
107
+	openChangeDeptType(flag){
108
+	  flag && this.getDeptTypeList();
109
+	}
159 110
 
160
-  // 人员搜索
161
-  changeUserInp(e) {
162
-    this.searchTimer(this.getUserList, e);
163
-  }
164
-
165
-  // 获取人员列表
166
-  userList:any[] = [];
167
-  getUserList(keyword = ''){
168
-    if(!this.validateForm.value.groupId){
169
-      this.isLoading = false;
170
-      this.userList = [];
171
-      return;
172
-    }
173
-    let postData: any = {
174
-      idx: 0,
175
-      sum: 20,
176
-      user: {
177
-        name: keyword,
178
-        simpleQuery: true,
179
-        groupdata: { id: this.validateForm.value.groupId },
180
-      },
181
-    };
182
-    this.isLoading = true;
183
-    this.mainService.getFetchDataList("simple/data", "user", postData).subscribe(result => {
184
-      this.isLoading = false;
185
-      if(result.status == 200){
186
-        this.userList = result.list || [];
187
-      }else{
188
-        this.userList = [];
189
-      }
190
-    });
191
-  }
192
-  openChangeUser(flag){
193
-    flag && this.setIsSelecting(false);
194
-    flag && this.getUserList();
195
-  }
196
-
197
-  // =================统计分类===================
198
-
199
-  // 获取统计分类列表
200
-  statisticsTypeList:any[] = [];
201
-  getSourceList(){
202
-    this.mainService.getDictionary("list", "statistics_date_type").subscribe(result => {
203
-      this.statisticsTypeList = result;
204
-    });
205
-  }
111
+	// 获取科室类型列表
112
+	deptTypeList:any[] = [];
113
+	getDeptTypeList(keyword?) {
114
+	  this.isLoading = true;
115
+	  this.mainService
116
+	    .getDictionary("list", "dept_type")
117
+	    .subscribe((data) => {
118
+	      this.isLoading = false;
119
+	      this.deptTypeList = data;
120
+	    });
121
+	}
206 122
 
207 123
   // =================楼栋===================
208 124
 
@@ -238,50 +154,61 @@ export class PhoneSearchMoreComponent implements OnInit {
238 154
     flag && this.getBuildingList();
239 155
   }
240 156
 
241
-  // =================任务类型===================
157
+  changeBuilding(id){
158
+    this.setIsSelecting(true);
159
+    this.floorList = [];
160
+    this.validateForm.controls.floorId.setValue(null);
161
+    this.getFloorList();
162
+  }
163
+
164
+  // =================楼层===================
242 165
 
243
-  // 任务类型搜索
244
-  changeTaskTypeInp(e) {
245
-    this.searchTimer(this.getTaskTypeList, e);
166
+  // 楼层搜索
167
+  changeFloorInp(e) {
168
+    this.searchTimer(this.getFloorList, e);
246 169
   }
247 170
 
248
-  // 获取任务类型列表
249
-  taskTypeList:any[] = [];
250
-  getTaskTypeList(keyword?){
171
+  // 获取楼层列表
172
+  floorList:any[] = [];
173
+  getFloorList(keyword = ''){
174
+    if(!this.validateForm.value.buildingId){
175
+      this.isLoading = false;
176
+      this.floorList = [];
177
+      return;
178
+    }
251 179
     let postData: any = {
252 180
       idx: 0,
253 181
       sum: 20,
254
-      taskType: {
255
-        simpleQuery: true,
256
-        taskName: keyword,
257
-        statisticalHosId: this.getHosId,
182
+      floor: {
183
+        floorName: keyword,
184
+        buildId : this.validateForm.value.buildingId,
258 185
       },
259 186
     };
260 187
     this.isLoading = true;
261
-    this.mainService.getFetchDataList("simple/data", "taskType", postData).subscribe(result => {
188
+    this.mainService.getFetchDataList("simple/data", "floor", postData).subscribe(result => {
262 189
       this.isLoading = false;
263 190
       if(result.status == 200){
264
-        this.taskTypeList = result.list || [];
191
+        this.floorList = result.list || [];
265 192
       }else{
266
-        this.taskTypeList = [];
193
+        this.floorList = [];
267 194
       }
268 195
     });
269 196
   }
270
-  openChangeTaskType(flag){
197
+  openChangeFloor(flag){
271 198
     flag && this.setIsSelecting(false);
272
-    flag && this.getTaskTypeList();
199
+    flag && this.getFloorList();
273 200
   }
274 201
 
275 202
   // =================科室===================
276 203
 
277 204
   // 科室搜索
278
-  changeRepairDeptInp(e) {
279
-    this.searchTimer(this.getRepairDeptList, e);
205
+  changeDeptInp(e) {
206
+    this.searchTimer(this.getDeptList, e);
280 207
   }
281 208
 
282 209
   // 获取科室列表
283 210
   deptList:any[] = [];
284
-  getRepairDeptList(keyword?){
211
+  getDeptList(keyword?){
285 212
     let postData: any = {
286 213
       idx: 0,
287 214
       sum: 20,
@@ -301,8 +228,8 @@ export class PhoneSearchMoreComponent implements OnInit {
301 228
       }
302 229
     });
303 230
   }
304
-  openChangeRepairDept(flag){
231
+  openChangeDept(flag){
305 232
     flag && this.setIsSelecting(false);
306
-    flag && this.getRepairDeptList();
233
+    flag && this.getDeptList();
307 234
   }
308 235
 }

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

@@ -107,6 +107,15 @@ const routes: Routes = [
107 107
 			    title: '配-业务分类统计'
108 108
 			  }
109 109
 			},
110
+			{
111
+			  // 任务类型质控统计
112
+			  path: 'taskTypeQualityControlStatistics',
113
+			  loadChildren: () => import('./taskType-quality-control-statistics/taskType-quality-control-statistics.module').then(m => m.TaskTypeQualityControlStatisticsModule),
114
+			  data: {
115
+			    reuse: true,
116
+			    title: '配-任务类型质控统计'
117
+			  }
118
+			},
110 119
     ]
111 120
   }
112 121
 ];

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

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

+ 81 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.html

@@ -0,0 +1,81 @@
1
+<div class="searchDataWrap">
2
+  <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+    <div class="searchDataItem">
5
+      <span class="label">任务类型</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeTaskTypeInp($event)" nzAllowClear nzPlaceHolder="请选择任务类型" [(ngModel)]="taskTypeId" (nzOpenChange)="openChangeTaskType($event)">
7
+        <ng-container *ngFor="let option of taskTypeList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.hosId.hosName + '-' + option.taskName" [nzValue]="option.id"></nz-option>
9
+        </ng-container>
10
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
+        </nz-option>
13
+      </nz-select>
14
+    </div>
15
+  </div>
16
+  <div class="operation">
17
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
18
+    <button nz-button class="btn default" (click)="search()">查询</button>
19
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
20
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21
+  </div>
22
+</div>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.deptDTO || fieldConfig.fields.buildingDTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
+  <span>{{fieldConfig.fields.userDTO?.name}}</span>
26
+  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
27
+	<span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
28
+</div>
29
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
30
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
31
+    <tr>
32
+      <th nzWidth="10%">任务类型名称</th>
33
+      <th nzWidth="10%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
34
+      <th nzWidth="10%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
35
+			<th nzWidth="10%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
36
+			<th nzWidth="10%" nzShowSort nzSortKey="arrive_time_num" [(nzSort)]="sortCurrent.arrive_time_num">平均到达时间</th>
37
+      <th nzWidth="10%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
38
+      <th nzWidth="10%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时达标率</th>
39
+      <th nzWidth="10%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
40
+      <th nzWidth="10%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
41
+      <th nzWidth="10%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
42
+    </tr>
43
+  </thead>
44
+  <tbody>
45
+    <tr *ngFor="let data of listOfData">
46
+      <td>{{ data.taskName }}</td>
47
+      <td>{{ data.totalCount }}</td>
48
+      <td>{{ data.totalGrade }}</td>
49
+      <td>{{ data.response_time_num }}</td>
50
+      <td>{{ data.arrive_time_num }}</td>
51
+      <td>{{ data.execution_time_num }}</td>
52
+      <td>{{ data.aveper }}</td>
53
+      <td>{{ data.total_time }}</td>
54
+      <td>{{ data.five_count }}</td>
55
+      <td>{{ data.special_close }}</td>
56
+    </tr>
57
+  </tbody>
58
+  <ng-template #footerTpl>
59
+    <table class="footTable">
60
+      <tr *ngFor="let data of listOfDataEnd">
61
+        <td style="width: 10%">{{ data.taskName }}</td>
62
+        <td style="width: 10%">{{ data.totalCount }}</td>
63
+        <td style="width: 10%">{{ data.totalGrade }}</td>
64
+        <td style="width: 10%">{{ data.response_time_num }}</td>
65
+        <td style="width: 10%">{{ data.arrive_time_num }}</td>
66
+        <td style="width: 10%">{{ data.execution_time_num }}</td>
67
+        <td style="width: 10%">{{ data.aveper }}</td>
68
+        <td style="width: 10%">{{ data.total_time }}</td>
69
+        <td style="width: 10%">{{ data.five_count }}</td>
70
+        <td style="width: 10%">{{ data.special_close }}</td>
71
+      </tr>
72
+    </table>
73
+  </ng-template>
74
+</nz-table>
75
+<div class="pagination">
76
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
77
+  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
78
+</div>
79
+
80
+<!-- 详细搜索 -->
81
+<app-distribution-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-distribution-search-more>

+ 71 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.less

@@ -0,0 +1,71 @@
1
+@import "../../../../../../src/theme.less";
2
+:host{
3
+  position: absolute;
4
+  top: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  left: 0;
8
+  ::ng-deep .ant-table-footer{
9
+    padding: 16px 0;
10
+    width: calc(100% - 15px);
11
+    font-weight: bold;
12
+  }
13
+  tr, th{
14
+    text-align: center;
15
+  }
16
+  .searchDataWrap{
17
+    display: flex;
18
+    align-items: center;
19
+    justify-content: space-between;
20
+    .searchData{
21
+      padding: 16px;
22
+      display: flex;
23
+      align-items: center;
24
+      .searchDataItem{
25
+        margin-right: 24px;
26
+        .label{
27
+          font-size: 16px;
28
+        }
29
+        .selectItem{
30
+          width: 160px;
31
+        }
32
+      }
33
+    }
34
+    .operation{
35
+      margin-right: 16px;
36
+      display: flex;
37
+      align-items: center;
38
+      cursor: pointer;
39
+      .icon_transport{
40
+        margin-right: 16px;
41
+        font-size: 24px;
42
+      }
43
+      .btn{
44
+        &.default{
45
+          height: 32px;
46
+          line-height: 32px;
47
+          min-width: 70px;
48
+        }
49
+      }
50
+    }
51
+  }
52
+
53
+  .table{
54
+    margin: 0 8px;
55
+  }
56
+
57
+  .moreFilter{
58
+    margin-bottom: 16px;
59
+    span{
60
+      margin-left: 16px;
61
+      color: @primary-color;
62
+    }
63
+  }
64
+
65
+  .pagination{
66
+    padding: 16px;
67
+    display: flex;
68
+    justify-content: flex-end;
69
+    align-items: center;
70
+  }
71
+}

+ 276 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.component.ts

@@ -0,0 +1,276 @@
1
+import { TabService } from './../../services/tab.service';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { Subject } from 'rxjs';
4
+import { NzMessageService } from 'ng-zorro-antd/message';
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
6
+import { MainService } from 'src/app/services/main.service';
7
+import { ActivatedRoute } from '@angular/router';
8
+import { ToolService } from "../../../../services/tool.service";
9
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
10
+@Component({
11
+  selector: "app-taskType-quality-control-statistics",
12
+  templateUrl: "./taskType-quality-control-statistics.component.html",
13
+  styleUrls: ["./taskType-quality-control-statistics.component.less"],
14
+})
15
+export class TaskTypeQualityControlStatisticsComponent implements OnInit, AfterViewInit {
16
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
17
+  constructor(
18
+    private mainService: MainService,
19
+    private message: NzMessageService,
20
+    private route: ActivatedRoute,
21
+    private tabService: TabService,
22
+		private tool: ToolService,
23
+  ) {}
24
+
25
+  listOfData: any[] = []; //表格数据
26
+  listOfDataEnd: any[] = []; //表格合计
27
+  pageIndex: number = 1; //表格当前页码
28
+  pageSize: number = 30; //表格每页展示条数
29
+  listLength: number = 0; //表格总数据量
30
+
31
+  taskTypeId;//任务类型id
32
+
33
+  searchTimerSubject = new Subject();
34
+
35
+  ngOnInit() {
36
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
37
+      let fun = v[0];
38
+      fun.call(this, v[1]);
39
+    });
40
+  }
41
+
42
+  ngAfterViewInit(){
43
+    this.initSessionData();
44
+    this.getQueryParams();
45
+    setTimeout(() => {
46
+      this.search();
47
+    }, 0)
48
+    this.onResize();
49
+  }
50
+
51
+  tableHeight:number = 0;
52
+  @HostListener('window:resize')
53
+  onResize(): void {
54
+    setTimeout(() => {
55
+      this.tableHeight = window.innerHeight - (document.querySelector('.searchDataWrap') as HTMLElement).offsetHeight - 64 - 36 - 48 - 8 - (document.querySelector('.ant-table-header') as HTMLElement).offsetHeight - 55 - this.getMoreFilter + 14;
56
+
57
+    }, 0)
58
+  }
59
+
60
+  getQueryParams(){
61
+    let queryParams = this.tabService.getQueryParams();
62
+    this.tabService.clearQueryParams();
63
+    if(queryParams.dateRange){
64
+      this.dateRange = queryParams.dateRange;
65
+      this.customChangeDateComponent.initByDate(this.dateRange);
66
+    }
67
+  }
68
+
69
+  get getMoreFilter(){
70
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.deptDTO;
71
+    return flag ? 37 : 0;
72
+  }
73
+
74
+  // 初始化缓存数据
75
+  queryType:any;
76
+  hosId:any;
77
+  dutyId:any;
78
+  parentDutyId:any;
79
+  initSessionData(){
80
+    let newStatistics = JSON.parse(sessionStorage.getItem('newStatistics'));
81
+    let queryType:any = newStatistics.queryType;
82
+    let hosId:any = newStatistics.hospitalId;
83
+    let dutyId:any = newStatistics.dutyId;
84
+
85
+    queryType = queryType ? +queryType : undefined;
86
+    hosId = hosId ? +hosId : undefined;
87
+    dutyId = dutyId ? +dutyId : undefined;
88
+
89
+    this.queryType = queryType;
90
+    if(queryType == 1){
91
+      this.hosId = undefined;
92
+      this.dutyId = undefined;
93
+      this.parentDutyId = undefined;
94
+    }else if(queryType == 2){
95
+      this.hosId = hosId;
96
+      this.dutyId = undefined;
97
+      this.parentDutyId = undefined;
98
+    }else if(queryType == 3){
99
+      this.hosId = undefined;
100
+      this.dutyId = dutyId;
101
+      this.parentDutyId = undefined;
102
+    }else if(queryType == 4){
103
+      this.hosId = undefined;
104
+      this.dutyId = undefined;
105
+      this.parentDutyId = dutyId;
106
+    }
107
+  }
108
+
109
+  get getHosId(){
110
+    return this.parentDutyId || this.dutyId || this.hosId;
111
+  }
112
+
113
+  // 表格数据
114
+  loading1 = false;
115
+  getList(num?: number, field?: string, sort?: string) {
116
+    if (num !== undefined) {
117
+      this.pageIndex = num;
118
+    }
119
+    let postData:any = {
120
+      idx: this.pageIndex - 1,
121
+      sum: this.pageSize,
122
+			taskTypeId: this.taskTypeId || undefined,
123
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
124
+      startDate: this.customChangeDateComponent.startDate || undefined,
125
+      endDate: this.customChangeDateComponent.endDate || undefined,
126
+      hosId: this.getHosId,
127
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
128
+      userId: this.fieldConfig.fields.userId || undefined,
129
+      deptId: this.fieldConfig.fields.deptId || undefined,
130
+    };
131
+    if (field && sort) {
132
+      postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
133
+    }
134
+    this.loading1 = true;
135
+    this.mainService
136
+      .postCustom("itsm/report", "taskTypeTransOrderQc", postData)
137
+      .subscribe((result) => {
138
+        this.loading1 = false;
139
+        this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
140
+        this.listOfDataEnd = result.dataList.filter((v, i) => { return i == result.dataList.length - 1 });
141
+        this.listLength = result.totalCount;
142
+      });
143
+  }
144
+
145
+  // 列表排序
146
+  sortCurrent:any = {};
147
+  sortCurrentKey: string = "";
148
+  sortCurrentValue: string | null = "";
149
+  sort(e) {
150
+    const { key, value } = e;
151
+    this.sortCurrentKey = key;
152
+    this.sortCurrentValue = value;
153
+    this.getList(this.pageIndex, this.sortCurrentKey, this.sortCurrentValue);
154
+  }
155
+
156
+  // 搜索
157
+  search() {
158
+    this.getList(1, this.sortCurrentKey, this.sortCurrentValue);
159
+  }
160
+
161
+  // 日期选择
162
+  dateRange: any = [];
163
+
164
+  // 导出
165
+  excelExportLoading:any = false;
166
+  excelExport(){
167
+    this.excelExportLoading = this.message.loading("导出中..", {
168
+      nzDuration: 0,
169
+    }).messageId;
170
+    let postData:any = {
171
+			taskTypeId: this.taskTypeId || undefined,
172
+			buildingId: this.fieldConfig.fields.buildingId || undefined,
173
+      startDate: this.customChangeDateComponent.startDate || undefined,
174
+      endDate: this.customChangeDateComponent.endDate || undefined,
175
+      hosId: this.getHosId,
176
+      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
177
+      userId: this.fieldConfig.fields.userId || undefined,
178
+      deptId: this.fieldConfig.fields.deptId || undefined,
179
+    };
180
+    if (this.sortCurrentKey && this.sortCurrentValue) {
181
+      postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
182
+    }
183
+    this.mainService
184
+      .postExportCustom("itsm/export", "taskTypeTransOrderQc", postData)
185
+      .subscribe((data) => {
186
+        this.message.remove(this.excelExportLoading);
187
+        this.excelExportLoading = false;
188
+        this.message.success('导出成功');
189
+        var file = new Blob([data], {
190
+          type: "application/vnd.ms-excel",
191
+        });
192
+        //trick to download store a file having its URL
193
+        var fileURL = URL.createObjectURL(file);
194
+        var a = document.createElement("a");
195
+        a.href = fileURL;
196
+        a.target = "_blank";
197
+        a.download = `${this.route.parent.routeConfig.data.title}.xls`;
198
+        document.body.appendChild(a);
199
+        a.click();
200
+      },(err) => {
201
+        this.message.remove(this.excelExportLoading);
202
+        this.excelExportLoading = false;
203
+        this.message.error('导出失败');
204
+      });
205
+  }
206
+  // 重置
207
+  reset(){
208
+    this.sortCurrentKey = "";
209
+		this.sortCurrentValue = "";
210
+		this.sortCurrent = {};
211
+    this.dateRange = []
212
+    this.taskTypeId = undefined;
213
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined};
214
+    this.customChangeDateComponent.resetByDate();
215
+    this.search();
216
+  }
217
+
218
+  // 任务类型搜索
219
+  changeTaskTypeInp(e) {
220
+    this.searchTimer(this.getTaskTypeList, e);
221
+  }
222
+
223
+  // 防抖
224
+  isLoading = false;
225
+  searchTimer(fun, e) {
226
+    this.isLoading = true;
227
+    this.searchTimerSubject.next([fun, e]);
228
+  }
229
+
230
+  openChangeTaskType(flag){
231
+    flag && this.getTaskTypeList();
232
+  }
233
+
234
+  // 获取任务类型列表
235
+  taskTypeList:any[] = [];
236
+  getTaskTypeList(keyword?) {
237
+    let postData: any = {
238
+      idx: 0,
239
+      sum: 20,
240
+      taskType: {
241
+        simpleQuery: true,
242
+        taskName: keyword,
243
+        statisticalHosId: this.getHosId,
244
+      },
245
+    };
246
+    this.isLoading = true;
247
+    this.mainService
248
+      .getFetchDataList("simple/data", "taskType", postData)
249
+      .subscribe((data) => {
250
+        this.isLoading = false;
251
+        this.taskTypeList = data.list;
252
+      });
253
+  }
254
+
255
+  // 详细搜索
256
+  fieldConfig:any = {
257
+    fields: {groupId: undefined, userId: undefined, deptId: undefined, buildingId: undefined},
258
+    config: {groupAndUser: true, dept: true, building: true},
259
+  }
260
+  showSearchMore:boolean = false;
261
+  showMore(){
262
+    this.showSearchMore = true;
263
+  }
264
+
265
+  cancelEvent(){
266
+    this.showSearchMore = false;
267
+  }
268
+
269
+  submitEvent(fields){
270
+    this.showSearchMore = false;
271
+    this.fieldConfig.fields = fields;
272
+    console.log('this.fieldConfig.fields:', this.fieldConfig.fields)
273
+    this.search();
274
+    this.onResize();
275
+  }
276
+}

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/taskType-quality-control-statistics/taskType-quality-control-statistics.module.ts

@@ -0,0 +1,23 @@
1
+import { TaskTypeQualityControlStatisticsComponent } from './taskType-quality-control-statistics.component';
2
+import { NgModule } from '@angular/core';
3
+import { CommonModule } from '@angular/common';
4
+
5
+import { TaskTypeQualityControlStatisticsRoutingModule } from './taskType-quality-control-statistics-routing.module';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+import { DistributionSearchMoreModule } from '../../components/distribution-search-more/distribution-search-more.module';
8
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9
+
10
+
11
+@NgModule({
12
+  declarations: [
13
+    TaskTypeQualityControlStatisticsComponent,
14
+  ],
15
+  imports: [
16
+    CommonModule,
17
+    TaskTypeQualityControlStatisticsRoutingModule,
18
+    ShareModule,
19
+    DistributionSearchMoreModule,
20
+    CustomChangeDateModule,
21
+  ]
22
+})
23
+export class TaskTypeQualityControlStatisticsModule { }

+ 1 - 5
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.html

@@ -1,10 +1,6 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
-    <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
3
+    <app-custom-change-date #customChangeDate [isShowType]="true"></app-custom-change-date>
8 4
     <div class="searchDataItem">
9 5
       <span class="label">报修科室</span>:
10 6
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }

+ 16 - 23
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts

@@ -2,16 +2,17 @@ import { TabService } from './../../services/tab.service';
2 2
 import { debounceTime } from 'rxjs/operators';
3 3
 import { Subject } from 'rxjs';
4 4
 import { NzMessageService } from 'ng-zorro-antd/message';
5
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
6
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
7 6
 import { MainService } from 'src/app/services/main.service';
8 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
9 9
 @Component({
10 10
   selector: "app-incident-statistics",
11 11
   templateUrl: "./incident-statistics.component.html",
12 12
   styleUrls: ["./incident-statistics.component.less"],
13 13
 })
14 14
 export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
15 16
   constructor(
16 17
     private mainService: MainService,
17 18
     private message: NzMessageService,
@@ -34,12 +35,14 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
34 35
       let fun = v[0];
35 36
       fun.call(this, v[1]);
36 37
     });
37
-    this.initSessionData();
38
-    this.getQueryParams();
39
-    this.search();
40 38
   }
41 39
 
42 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
43 46
     this.onResize();
44 47
   }
45 48
 
@@ -57,6 +60,7 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
57 60
     this.tabService.clearQueryParams();
58 61
     if(queryParams.dateRange){
59 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
60 64
     }
61 65
   }
62 66
 
@@ -113,8 +117,8 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
113 117
     let postData:any = {
114 118
       idx: this.pageIndex - 1,
115 119
       sum: this.pageSize,
116
-      startDate: this.dateRange[0] || undefined,
117
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
118 122
       hosId: this.hosId || undefined,
119 123
       dutyId: this.dutyId || undefined,
120 124
       parentDutyId: this.parentDutyId || undefined,
@@ -156,19 +160,7 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
156 160
   }
157 161
 
158 162
   // 日期选择
159
-  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')];
160
-  changeDate(result?): void {
161
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
162
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
163
-    this.dateRange = result;
164
-  }
165
-
166
-  onCalendarChangeDate(dateArr){
167
-    console.log(dateArr)
168
-    if(dateArr.length == 2){
169
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
170
-    }
171
-  }
163
+  dateRange: any = [];
172 164
 
173 165
   // 导出
174 166
   excelExportLoading:any = false;
@@ -177,8 +169,8 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
177 169
       nzDuration: 0,
178 170
     }).messageId;
179 171
     let postData:any = {
180
-      startDate: this.dateRange[0] || undefined,
181
-      endDate: this.dateRange[1] || undefined,
172
+      startDate: this.customChangeDateComponent.startDate || undefined,
173
+      endDate: this.customChangeDateComponent.endDate || undefined,
182 174
       hosId: this.hosId || undefined,
183 175
       dutyId: this.dutyId || undefined,
184 176
       parentDutyId: this.parentDutyId || undefined,
@@ -220,9 +212,10 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
220 212
     this.sortCurrentKey = "";
221 213
 		this.sortCurrentValue = "";
222 214
 		this.sortCurrent = {};
223
-    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')]
215
+    this.dateRange = []
224 216
     this.repairDeptId = undefined;
225 217
     this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
218
+    this.customChangeDateComponent.resetByDate();
226 219
     this.search();
227 220
   }
228 221
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.module.ts

@@ -6,6 +6,7 @@ import { IncidentStatisticsRoutingModule } from './incident-statistics-routing.m
6 6
 import { ShareModule } from 'src/app/share/share.module';
7 7
 import { VirtualScrollerModule } from 'ngx-virtual-scroller';
8 8
 import { SearchMoreModule } from '../../components/search-more/search-more.module';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
9 10
 
10 11
 
11 12
 @NgModule({
@@ -18,6 +19,7 @@ import { SearchMoreModule } from '../../components/search-more/search-more.modul
18 19
     ShareModule,
19 20
     VirtualScrollerModule,
20 21
     SearchMoreModule,
22
+    CustomChangeDateModule,
21 23
   ]
22 24
 })
23 25
 export class IncidentStatisticsModule { }

+ 21 - 35
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.html

@@ -2,10 +2,10 @@
2 2
   <div class="searchData">
3 3
     <app-custom-change-date #customChangeDate [isShowType]="true"></app-custom-change-date>
4 4
     <div class="searchDataItem">
5
-      <span class="label">统计分类</span>:
6
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">
7
-        <ng-container *ngFor="let option of statisticsTypeList">
8
-          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
5
+      <span class="label">科室</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" (nzOpenChange)="openChangeDept($event)">
7
+        <ng-container *ngFor="let option of deptList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
9 9
         </ng-container>
10 10
         <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11 11
           <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -20,52 +20,38 @@
20 20
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21 21
   </div>
22 22
 </div>
23
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
24
-  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
-  <span>{{fieldConfig.fields.userDTO?.name}}</span>
26
-  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptTypeDTO">
27 24
   <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
28
-  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
25
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
26
+  <span>{{fieldConfig.fields.deptTypeDTO?.name}}</span>
29 27
 </div>
30 28
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
31 29
   <thead (nzSortChange)="sort($event)" nzSingleSort>
32 30
     <tr>
33
-      <th nzWidth="12%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">日期</th>
34
-      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
35
-      <th nzWidth="11%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
36
-      <th nzWidth="11%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
37
-      <th nzWidth="11%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
38
-      <th nzWidth="11%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时完成达标率</th>
39
-      <th nzWidth="11%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
40
-      <th nzWidth="11%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
41
-      <th nzWidth="11%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
31
+      <th nzWidth="20%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">日期</th>
32
+      <th nzWidth="20%" nzShowSort nzSortKey="intoCount" [(nzSort)]="sortCurrent.intoCount">来电量</th>
33
+      <th nzWidth="20%" nzShowSort nzSortKey="intoTime" [(nzSort)]="sortCurrent.intoTime">来电时长</th>
34
+      <th nzWidth="20%" nzShowSort nzSortKey="outCount" [(nzSort)]="sortCurrent.outCount">去电量</th>
35
+      <th nzWidth="20%" nzShowSort nzSortKey="outTime" [(nzSort)]="sortCurrent.outTime">去电时长</th>
42 36
     </tr>
43 37
   </thead>
44 38
   <tbody>
45 39
     <tr *ngFor="let data of listOfData">
46 40
       <td>{{ data.date }}</td>
47
-      <td>{{ data.totalCount }}</td>
48
-      <td>{{ data.totalGrade }}</td>
49
-      <td>{{ data.response_time_num }}</td>
50
-      <td>{{ data.execution_time_num }}</td>
51
-      <td>{{ data.aveper }}</td>
52
-      <td>{{ data.total_time }}</td>
53
-      <td>{{ data.five_count }}</td>
54
-      <td>{{ data.special_close }}</td>
41
+      <td>{{ data.intoCount }}</td>
42
+      <td>{{ data.intoTime }}</td>
43
+      <td>{{ data.outCount }}</td>
44
+      <td>{{ data.outTime }}</td>
55 45
     </tr>
56 46
   </tbody>
57 47
   <ng-template #footerTpl>
58 48
     <table class="footTable">
59 49
       <tr *ngFor="let data of listOfDataEnd">
60
-        <td style="width: 12%">{{ data.date }}</td>
61
-        <td style="width: 11%">{{ data.totalCount }}</td>
62
-        <td style="width: 11%">{{ data.totalGrade }}</td>
63
-        <td style="width: 11%">{{ data.response_time_num }}</td>
64
-        <td style="width: 11%">{{ data.execution_time_num }}</td>
65
-        <td style="width: 11%">{{ data.aveper }}</td>
66
-        <td style="width: 11%">{{ data.total_time }}</td>
67
-        <td style="width: 11%">{{ data.five_count }}</td>
68
-        <td style="width: 11%">{{ data.special_close }}</td>
50
+        <td style="width: 20%">{{ data.date }}</td>
51
+        <td style="width: 20%">{{ data.intoCount }}</td>
52
+        <td style="width: 20%">{{ data.intoTime }}</td>
53
+        <td style="width: 20%">{{ data.outCount }}</td>
54
+        <td style="width: 20%">{{ data.outTime }}</td>
69 55
       </tr>
70 56
     </table>
71 57
   </ng-template>

+ 51 - 26
src/app/views/new-statistics/phone-statistics/date-phone-statistics/date-phone-statistics.component.ts

@@ -1,4 +1,6 @@
1 1
 import { TabService } from './../../services/tab.service';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { Subject } from 'rxjs';
2 4
 import { NzMessageService } from 'ng-zorro-antd/message';
3 5
 import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
4 6
 import { MainService } from 'src/app/services/main.service';
@@ -24,9 +26,16 @@ export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
24 26
   pageSize: number = 30; //表格每页展示条数
25 27
   listLength: number = 0; //表格总数据量
26 28
 
27
-  statisticsTypeId;//统计分类id
29
+  deptId;//科室id
28 30
 
29
-  ngOnInit() {}
31
+  searchTimerSubject = new Subject();
32
+
33
+  ngOnInit() {
34
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
35
+      let fun = v[0];
36
+      fun.call(this, v[1]);
37
+    });
38
+  }
30 39
 
31 40
   ngAfterViewInit(){
32 41
     this.initSessionData();
@@ -56,7 +65,7 @@ export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
56 65
   }
57 66
 
58 67
   get getMoreFilter(){
59
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO;
68
+    let flag = this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.deptTypeDTO;
60 69
     return flag ? 37 : 0;
61 70
   }
62 71
 
@@ -108,22 +117,21 @@ export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
108 117
     let postData:any = {
109 118
       idx: this.pageIndex - 1,
110 119
       sum: this.pageSize,
120
+      dateType: this.customChangeDateComponent.dateType,
111 121
       startDate: this.customChangeDateComponent.startDate || undefined,
112 122
       endDate: this.customChangeDateComponent.endDate || undefined,
113 123
       hosId: this.getHosId,
114
-      statisticsTypeId: this.statisticsTypeId || undefined,
115
-      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
116
-      userId: this.fieldConfig.fields.userId || undefined,
117
-      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
124
+      deptId: this.deptId || undefined,
118 125
       buildingId: this.fieldConfig.fields.buildingId || undefined,
119
-      deptId: this.fieldConfig.fields.deptId || undefined,
126
+      placeId: this.fieldConfig.fields.floorId || undefined,
127
+      deptTypeId: this.fieldConfig.fields.deptTypeId || undefined,
120 128
     };
121 129
     if (field && sort) {
122 130
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
123 131
     }
124 132
     this.loading1 = true;
125 133
     this.mainService
126
-      .postCustom("itsm/report", "dateTransOrderQc", postData)
134
+      .postCustom("itsm/report", "phoneDate", postData)
127 135
       .subscribe((result) => {
128 136
         this.loading1 = false;
129 137
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -158,21 +166,20 @@ export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
158 166
       nzDuration: 0,
159 167
     }).messageId;
160 168
     let postData:any = {
169
+      dateType: this.customChangeDateComponent.dateType,
161 170
       startDate: this.customChangeDateComponent.startDate || undefined,
162 171
       endDate: this.customChangeDateComponent.endDate || undefined,
163 172
       hosId: this.getHosId,
164
-      statisticsTypeId: this.statisticsTypeId || undefined,
165
-      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
166
-      userId: this.fieldConfig.fields.userId || undefined,
167
-      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
173
+      deptId: this.deptId || undefined,
168 174
       buildingId: this.fieldConfig.fields.buildingId || undefined,
169
-      deptId: this.fieldConfig.fields.deptId || undefined,
175
+      placeId: this.fieldConfig.fields.floorId || undefined,
176
+      deptTypeId: this.fieldConfig.fields.deptTypeId || undefined,
170 177
     };
171 178
     if (this.sortCurrentKey && this.sortCurrentValue) {
172 179
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
173 180
     }
174 181
     this.mainService
175
-      .postExportCustom("itsm/exportMergeTitle", "dateTransOrderQc", postData)
182
+      .postExportCustom("itsm/export", "phoneDate", postData)
176 183
       .subscribe((data) => {
177 184
         this.message.remove(this.excelExportLoading);
178 185
         this.excelExportLoading = false;
@@ -200,35 +207,53 @@ export class DatePhoneStatisticsComponent implements OnInit, AfterViewInit {
200 207
 		this.sortCurrentValue = "";
201 208
 		this.sortCurrent = {};
202 209
     this.dateRange = []
203
-    this.statisticsTypeId = undefined;
204
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined};
210
+    this.deptId = undefined;
211
+    this.fieldConfig.fields = {buildingId: undefined, floorId: undefined, deptTypeId: undefined};
205 212
     this.customChangeDateComponent.resetByDate();
206 213
     this.search();
207 214
   }
208 215
 
216
+  // 科室搜索
217
+  changeDeptInp(e) {
218
+    this.searchTimer(this.getDeptList, e);
219
+  }
220
+
209 221
   // 防抖
210 222
   isLoading = false;
223
+  searchTimer(fun, e) {
224
+    this.isLoading = true;
225
+    this.searchTimerSubject.next([fun, e]);
226
+  }
211 227
 
212
-  openChangeStatisticsType(flag){
213
-    flag && this.getStatisticsTypeList();
228
+  openChangeDept(flag){
229
+    flag && this.getDeptList();
214 230
   }
215 231
 
216
-  // 获取统计分类列表
217
-  statisticsTypeList:any[] = [];
218
-  getStatisticsTypeList(keyword?) {
232
+  // 获取科室列表
233
+  deptList:any[] = [];
234
+  getDeptList(keyword?) {
235
+    let data = {
236
+      department: {
237
+        statisticalHosId: this.getHosId,
238
+        dept: keyword,
239
+        searchType: 1,
240
+      },
241
+      idx: 0,
242
+      sum: 20,
243
+    };
219 244
     this.isLoading = true;
220 245
     this.mainService
221
-      .getDictionary("list", "statistics_date_type")
246
+      .getFetchDataList("data", "department", data)
222 247
       .subscribe((data) => {
223 248
         this.isLoading = false;
224
-        this.statisticsTypeList = data;
249
+        this.deptList = data.list;
225 250
       });
226 251
   }
227 252
 
228 253
   // 详细搜索
229 254
   fieldConfig:any = {
230
-    fields: {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined},
231
-    config: {groupAndUser: true, taskType: true, building: true, dept: true},
255
+    fields: {buildingId: undefined, floorId: undefined, deptTypeId: undefined},
256
+    config: {buildingAndFloor: true, deptType: true},
232 257
   }
233 258
   showSearchMore:boolean = false;
234 259
   showMore(){

+ 26 - 41
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.html

@@ -1,15 +1,11 @@
1 1
 <div class="searchDataWrap">
2 2
   <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
3 4
     <div class="searchDataItem">
4
-      <span class="label">建单时间</span>:
5
-      <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
-      </nz-range-picker>
7
-    </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">统计分类</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzAllowClear nzPlaceHolder="请选择统计分类" [(ngModel)]="statisticsTypeId" (nzOpenChange)="openChangeStatisticsType($event)">
11
-        <ng-container *ngFor="let option of statisticsTypeList">
12
-          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
5
+      <span class="label">科室</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeDeptInp($event)" nzAllowClear nzPlaceHolder="请选择科室" [(ngModel)]="deptId" (nzOpenChange)="openChangeDept($event)">
7
+        <ng-container *ngFor="let option of deptList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
13 9
         </ng-container>
14 10
         <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15 11
           <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -24,52 +20,41 @@
24 20
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 21
   </div>
26 22
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptDTO">
28
-  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
-  <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
-  <span>{{fieldConfig.fields.taskTypeDTO?.taskName}}</span>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.taskTypeDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.deptTypeDTO">
31 24
   <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
32
-  <span>{{fieldConfig.fields.deptDTO?.dept}}</span>
25
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
26
+  <span>{{fieldConfig.fields.deptTypeDTO?.name}}</span>
33 27
 </div>
34 28
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
35 29
   <thead (nzSortChange)="sort($event)" nzSingleSort>
36 30
     <tr>
37
-      <th nzWidth="12%" nzShowSort nzSortKey="date" [(nzSort)]="sortCurrent.date">日期</th>
38
-      <th nzWidth="11%" nzShowSort nzSortKey="totalCount" [(nzSort)]="sortCurrent.totalCount">工单数量</th>
39
-      <th nzWidth="11%" nzShowSort nzSortKey="totalGrade" [(nzSort)]="sortCurrent.totalGrade">总积分</th>
40
-      <th nzWidth="11%" nzShowSort nzSortKey="response_time_num" [(nzSort)]="sortCurrent.response_time_num">平均响应时间</th>
41
-      <th nzWidth="11%" nzShowSort nzSortKey="execution_time_num" [(nzSort)]="sortCurrent.execution_time_num">平均送达时间</th>
42
-      <th nzWidth="11%" nzShowSort nzSortKey="aveper" [(nzSort)]="sortCurrent.aveper">按时完成达标率</th>
43
-      <th nzWidth="11%" nzShowSort nzSortKey="total_time" [(nzSort)]="sortCurrent.total_time">平均总时间</th>
44
-      <th nzWidth="11%" nzShowSort nzSortKey="five_count" [(nzSort)]="sortCurrent.five_count">五分钟内工单</th>
45
-      <th nzWidth="11%" nzShowSort nzSortKey="special_close" [(nzSort)]="sortCurrent.special_close">特殊关闭数</th>
31
+      <th nzWidth="20%" nzShowSort nzSortKey="orders" [(nzSort)]="sortCurrent.orders">科室名称(编码)</th>
32
+      <th nzWidth="16%">号码</th>
33
+      <th nzWidth="16%" nzShowSort nzSortKey="intoCount" [(nzSort)]="sortCurrent.intoCount">来电量</th>
34
+      <th nzWidth="16%" nzShowSort nzSortKey="intoTime" [(nzSort)]="sortCurrent.intoTime">来电时长</th>
35
+      <th nzWidth="16%" nzShowSort nzSortKey="outCount" [(nzSort)]="sortCurrent.outCount">去电量</th>
36
+      <th nzWidth="16%" nzShowSort nzSortKey="outTime" [(nzSort)]="sortCurrent.outTime">去电时长</th>
46 37
     </tr>
47 38
   </thead>
48 39
   <tbody>
49 40
     <tr *ngFor="let data of listOfData">
50
-      <td>{{ data.date }}</td>
51
-      <td>{{ data.totalCount }}</td>
52
-      <td>{{ data.totalGrade }}</td>
53
-      <td>{{ data.response_time_num }}</td>
54
-      <td>{{ data.execution_time_num }}</td>
55
-      <td>{{ data.aveper }}</td>
56
-      <td>{{ data.total_time }}</td>
57
-      <td>{{ data.five_count }}</td>
58
-      <td>{{ data.special_close }}</td>
41
+      <td>{{ data.deptName }}<ng-container *ngIf="data.deptCode">({{ data.deptCode }})</ng-container></td>
42
+      <td>{{ data.deptPhone }}</td>
43
+      <td>{{ data.intoCount }}</td>
44
+      <td>{{ data.intoTime }}</td>
45
+      <td>{{ data.outCount }}</td>
46
+      <td>{{ data.outTime }}</td>
59 47
     </tr>
60 48
   </tbody>
61 49
   <ng-template #footerTpl>
62 50
     <table class="footTable">
63 51
       <tr *ngFor="let data of listOfDataEnd">
64
-        <td style="width: 12%">{{ data.date }}</td>
65
-        <td style="width: 11%">{{ data.totalCount }}</td>
66
-        <td style="width: 11%">{{ data.totalGrade }}</td>
67
-        <td style="width: 11%">{{ data.response_time_num }}</td>
68
-        <td style="width: 11%">{{ data.execution_time_num }}</td>
69
-        <td style="width: 11%">{{ data.aveper }}</td>
70
-        <td style="width: 11%">{{ data.total_time }}</td>
71
-        <td style="width: 11%">{{ data.five_count }}</td>
72
-        <td style="width: 11%">{{ data.special_close }}</td>
52
+        <td style="width: 20%">{{ data.deptCode }}</td>
53
+        <td style="width: 16%">{{ data.deptPhone }}</td>
54
+        <td style="width: 16%">{{ data.intoCount }}</td>
55
+        <td style="width: 16%">{{ data.intoTime }}</td>
56
+        <td style="width: 16%">{{ data.outCount }}</td>
57
+        <td style="width: 16%">{{ data.outTime }}</td>
73 58
       </tr>
74 59
     </table>
75 60
   </ng-template>

+ 2 - 2
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.less

@@ -27,7 +27,7 @@
27 27
           font-size: 16px;
28 28
         }
29 29
         .selectItem{
30
-          width: 224px;
30
+          width: 160px;
31 31
         }
32 32
       }
33 33
     }
@@ -68,4 +68,4 @@
68 68
     justify-content: flex-end;
69 69
     align-items: center;
70 70
   }
71
-}
71
+}

+ 63 - 48
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.component.ts

@@ -1,15 +1,18 @@
1 1
 import { TabService } from './../../services/tab.service';
2
+import { debounceTime } from 'rxjs/operators';
3
+import { Subject } from 'rxjs';
2 4
 import { NzMessageService } from 'ng-zorro-antd/message';
3
-import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
4
-import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
5
+import { Component, OnInit, HostListener, AfterViewInit, ViewChild } from "@angular/core";
5 6
 import { MainService } from 'src/app/services/main.service';
6 7
 import { ActivatedRoute } from '@angular/router';
8
+import { CustomChangeDateComponent } from '../../components/custom-change-date/custom-change-date.component';
7 9
 @Component({
8 10
   selector: "app-department-phone-statistics",
9 11
   templateUrl: "./department-phone-statistics.component.html",
10 12
   styleUrls: ["./department-phone-statistics.component.less"],
11 13
 })
12 14
 export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit {
15
+  @ViewChild('customChangeDate', { static: false }) customChangeDateComponent!: CustomChangeDateComponent;
13 16
   constructor(
14 17
     private mainService: MainService,
15 18
     private message: NzMessageService,
@@ -23,15 +26,23 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
23 26
   pageSize: number = 30; //表格每页展示条数
24 27
   listLength: number = 0; //表格总数据量
25 28
 
26
-  statisticsTypeId;//统计分类id
29
+  deptId;//科室id
30
+
31
+  searchTimerSubject = new Subject();
27 32
 
28 33
   ngOnInit() {
29
-    this.initSessionData();
30
-    this.getQueryParams();
31
-    this.search();
34
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
35
+      let fun = v[0];
36
+      fun.call(this, v[1]);
37
+    });
32 38
   }
33 39
 
34 40
   ngAfterViewInit(){
41
+    this.initSessionData();
42
+    this.getQueryParams();
43
+    setTimeout(() => {
44
+      this.search();
45
+    }, 0)
35 46
     this.onResize();
36 47
   }
37 48
 
@@ -49,11 +60,12 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
49 60
     this.tabService.clearQueryParams();
50 61
     if(queryParams.dateRange){
51 62
       this.dateRange = queryParams.dateRange;
63
+      this.customChangeDateComponent.initByDate(this.dateRange);
52 64
     }
53 65
   }
54 66
 
55 67
   get getMoreFilter(){
56
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.taskTypeDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.deptDTO;
68
+    let flag = this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.deptTypeDTO;
57 69
     return flag ? 37 : 0;
58 70
   }
59 71
 
@@ -105,22 +117,20 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
105 117
     let postData:any = {
106 118
       idx: this.pageIndex - 1,
107 119
       sum: this.pageSize,
108
-      startDate: this.dateRange[0] || undefined,
109
-      endDate: this.dateRange[1] || undefined,
120
+      startDate: this.customChangeDateComponent.startDate || undefined,
121
+      endDate: this.customChangeDateComponent.endDate || undefined,
110 122
       hosId: this.getHosId,
111
-      statisticsTypeId: this.statisticsTypeId || undefined,
112
-      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
113
-      userId: this.fieldConfig.fields.userId || undefined,
114
-      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
123
+      deptId: this.deptId || undefined,
115 124
       buildingId: this.fieldConfig.fields.buildingId || undefined,
116
-      deptId: this.fieldConfig.fields.deptId || undefined,
125
+      placeId: this.fieldConfig.fields.floorId || undefined,
126
+      deptTypeId: this.fieldConfig.fields.deptTypeId || undefined,
117 127
     };
118 128
     if (field && sort) {
119 129
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
120 130
     }
121 131
     this.loading1 = true;
122 132
     this.mainService
123
-      .postCustom("itsm/report", "dateTransOrderQc", postData)
133
+      .postCustom("itsm/report", "phoneDept", postData)
124 134
       .subscribe((result) => {
125 135
         this.loading1 = false;
126 136
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -146,19 +156,7 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
146 156
   }
147 157
 
148 158
   // 日期选择
149
-  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')];
150
-  changeDate(result?): void {
151
-    result[0] = format(startOfDay(result[0]), 'yyyy-MM-dd HH:mm:ss');
152
-    result[1] = format(endOfDay(result[1]), 'yyyy-MM-dd HH:mm:ss');
153
-    this.dateRange = result;
154
-  }
155
-
156
-  onCalendarChangeDate(dateArr){
157
-    console.log(dateArr)
158
-    if(dateArr.length == 2){
159
-      this.dateRange = [format(startOfDay(dateArr[0]), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(dateArr[1]), 'yyyy-MM-dd HH:mm:ss')];
160
-    }
161
-  }
159
+  dateRange: any = [];
162 160
 
163 161
   // 导出
164 162
   excelExportLoading:any = false;
@@ -167,21 +165,19 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
167 165
       nzDuration: 0,
168 166
     }).messageId;
169 167
     let postData:any = {
170
-      startDate: this.dateRange[0] || undefined,
171
-      endDate: this.dateRange[1] || undefined,
168
+      startDate: this.customChangeDateComponent.startDate || undefined,
169
+      endDate: this.customChangeDateComponent.endDate || undefined,
172 170
       hosId: this.getHosId,
173
-      statisticsTypeId: this.statisticsTypeId || undefined,
174
-      groupId: this.fieldConfig.fields.userId ? undefined : (this.fieldConfig.fields.groupId || undefined),
175
-      userId: this.fieldConfig.fields.userId || undefined,
176
-      taskTypeId: this.fieldConfig.fields.taskTypeId || undefined,
171
+      deptId: this.deptId || undefined,
177 172
       buildingId: this.fieldConfig.fields.buildingId || undefined,
178
-      deptId: this.fieldConfig.fields.deptId || undefined,
173
+      placeId: this.fieldConfig.fields.floorId || undefined,
174
+      deptTypeId: this.fieldConfig.fields.deptTypeId || undefined,
179 175
     };
180 176
     if (this.sortCurrentKey && this.sortCurrentValue) {
181 177
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
182 178
     }
183 179
     this.mainService
184
-      .postExportCustom("itsm/exportMergeTitle", "dateTransOrderQc", postData)
180
+      .postExportCustom("itsm/export", "phoneDept", postData)
185 181
       .subscribe((data) => {
186 182
         this.message.remove(this.excelExportLoading);
187 183
         this.excelExportLoading = false;
@@ -208,35 +204,54 @@ export class DepartmentPhoneStatisticsComponent implements OnInit, AfterViewInit
208 204
     this.sortCurrentKey = "";
209 205
 		this.sortCurrentValue = "";
210 206
 		this.sortCurrent = {};
211
-    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')]
212
-    this.statisticsTypeId = undefined;
213
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined};
207
+    this.dateRange = []
208
+    this.deptId = undefined;
209
+    this.fieldConfig.fields = {buildingId: undefined, floorId: undefined, deptTypeId: undefined};
210
+    this.customChangeDateComponent.resetByDate();
214 211
     this.search();
215 212
   }
216 213
 
214
+  // 科室搜索
215
+  changeDeptInp(e) {
216
+    this.searchTimer(this.getDeptList, e);
217
+  }
218
+
217 219
   // 防抖
218 220
   isLoading = false;
221
+  searchTimer(fun, e) {
222
+    this.isLoading = true;
223
+    this.searchTimerSubject.next([fun, e]);
224
+  }
219 225
 
220
-  openChangeStatisticsType(flag){
221
-    flag && this.getStatisticsTypeList();
226
+  openChangeDept(flag){
227
+    flag && this.getDeptList();
222 228
   }
223 229
 
224
-  // 获取统计分类列表
225
-  statisticsTypeList:any[] = [];
226
-  getStatisticsTypeList(keyword?) {
230
+  // 获取科室列表
231
+  deptList:any[] = [];
232
+  getDeptList(keyword?) {
233
+    let data = {
234
+      department: {
235
+        statisticalHosId: this.getHosId,
236
+        dept: keyword,
237
+        searchType: 1,
238
+      },
239
+      idx: 0,
240
+      sum: 20,
241
+    };
227 242
     this.isLoading = true;
228 243
     this.mainService
229
-      .getDictionary("list", "statistics_date_type")
244
+      .getFetchDataList("data", "department", data)
230 245
       .subscribe((data) => {
231 246
         this.isLoading = false;
232
-        this.statisticsTypeList = data;
247
+        this.deptList = data.list;
233 248
       });
234 249
   }
235 250
 
236 251
   // 详细搜索
237 252
   fieldConfig:any = {
238
-    fields: {groupId: undefined, userId: undefined, taskTypeId: undefined, buildingId: undefined, deptId: undefined},
239
-    config: {groupAndUser: true, taskType: true, building: true, dept: true},
253
+    fields: {buildingId: undefined, floorId: undefined, deptTypeId: undefined},
254
+    config: {buildingAndFloor: true, deptType: true},
240 255
   }
241 256
   showSearchMore:boolean = false;
242 257
   showMore(){

+ 4 - 0
src/app/views/new-statistics/phone-statistics/department-phone-statistics/department-phone-statistics.module.ts

@@ -4,7 +4,9 @@ import { CommonModule } from '@angular/common';
4 4
 
5 5
 import { DepartmentPhoneStatisticsRoutingModule } from './department-phone-statistics-routing.module';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7
+import { VirtualScrollerModule } from 'ngx-virtual-scroller';
7 8
 import { PhoneSearchMoreModule } from '../../components/phone-search-more/phone-search-more.module';
9
+import { CustomChangeDateModule } from '../../components/custom-change-date/custom-change-date.module';
8 10
 
9 11
 
10 12
 @NgModule({
@@ -15,7 +17,9 @@ import { PhoneSearchMoreModule } from '../../components/phone-search-more/phone-
15 17
     CommonModule,
16 18
     DepartmentPhoneStatisticsRoutingModule,
17 19
     ShareModule,
20
+    VirtualScrollerModule,
18 21
     PhoneSearchMoreModule,
22
+    CustomChangeDateModule,
19 23
   ]
20 24
 })
21 25
 export class DepartmentPhoneStatisticsModule { }