seimin 1 月之前
父节点
当前提交
77f3f3c283
共有 23 个文件被更改,包括 610 次插入521 次删除
  1. 60 4
      src/app/views/new-statistics/components/search-more/search-more.component.html
  2. 0 1
      src/app/views/new-statistics/components/search-more/search-more.component.less
  3. 170 6
      src/app/views/new-statistics/components/search-more/search-more.component.ts
  4. 1 1
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts
  5. 8 19
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.html
  6. 31 74
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts
  7. 1 1
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts
  8. 26 17
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.html
  9. 98 49
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts
  10. 16 17
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.html
  11. 51 47
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts
  12. 1 1
      src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts
  13. 1 1
      src/app/views/new-statistics/maintenance-statistics/department-incident-statistics/department-incident-statistics.component.ts
  14. 1 1
      src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts
  15. 1 1
      src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts
  16. 6 18
      src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.html
  17. 23 76
      src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts
  18. 7 7
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.html
  19. 23 23
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts
  20. 6 18
      src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.html
  21. 23 76
      src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts
  22. 15 16
      src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.html
  23. 41 47
      src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts

+ 60 - 4
src/app/views/new-statistics/components/search-more/search-more.component.html

@@ -5,9 +5,9 @@
5
     <div class="content">
5
     <div class="content">
6
       <form nz-form [formGroup]="validateForm" class="addForm">
6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
7
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8
-          <nz-form-label [nzSpan]="6" nzFor="groupId">维&nbsp;&nbsp;修&nbsp;&nbsp;组</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)">
8
+          <nz-form-label [nzSpan]="6" nzFor="groupId">维修分组</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">
11
               <ng-container *ngFor="let option of groupList">
12
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
12
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
13
               </ng-container>
13
               </ng-container>
@@ -19,7 +19,7 @@
19
         </nz-form-item>
19
         </nz-form-item>
20
 
20
 
21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
22
-          <nz-form-label [nzSpan]="6" nzFor="groupId">维修人员</nz-form-label>
22
+          <nz-form-label [nzSpan]="6" nzFor="userId">维修人员</nz-form-label>
23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修人员!">
23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修人员!">
24
             <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择维修人员" (nzOpenChange)="openChangeUser($event)">
24
             <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择维修人员" (nzOpenChange)="openChangeUser($event)">
25
               <ng-container *ngFor="let option of userList">
25
               <ng-container *ngFor="let option of userList">
@@ -87,6 +87,62 @@
87
             </nz-select>
87
             </nz-select>
88
           </nz-form-control>
88
           </nz-form-control>
89
         </nz-form-item>
89
         </nz-form-item>
90
+
91
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
92
+          <nz-form-label [nzSpan]="6" nzFor="buildingId">楼<span style="visibility: hidden;">囧囧</span>栋</nz-form-label>
93
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼栋!">
94
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeBuildingInp($event)" formControlName="buildingId" nzPlaceHolder="请选择楼栋" (nzOpenChange)="openChangeBuilding($event)" (ngModelChange)="changeBuilding($event)">
95
+              <ng-container *ngFor="let option of buildingList">
96
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
97
+              </ng-container>
98
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
99
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
100
+              </nz-option>
101
+            </nz-select>
102
+          </nz-form-control>
103
+        </nz-form-item>
104
+
105
+        <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
106
+          <nz-form-label [nzSpan]="6" nzFor="floorId">楼<span style="visibility: hidden;">囧囧</span>层</nz-form-label>
107
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼层!">
108
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeFloorInp($event)" formControlName="floorId" nzPlaceHolder="请选择楼层" (nzOpenChange)="openChangeFloor($event)">
109
+              <ng-container *ngFor="let option of floorList">
110
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
111
+              </ng-container>
112
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
113
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
114
+              </nz-option>
115
+            </nz-select>
116
+          </nz-form-control>
117
+        </nz-form-item>
118
+
119
+        <nz-form-item [hidden]="!fieldConfig.config.company">
120
+          <nz-form-label [nzSpan]="6" nzFor="companyId">三方公司</nz-form-label>
121
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择三方公司!">
122
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeCompanyInp($event)" formControlName="companyId" nzPlaceHolder="请选择三方公司" (nzOpenChange)="openChangeCompany($event)">
123
+              <ng-container *ngFor="let option of companyList">
124
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
125
+              </ng-container>
126
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
127
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
128
+              </nz-option>
129
+            </nz-select>
130
+          </nz-form-control>
131
+        </nz-form-item>
132
+
133
+        <nz-form-item [hidden]="!fieldConfig.config.repairDept">
134
+          <nz-form-label [nzSpan]="6" nzFor="repairDeptId">报修科室</nz-form-label>
135
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择报修科室!">
136
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" formControlName="repairDeptId" nzPlaceHolder="请选择报修科室" (nzOpenChange)="openChangeRepairDept($event)">
137
+              <ng-container *ngFor="let option of repairDeptList">
138
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
139
+              </ng-container>
140
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
141
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
142
+              </nz-option>
143
+            </nz-select>
144
+          </nz-form-control>
145
+        </nz-form-item>
90
       </form>
146
       </form>
91
     </div>
147
     </div>
92
     <div class="display_flex justify-content_flex-center">
148
     <div class="display_flex justify-content_flex-center">

+ 0 - 1
src/app/views/new-statistics/components/search-more/search-more.component.less

@@ -87,7 +87,6 @@
87
 
87
 
88
       .content {
88
       .content {
89
         width: 100%;
89
         width: 100%;
90
-        min-height: 166px;
91
         padding: 10px 24px 0;
90
         padding: 10px 24px 0;
92
         height: auto;
91
         height: auto;
93
         overflow-y: auto;
92
         overflow-y: auto;

+ 170 - 6
src/app/views/new-statistics/components/search-more/search-more.component.ts

@@ -47,6 +47,10 @@ export class SearchMoreComponent implements OnInit {
47
     this.category2List = this.fieldConfig.fields.category2DTO ? [this.fieldConfig.fields.category2DTO] : [];
47
     this.category2List = this.fieldConfig.fields.category2DTO ? [this.fieldConfig.fields.category2DTO] : [];
48
     this.category3List = this.fieldConfig.fields.category3DTO ? [this.fieldConfig.fields.category3DTO] : [];
48
     this.category3List = this.fieldConfig.fields.category3DTO ? [this.fieldConfig.fields.category3DTO] : [];
49
     this.sourceList = this.fieldConfig.fields.sourceDTO ? [this.fieldConfig.fields.sourceDTO] : [];
49
     this.sourceList = this.fieldConfig.fields.sourceDTO ? [this.fieldConfig.fields.sourceDTO] : [];
50
+    this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
51
+    this.floorList = this.fieldConfig.fields.floorDTO ? [this.fieldConfig.fields.floorDTO] : [];
52
+    this.companyList = this.fieldConfig.fields.companyDTO ? [this.fieldConfig.fields.companyDTO] : [];
53
+    this.repairDeptList = this.fieldConfig.fields.repairDeptDTO ? [this.fieldConfig.fields.repairDeptDTO] : [];
50
 
54
 
51
     this.validateForm = this.fb.group({
55
     this.validateForm = this.fb.group({
52
       groupId: [this.fieldConfig.fields.groupId || null],
56
       groupId: [this.fieldConfig.fields.groupId || null],
@@ -55,6 +59,10 @@ export class SearchMoreComponent implements OnInit {
55
       category2Id: [this.fieldConfig.fields.category2DTO ? this.fieldConfig.fields.category2DTO.id  : null],
59
       category2Id: [this.fieldConfig.fields.category2DTO ? this.fieldConfig.fields.category2DTO.id  : null],
56
       category3Id: [this.fieldConfig.fields.category3DTO ? this.fieldConfig.fields.category3DTO.id  : null],
60
       category3Id: [this.fieldConfig.fields.category3DTO ? this.fieldConfig.fields.category3DTO.id  : null],
57
       sourceId: [this.fieldConfig.fields.sourceId || null],
61
       sourceId: [this.fieldConfig.fields.sourceId || null],
62
+      buildingId: [this.fieldConfig.fields.buildingId || null],
63
+      floorId: [this.fieldConfig.fields.floorId === undefined ? null : this.fieldConfig.fields.floorId],
64
+      companyId: [this.fieldConfig.fields.companyDTO ? this.fieldConfig.fields.companyDTO.id  : null],
65
+      repairDeptId: [this.fieldConfig.fields.repairDeptDTO ? this.fieldConfig.fields.repairDeptDTO.id  : null],
58
     });
66
     });
59
   }
67
   }
60
   // 表单提交
68
   // 表单提交
@@ -94,6 +102,18 @@ export class SearchMoreComponent implements OnInit {
94
       fields.sourceId = this.validateForm.value.sourceId;
102
       fields.sourceId = this.validateForm.value.sourceId;
95
       fields.sourceDTO = this.sourceList.find(item => item.id == this.validateForm.value.sourceId);
103
       fields.sourceDTO = this.sourceList.find(item => item.id == this.validateForm.value.sourceId);
96
     }
104
     }
105
+    if(this.fieldConfig.config.buildingAndFloor){
106
+      fields.buildingId = this.validateForm.value.buildingId;
107
+      fields.buildingDTO = this.buildingList.find(item => item.id == this.validateForm.value.buildingId);
108
+      fields.floorId = this.validateForm.value.floorId;
109
+      fields.floorDTO = this.floorList.find(item => item.id == this.validateForm.value.floorId);
110
+    }
111
+    if(this.fieldConfig.config.company){
112
+      fields.companyDTO = this.companyList.find(item => item.id == this.validateForm.value.companyId);
113
+    }
114
+    if(this.fieldConfig.config.repairDept){
115
+      fields.repairDeptDTO = this.repairDeptList.find(item => item.id == this.validateForm.value.repairDeptId);
116
+    }
97
     this.submitEvent.emit(fields);
117
     this.submitEvent.emit(fields);
98
     this.hideModal();
118
     this.hideModal();
99
   }
