seimin 1 kuukausi sitten
vanhempi
commit
bc639a28a5
25 muutettua tiedostoa jossa 1546 lisäystä ja 28 poistoa
  1. 14 0
      src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.html
  2. 5 0
      src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.ts
  3. 29 1
      src/app/views/new-statistics/components/search-more/search-more.component.html
  4. 51 6
      src/app/views/new-statistics/components/search-more/search-more.component.ts
  5. 18 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-inspection-statistics-routing.module.ts
  6. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics-routing.module.ts
  7. 79 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.html
  8. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.less
  9. 278 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.ts
  10. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module.ts
  11. 14 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics-routing.module.ts
  12. 85 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.html
  13. 71 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.less
  14. 252 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.component.ts
  15. 23 0
      src/app/views/new-statistics/distribution-inspection-statistics/hour-quality-control-statistics/hour-quality-control-statistics.module.ts
  16. 9 0
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics-routing.module.ts
  17. 14 0
      src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics-routing.module.ts
  18. 84 0
      src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.html
  19. 71 0
      src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.less
  20. 284 0
      src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.ts
  21. 23 0
      src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.module.ts
  22. 11 8
      src/app/views/new-statistics/maintenance-statistics/work-hour-big-statistics/work-hour-big-statistics.component.html
  23. 2 0
      src/app/views/new-statistics/maintenance-statistics/work-hour-big-statistics/work-hour-big-statistics.component.ts
  24. 13 9
      src/app/views/new-statistics/maintenance-statistics/work-hour-small-statistics/work-hour-small-statistics.component.html
  25. 8 4
      src/app/views/new-statistics/maintenance-statistics/work-hour-small-statistics/work-hour-small-statistics.component.ts

+ 14 - 0
src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.html

@@ -4,6 +4,20 @@
4 4
     </div>
5 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
+        <nz-form-item [hidden]="!fieldConfig.config.group">
8
+          <nz-form-label [nzSpan]="6" nzFor="groupId">分<span style="visibility: hidden;">囧囧</span>组</nz-form-label>
9
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择分组!">
10
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" formControlName="groupId" nzPlaceHolder="请选择分组" (nzOpenChange)="openChangeGroup($event)" (ngModelChange)="changeGroup($event)">
11
+              <ng-container *ngFor="let option of groupList">
12
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
13
+              </ng-container>
14
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
+              </nz-option>
17
+            </nz-select>
18
+          </nz-form-control>
19
+        </nz-form-item>
20
+
7 21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8 22
           <nz-form-label [nzSpan]="6" nzFor="groupId">分<span style="visibility: hidden;">囧囧</span>组</nz-form-label>
9 23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择分组!">

+ 5 - 0
src/app/views/new-statistics/components/distribution-search-more/distribution-search-more.component.ts

