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 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7 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 11
               <ng-container *ngFor="let option of groupList">
12 12
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
13 13
               </ng-container>
@@ -19,7 +19,7 @@
19 19
         </nz-form-item>
20 20
 
21 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 23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修人员!">
24 24
             <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择维修人员" (nzOpenChange)="openChangeUser($event)">
25 25
               <ng-container *ngFor="let option of userList">
@@ -87,6 +87,62 @@
87 87
             </nz-select>
88 88
           </nz-form-control>
89 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 146
       </form>
91 147
     </div>
92 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 88
       .content {
89 89
         width: 100%;
90
-        min-height: 166px;
91 90
         padding: 10px 24px 0;
92 91
         height: auto;
93 92
         overflow-y: auto;

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

@@ -47,6 +47,10 @@ export class SearchMoreComponent implements OnInit {
47 47
     this.category2List = this.fieldConfig.fields.category2DTO ? [this.fieldConfig.fields.category2DTO] : [];
48 48
     this.category3List = this.fieldConfig.fields.category3DTO ? [this.fieldConfig.fields.category3DTO] : [];
49 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 55
     this.validateForm = this.fb.group({
52 56
       groupId: [this.fieldConfig.fields.groupId || null],
@@ -55,6 +59,10 @@ export class SearchMoreComponent implements OnInit {
55 59
       category2Id: [this.fieldConfig.fields.category2DTO ? this.fieldConfig.fields.category2DTO.id  : null],
56 60
       category3Id: [this.fieldConfig.fields.category3DTO ? this.fieldConfig.fields.category3DTO.id  : null],
57 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 102
       fields.sourceId = this.validateForm.value.sourceId;
95 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 117
     this.submitEvent.emit(fields);
98 118
     this.hideModal();
99 119
   }
@@ -109,14 +129,14 @@ export class SearchMoreComponent implements OnInit {
109 129
     this.searchTimerSubject.next([fun, e]);
110 130
   }
111 131
 
112
-  // =================维修组===================
132
+  // =================维修组===================
113 133
 
114
-  // 维修组搜索
134
+  // 维修组搜索
115 135
   changeGroupInp(e) {
116 136
     this.searchTimer(this.getGroupList, e);
117 137
   }
118 138
 
119
-  // 获取维修组列表
139
+  // 获取维修组列表
120 140
   groupList:any[] = [];
121 141
   getGroupList(keyword?){
122 142
     let postData: any = {
@@ -167,9 +187,11 @@ export class SearchMoreComponent implements OnInit {
167 187
       idx: 0,
168 188
       sum: 20,
169 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 197
     this.isLoading = true;
@@ -315,4 +337,146 @@ export class SearchMoreComponent implements OnInit {
315 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 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 5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6 6
       </nz-range-picker>
7 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 8
   </div>
20 9
   <div class="operation">
21 10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,18 @@
24 13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 14
   </div>
26 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 17
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29 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 23
 </div>
35 24
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 25
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 26
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
27
+      <th nzWidth="10%">故障现象</th>
39 28
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 30
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +39,7 @@
50 39
   </thead>
51 40
   <tbody>
52 41
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
42
+      <td>{{ data.category }}</td>
54 43
       <td>{{ data.sum }}</td>
55 44
       <td>{{ data.avgResponseTime }}</td>
56 45
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +55,7 @@
66 55
   <ng-template #footerTpl>
67 56
     <table class="footTable">
68 57
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
58
+        <td style="width: 10%">{{ data.category }}</td>
70 59
         <td style="width: 9%">{{ data.sum }}</td>
71 60
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 1
 import { NzMessageService } from 'ng-zorro-antd/message';
4 2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5 3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
23 21
   pageSize: number = 30; //表格每页展示条数
24 22
   listLength: number = 0; //表格总数据量
25 23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30 24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35 25
     this.initSessionData();
36 26
     this.search();
37 27
   }
@@ -50,7 +40,7 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
50 40
   }
51 41
 
52 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 44
     return flag ? 21 : 0;
55 45
   }
56 46
 
@@ -102,24 +92,25 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
102 92
     let postData:any = {
103 93
       idx: this.pageIndex - 1,
104 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 108
     if (field && sort) {
118 109
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 110
     }
120 111
     this.loading1 = true;
121 112
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
113
+      .postCustom("itsm/report", "breakdownCategory", postData)
123 114
       .subscribe((result) => {
124 115
         this.loading1 = false;
125 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 124
   sortCurrentKey: string = "";
134 125
   sortCurrentValue: string | null = "";
135 126
   sort(e) {
@@ -166,23 +157,24 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
166 157
       nzDuration: 0,
167 158
     }).messageId;
168 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 173
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 174
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 175
     }
184 176
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
177
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186 178
       .subscribe((data) => {
187 179
         this.message.remove(this.excelExportLoading);
188 180
         this.excelExportLoading = false;
@@ -210,52 +202,17 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
210 202
 		this.sortCurrentValue = "";
211 203
 		this.sortCurrent = {};
212 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 206
     this.search();
216 207
   }
217 208
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223 209
   // 防抖
224 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 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 217
   showSearchMore:boolean = false;
261 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 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 6
       </nz-range-picker>
7 7
     </div>
8 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 27
     </div>
19 28
   </div>
20 29
   <div class="operation">
@@ -24,18 +33,18 @@
24 33
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 34
   </div>
26 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 37
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29 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 43
 </div>
35 44
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 45
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 46
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
47
+      <th nzWidth="10%">故障现象</th>
39 48
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 49
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 50
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +59,7 @@
50 59
   </thead>
51 60
   <tbody>
52 61
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
62
+      <td>{{ data.category }}</td>
54 63
       <td>{{ data.sum }}</td>
55 64
       <td>{{ data.avgResponseTime }}</td>
56 65
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +75,7 @@
66 75
   <ng-template #footerTpl>
67 76
     <table class="footTable">
68 77
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
78
+        <td style="width: 10%">{{ data.category }}</td>
70 79
         <td style="width: 9%">{{ data.sum }}</td>
71 80
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 23
   pageSize: number = 30; //表格每页展示条数
24 24
   listLength: number = 0; //表格总数据量
25 25
 
26
-  repairDeptId;//报修科室id
26
+  category1Id;//一级分类id
27
+  category2Id;//二级分类id
27 28
 
28 29
   searchTimerSubject = new Subject();
29 30
 
@@ -50,7 +51,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
50 51
   }
51 52
 
52 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 55
     return flag ? 21 : 0;
55 56
   }
56 57
 
@@ -102,24 +103,26 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
102 103
     let postData:any = {
103 104
       idx: this.pageIndex - 1,
104 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 120
     if (field && sort) {
118 121
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 122
     }
120 123
     this.loading1 = true;
121 124
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
125
+      .postCustom("itsm/report", "breakdownCategory", postData)
123 126
       .subscribe((result) => {
124 127
         this.loading1 = false;
125 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 136
   sortCurrentKey: string = "";
134 137
   sortCurrentValue: string | null = "";
135 138
   sort(e) {
@@ -166,23 +169,25 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
166 169
       nzDuration: 0,
167 170
     }).messageId;
168 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 186
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 187
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 188
     }
184 189
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
190
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186 191
       .subscribe((data) => {
187 192
         this.message.remove(this.excelExportLoading);
188 193
         this.excelExportLoading = false;
@@ -210,16 +215,12 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
210 215
 		this.sortCurrentValue = "";
211 216
 		this.sortCurrent = {};
212 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 221
     this.search();
216 222
   }
217 223
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223 224
   // 防抖
224 225
   isLoading = false;
225 226
   searchTimer(fun, e) {
@@ -227,35 +228,83 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
227 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 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 295
     this.isLoading = true;
247 296
     this.mainService
248
-      .getFetchDataList("data", "department", data)
297
+      .incidentPost("listIncidentCategory", data)
249 298
       .subscribe((data) => {
250 299
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
300
+        this.category2List = data.data;
252 301
       });
253 302
   }
254 303
 
255 304
   // 详细搜索
256 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 309
   showSearchMore:boolean = false;
261 310
   showMore(){

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

@@ -6,15 +6,14 @@
6 6
       </nz-range-picker>
7 7
     </div>
8 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 17
     </div>
19 18
   </div>
20 19
   <div class="operation">
@@ -24,18 +23,18 @@
24 23
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 24
   </div>
26 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 27
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29 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 33
 </div>
35 34
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 35
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 36
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
37
+      <th nzWidth="10%">故障现象</th>
39 38
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 39
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +49,7 @@
50 49
   </thead>
51 50
   <tbody>
52 51
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
52
+      <td>{{ data.category }}</td>
54 53
       <td>{{ data.sum }}</td>
55 54
       <td>{{ data.avgResponseTime }}</td>
56 55
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +65,7 @@
66 65
   <ng-template #footerTpl>
67 66
     <table class="footTable">
68 67
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
68
+        <td style="width: 10%">{{ data.category }}</td>
70 69
         <td style="width: 9%">{{ data.sum }}</td>
71 70
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 23
   pageSize: number = 30; //表格每页展示条数
24 24
   listLength: number = 0; //表格总数据量
25 25
 
26
-  repairDeptId;//报修科室id
26
+  category1Id;//一级分类id
27 27
 
28 28
   searchTimerSubject = new Subject();
29 29
 
@@ -50,7 +50,7 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
50 50
   }
51 51
 
52 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 54
     return flag ? 21 : 0;
55 55
   }
56 56
 
@@ -102,24 +102,26 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
102 102
     let postData:any = {
103 103
       idx: this.pageIndex - 1,
104 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 119
     if (field && sort) {
118 120
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 121
     }
120 122
     this.loading1 = true;
121 123
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
124
+      .postCustom("itsm/report", "breakdownCategory", postData)
123 125
       .subscribe((result) => {
124 126
         this.loading1 = false;
125 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 135
   sortCurrentKey: string = "";
134 136
   sortCurrentValue: string | null = "";
135 137
   sort(e) {
@@ -166,23 +168,25 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
166 168
       nzDuration: 0,
167 169
     }).messageId;
168 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 185
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 186
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 187
     }
184 188
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
189
+      .postExportCustom("itsm/export", "breakdownCategory", postData)
186 190
       .subscribe((data) => {
187 191
         this.message.remove(this.excelExportLoading);
188 192
         this.excelExportLoading = false;
@@ -210,14 +214,14 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
210 214
 		this.sortCurrentValue = "";
211 215
 		this.sortCurrent = {};
212 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 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 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 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 250
     this.isLoading = true;
247 251
     this.mainService
248
-      .getFetchDataList("data", "department", data)
252
+      .incidentPost("listIncidentCategory", data)
249 253
       .subscribe((data) => {
250 254
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
255
+        this.category1List = data.data;
252 256
       });
253 257
   }
254 258
 
255 259
   // 详细搜索
256 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 264
   showSearchMore:boolean = false;
261 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 135
   sort(e) {

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

@@ -5,17 +5,6 @@
5 5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6 6
       </nz-range-picker>
7 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 8
   </div>
20 9
   <div class="operation">
21 10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,17 @@
24 13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 14
   </div>
26 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 17
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31 18
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32 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 22
 </div>
35 23
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 24
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 25
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
26
+      <th nzWidth="10%">分组名称</th>
39 27
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 28
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +38,7 @@
50 38
   </thead>
51 39
   <tbody>
52 40
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
41
+      <td>{{ data.groupName }}</td>
54 42
       <td>{{ data.sum }}</td>
55 43
       <td>{{ data.avgResponseTime }}</td>
56 44
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +54,7 @@
66 54
   <ng-template #footerTpl>
67 55
     <table class="footTable">
68 56
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
57
+        <td style="width: 10%">{{ data.groupName }}</td>
70 58
         <td style="width: 9%">{{ data.sum }}</td>
71 59
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 1
 import { NzMessageService } from 'ng-zorro-antd/message';
4 2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5 3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
23 21
   pageSize: number = 30; //表格每页展示条数
24 22
   listLength: number = 0; //表格总数据量
25 23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30 24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35 25
     this.initSessionData();
36 26
     this.search();
37 27
   }
@@ -50,7 +40,7 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
50 40
   }
51 41
 
52 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 44
     return flag ? 21 : 0;
55 45
   }
56 46
 
@@ -102,24 +92,21 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
102 92
     let postData:any = {
103 93
       idx: this.pageIndex - 1,
104 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 104
     if (field && sort) {
118 105
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 106
     }
120 107
     this.loading1 = true;
121 108
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
109
+      .postCustom("itsm/report", "repairGroup", postData)
123 110
       .subscribe((result) => {
124 111
         this.loading1 = false;
125 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 120
   sortCurrentKey: string = "";
134 121
   sortCurrentValue: string | null = "";
135 122
   sort(e) {
@@ -166,23 +153,20 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
166 153
       nzDuration: 0,
167 154
     }).messageId;
168 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 165
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 166
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 167
     }
184 168
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
169
+      .postExportCustom("itsm/export", "repairGroup", postData)
186 170
       .subscribe((data) => {
187 171
         this.message.remove(this.excelExportLoading);
188 172
         this.excelExportLoading = false;
@@ -210,52 +194,17 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
210 194
 		this.sortCurrentValue = "";
211 195
 		this.sortCurrent = {};
212 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 198
     this.search();
216 199
   }
217 200
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223 201
   // 防抖
224 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 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 209
   showSearchMore:boolean = false;
261 210
   showMore(){
@@ -274,5 +223,3 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
274 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 8
     <div class="searchDataItem">
9 9
       <span class="label">报修科室</span>:
10 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 18
     </div>
19 19
   </div>
20 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 102
     let postData:any = {
103 103
       idx: this.pageIndex - 1,
104 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 117
     if (field && sort) {
118 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 133
   sortCurrentKey: string = "";
134 134
   sortCurrentValue: string | null = "";
135 135
   sort(e) {
@@ -166,17 +166,17 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
166 166
       nzDuration: 0,
167 167
     }).messageId;
168 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 181
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 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 5
       <nz-range-picker [(ngModel)]="dateRange" [nzAllowClear]="false" (ngModelChange)="changeDate($event)" (nzOnCalendarChange)="onCalendarChangeDate($event)">
6 6
       </nz-range-picker>
7 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 8
   </div>
20 9
   <div class="operation">
21 10
     <i class="icon_transport transport-gengduo" (click)="showMore()"></i>
@@ -24,18 +13,17 @@
24 13
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 14
   </div>
26 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 17
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31 18
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32 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 22
 </div>
35 23
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 24
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 25
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
26
+      <th nzWidth="10%">分组名称</th>
39 27
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 28
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 29
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +38,7 @@
50 38
   </thead>
51 39
   <tbody>
52 40
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
41
+      <td>{{ data.groupName }}</td>
54 42
       <td>{{ data.sum }}</td>
55 43
       <td>{{ data.avgResponseTime }}</td>
56 44
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +54,7 @@
66 54
   <ng-template #footerTpl>
67 55
     <table class="footTable">
68 56
       <tr *ngFor="let data of listOfDataEnd">
69
-        <td style="width: 10%">{{ data.startDate }}</td>
57
+        <td style="width: 10%">{{ data.groupName }}</td>
70 58
         <td style="width: 9%">{{ data.sum }}</td>
71 59
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 1
 import { NzMessageService } from 'ng-zorro-antd/message';
4 2
 import { format, addMonths, startOfMonth, endOfMonth, startOfDay, endOfDay } from 'date-fns';
5 3
 import { Component, OnInit, HostListener, AfterViewInit } from "@angular/core";
@@ -23,15 +21,7 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
23 21
   pageSize: number = 30; //表格每页展示条数
24 22
   listLength: number = 0; //表格总数据量
25 23
 
26
-  repairDeptId;//报修科室id
27
-
28
-  searchTimerSubject = new Subject();
29
-
30 24
   ngOnInit() {
31
-    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
32
-      let fun = v[0];
33
-      fun.call(this, v[1]);
34
-    });
35 25
     this.initSessionData();
36 26
     this.search();
37 27
   }
@@ -50,7 +40,7 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
50 40
   }
51 41
 
52 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 44
     return flag ? 21 : 0;
55 45
   }
56 46
 
@@ -102,24 +92,21 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
102 92
     let postData:any = {
103 93
       idx: this.pageIndex - 1,
104 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 104
     if (field && sort) {
118 105
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 106
     }
120 107
     this.loading1 = true;
121 108
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
109
+      .postCustom("itsm/report", "tripartiteCompany", postData)
123 110
       .subscribe((result) => {
124 111
         this.loading1 = false;
125 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 120
   sortCurrentKey: string = "";
134 121
   sortCurrentValue: string | null = "";
135 122
   sort(e) {
@@ -166,23 +153,20 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
166 153
       nzDuration: 0,
167 154
     }).messageId;
168 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 165
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 166
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 167
     }
184 168
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
169
+      .postExportCustom("itsm/export", "tripartiteCompany", postData)
186 170
       .subscribe((data) => {
187 171
         this.message.remove(this.excelExportLoading);
188 172
         this.excelExportLoading = false;
@@ -210,52 +194,17 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
210 194
 		this.sortCurrentValue = "";
211 195
 		this.sortCurrent = {};
212 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 198
     this.search();
216 199
   }
217 200
 
218
-  // 科室搜索
219
-  changeRepairDeptInp(e) {
220
-    this.searchTimer(this.getRepairDeptList, e);
221
-  }
222
-
223 201
   // 防抖
224 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 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 209
   showSearchMore:boolean = false;
261 210
   showMore(){
@@ -274,5 +223,3 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
274 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 6
       </nz-range-picker>
7 7
     </div>
8 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 18
     </div>
19 19
   </div>
20 20
   <div class="operation">
@@ -24,18 +24,17 @@
24 24
     <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
25 25
   </div>
26 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 28
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
31 29
   <span>{{fieldConfig.fields.category2DTO?.category}}</span>
32 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 33
 </div>
35 34
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
36 35
   <thead (nzSortChange)="sort($event)" nzSingleSort>
37 36
     <tr>
38
-      <th nzWidth="10%" nzShowSort nzSortKey="startDate" [(nzSort)]="sortCurrent.startDate">时间</th>
37
+      <th nzWidth="10%">人员姓名(工号)</th>
39 38
       <th nzWidth="9%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
40 39
       <th nzWidth="9%" nzShowSort nzSortKey="avgResponseTime" [(nzSort)]="sortCurrent.avgResponseTime">平均响应时间</th>
41 40
       <th nzWidth="9%" nzShowSort nzSortKey="avgResolvedTime" [(nzSort)]="sortCurrent.avgResolvedTime">平均解决时间</th>
@@ -50,7 +49,7 @@
50 49
   </thead>
51 50
   <tbody>
52 51
     <tr *ngFor="let data of listOfData">
53
-      <td>{{ data.startDate }}</td>
52
+      <td>{{ data.userName }}({{ data.userAccount }})</td>
54 53
       <td>{{ data.sum }}</td>
55 54
       <td>{{ data.avgResponseTime }}</td>
56 55
       <td>{{ data.avgResolvedTime }}</td>
@@ -66,7 +65,7 @@
66 65
   <ng-template #footerTpl>
67 66
     <table class="footTable">
68 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 69
         <td style="width: 9%">{{ data.sum }}</td>
71 70
         <td style="width: 9%">{{ data.avgResponseTime }}</td>
72 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 23
   pageSize: number = 30; //表格每页展示条数
24 24
   listLength: number = 0; //表格总数据量
25 25
 
26
-  repairDeptId;//报修科室id
26
+  groupId;//维修分组id
27 27
 
28 28
   searchTimerSubject = new Subject();
29 29
 
@@ -50,7 +50,7 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
50 50
   }
51 51
 
52 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 54
     return flag ? 21 : 0;
55 55
   }
56 56
 
@@ -102,24 +102,22 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
102 102
     let postData:any = {
103 103
       idx: this.pageIndex - 1,
104 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 115
     if (field && sort) {
118 116
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
119 117
     }
120 118
     this.loading1 = true;
121 119
     this.mainService
122
-      .postCustom("itsm/report", "incidentWorkOrder", postData)
120
+      .postCustom("itsm/report", "repairUser", postData)
123 121
       .subscribe((result) => {
124 122
         this.loading1 = false;
125 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 131
   sortCurrentKey: string = "";
134 132
   sortCurrentValue: string | null = "";
135 133
   sort(e) {
@@ -166,23 +164,21 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
166 164
       nzDuration: 0,
167 165
     }).messageId;
168 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 177
     if (this.sortCurrentKey && this.sortCurrentValue) {
182 178
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
183 179
     }
184 180
     this.mainService
185
-      .postExportCustom("itsm/export", "incidentWorkOrder", postData)
181
+      .postExportCustom("itsm/export", "repairUser", postData)
186 182
       .subscribe((data) => {
187 183
         this.message.remove(this.excelExportLoading);
188 184
         this.excelExportLoading = false;
@@ -210,14 +206,14 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
210 206
 		this.sortCurrentValue = "";
211 207
 		this.sortCurrent = {};
212 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 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 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 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 239
       idx: 0,
244 240
       sum: 20,
245 241
     };
246 242
     this.isLoading = true;
247 243
     this.mainService
248
-      .getFetchDataList("data", "department", data)
244
+      .getFetchDataList("data", "group2", data)
249 245
       .subscribe((data) => {
250 246
         this.isLoading = false;
251
-        this.repairDeptList = data.list;
247
+        this.groupList = data.list;
252 248
       });
253 249
   }
254 250
 
255 251
   // 详细搜索
256 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 256
   showSearchMore:boolean = false;
261 257
   showMore(){
@@ -274,5 +270,3 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
274 270
     this.onResize();
275 271
   }
276 272
 }
277
-
278
-