119
   }
@@ -109,14 +129,14 @@ export class SearchMoreComponent implements OnInit {
109
     this.searchTimerSubject.next([fun, e]);
129
     this.searchTimerSubject.next([fun, e]);
110
   }
130
   }
111
 
131
 
112
-  // =================维修组===================
132
+  // =================维修组===================
113
 
133
 
114
-  // 维修组搜索
134
+  // 维修组搜索
115
   changeGroupInp(e) {
135
   changeGroupInp(e) {
116
     this.searchTimer(this.getGroupList, e);
136
     this.searchTimer(this.getGroupList, e);
117
   }
137
   }
118
 
138
 
119
-  // 获取维修组列表
139
+  // 获取维修组列表
120
   groupList:any[] = [];
140
   groupList:any[] = [];
121
   getGroupList(keyword?){
141
   getGroupList(keyword?){
122
     let postData: any = {
142
     let postData: any = {
@@ -167,9 +187,11 @@ export class SearchMoreComponent implements OnInit {
167
       idx: 0,
187
       idx: 0,
168
       sum: 20,
188
       sum: 20,
169
       user: {
189
       user: {
170
-        hospitals: this.getHosId,
171
-        groupName: keyword,
172
-        type: 3,
190
+        name: keyword,
191
+        simpleQuery: true,
192
+        groupdata: { id: groupId },
193
+        roleCodes: 'first-line support,second-line support,incident manager',
194
+        engineer: 1,
173
       },
195
       },
174
     };
196
     };
175
     this.isLoading = true;
197
     this.isLoading = true;
@@ -315,4 +337,146 @@ export class SearchMoreComponent implements OnInit {
315
       this.sourceList = result;
337
       this.sourceList = result;
316
     });
338
     });
317
   }
339
   }
340
+
341
+  // =================楼栋===================
342
+
343
+  // 楼栋搜索
344
+  changeBuildingInp(e) {
345
+    this.searchTimer(this.getBuildingList, e);
346
+  }
347
+
348
+  // 获取楼栋列表
349
+  buildingList:any[] = [];
350
+  getBuildingList(keyword?){
351
+    let postData: any = {
352
+      idx: 0,
353
+      sum: 20,
354
+      building: {
355
+        simpleQuery: true,
356
+        buildingName: keyword,
357
+        cascadeHosId:this.getHosId,
358
+      },
359
+    };
360
+    this.isLoading = true;
361
+    this.mainService.getFetchDataList("simple/data", "building", postData).subscribe(result => {
362
+      this.isLoading = false;
363
+      if(result.status == 200){
364
+        this.buildingList = result.list || [];
365
+      }else{
366
+        this.buildingList = [];
367
+      }
368
+    });
369
+  }
370
+  openChangeBuilding(flag){
371
+    flag && this.getBuildingList();
372
+  }
373
+
374
+  changeBuilding(id){
375
+    this.floorList = [];
376
+    this.validateForm.controls.floorId.setValue(null);
377
+    this.getFloorList('', id);
378
+  }
379
+
380
+  // =================楼层===================
381
+
382
+  // 楼层搜索
383
+  changeFloorInp(e) {
384
+    this.searchTimer(this.getFloorList, e);
385
+  }
386
+
387
+  // 获取楼层列表
388
+  floorList:any[] = [];
389
+  getFloorList(keyword = '', buildingId = ''){
390
+    if(!buildingId){
391
+      this.isLoading = false;
392
+      this.floorList = [];
393
+      return;
394
+    }
395
+    let postData: any = {
396
+      idx: 0,
397
+      sum: 20,
398
+      floor: {
399
+        floorName: keyword,
400
+        buildId : buildingId,
401
+      },
402
+    };
403
+    this.isLoading = true;
404
+    this.mainService.getFetchDataList("simple/data", "floor", postData).subscribe(result => {
405
+      this.isLoading = false;
406
+      if(result.status == 200){
407
+        this.floorList = result.list || [];
408
+      }else{
409
+        this.floorList = [];
410
+      }
411
+    });
412
+  }
413
+  openChangeFloor(flag){
414
+    flag && this.getFloorList('', this.validateForm.value.buildingId);
415
+  }
416
+
417
+  // =================三方公司===================
418
+
419
+  // 三方公司搜索
420
+  changeCompanyInp(e) {
421
+    this.searchTimer(this.getCompanyList, e);
422
+  }
423
+
424
+  // 获取三方公司列表
425
+  companyList:any[] = [];
426
+  getCompanyList(keyword?){
427
+    let postData: any = {
428
+      idx: 0,
429
+      sum: 20,
430
+      company: {
431
+        busiType: { key: "company_busi_type", value: "2" },
432
+        name: keyword,
433
+        hosId: this.getHosId,
434
+      },
435
+    };
436
+    this.isLoading = true;
437
+    this.mainService.getFetchDataList("simple/data", "company", postData).subscribe(result => {
438
+      this.isLoading = false;
439
+      if(result.status == 200){
440
+        this.companyList = result.list || [];
441
+      }else{
442
+        this.companyList = [];
443
+      }
444
+    });
445
+  }
446
+  openChangeCompany(flag){
447
+    flag && this.getCompanyList();
448
+  }
449
+
450
+  // =================报修科室===================
451
+
452
+  // 报修科室搜索
453
+  changeRepairDeptInp(e) {
454
+    this.searchTimer(this.getRepairDeptList, e);
455
+  }
456
+
457
+  // 获取报修科室列表
458
+  repairDeptList:any[] = [];
459
+  getRepairDeptList(keyword?){
460
+    let postData: any = {
461
+      idx: 0,
462
+      sum: 20,
463
+      department: {
464
+        cascadeHosId: this.getHosId,
465
+        dept: keyword,
466
+        searchType: 1,
467
+      },
468
+    };
469
+    this.isLoading = true;
470
+    this.mainService.getFetchDataList("simple/data", "department", postData).subscribe(result => {
471
+      this.isLoading = false;
472
+      if(result.status == 200){
473
+        this.repairDeptList = result.list || [];
474
+      }else{
475
+        this.repairDeptList = [];
476
+      }
477
+    });
478
+  }
479
+  openChangeRepairDept(flag){
480
+    flag && this.getRepairDeptList();
481
+  }
318
 }