@@ -66,6 +66,11 @@ export class DistributionSearchMoreComponent implements OnInit {
66 66
     if (this.validateForm.invalid) return;
67 67
 
68 68
     let fields:any = {}
69
+    if(this.fieldConfig.config.group){
70
+      fields.groupId = this.validateForm.value.groupId;
71
+      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
72
+    }
73
+
69 74
     if(this.fieldConfig.config.groupAndUser){
70 75
       fields.groupId = this.validateForm.value.groupId;
71 76
       fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);

+ 29 - 1
src/app/views/new-statistics/components/search-more/search-more.component.html

@@ -4,6 +4,34 @@
4 4
     </div>
5 5
     <div class="content">
6 6
       <form nz-form [formGroup]="validateForm" class="addForm">
7
+        <nz-form-item [hidden]="!fieldConfig.config.workHourParent">
8
+          <nz-form-label [nzSpan]="6" nzFor="workHourParentId">工时大类</nz-form-label>
9
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择工时大类!">
10
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeWorkHourParentInp($event)" formControlName="workHourParentId" nzPlaceHolder="请选择工时大类" (nzOpenChange)="openChangeWorkHourParent($event)" (ngModelChange)="setIsSelecting(true)">
11
+              <ng-container *ngFor="let option of workHourParentList">
12
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.workName" [nzValue]="option.id"></nz-option>
13
+              </ng-container>
14
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
15
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
16
+              </nz-option>
17
+            </nz-select>
18
+          </nz-form-control>
19
+        </nz-form-item>
20
+
21
+        <nz-form-item [hidden]="!fieldConfig.config.group">
22
+          <nz-form-label [nzSpan]="6" nzFor="groupId">维修分组</nz-form-label>
23
+          <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修分组!">
24
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeGroupInp($event)" formControlName="groupId" nzPlaceHolder="请选择维修分组" (nzOpenChange)="openChangeGroup($event)" (ngModelChange)="changeGroup($event)">
25
+              <ng-container *ngFor="let option of groupList">
26
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
27
+              </ng-container>
28
+              <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
29
+                <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
30
+              </nz-option>
31
+            </nz-select>
32
+          </nz-form-control>
33
+        </nz-form-item>
34
+
7 35
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
8 36
           <nz-form-label [nzSpan]="6" nzFor="groupId">维修分组</nz-form-label>
9 37
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修分组!">
@@ -143,7 +171,7 @@
143 171
             </nz-select>
144 172
           </nz-form-control>
145 173
         </nz-form-item>
146
-				
174
+
147 175
 				<nz-form-item [hidden]="!fieldConfig.config.deptType">
148 176
 				  <nz-form-label [nzSpan]="6" nzFor="deptTypeId">科室类型</nz-form-label>
149 177
 				  <nz-form-control [nzSpan]="18" nzErrorTip="请选择科室类型!">

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

@@ -50,9 +50,10 @@ export class SearchMoreComponent implements OnInit {
50 50
     this.buildingList = this.fieldConfig.fields.buildingDTO ? [this.fieldConfig.fields.buildingDTO] : [];
51 51
     this.floorList = this.fieldConfig.fields.floorDTO ? [this.fieldConfig.fields.floorDTO] : [];
52 52
     this.companyList = this.fieldConfig.fields.companyDTO ? [this.fieldConfig.fields.companyDTO] : [];
53
+    this.workHourParentList = this.fieldConfig.fields.workHourParentDTO ? [this.fieldConfig.fields.workHourParentDTO] : [];
53 54
     this.repairDeptList = this.fieldConfig.fields.repairDeptDTO ? [this.fieldConfig.fields.repairDeptDTO] : [];
54 55
 		this.deptTypeList = this.fieldConfig.fields.deptTypeDTO ? [this.fieldConfig.fields.deptTypeDTO] : [];
55
-		 
56
+
56 57
     this.validateForm = this.fb.group({
57 58
       groupId: [this.fieldConfig.fields.groupId || null],
58 59
       userId: [this.fieldConfig.fields.userId === undefined ? null : this.fieldConfig.fields.userId],
@@ -63,6 +64,7 @@ export class SearchMoreComponent implements OnInit {
63 64
       buildingId: [this.fieldConfig.fields.buildingId || null],
64 65
       floorId: [this.fieldConfig.fields.floorId === undefined ? null : this.fieldConfig.fields.floorId],
65 66
       companyId: [this.fieldConfig.fields.companyDTO ? this.fieldConfig.fields.companyDTO.id  : null],
67
+      workHourParentId: [this.fieldConfig.fields.workHourParentDTO ? this.fieldConfig.fields.workHourParentDTO.id  : null],
66 68
       repairDeptId: [this.fieldConfig.fields.repairDeptDTO ? this.fieldConfig.fields.repairDeptDTO.id  : null],
67 69
 			deptTypeId: [this.fieldConfig.fields.deptTypeId || null],
68 70
 		});
@@ -87,6 +89,11 @@ export class SearchMoreComponent implements OnInit {
87 89
       hierarchy = 1;
88 90
     }
89 91
     let fields:any = {}
92
+    if(this.fieldConfig.config.group){
93
+      fields.groupId = this.validateForm.value.groupId;
94
+      fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
95
+    }
96
+
90 97
     if(this.fieldConfig.config.groupAndUser){
91 98
       fields.groupId = this.validateForm.value.groupId;
92 99
       fields.groupDTO = this.groupList.find(item => item.id == this.validateForm.value.groupId);
@@ -114,6 +121,10 @@ export class SearchMoreComponent implements OnInit {
114 121
       fields.companyId = this.validateForm.value.companyId;
115 122
       fields.companyDTO = this.companyList.find(item => item.id == this.validateForm.value.companyId);
116 123
     }
124
+    if(this.fieldConfig.config.workHourParent){
125
+      fields.workHourParentId = this.validateForm.value.workHourParentId;
126
+      fields.workHourParentDTO = this.workHourParentList.find(item => item.id == this.validateForm.value.workHourParentId);
127
+    }
117 128
     if(this.fieldConfig.config.repairDept){
118 129
       fields.repairDeptId = this.validateForm.value.repairDeptId;
119 130
       fields.repairDeptDTO = this.repairDeptList.find(item => item.id == this.validateForm.value.repairDeptId);
@@ -122,7 +133,7 @@ export class SearchMoreComponent implements OnInit {
122 133
 		  fields.deptTypeId = this.validateForm.value.deptTypeId;
123 134
 		  fields.deptTypeDTO = this.deptTypeList.find(item => item.id == this.validateForm.value.deptTypeId);
124 135
 		}
125
-		
136
+
126 137
     this.submitEvent.emit(fields);
127 138
     this.hideModal();
128 139
   }
@@ -188,14 +199,14 @@ export class SearchMoreComponent implements OnInit {
188 199
     this.validateForm.controls.userId.setValue(null);
189 200
     this.getUserList();
190 201
   }
191
-	
202
+
192 203
 	// =================科室类型===================
193
-	
204
+
194 205
 	// 科室类型
195 206
 	openChangeDeptType(flag){
196 207
 	  flag && this.getDeptTypeList();
197 208
 	}
198
-	
209
+
199 210
 	// 获取科室类型列表
200 211
 	deptTypeList:any[] = [];
201 212
 	getDeptTypeList(keyword?) {
@@ -207,7 +218,7 @@ export class SearchMoreComponent implements OnInit {
207 218
 	      this.deptTypeList = data;
208 219
 	    });
209 220
 	}
210
-	
221
+
211 222
   // =================维修人员===================
212 223
 
213 224
   // 维修人员搜索
@@ -529,4 +540,38 @@ export class SearchMoreComponent implements OnInit {
529 540
     flag && this.setIsSelecting(false);
530 541
     flag && this.getRepairDeptList();
531 542
   }
543
+
544
+  // =================工时大类===================
545
+
546
+  // 工时大类搜索
547
+  changeWorkHourParentInp(e) {
548
+    this.searchTimer(this.getWorkHourParentList, e);
549
+  }
550
+
551
+  // 获取工时大类列表
552
+  workHourParentList:any[] = [];
553
+  getWorkHourParentList(keyword?){
554
+    let postData: any = {
555
+      idx: 0,
556
+      sum: 20,
557
+      workHourManagement: {
558
+        keyWords: keyword,
559
+        treeLevel: 1,
560
+        statisticalHosId: this.getHosId,
561
+      },
562
+    };
563
+    this.isLoading = true;
564
+    this.mainService.getFetchDataList("simple/data", "workHourManagement", postData).subscribe(result => {
565
+      this.isLoading = false;
566
+      if(result.status == 200){
567
+        this.workHourParentList = result.list || [];
568
+      }else{
569
+        this.workHourParentList = [];
570
+      }
571
+    });
572
+  }
573
+  openChangeWorkHourParent(flag){
574
+    flag && this.setIsSelecting(false);
575
+    flag && this.getWorkHourParentList();
576
+  }
532 577
 }

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

@@ -116,6 +116,24 @@ const routes: Routes = [
116 116
 			    title: '配-任务类型质控统计'
117 117
 			  }
118 118
 			},
119
+			{
120
+			  // 人员评价统计
121
+			  path: 'distributionUserEvaluateStatistics',
122
+			  loadChildren: () => import('./distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module').then(m => m.DistributionUserEvaluateStatisticsModule),
123
+			  data: {
124
+			    reuse: true,
125
+			    title: '配-人员评价统计'
126
+			  }
127
+			},
128
+      {
129
+			  // 24小时质控统计
130
+			  path: 'hourQualityControlStatistics',
131
+			  loadChildren: () => import('./hour-quality-control-statistics/hour-quality-control-statistics.module').then(m => m.HourQualityControlStatisticsModule),
132
+			  data: {
133
+			    reuse: true,
134
+			    title: '配-24小时质控统计'
135
+			  }
136
+			},
119 137
     ]