482
 }

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts

@@ -129,7 +129,7 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

+ 8 - 19
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.html

@@ -5,17 +5,6 @@
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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
-    </div>
19
   </div>
8
   </div>
20
   <div class="operation">
9
   <div class="operation">
21
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,18 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
14
   </div>
26
 </div>
15
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
16
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.companyDTO || fieldConfig.fields.repairDeptDTO">
28
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
17
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
18
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
-  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
-  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
-  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
19
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
20
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
21
+  <span>{{fieldConfig.fields.companyDTO?.name}}</span>
22
+  <span>{{fieldConfig.fields.repairDeptDTO?.dept}}</span>
34
 </div>
23
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
24
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
25
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
26
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
27
+      <th nzWidth="10%">故障现象</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
28
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
30
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +39,7 @@
50
   </thead>
39
   </thead>
51
   <tbody>
40
   <tbody>
52
     <tr *ngFor="let data of listOfData">
41
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
42
+      <td>{{ data.category }}</td>
54
       <td>{{ data.sum }}</td>
43
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
44
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
45
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +55,7 @@
66
   <ng-template #footerTpl>
55
   <ng-template #footerTpl>
67
     <table class="footTable">
56
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
57
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
58
+        <td style="width: 10%">{{ data.category }}</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
59
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
60
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
61
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

+ 31 - 74
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts

@@ -1,5 +1,3 @@
1
-import { debounceTime } from 'rxjs/operators';
2
-import { Subject } from 'rxjs';
3
 import { NzMessageService } from 'ng-zorro-antd/message';
1
 import { NzMessageService } from 'ng-zorro-antd/message';
4
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
23
   pageSize: number = 30; //表格每页展示条数
21
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
22
   listLength: number = 0; //表格总数据量
25
 
23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30
   ngOnInit() {
24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35
     this.initSessionData();
25
     this.initSessionData();
36
     this.search();
26
     this.search();
37
   }
27
   }
@@ -50,7 +40,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
50
   }
40
   }
51
 
41
 
52
   get getMoreFilter(){
42
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
43
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.companyDTO || this.fieldConfig.fields.repairDeptDTO;
54
     return flag ? 21 : 0;
44
     return flag ? 21 : 0;
55
   }
45
   }
56
 
46
 
@@ -102,24 +92,25 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
92
     let postData:any = {
103
       idx: this.pageIndex - 1,
93
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
94
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
95
+      startDate: this.dateRange[0] || undefined,
96
+      endDate: this.dateRange[1] || undefined,
97
+      hosId: this.hosId || undefined,
98
+      dutyId: this.dutyId || undefined,
99
+      parentDutyId: this.parentDutyId || undefined,
100
+      groupId: this.fieldConfig.fields.groupId || undefined,
101
+      userId: this.fieldConfig.fields.userId || undefined,
102
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
103
+      placeId: this.fieldConfig.fields.floorId || undefined,
104
+      compantId: this.fieldConfig.fields.compantId || undefined,
105
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
106
+      categoryLevel: 1,
116
     };
107
     };
117
     if (field && sort) {
108
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
109
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
110
     }
120
     this.loading1 = true;
111
     this.loading1 = true;
121
     this.mainService
112
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
113
+      .postCustom("itsm/report", "breakdownCategory", postData)
123
       .subscribe((result) => {
114
       .subscribe((result) => {
124
         this.loading1 = false;
115
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
116
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +120,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
129
   }
120
   }
130
 
121
 
131
   // 列表排序
122
   // 列表排序
132
-  sortCurrent = {};
123
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
124
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
125
   sortCurrentValue: string | null = "";
135
   sort(e) {
126
   sort(e) {
@@ -166,23 +157,24 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
157
       nzDuration: 0,
167
     }).messageId;
158
     }).messageId;
168
     let postData:any = {
159
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
160
+      startDate: this.dateRange[0] || undefined,
161
+      endDate: this.dateRange[1] || undefined,
162
+      hosId: this.hosId || undefined,
163
+      dutyId: this.dutyId || undefined,
164
+      parentDutyId: this.parentDutyId || undefined,
165
+      groupId: this.fieldConfig.fields.groupId || undefined,
166
+      userId: this.fieldConfig.fields.userId || undefined,
167
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
168
+      placeId: this.fieldConfig.fields.floorId || undefined,
169
+      compantId: this.fieldConfig.fields.compantId || undefined,
170
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
171
+      categoryLevel: 1,
180
     };
172
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
173
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
174
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
175
     }
184
     this.mainService
176
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
177
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186
       .subscribe((data) => {
178
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
179
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
180
         this.excelExportLoading = false;
@@ -210,52 +202,17 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
210
 		this.sortCurrentValue = "";
202
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
203
 		this.sortCurrent = {};
212
     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')]
204
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
205
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
215
     this.search();
206
     this.search();
216
   }
207
   }
217
 
208
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223
   // 防抖
209
   // 防抖
224
   isLoading = false;
210
   isLoading = false;
225
-  searchTimer(fun, e) {
226
-    this.isLoading = true;
227
-    this.searchTimerSubject.next([fun, e]);
228
-  }
229
-
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
232
-  }
233
-
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
237
-    let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
242
-      },
243
-      idx: 0,
244
-      sum: 20,
245
-    };
246
-    this.isLoading = true;
247
-    this.mainService
248
-      .getFetchDataList("data", "department", data)
249
-      .subscribe((data) => {
250
-        this.isLoading = false;
251
-        this.repairDeptList = data.list;
252
-      });
253
-  }
254
 
211
 
255
   // 详细搜索
212
   // 详细搜索
256
   fieldConfig:any = {
213
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
214
+    fields: {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined},
215
+    config: {groupAndUser: true, buildingAndFloor: true, company: true, repairDept: true},
259
   }
216
   }
260
   showSearchMore:boolean = false;
217
   showSearchMore:boolean = false;
261
   showMore(){
218
   showMore(){

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts

@@ -129,7 +129,7 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

+ 26 - 17
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.html

@@ -6,15 +6,24 @@
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
     <div class="searchDataItem">
8
     <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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>
9
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCategory1Inp($event)" nzAllowClear nzPlaceHolder="请选择一级分类" [(ngModel)]="category1Id" (nzOpenChange)="openChangeCategory1($event)" (ngModelChange)="changeCategory1($event)">
10
+        <ng-container *ngFor="let option of category1List">
11
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
12
+        </ng-container>
13
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
14
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
15
+        </nz-option>
16
+      </nz-select>
17
+    </div>
18
+    <div class="searchDataItem">
19
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCategory2Inp($event)" nzAllowClear nzPlaceHolder="请选择二级分类" [(ngModel)]="category2Id" (nzOpenChange)="openChangeCategory2($event)">
20
+        <ng-container *ngFor="let option of category2List">
21
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
22
+        </ng-container>
23
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
24
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
25
+        </nz-option>
26
+      </nz-select>
18
     </div>
27
     </div>
19
   </div>
28
   </div>
20
   <div class="operation">
29
   <div class="operation">
@@ -24,18 +33,18 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
33
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
34
   </div>
26
 </div>
35
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
36
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.companyDTO || fieldConfig.fields.repairDeptDTO">
28
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
37
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
38
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
-  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
-  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
-  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
39
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
40
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
41
+  <span>{{fieldConfig.fields.companyDTO?.name}}</span>
42
+  <span>{{fieldConfig.fields.repairDeptDTO?.dept}}</span>
34
 </div>
43
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
44
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
45
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
46
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
47
+      <th nzWidth="10%">故障现象</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
48
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
49
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
50
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +59,7 @@
50
   </thead>
59
   </thead>
51
   <tbody>
60
   <tbody>
52
     <tr *ngFor="let data of listOfData">
61
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
62
+      <td>{{ data.category }}</td>
54
       <td>{{ data.sum }}</td>
63
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
64
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
65
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +75,7 @@
66
   <ng-template #footerTpl>
75
   <ng-template #footerTpl>
67
     <table class="footTable">
76
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
77
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
78
+        <td style="width: 10%">{{ data.category }}</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
79
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
80
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
81
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

+ 98 - 49
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts

@@ -23,7 +23,8 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
23
   pageSize: number = 30; //表格每页展示条数
23
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
24
   listLength: number = 0; //表格总数据量
25
 
25
 
26
-  repairDeptId;//报修科室id
26
+  category1Id;//一级分类id
27
+  category2Id;//二级分类id
27
 
28
 
28
   searchTimerSubject = new Subject();
29
   searchTimerSubject = new Subject();
29
 
30
 
@@ -50,7 +51,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
50
   }
51
   }
51
 
52
 
52
   get getMoreFilter(){
53
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
54
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.companyDTO || this.fieldConfig.fields.repairDeptDTO;
54
     return flag ? 21 : 0;
55
     return flag ? 21 : 0;
55
   }
56
   }
56
 
57
 
@@ -102,24 +103,26 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
103
     let postData:any = {
103
       idx: this.pageIndex - 1,
104
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
105
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
106
+      startDate: this.dateRange[0] || undefined,
107
+      endDate: this.dateRange[1] || undefined,
108
+      hosId: this.hosId || undefined,
109
+      dutyId: this.dutyId || undefined,
110
+      parentDutyId: this.parentDutyId || undefined,
111
+      categoryId: this.category2Id || this.category1Id || undefined,
112
+      groupId: this.fieldConfig.fields.groupId || undefined,
113
+      userId: this.fieldConfig.fields.userId || undefined,
114
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
115
+      placeId: this.fieldConfig.fields.floorId || undefined,
116
+      compantId: this.fieldConfig.fields.compantId || undefined,
117
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
118
+      categoryLevel: 3,
116
     };
119
     };
117
     if (field && sort) {
120
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
121
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
122
     }
120
     this.loading1 = true;
123
     this.loading1 = true;
121
     this.mainService
124
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
125
+      .postCustom("itsm/report", "breakdownCategory", postData)
123
       .subscribe((result) => {
126
       .subscribe((result) => {
124
         this.loading1 = false;
127
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
128
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +132,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
129
   }
132
   }
130
 
133
 
131
   // 列表排序
134
   // 列表排序
132
-  sortCurrent = {};
135
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
136
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
137
   sortCurrentValue: string | null = "";
135
   sort(e) {
138
   sort(e) {
@@ -166,23 +169,25 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
169
       nzDuration: 0,
167
     }).messageId;
170
     }).messageId;
168
     let postData:any = {
171
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
172
+      startDate: this.dateRange[0] || undefined,
173
+      endDate: this.dateRange[1] || undefined,
174
+      hosId: this.hosId || undefined,
175
+      dutyId: this.dutyId || undefined,
176
+      parentDutyId: this.parentDutyId || undefined,
177
+      categoryId: this.category2Id || this.category1Id || undefined,
178
+      groupId: this.fieldConfig.fields.groupId || undefined,
179
+      userId: this.fieldConfig.fields.userId || undefined,
180
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
181
+      placeId: this.fieldConfig.fields.floorId || undefined,
182
+      compantId: this.fieldConfig.fields.compantId || undefined,
183
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
184
+      categoryLevel: 3,
180
     };
185
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
186
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
187
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
188
     }
184
     this.mainService
189
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
190
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186
       .subscribe((data) => {
191
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
192
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
193
         this.excelExportLoading = false;
@@ -210,16 +215,12 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
210
 		this.sortCurrentValue = "";
215
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
216
 		this.sortCurrent = {};
212
     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')]
217
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
218
+    this.category1Id = undefined;
219
+    this.category2Id = undefined;
220
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
215
     this.search();
221
     this.search();
216
   }
222
   }
217
 
223
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223
   // 防抖
224
   // 防抖
224
   isLoading = false;
225
   isLoading = false;
225
   searchTimer(fun, e) {
226
   searchTimer(fun, e) {
@@ -227,35 +228,83 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
227
     this.searchTimerSubject.next([fun, e]);
228
     this.searchTimerSubject.next([fun, e]);
228
   }
229
   }
229
 
230
 
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
231
+  // =====================一级分类=====================
232
+
233
+  // 一级分类搜索
234
+  changeCategory1Inp(e) {
235
+    this.searchTimer(this.getCategory1List, e);
236
+  }
237
+
238
+  openChangeCategory1(flag){
239
+    flag && this.getCategory1List();
240
+  }
241
+
242
+  changeCategory1(id){
243
+    this.category2List = [];
244
+    this.category2Id = null;
245
+    this.getCategory2List('', id);
232
   }
246
   }
233
 
247
 
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
248
+  // 获取一级分类列表
249
+  category1List:any[] = [];
250
+  getCategory1List(keyword?) {
251
+    let data = {
252
+      category: {
253
+        category: keyword,
254
+        selectType: 'mutlQuery',
255
+        dutyIds: this.queryType == 3 ? this.dutyId : undefined,
256
+        parentDutyId: this.queryType == 3 ? this.parentDutyId : undefined,
257
+        hierarchy: 1,
258
+      },
259
+    };
260
+    this.isLoading = true;
261
+    this.mainService
262
+      .incidentPost("listIncidentCategory", data)
263
+      .subscribe((data) => {
264
+        this.isLoading = false;
265
+        this.category1List = data.data;
266
+      });
267
+  }
268
+
269
+  // =====================二级分类=====================
270
+
271
+  // 二级分类搜索
272
+  changeCategory2Inp(e) {
273
+    this.searchTimer(this.getCategory2List, e);
274
+  }
275
+
276
+  openChangeCategory2(flag){
277
+    flag && this.getCategory2List('', this.category1Id);
278
+  }
279
+
280
+  // 获取二级分类列表
281
+  category2List:any[] = [];
282
+  getCategory2List(keyword = '', parentId = '') {
283
+    if(!parentId){
284
+      this.isLoading = false;
285
+      this.category2List = [];
286
+      return;
287
+    }
237
     let data = {
288
     let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
289
+      category: {
290
+        category: keyword,
291
+        selectType: 'mutlQuery',
292
+        parent: { id: parentId },
242
       },
293
       },
243
-      idx: 0,
244
-      sum: 20,
245
     };
294
     };
246
     this.isLoading = true;
295
     this.isLoading = true;
247
     this.mainService
296
     this.mainService
248
-      .getFetchDataList("data", "department", data)
297
+      .incidentPost("listIncidentCategory", data)
249
       .subscribe((data) => {
298
       .subscribe((data) => {
250
         this.isLoading = false;
299
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
300
+        this.category2List = data.data;
252
       });
301
       });
253
   }
302
   }
254
 
303
 
255
   // 详细搜索
304
   // 详细搜索
256
   fieldConfig:any = {
305
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
306
+    fields: {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined},
307
+    config: {groupAndUser: true, buildingAndFloor: true, company: true, repairDept: true},
259
   }
308
   }
260
   showSearchMore:boolean = false;
309
   showSearchMore:boolean = false;