120 138
   }
121 139
 ];

+ 14 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics-routing.module.ts

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

+ 79 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.html

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

+ 71 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.less

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

+ 278 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.component.ts

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

+ 23 - 0
src/app/views/new-statistics/distribution-inspection-statistics/distribution-user-evaluate-statistics/distribution-user-evaluate-statistics.module.ts

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

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

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

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

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

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

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

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

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

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

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

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

@@ -161,6 +161,15 @@ const routes: Routes = [
161 161
           title: '修-工时大类统计'
162 162
         }
163 163
       },
164
+      {
165
+        // 人员评价统计
166
+        path: 'userEvaluateStatistics',
167
+        loadChildren: () => import('./user-evaluate-statistics/user-evaluate-statistics.module').then(m => m.UserEvaluateStatisticsModule),
168
+        data: {
169
+          reuse: true,
170
+          title: '修-人员评价统计'
171
+        }
172
+      },
164 173
     ]
165 174
   }
166 175
 ];

+ 14 - 0
src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics-routing.module.ts

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

+ 84 - 0
src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.html

@@ -0,0 +1,84 @@
1
+<div class="searchDataWrap">
2
+  <div class="searchData">
3
+    <app-custom-change-date #customChangeDate [isShowType]="false"></app-custom-change-date>
4
+    <div class="searchDataItem">
5
+      <span class="label">维修人员</span>:
6
+      <nz-select class="selectItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" nzAllowClear nzPlaceHolder="请选择维修人员" [(ngModel)]="userId" (nzOpenChange)="openChangeUser($event)">
7
+        <ng-container *ngFor="let option of userList">
8
+          <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
9
+        </ng-container>
10
+        <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
11
+          <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
12
+        </nz-option>
13
+      </nz-select>
14
+    </div>
15
+  </div>
16
+  <div class="operation">
17
+    <i class="icon_transport transport-gengduo" nz-tooltip nzTooltipTitle="更多搜索" (click)="showMore()"></i>
18
+    <button nz-button class="btn default" (click)="search()">查询</button>
19
+    <button nz-button class="btn default ml8" (click)="reset()">重置</button>
20
+    <button nz-button class="btn default ml8" (click)="excelExport()" [nzLoading]="excelExportLoading">导出</button>
21
+  </div>
22
+</div>
23
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.repairDeptDTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO">
24
+  <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
25
+  <span>{{fieldConfig.fields.category1DTO?.category}}</span>
26
+  <span>{{fieldConfig.fields.category2DTO?.category}}</span>
27
+  <span>{{fieldConfig.fields.category3DTO?.category}}</span>
28
+  <span>{{fieldConfig.fields.buildingDTO?.buildingName}}</span>
29
+  <span>{{fieldConfig.fields.floorDTO?.floorName}}</span>
30
+  <span>{{fieldConfig.fields.repairDeptDTO?.dept}}</span>
31
+</div>
32
+<nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
33
+  <thead (nzSortChange)="sort($event)" nzSingleSort>
34
+    <tr>
35
+      <th nzWidth="10%">人员姓名(工号)</th>
36
+      <th nzWidth="10%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">工单总数</th>
37
+      <th nzWidth="10%" nzShowSort nzSortKey="degreeCount" [(nzSort)]="sortCurrent.degreeCount">评价工单数</th>
38
+      <th nzWidth="10%" nzShowSort nzSortKey="oneStar" [(nzSort)]="sortCurrent.oneStar">一星</th>
39
+      <th nzWidth="10%" nzShowSort nzSortKey="twoStar" [(nzSort)]="sortCurrent.twoStar">二星</th>
40
+      <th nzWidth="10%" nzShowSort nzSortKey="threeStar" [(nzSort)]="sortCurrent.threeStar">三星</th>
41
+      <th nzWidth="10%" nzShowSort nzSortKey="fourStar" [(nzSort)]="sortCurrent.fourStar">四星</th>
42
+      <th nzWidth="10%" nzShowSort nzSortKey="fiveStar" [(nzSort)]="sortCurrent.fiveStar">五星</th>
43
+      <th nzWidth="10%" nzShowSort nzSortKey="totalStar" [(nzSort)]="sortCurrent.totalStar">评价总星数</th>
44
+      <th nzWidth="10%" nzShowSort nzSortKey="avgStar" [(nzSort)]="sortCurrent.avgStar">平均总星数</th>
45
+    </tr>
46
+  </thead>
47
+  <tbody>
48
+    <tr *ngFor="let data of listOfData">
49
+      <td>{{ data.userName }}<ng-container *ngIf="data.userAccount">({{ data.userAccount }})</ng-container></td>
50
+      <td>{{ data.sum }}</td>
51
+      <td>{{ data.degreeCount }}</td>
52
+      <td>{{ data.oneStar }}</td>
53
+      <td>{{ data.twoStar }}</td>
54
+      <td>{{ data.threeStar }}</td>
55
+      <td>{{ data.fourStar }}</td>
56
+      <td>{{ data.fiveStar }}</td>
57
+      <td>{{ data.totalStar }}</td>
58
+      <td>{{ data.avgStar }}</td>
59
+    </tr>
60
+  </tbody>
61
+  <ng-template #footerTpl>
62
+    <table class="footTable">
63
+      <tr *ngFor="let data of listOfDataEnd">
64
+        <td style="width: 10%">{{ data.userName }}</td>
65
+        <td style="width: 10%">{{ data.sum }}</td>
66
+        <td style="width: 10%">{{ data.degreeCount }}</td>
67
+        <td style="width: 10%">{{ data.oneStar }}</td>
68
+        <td style="width: 10%">{{ data.twoStar }}</td>
69
+        <td style="width: 10%">{{ data.threeStar }}</td>
70
+        <td style="width: 10%">{{ data.fourStar }}</td>
71
+        <td style="width: 10%">{{ data.fiveStar }}</td>
72
+        <td style="width: 10%">{{ data.totalStar }}</td>
73
+        <td style="width: 10%">{{ data.avgStar }}</td>
74
+      </tr>
75
+    </table>
76
+  </ng-template>
77
+</nz-table>
78
+<div class="pagination">
79
+  <ng-template #totalTemplate let-total> 共 {{ total }} 条 </ng-template>
80
+  <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)" nzShowSizeChanger [nzPageSizeOptions]="[30,50,100,200]" [nzShowTotal]="totalTemplate"></nz-pagination>
81
+</div>
82
+
83
+<!-- 详细搜索 -->
84
+<app-search-more [fieldConfig]="fieldConfig" *ngIf="showSearchMore" [hosId]="hosId" [queryType]="queryType"  [dutyId]="dutyId"  [parentDutyId]="parentDutyId" (cancelEvent)="cancelEvent()" (submitEvent)="submitEvent($event)"></app-search-more>