261
   showMore(){
310
   showMore(){

+ 16 - 17
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.html

@@ -6,15 +6,14 @@
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
     <div class="searchDataItem">
8
     <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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>
9
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeCategory1Inp($event)" nzAllowClear nzPlaceHolder="请选择一级分类" [(ngModel)]="category1Id" (nzOpenChange)="openChangeCategory1($event)">
10
+        <ng-container *ngFor="let option of category1List">
11
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
12
+        </ng-container>
13
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
14
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
15
+        </nz-option>
16
+      </nz-select>
18
     </div>
17
     </div>
19
   </div>
18
   </div>
20
   <div class="operation">
19
   <div class="operation">
@@ -24,18 +23,18 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
23
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
24
   </div>
26
 </div>
25
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
26
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.companyDTO || fieldConfig.fields.repairDeptDTO">
28
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
27
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
28
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
30
-  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
-  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
-  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
29
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
30
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
31
+  <span>{{fieldConfig.fields.companyDTO?.name}}</span>
32
+  <span>{{fieldConfig.fields.repairDeptDTO?.dept}}</span>
34
 </div>
33
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
34
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
35
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
36
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
37
+      <th nzWidth="10%">故障现象</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
38
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +49,7 @@
50
   </thead>
49
   </thead>
51
   <tbody>
50
   <tbody>
52
     <tr *ngFor="let data of listOfData">
51
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
52
+      <td>{{ data.category }}</td>
54
       <td>{{ data.sum }}</td>
53
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
54
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
55
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +65,7 @@
66
   <ng-template #footerTpl>
65
   <ng-template #footerTpl>
67
     <table class="footTable">
66
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
67
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
68
+        <td style="width: 10%">{{ data.category }}</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
69
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
70
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
71
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

+ 51 - 47
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts

@@ -23,7 +23,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
23
   pageSize: number = 30; //表格每页展示条数
23
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
24
   listLength: number = 0; //表格总数据量
25
 
25
 
26
-  repairDeptId;//报修科室id
26
+  category1Id;//一级分类id
27
 
27
 
28
   searchTimerSubject = new Subject();
28
   searchTimerSubject = new Subject();
29
 
29
 
@@ -50,7 +50,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
50
   }
50
   }
51
 
51
 
52
   get getMoreFilter(){
52
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
53
+    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.companyDTO || this.fieldConfig.fields.repairDeptDTO;
54
     return flag ? 21 : 0;
54
     return flag ? 21 : 0;
55
   }
55
   }
56
 
56
 
@@ -102,24 +102,26 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
102
     let postData:any = {
103
       idx: this.pageIndex - 1,
103
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
104
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
105
+      startDate: this.dateRange[0] || undefined,
106
+      endDate: this.dateRange[1] || undefined,
107
+      hosId: this.hosId || undefined,
108
+      dutyId: this.dutyId || undefined,
109
+      parentDutyId: this.parentDutyId || undefined,
110
+      categoryId: this.category1Id || undefined,
111
+      groupId: this.fieldConfig.fields.groupId || undefined,
112
+      userId: this.fieldConfig.fields.userId || undefined,
113
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
114
+      placeId: this.fieldConfig.fields.floorId || undefined,
115
+      compantId: this.fieldConfig.fields.compantId || undefined,
116
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
117
+      categoryLevel: 2,
116
     };
118
     };
117
     if (field && sort) {
119
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
120
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
121
     }
120
     this.loading1 = true;
122
     this.loading1 = true;
121
     this.mainService
123
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
124
+      .postCustom("itsm/report", "breakdownCategory", postData)
123
       .subscribe((result) => {
125
       .subscribe((result) => {
124
         this.loading1 = false;
126
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
127
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +131,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
129
   }
131
   }
130
 
132
 
131
   // 列表排序
133
   // 列表排序
132
-  sortCurrent = {};
134
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
135
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
136
   sortCurrentValue: string | null = "";
135
   sort(e) {
137
   sort(e) {
@@ -166,23 +168,25 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
168
       nzDuration: 0,
167
     }).messageId;
169
     }).messageId;
168
     let postData:any = {
170
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
171
+      startDate: this.dateRange[0] || undefined,
172
+      endDate: this.dateRange[1] || undefined,
173
+      hosId: this.hosId || undefined,
174
+      dutyId: this.dutyId || undefined,
175
+      parentDutyId: this.parentDutyId || undefined,
176
+      categoryId: this.category1Id || undefined,
177
+      groupId: this.fieldConfig.fields.groupId || undefined,
178
+      userId: this.fieldConfig.fields.userId || undefined,
179
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
180
+      placeId: this.fieldConfig.fields.floorId || undefined,
181
+      compantId: this.fieldConfig.fields.compantId || undefined,
182
+      repairDeptId: this.fieldConfig.fields.repairDeptId || undefined,
183
+      categoryLevel: 2,
180
     };
184
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
185
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
186
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
187
     }
184
     this.mainService
188
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
189
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186
       .subscribe((data) => {
190
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
191
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
192
         this.excelExportLoading = false;
@@ -210,14 +214,14 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
210
 		this.sortCurrentValue = "";
214
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
215
 		this.sortCurrent = {};
212
     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')]
216
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
217
+    this.category1Id = undefined;
218
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined};
215
     this.search();
219
     this.search();
216
   }
220
   }
217
 
221
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
222
+  // 一级分类搜索
223
+  changeCategory1Inp(e) {
224
+    this.searchTimer(this.getCategory1List, e);
221
   }
225
   }
222
 
226
 
223
   // 防抖
227
   // 防抖
@@ -227,35 +231,35 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
227
     this.searchTimerSubject.next([fun, e]);
231
     this.searchTimerSubject.next([fun, e]);
228
   }
232
   }
229
 
233
 
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
234
+  openChangeCategory1(flag){
235
+    flag && this.getCategory1List();
232
   }
236
   }
233
 
237
 
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
238
+  // 获取一级分类列表
239
+  category1List:any[] = [];
240
+  getCategory1List(keyword?) {
237
     let data = {
241
     let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
242
+      category: {
243
+        category: keyword,
244
+        selectType: 'mutlQuery',
245
+        dutyIds: this.queryType == 3 ? this.dutyId : undefined,
246
+        parentDutyId: this.queryType == 3 ? this.parentDutyId : undefined,
247
+        hierarchy: 1,
242
       },
248
       },
243
-      idx: 0,
244
-      sum: 20,
245
     };
249
     };
246
     this.isLoading = true;
250
     this.isLoading = true;
247
     this.mainService
251
     this.mainService
248
-      .getFetchDataList("data", "department", data)
252
+      .incidentPost("listIncidentCategory", data)
249
       .subscribe((data) => {
253
       .subscribe((data) => {
250
         this.isLoading = false;
254
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
255
+        this.category1List = data.data;
252
       });
256
       });
253
   }
257
   }
254
 
258
 
255
   // 详细搜索
259
   // 详细搜索
256
   fieldConfig:any = {
260
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
261
+    fields: {groupId: undefined, userId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, repairDeptId: undefined},
262
+    config: {groupAndUser: true, buildingAndFloor: true, company: true, repairDept: true},
259
   }
263
   }
260
   showSearchMore:boolean = false;
264
   showSearchMore:boolean = false;
261
   showMore(){
265
   showMore(){

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts

@@ -129,7 +129,7 @@ export class DepartmentEvaluateStatisticsComponent implements OnInit, AfterViewI
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

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

@@ -129,7 +129,7 @@ export class DepartmentIncidentStatisticsComponent implements OnInit, AfterViewI
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts

@@ -129,7 +129,7 @@ export class DepartmentSourceStatisticsComponent implements OnInit, AfterViewIni
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

+ 1 - 1
src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts

@@ -129,7 +129,7 @@ export class FloorStatisticsComponent implements OnInit, AfterViewInit {
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {

+ 6 - 18
src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.html

@@ -5,17 +5,6 @@
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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
-    </div>
19
   </div>
8
   </div>
20
   <div class="operation">
9
   <div class="operation">
21
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,17 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
14
   </div>
26
 </div>
15
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
28
-  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
-  <span>{{fieldConfig.fields.userDTO?.name}}</span>
16
+<div class="moreFilter" *ngIf="fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO">
30
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
17
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
18
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
19
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
20
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
21
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
34
 </div>
22
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
23
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
24
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
25
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
26
+      <th nzWidth="10%">分组名称</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
27
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
28
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +38,7 @@
50
   </thead>
38
   </thead>
51
   <tbody>
39
   <tbody>
52
     <tr *ngFor="let data of listOfData">
40
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
41
+      <td>{{ data.groupName }}</td>
54
       <td>{{ data.sum }}</td>
42
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
43
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
44
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +54,7 @@
66
   <ng-template #footerTpl>
54
   <ng-template #footerTpl>
67
     <table class="footTable">
55
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
56
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
57
+        <td style="width: 10%">{{ data.groupName }}</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
58
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
59
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
60
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

+ 23 - 76
src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts

@@ -1,5 +1,3 @@
1
-import { debounceTime } from 'rxjs/operators';
2
-import { Subject } from 'rxjs';
3
 import { NzMessageService } from 'ng-zorro-antd/message';
1
 import { NzMessageService } from 'ng-zorro-antd/message';
4
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
23
   pageSize: number = 30; //表格每页展示条数
21
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
22
   listLength: number = 0; //表格总数据量
25
 
23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30
   ngOnInit() {
24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35
     this.initSessionData();
25
     this.initSessionData();
36
     this.search();
26
     this.search();
37
   }
27
   }
@@ -50,7 +40,7 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
50
   }
40
   }
51
 
41
 
52
   get getMoreFilter(){
42
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
43
+    let flag = this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO;
54
     return flag ? 21 : 0;
44
     return flag ? 21 : 0;
55
   }
45
   }
56
 
46
 
@@ -102,24 +92,21 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
92
     let postData:any = {
103
       idx: this.pageIndex - 1,
93
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
94
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
95
+      startDate: this.dateRange[0] || undefined,
96
+      endDate: this.dateRange[1] || undefined,
97
+      hosId: this.hosId || undefined,
98
+      dutyId: this.dutyId || undefined,
99
+      parentDutyId: this.parentDutyId || undefined,
100
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
101
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
102
+      placeId: this.fieldConfig.fields.floorId || undefined,
116
     };
103
     };
117
     if (field && sort) {
104
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
105
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
106
     }
120
     this.loading1 = true;
107
     this.loading1 = true;
121
     this.mainService
108
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
109
+      .postCustom("itsm/report", "repairGroup", postData)
123
       .subscribe((result) => {
110
       .subscribe((result) => {
124
         this.loading1 = false;
111
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
112
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +116,7 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
129
   }
116
   }
130
 
117
 
131
   // 列表排序
118
   // 列表排序
132
-  sortCurrent = {};
119
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
120
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
121
   sortCurrentValue: string | null = "";
135
   sort(e) {
122
   sort(e) {
@@ -166,23 +153,20 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
153
       nzDuration: 0,
167
     }).messageId;
154
     }).messageId;
168
     let postData:any = {
155
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
156
+      startDate: this.dateRange[0] || undefined,
157
+      endDate: this.dateRange[1] || undefined,
158
+      hosId: this.hosId || undefined,
159
+      dutyId: this.dutyId || undefined,
160
+      parentDutyId: this.parentDutyId || undefined,
161
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
162
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
163
+      placeId: this.fieldConfig.fields.floorId || undefined,
180
     };
164
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
165
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
166
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
167
     }
184
     this.mainService
168
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
169
+      .postExportCustom("itsm/export", "repairGroup", postData)
186
       .subscribe((data) => {
170
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
171
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
172
         this.excelExportLoading = false;
@@ -210,52 +194,17 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
210
 		this.sortCurrentValue = "";
194
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
195
 		this.sortCurrent = {};
212
     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')]
196
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
197
+    this.fieldConfig.fields = {categoryId: undefined, buildingId: undefined, floorId: undefined};
215
     this.search();
198
     this.search();
216
   }
199
   }
217
 
200
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223
   // 防抖
201
   // 防抖
224
   isLoading = false;
202
   isLoading = false;
225
-  searchTimer(fun, e) {
226
-    this.isLoading = true;
227
-    this.searchTimerSubject.next([fun, e]);
228
-  }
229
-
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
232
-  }
233
-
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
237
-    let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
242
-      },
243
-      idx: 0,
244
-      sum: 20,
245
-    };
246
-    this.isLoading = true;
247
-    this.mainService
248
-      .getFetchDataList("data", "department", data)
249
-      .subscribe((data) => {
250
-        this.isLoading = false;
251
-        this.repairDeptList = data.list;
252
-      });
253
-  }
254
 
203
 
255
   // 详细搜索
204
   // 详细搜索
256
   fieldConfig:any = {
205
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
206
+    fields: {categoryId: undefined, buildingId: undefined, floorId: undefined},
207
+    config: {category123: true, buildingAndFloor: true},
259
   }
208
   }
260
   showSearchMore:boolean = false;
209
   showSearchMore:boolean = false;
261
   showMore(){
210
   showMore(){
@@ -274,5 +223,3 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
274
     this.onResize();
223
     this.onResize();
275
   }
224
   }
276
 }
225
 }
277
-
278
-

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

@@ -8,13 +8,13 @@
8
     <div class="searchDataItem">
8
     <div class="searchDataItem">
9
       <span class="label">报修科室</span>:
9
       <span class="label">报修科室</span>:
10
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
10
       <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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>
11
+        <ng-container *ngFor="let option of repairDeptList">
12
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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
     </div>
18
     </div>
19
   </div>
19
   </div>
20
   <div class="operation">
20
   <div class="operation">

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

@@ -102,17 +102,17 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
102
     let postData:any = {
103
       idx: this.pageIndex - 1,
103
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
104
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
105
+      startDate: this.dateRange[0] || undefined,
106
+      endDate: this.dateRange[1] || undefined,
107
+      hosId: this.hosId || undefined,
108
+      dutyId: this.dutyId || undefined,
109
+      parentDutyId: this.parentDutyId || undefined,
110
+      repairDeptId: this.repairDeptId || undefined,
111
+      groupId: this.fieldConfig.fields.groupId || undefined,
112
+      userId: this.fieldConfig.fields.userId || undefined,
113
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
114
+      sourceId: this.fieldConfig.fields.sourceId || undefined,
115
+      hierarchy: this.fieldConfig.fields.hierarchy || undefined,
116
     };
116
     };
117
     if (field && sort) {
117
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
@@ -129,7 +129,7 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
129
   }
129
   }
130
 
130
 
131
   // 列表排序
131
   // 列表排序
132
-  sortCurrent = {};
132
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
133
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
134
   sortCurrentValue: string | null = "";
135
   sort(e) {
135
   sort(e) {
@@ -166,17 +166,17 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
166
       nzDuration: 0,
167
     }).messageId;
167
     }).messageId;
168
     let postData:any = {
168
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
169
+      startDate: this.dateRange[0] || undefined,
170
+      endDate: this.dateRange[1] || undefined,
171
+      hosId: this.hosId || undefined,
172
+      dutyId: this.dutyId || undefined,
173
+      parentDutyId: this.parentDutyId || undefined,
174
+      repairDeptId: this.repairDeptId || undefined,
175
+      groupId: this.fieldConfig.fields.groupId || undefined,
176
+      userId: this.fieldConfig.fields.userId || undefined,
177
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
178
+      sourceId: this.fieldConfig.fields.sourceId || undefined,
179
+      hierarchy: this.fieldConfig.fields.hierarchy || undefined,
180
     };