+ 71 - 0
src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.less

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

+ 284 - 0
src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.component.ts

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

+ 23 - 0
src/app/views/new-statistics/maintenance-statistics/user-evaluate-statistics/user-evaluate-statistics.module.ts

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

+ 11 - 8
src/app/views/new-statistics/maintenance-statistics/work-hour-big-statistics/work-hour-big-statistics.component.html

@@ -37,10 +37,11 @@
37 37
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
38 38
   <thead (nzSortChange)="sort($event)" nzSingleSort>
39 39
     <tr>
40
-      <th nzWidth="25%">工时名称</th>
41
-      <th nzWidth="25%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">含工时工单总数</th>
42
-      <th nzWidth="25%" nzShowSort nzSortKey="workHourNum" [(nzSort)]="sortCurrent.workHourNum">使用数量</th>
43
-      <th nzWidth="25%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">总费用(元)</th>
40
+      <th nzWidth="20%">工时名称</th>
41
+      <th nzWidth="20%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">含工时工单总数</th>
42
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourNum" [(nzSort)]="sortCurrent.workHourNum">使用数量</th>
43
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">总费用(元)</th>
44
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourScore" [(nzSort)]="sortCurrent.workHourScore">总积分</th>
44 45
     </tr>
45 46
   </thead>