180
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`

+ 6 - 18
src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.html

@@ -5,17 +5,6 @@
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
-    <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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
-    </div>
19
   </div>
8
   </div>
20
   <div class="operation">
9
   <div class="operation">
21
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,17 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
14
   </div>
26
 </div>
15
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
28
-  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
-  <span>{{fieldConfig.fields.userDTO?.name}}</span>
16
+<div class="moreFilter" *ngIf="fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO">
30
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
17
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
18
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
19
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
20
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
21
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
34
 </div>
22
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
23
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
24
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
25
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
26
+      <th nzWidth="10%">分组名称</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
27
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
28
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +38,7 @@
50
   </thead>
38
   </thead>
51
   <tbody>
39
   <tbody>
52
     <tr *ngFor="let data of listOfData">
40
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
41
+      <td>{{ data.groupName }}</td>
54
       <td>{{ data.sum }}</td>
42
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
43
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
44
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +54,7 @@
66
   <ng-template #footerTpl>
54
   <ng-template #footerTpl>
67
     <table class="footTable">
55
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
56
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
57
+        <td style="width: 10%">{{ data.groupName }}</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
58
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
59
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
60
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

+ 23 - 76
src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts

@@ -1,5 +1,3 @@
1
-import { debounceTime } from 'rxjs/operators';
2
-import { Subject } from 'rxjs';
3
 import { NzMessageService } from 'ng-zorro-antd/message';
1
 import { NzMessageService } from 'ng-zorro-antd/message';
4
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
23
   pageSize: number = 30; //表格每页展示条数
21
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
22
   listLength: number = 0; //表格总数据量
25
 
23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30
   ngOnInit() {
24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35
     this.initSessionData();
25
     this.initSessionData();
36
     this.search();
26
     this.search();
37
   }
27
   }
@@ -50,7 +40,7 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
50
   }
40
   }
51
 
41
 
52
   get getMoreFilter(){
42
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
43
+    let flag = this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO;
54
     return flag ? 21 : 0;
44
     return flag ? 21 : 0;
55
   }
45
   }
56
 
46
 
@@ -102,24 +92,21 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
102
     let postData:any = {
92
     let postData:any = {
103
       idx: this.pageIndex - 1,
93
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
94
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
95
+      startDate: this.dateRange[0] || undefined,
96
+      endDate: this.dateRange[1] || undefined,
97
+      hosId: this.hosId || undefined,
98
+      dutyId: this.dutyId || undefined,
99
+      parentDutyId: this.parentDutyId || undefined,
100
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
101
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
102
+      placeId: this.fieldConfig.fields.floorId || undefined,
116
     };
103
     };
117
     if (field && sort) {
104
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
105
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
106
     }
120
     this.loading1 = true;
107
     this.loading1 = true;
121
     this.mainService
108
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
109
+      .postCustom("itsm/report", "tripartiteCompany", postData)
123
       .subscribe((result) => {
110
       .subscribe((result) => {
124
         this.loading1 = false;
111
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
112
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +116,7 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
129
   }
116
   }
130
 
117
 
131
   // 列表排序
118
   // 列表排序
132
-  sortCurrent = {};
119
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
120
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
121
   sortCurrentValue: string | null = "";
135
   sort(e) {
122
   sort(e) {
@@ -166,23 +153,20 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
166
       nzDuration: 0,
153
       nzDuration: 0,
167
     }).messageId;
154
     }).messageId;
168
     let postData:any = {
155
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
156
+      startDate: this.dateRange[0] || undefined,
157
+      endDate: this.dateRange[1] || undefined,
158
+      hosId: this.hosId || undefined,
159
+      dutyId: this.dutyId || undefined,
160
+      parentDutyId: this.parentDutyId || undefined,
161
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
162
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
163
+      placeId: this.fieldConfig.fields.floorId || undefined,
180
     };
164
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
165
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
166
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
167
     }
184
     this.mainService
168
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
169
+      .postExportCustom("itsm/export", "tripartiteCompany", postData)
186
       .subscribe((data) => {
170
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
171
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
172
         this.excelExportLoading = false;
@@ -210,52 +194,17 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
210
 		this.sortCurrentValue = "";
194
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
195
 		this.sortCurrent = {};
212
     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')]
196
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
197
+    this.fieldConfig.fields = {categoryId: undefined, buildingId: undefined, floorId: undefined};
215
     this.search();
198
     this.search();
216
   }
199
   }
217
 
200
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223
   // 防抖
201
   // 防抖
224
   isLoading = false;
202
   isLoading = false;
225
-  searchTimer(fun, e) {
226
-    this.isLoading = true;
227
-    this.searchTimerSubject.next([fun, e]);
228
-  }
229
-
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
232
-  }
233
-
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
237
-    let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
242
-      },
243
-      idx: 0,
244
-      sum: 20,
245
-    };
246
-    this.isLoading = true;
247
-    this.mainService
248
-      .getFetchDataList("data", "department", data)
249
-      .subscribe((data) => {
250
-        this.isLoading = false;
251
-        this.repairDeptList = data.list;
252
-      });
253
-  }
254
 
203
 
255
   // 详细搜索
204
   // 详细搜索
256
   fieldConfig:any = {
205
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
206
+    fields: {categoryId: undefined, buildingId: undefined, floorId: undefined},
207
+    config: {category123: true, buildingAndFloor: true},
259
   }
208
   }
260
   showSearchMore:boolean = false;
209
   showSearchMore:boolean = false;
261
   showMore(){
210
   showMore(){
@@ -274,5 +223,3 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
274
     this.onResize();
223
     this.onResize();
275
   }
224
   }
276
 }
225
 }
277
-
278
-

+ 15 - 16
src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.html

@@ -6,15 +6,15 @@
6
       </nz-range-picker>
6
       </nz-range-picker>
7
     </div>
7
     </div>
8
     <div class="searchDataItem">
8
     <div class="searchDataItem">
9
-      <span class="label">报修科室</span>:
10
-      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" nzAllowClear nzPlaceHolder="请选择报修科室" [(ngModel)]="repairDeptId" (nzOpenChange)="openChangeRepairDept($event)">
11
-      <ng-container *ngFor="let option of repairDeptList">
12
-        <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [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>
9
+      <span class="label">维修分组</span>:
10
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" nzAllowClear nzPlaceHolder="请选择维修分组" [(ngModel)]="groupId" (nzOpenChange)="openChangeGroup($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
     </div>
18
     </div>
19
   </div>
19
   </div>
20
   <div class="operation">
20
   <div class="operation">
@@ -24,18 +24,17 @@
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25
   </div>
25
   </div>
26
 </div>
26
 </div>
27
-<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.sourceDTO">
28
-  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29
-  <span>{{fieldConfig.fields.userDTO?.name}}</span>
27
+<div class="moreFilter" *ngIf="fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO">
30
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
28
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
29
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
30
   <span>{{fieldConfig.fields.category3DTO?.category}}</span>
33
-  <span>{{fieldConfig.fields.sourceDTO?.name}}</span>
31
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
32
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
34
 </div>
33
 </div>
35
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
34
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36
   <thead (nzSortChange)="sort($event)" nzSingleSort>
35
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37
     <tr>
36
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
37
+      <th nzWidth="10%">人员姓名(工号)</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
38
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
39
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +49,7 @@
50
   </thead>
49
   </thead>
51
   <tbody>
50
   <tbody>
52
     <tr *ngFor="let data of listOfData">
51
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
52
+      <td>{{ data.userName }}({{ data.userAccount }})</td>
54
       <td>{{ data.sum }}</td>
53
       <td>{{ data.sum }}</td>
55
       <td>{{ data.avgResponseTime }}</td>
54
       <td>{{ data.avgResponseTime }}</td>
56
       <td>{{ data.avgResolvedTime }}</td>
55
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +65,7 @@
66
   <ng-template #footerTpl>
65
   <ng-template #footerTpl>
67
     <table class="footTable">
66
     <table class="footTable">
68
       <tr *ngFor="let data of listOfDataEnd">
67
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
68
+        <td style="width: 10%">{{ data.userName }}({{ data.userAccount }})</td>
70
         <td style="width: 9%">{{ data.sum }}</td>
69
         <td style="width: 9%">{{ data.sum }}</td>
71
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
70
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>
71
         <td style="width: 9%">{{ data.avgResolvedTime }}</td>

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

@@ -23,7 +23,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
23
   pageSize: number = 30; //表格每页展示条数
23
   pageSize: number = 30; //表格每页展示条数
24
   listLength: number = 0; //表格总数据量
24
   listLength: number = 0; //表格总数据量
25
 
25
 
26
-  repairDeptId;//报修科室id
26
+  groupId;//维修分组id
27
 
27
 
28
   searchTimerSubject = new Subject();
28
   searchTimerSubject = new Subject();
29
 
29
 
@@ -50,7 +50,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
50
   }
50
   }
51
 
51
 
52
   get getMoreFilter(){
52
   get getMoreFilter(){
53
-    let flag = this.fieldConfig.fields.groupDTO || this.fieldConfig.fields.userDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO || this.fieldConfig.fields.sourceDTO;
53
+    let flag = this.fieldConfig.fields.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.category1DTO || this.fieldConfig.fields.category2DTO || this.fieldConfig.fields.category3DTO;
54
     return flag ? 21 : 0;
54
     return flag ? 21 : 0;
55
   }
55
   }
56
 
56
 
@@ -102,24 +102,22 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
102
     let postData:any = {
102
     let postData:any = {
103
       idx: this.pageIndex - 1,
103
       idx: this.pageIndex - 1,
104
       sum: this.pageSize,
104
       sum: this.pageSize,
105
-      startDate: this.dateRange[0],
106
-      endDate: this.dateRange[1],
107
-      hosId: this.hosId,
108
-      dutyId: this.dutyId,
109
-      parentDutyId: this.parentDutyId,
110
-      repairDeptId: this.repairDeptId,
111
-      groupId: this.fieldConfig.fields.groupId,
112
-      userId: this.fieldConfig.fields.userId,
113
-      categoryId: this.fieldConfig.fields.categoryId,
114
-      sourceId: this.fieldConfig.fields.sourceId,
115
-      hierarchy: this.fieldConfig.fields.hierarchy,
105
+      startDate: this.dateRange[0] || undefined,
106
+      endDate: this.dateRange[1] || undefined,
107
+      hosId: this.hosId || undefined,
108
+      dutyId: this.dutyId || undefined,
109
+      parentDutyId: this.parentDutyId || undefined,
110
+      groupId: this.groupId || undefined,
111
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
112
+      placeId: this.fieldConfig.fields.buildingId || undefined,
113
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
116
     };
114
     };
117
     if (field && sort) {
115
     if (field && sort) {
118
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
116
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119
     }
117
     }
120
     this.loading1 = true;
118
     this.loading1 = true;
121
     this.mainService
119
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
120
+      .postCustom("itsm/report", "repairUser", postData)
123
       .subscribe((result) => {
121
       .subscribe((result) => {
124
         this.loading1 = false;
122
         this.loading1 = false;
125
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
123
         this.listOfData = result.dataList.filter((v, i) => { return i != result.dataList.length - 1 });
@@ -129,7 +127,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
129
   }
127
   }
130
 
128
 
131
   // 列表排序
129
   // 列表排序
132
-  sortCurrent = {};
130
+  sortCurrent:any = {};
133
   sortCurrentKey: string = "";
131
   sortCurrentKey: string = "";
134
   sortCurrentValue: string | null = "";
132
   sortCurrentValue: string | null = "";
135
   sort(e) {
133
   sort(e) {
@@ -166,23 +164,21 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
166
       nzDuration: 0,
164
       nzDuration: 0,
167
     }).messageId;
165
     }).messageId;
168
     let postData:any = {
166
     let postData:any = {
169
-      startDate: this.dateRange[0],
170
-      endDate: this.dateRange[1],
171
-      hosId: this.hosId,
172
-      dutyId: this.dutyId,
173
-      parentDutyId: this.parentDutyId,
174
-      repairDeptId: this.repairDeptId,
175
-      groupId: this.fieldConfig.fields.groupId,
176
-      userId: this.fieldConfig.fields.userId,
177
-      categoryId: this.fieldConfig.fields.categoryId,
178
-      sourceId: this.fieldConfig.fields.sourceId,
179
-      hierarchy: this.fieldConfig.fields.hierarchy,
167
+      startDate: this.dateRange[0] || undefined,
168
+      endDate: this.dateRange[1] || undefined,
169
+      hosId: this.hosId || undefined,
170
+      dutyId: this.dutyId || undefined,
171
+      parentDutyId: this.parentDutyId || undefined,
172
+      groupId: this.groupId || undefined,
173
+      buildingId: this.fieldConfig.fields.buildingId || undefined,
174
+      placeId: this.fieldConfig.fields.buildingId || undefined,
175
+      categoryId: this.fieldConfig.fields.categoryId || undefined,
180
     };
176
     };
181
     if (this.sortCurrentKey && this.sortCurrentValue) {
177
     if (this.sortCurrentKey && this.sortCurrentValue) {
182
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
178
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183
     }
179
     }
184
     this.mainService
180
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
181
+      .postExportCustom("itsm/export", "repairUser", postData)
186
       .subscribe((data) => {
182
       .subscribe((data) => {
187
         this.message.remove(this.excelExportLoading);
183
         this.message.remove(this.excelExportLoading);
188
         this.excelExportLoading = false;
184
         this.excelExportLoading = false;
@@ -210,14 +206,14 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
210
 		this.sortCurrentValue = "";
206
 		this.sortCurrentValue = "";
211
 		this.sortCurrent = {};
207
 		this.sortCurrent = {};
212
     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')]
208
     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')]
213
-    this.repairDeptId = undefined;
214
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined};
209
+    this.groupId = undefined;
210
+    this.fieldConfig.fields = {buildingId: undefined, floorId: undefined, categoryId: undefined};
215
     this.search();
211
     this.search();
216
   }
212
   }
217
 
213
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
214
+  // 维修分组搜索
215
+  changeGroupInp(e) {
216
+    this.searchTimer(this.getGroupList, e);
221
   }
217
   }
222
 
218
 
223
   // 防抖
219
   // 防抖
@@ -227,35 +223,35 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
227
     this.searchTimerSubject.next([fun, e]);
223
     this.searchTimerSubject.next([fun, e]);
228
   }
224
   }
229
 
225
 
230
-  openChangeRepairDept(flag){
231
-    flag && this.getRepairDeptList();
226
+  openChangeGroup(flag){
227
+    flag && this.getGroupList();
232
   }
228
   }
233
 
229
 
234
-  // 获取报修科室列表
235
-  repairDeptList:any[] = [];
236
-  getRepairDeptList(keyword?) {
230
+  // 获取维修分组列表
231
+  groupList:any[] = [];
232
+  getGroupList(keyword?) {
237
     let data = {
233
     let data = {
238
-      department: {
239
-        cascadeHosId: this.getHosId,
240
-        dept: keyword,
241
-        searchType: 1,
234
+      group2: {
235
+        hospitals: this.getHosId,
236
+        groupName: keyword,
237
+        type: 3,
242
       },
238
       },
243
       idx: 0,
239
       idx: 0,
244
       sum: 20,
240
       sum: 20,
245
     };
241
     };
246
     this.isLoading = true;
242
     this.isLoading = true;
247
     this.mainService
243
     this.mainService
248
-      .getFetchDataList("data", "department", data)
244
+      .getFetchDataList("data", "group2", data)
249
       .subscribe((data) => {
245
       .subscribe((data) => {
250
         this.isLoading = false;
246
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
247
+        this.groupList = data.list;
252
       });
248
       });
253
   }
249
   }
254
 
250
 
255
   // 详细搜索
251
   // 详细搜索
256
   fieldConfig:any = {
252
   fieldConfig:any = {
257
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, sourceId: undefined, hierarchy: undefined},
258
-    config: {groupAndUser: true, category123: true, source: true},
253
+    fields: {buildingId: undefined, floorId: undefined, categoryId: undefined},
254
+    config: {buildingAndFloor: true, category123: true},
259
   }
255
   }
260
   showSearchMore:boolean = false;
256
   showSearchMore:boolean = false;
261
   showMore(){
257
   showMore(){
@@ -274,5 +270,3 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
274
     this.onResize();
270
     this.onResize();
275
   }
271
   }
276
 }
272
 }
277
-
278
-