46 47
   <tbody>
@@ -49,15 +50,17 @@
49 50
       <td>{{ data.sum }}</td>
50 51
       <td>{{ data.workHourNum }}</td>
51 52
       <td>{{ data.workHourPrice }}</td>
53
+      <td>{{ data.workHourScore }}</td>
52 54
     </tr>
53 55
   </tbody>
54 56
   <ng-template #footerTpl>
55 57
     <table class="footTable">
56 58
       <tr *ngFor="let data of listOfDataEnd">
57
-        <td style="width: 25%">{{ data.workHourName }}</td>
58
-        <td style="width: 25%">{{ data.sum }}</td>
59
-        <td style="width: 25%">{{ data.workHourNum }}</td>
60
-        <td style="width: 25%">{{ data.workHourPrice }}</td>
59
+        <td style="width: 20%">{{ data.workHourName }}</td>
60
+        <td style="width: 20%">{{ data.sum }}</td>
61
+        <td style="width: 20%">{{ data.workHourNum }}</td>
62
+        <td style="width: 20%">{{ data.workHourPrice }}</td>
63
+        <td style="width: 20%">{{ data.workHourScore }}</td>
61 64
       </tr>
62 65
     </table>
63 66
   </ng-template>

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/work-hour-big-statistics/work-hour-big-statistics.component.ts

@@ -113,6 +113,7 @@ export class WorkHourBigStatisticsComponent implements OnInit, AfterViewInit {
113 113
     let postData:any = {
114 114
       idx: this.pageIndex - 1,
115 115
       sum: this.pageSize,
116
+      treeLevel: 1,
116 117
       startDate: this.dateRange[0] || undefined,
117 118
       endDate: this.dateRange[1] || undefined,
118 119
       hosId: this.hosId || undefined,
@@ -179,6 +180,7 @@ export class WorkHourBigStatisticsComponent implements OnInit, AfterViewInit {
179 180
       nzDuration: 0,
180 181
     }).messageId;
181 182
     let postData:any = {
183
+      treeLevel: 1,
182 184
       startDate: this.dateRange[0] || undefined,
183 185
       endDate: this.dateRange[1] || undefined,
184 186
       hosId: this.hosId || undefined,

+ 13 - 9
src/app/views/new-statistics/maintenance-statistics/work-hour-small-statistics/work-hour-small-statistics.component.html

@@ -24,7 +24,8 @@
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.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.companyDTO">
27
+<div class="moreFilter" *ngIf="fieldConfig.fields.groupDTO || fieldConfig.fields.userDTO || fieldConfig.fields.category1DTO || fieldConfig.fields.category2DTO || fieldConfig.fields.category3DTO || fieldConfig.fields.buildingDTO || fieldConfig.fields.floorDTO || fieldConfig.fields.companyDTO || fieldConfig.fields.workHourParentDTO">
28
+  <span>{{fieldConfig.fields.workHourParentDTO?.workName}}</span>
28 29
   <span>{{fieldConfig.fields.groupDTO?.groupName}}</span>
29 30
   <span>{{fieldConfig.fields.userDTO?.name}}</span>
30 31
   <span>{{fieldConfig.fields.category1DTO?.category}}</span>
@@ -37,10 +38,11 @@
37 38
 <nz-table class="table" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false" [nzLoading]="loading1" [nzScroll]="{ y: tableHeight + 'px' }" [nzFooter]="footerTpl">
38 39
   <thead (nzSortChange)="sort($event)" nzSingleSort>
39 40
     <tr>
40
-      <th nzWidth="25%">工时名称</th>
41
-      <th nzWidth="25%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">含工时工单总数</th>
42
-      <th nzWidth="25%" nzShowSort nzSortKey="workHourNum" [(nzSort)]="sortCurrent.workHourNum">使用数量</th>
43
-      <th nzWidth="25%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">总费用(元)</th>
41
+      <th nzWidth="20%">工时名称</th>
42
+      <th nzWidth="20%" nzShowSort nzSortKey="sum" [(nzSort)]="sortCurrent.sum">含工时工单总数</th>
43
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourNum" [(nzSort)]="sortCurrent.workHourNum">使用数量</th>
44
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourPrice" [(nzSort)]="sortCurrent.workHourPrice">总费用(元)</th>
45
+      <th nzWidth="20%" nzShowSort nzSortKey="workHourScore" [(nzSort)]="sortCurrent.workHourScore">总积分</th>
44 46
     </tr>
45 47
   </thead>
46 48
   <tbody>
@@ -49,15 +51,17 @@
49 51
       <td>{{ data.sum }}</td>
50 52
       <td>{{ data.workHourNum }}</td>
51 53
       <td>{{ data.workHourPrice }}</td>
54
+      <td>{{ data.workHourScore }}</td>
52 55
     </tr>
53 56
   </tbody>
54 57
   <ng-template #footerTpl>
55 58
     <table class="footTable">
56 59
       <tr *ngFor="let data of listOfDataEnd">
57
-        <td style="width: 25%">{{ data.workHourName }}</td>
58
-        <td style="width: 25%">{{ data.sum }}</td>
59
-        <td style="width: 25%">{{ data.workHourNum }}</td>
60
-        <td style="width: 25%">{{ data.workHourPrice }}</td>
60
+        <td style="width: 20%">{{ data.workHourName }}</td>
61
+        <td style="width: 20%">{{ data.sum }}</td>
62
+        <td style="width: 20%">{{ data.workHourNum }}</td>
63
+        <td style="width: 20%">{{ data.workHourPrice }}</td>
64
+        <td style="width: 20%">{{ data.workHourScore }}</td>
61 65
       </tr>
62 66
     </table>
63 67
   </ng-template>

+ 8 - 4
src/app/views/new-statistics/maintenance-statistics/work-hour-small-statistics/work-hour-small-statistics.component.ts

@@ -61,7 +61,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
61 61
   }
62 62
 
63 63
   get getMoreFilter(){
64
-    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.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.companyDTO;
64
+    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.buildingDTO || this.fieldConfig.fields.floorDTO || this.fieldConfig.fields.companyDTO || this.fieldConfig.fields.workHourParentDTO;
65 65
     return flag ? 37 : 0;
66 66
   }
67 67
 
@@ -113,6 +113,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
113 113
     let postData:any = {
114 114
       idx: this.pageIndex - 1,
115 115
       sum: this.pageSize,
116
+      treeLevel: 2,
116 117
       startDate: this.dateRange[0] || undefined,
117 118
       endDate: this.dateRange[1] || undefined,
118 119
       hosId: this.hosId || undefined,
@@ -126,6 +127,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
126 127
       buildingId: this.fieldConfig.fields.buildingId || undefined,
127 128
       placeId: this.fieldConfig.fields.floorId || undefined,
128 129
       companyId: this.fieldConfig.fields.companyId || undefined,
130
+      workHourParentId: this.fieldConfig.fields.workHourParentId || undefined,
129 131
     };
130 132
     if (field && sort) {
131 133
       postData.sort = `${field} ${sort === "ascend" ? `asc` : `desc`}`
@@ -179,6 +181,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
179 181
       nzDuration: 0,
180 182
     }).messageId;
181 183
     let postData:any = {
184
+      treeLevel: 2,
182 185
       startDate: this.dateRange[0] || undefined,
183 186
       endDate: this.dateRange[1] || undefined,
184 187
       hosId: this.hosId || undefined,
@@ -192,6 +195,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
192 195
       buildingId: this.fieldConfig.fields.buildingId || undefined,
193 196
       placeId: this.fieldConfig.fields.floorId || undefined,
194 197
       companyId: this.fieldConfig.fields.companyId || undefined,
198
+      workHourParentId: this.fieldConfig.fields.workHourParentId || undefined,
195 199
     };
196 200
     if (this.sortCurrentKey && this.sortCurrentValue) {
197 201
       postData.sort = `${this.sortCurrentKey} ${this.sortCurrentValue === "ascend" ? `asc` : `desc`}`
@@ -226,7 +230,7 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
226 230
 		this.sortCurrent = {};
227 231
     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')]
228 232
     this.repairDeptId = undefined;
229
-    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined};
233
+    this.fieldConfig.fields = {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, workHourParentId: undefined};
230 234
     this.search();
231 235
   }
232 236
 
@@ -269,8 +273,8 @@ export class WorkHourSmallStatisticsComponent implements OnInit, AfterViewInit {
269 273
 
270 274
   // 详细搜索
271 275
   fieldConfig:any = {
272
-    fields: {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined},
273
-    config: {groupAndUser: true, category123: true, buildingAndFloor: true, company: true},
276
+    fields: {groupId: undefined, userId: undefined, categoryId: undefined, buildingId: undefined, floorId: undefined, companyId: undefined, workHourParentId: undefined},
277
+    config: {groupAndUser: true, category123: true, buildingAndFloor: true, company: true, workHourParent: true},
274 278
   }
275 279
   showSearchMore:boolean = false;
276 280
   showMore(){