ソースを参照

人员统计,科室统计,全院统计

seimin 11 ヶ月 前
コミット
bf8e38a405

+ 38 - 18
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.html

@@ -33,11 +33,36 @@
33 33
             <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
34 34
           </nz-select>
35 35
         </div>
36
+        <div class="list-template__searchItem">
37
+          <span class="label">科室名称</span>:
38
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
39
+            (nzOnSearch)="changeInp($event, 'getDeptList')" nzAllowClear nzPlaceHolder="请选择科室名称" [(ngModel)]="searchDto.dept">
40
+            <ng-container *ngFor="let option of deptList">
41
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
42
+            </ng-container>
43
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
44
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
+            </nz-option>
46
+          </nz-select>
47
+        </div>
48
+        <div class="list-template__searchItem">
49
+          <span class="label">楼栋名称</span>:
50
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
51
+            (nzOnSearch)="changeInp($event, 'getBuildingList')" nzAllowClear nzPlaceHolder="请选择楼栋名称" [(ngModel)]="searchDto.building">
52
+            <ng-container *ngFor="let option of buildingList">
53
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.buildingName" [nzValue]="option.id"></nz-option>
54
+            </ng-container>
55
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
56
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
57
+            </nz-option>
58
+          </nz-select>
59
+        </div>
36 60
       </div>
37 61
       <div nz-col nzXl='6' class="list-template__btns">
38 62
         <button nz-button class="btn default" (click)='search(1)'>搜索</button>
39 63
         <button nz-button class="btn default ml8" (click)='export()' [nzLoading]="loading2">导出</button>
40 64
         <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
65
+        <button nz-button class="btn default ml8" (click)='exportDetail()' [nzLoading]="loading3" [disabled]="!checkedDepIds.length">批量导出详细科室报表</button>
41 66
       </div>
42 67
     </div>
43 68
     <div class="list-template__bottom">
@@ -45,29 +70,24 @@
45 70
         [nzLoading]="loading1">
46 71
         <thead (nzSortChange)="sort($event)" nzSingleSort>
47 72
           <tr class="thead">
73
+            <th nzWidth="5%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked"
74
+              (nzCheckedChange)="checkAll($event)"></th>
48 75
             <th nzWidth="5%">序号</th>
49
-            <th nzWidth="5%">人员姓名</th>
50
-            <th nzShowSort nzWidth="10%" nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
51
-            <th nzShowSort nzWidth="10%" nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
52
-            <th nzShowSort nzWidth="10%" nzSortKey="getTrip" [(nzSort)]="sortCurrent.getTrip">回收趟数</th>
53
-            <th nzShowSort nzWidth="10%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
54
-            <th nzShowSort nzWidth="10%" nzSortKey="getClothesNum" [(nzSort)]="sortCurrent.getClothesNum">回收被服数量</th>
55
-            <th nzShowSort nzWidth="10%" nzSortKey="sendTrip" [(nzSort)]="sortCurrent.sendTrip">送回趟数</th>
56
-            <th nzShowSort nzWidth="10%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
57
-            <th nzShowSort nzWidth="10%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">送回被服数量</th>
58
-            <th nzShowSort nzWidth="10%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
76
+            <th nzWidth="5%">科室名称</th>
77
+            <th nzShowSort nzWidth="17%" nzSortKey="clothesTypeNum" [(nzSort)]="sortCurrent.clothesTypeNum">回收种类数</th>
78
+            <th nzShowSort nzWidth="17%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收单数</th>
79
+            <th nzShowSort nzWidth="17%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回单数</th>
80
+            <th nzShowSort nzWidth="17%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">洗涤被服数量</th>
81
+            <th nzShowSort nzWidth="17%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
59 82
           </tr>
60 83
         </thead>
61 84
         <tbody>
62
-          <tr *ngFor="let data of listOfData;let index=index;">
85
+          <tr *ngFor="let data of listOfData;let index=index;" (click)="selectedListData(data)">
86
+            <td nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" (nzCheckedChange)="refreshStatus()"></td>
63 87
             <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
64
-            <td>{{ data.userName }}</td>
65
-            <td>{{ data.totalTrip }}</td>
66
-            <td>{{ data.totalOrder }}</td>
67
-            <td>{{ data.getTrip }}</td>
88
+            <td>{{ data.dept || '' }}</td>
89
+            <td>{{ data.clothesTypeNum }}</td>
68 90
             <td>{{ data.getOrder }}</td>
69
-            <td>{{ data.getClothesNum }}</td>
70
-            <td>{{ data.sendTrip }}</td>
71 91
             <td>{{ data.sendOrder }}</td>
72 92
             <td>{{ data.sendClothesNum }}</td>
73 93
             <td>{{ data.price }}</td>
@@ -75,7 +95,7 @@
75 95
         </tbody>
76 96
       </nz-table>
77 97
       <div class="list-template__pagination">
78
-        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
98
+        <nz-pagination [(nzPageIndex)]="pageIndex" [nzPageSizeOptions]="[10,100]" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
79 99
           (nzPageIndexChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)"
80 100
           (nzPageSizeChange)="getList(pageIndex, sortCurrentKey, sortCurrentValue)">
81 101
         </nz-pagination>

+ 161 - 13
src/app/views/quilt-washing-department-statistics/quilt-washing-department-statistics.component.ts

@@ -6,6 +6,8 @@ import { MainService } from "../../services/main.service";
6 6
 import { DateService } from "../../services/date.service";
7 7
 import { MyServiceService } from "../../services/my-service.service";
8 8
 import { ToolService } from "../../services/tool.service";
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
9 11
 
10 12
 @Component({
11 13
   selector: "app-quilt-washing-department-statistics",
@@ -22,11 +24,22 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
22 24
     private tool: ToolService
23 25
   ) {}
24 26
 
27
+  searchTimerSubject = new Subject();
28
+
29
+  searchDto: any = {
30
+    dept: null,
31
+    building: null,
32
+  }
33
+
25 34
   ngOnInit() {
35
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
36
+      let fun = v[0];
37
+      fun.call(this, v[1]);
38
+    });
26 39
     this.coopBtns = this.tool.initCoopBtns(this.route);
27 40
     this.getAllHos();
28 41
     this.changeDateRange(this.defRange);
29
-    this.search();
42
+    // this.search();
30 43
   }
31 44
 
32 45
   dateType: string = "day"; //选中时间维度
@@ -116,12 +129,17 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
116 129
   // 导出
117 130
   loading2 = false;
118 131
   export() {
132
+    this.mapOfCheckedId = {};
133
+    this.checkedDepIds = [];
134
+    this.isAllDisplayDataChecked = false;
119 135
     let that = this;
120 136
     let postData: any = {
121 137
       startTime: this.startDate + " " + "00:00:00",
122 138
       endTime: this.endDate + " " + "23:59:59",
123 139
       hosId: that.hospital,
124 140
       type: this.dateType,
141
+      deptId: this.searchDto.dept || undefined,
142
+      buildingId: this.searchDto.building || undefined,
125 143
     };
126 144
     if (this.sortCurrentKey && this.sortCurrentValue) {
127 145
       postData.sort =
@@ -152,6 +170,51 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
152 170
       }
153 171
     );
154 172
   }
173
+  // 批量导出详细科室报表
174
+  loading3 = false;
175
+  exportDetail() {
176
+    let ids = this.checkedDepIds.join(",");
177
+    this.mapOfCheckedId = {};
178
+    this.checkedDepIds = [];
179
+    this.isAllDisplayDataChecked = false;
180
+    let that = this;
181
+    let postData: any = {
182
+      startTime: this.startDate + " " + "00:00:00",
183
+      endTime: this.endDate + " " + "23:59:59",
184
+      hosId: that.hospital,
185
+      type: this.dateType,
186
+      deptId: ids || undefined,
187
+      buildingId: this.searchDto.building || undefined,
188
+    };
189
+    if (this.sortCurrentKey && this.sortCurrentValue) {
190
+      postData.sort =
191
+        this.sortCurrentValue === "ascend"
192
+          ? this.sortCurrentKey
193
+          : `${this.sortCurrentKey} desc`;
194
+    }
195
+    this.loading3 = true;
196
+    that.mainService.exportReport("clothesDeptDetails", postData).subscribe(
197
+      (data) => {
198
+        this.loading3 = false;
199
+        this.showPromptModal("导出", true, "");
200
+        var file = new Blob([data], {
201
+          type: "application/vnd.ms-excel",
202
+        });
203
+        //trick to download store a file having its URL
204
+        var fileURL = URL.createObjectURL(file);
205
+        var a = document.createElement("a");
206
+        a.href = fileURL;
207
+        a.target = "_blank";
208
+        a.download = "详细科室报表.xls";
209
+        document.body.appendChild(a);
210
+        a.click();
211
+      },
212
+      (err) => {
213
+        this.loading3 = false;
214
+        this.showPromptModal("导出", false, "");
215
+      }
216
+    );
217
+  }
155 218
   // 重置
156 219
   reset() {
157 220
     this.changeDateType("day");
@@ -159,16 +222,52 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
159 222
     this.sortCurrentKey = "";
160 223
     this.sortCurrentValue = "";
161 224
     this.sortCurrent = {
162
-      source1: null,
163
-      source2: null,
164
-      source3: null,
165
-      source4: null,
225
+      clothesTypeNum: null,
226
+      getOrder: null,
227
+      sendOrder: null,
228
+      sendClothesNum: null,
229
+      price: null,
166 230
     };
231
+    this.searchDto = {
232
+      dept: null,
233
+      building: null,
234
+    }
167 235
     this.search();
168 236
   }
237
+  // 选中表格单列
238
+  mapOfCheckedId: { [key: string]: boolean } = {};
239
+  checkedDepIds = []; //已选中单列id
240
+  refreshStatus(): void {
241
+    this.isAllDisplayDataChecked = this.listOfData.every(
242
+      (item) => this.mapOfCheckedId[item.id]
243
+    );
244
+    let arr = [];
245
+    for (var k in this.mapOfCheckedId) {
246
+      if (this.mapOfCheckedId[k]) {
247
+        arr.push(Number(k));
248
+      }
249
+    }
250
+    this.checkedDepIds = arr;
251
+  }
252
+  // 整行操作
253
+  selectedListData(data) {
254
+    this.mapOfCheckedId[data.id] = !this.mapOfCheckedId[data.id];
255
+    this.refreshStatus();
256
+  }
257
+  // 全选
258
+  isAllDisplayDataChecked = false; //当前页是否全选
259
+  checkAll(value: boolean): void {
260
+    this.listOfData.forEach((item) => {
261
+      this.mapOfCheckedId[item.id] = value;
262
+    });
263
+    this.refreshStatus();
264
+  }
169 265
   // 表格数据
170 266
   loading1 = false;
171 267
   getList(num?: number, field?: string, sort?: string) {
268
+    this.mapOfCheckedId = {};
269
+    this.checkedDepIds = [];
270
+    this.isAllDisplayDataChecked = false;
172 271
     this.pageIndex = num;
173 272
     let postData: any = {
174 273
       idx: this.pageIndex - 1,
@@ -177,6 +276,8 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
177 276
       endTime: this.searchData.dateRange.end,
178 277
       hosId: this.searchData.hosId,
179 278
       type: this.dateType,
279
+      deptId: this.searchDto.dept || undefined,
280
+      buildingId: this.searchDto.building || undefined,
180 281
     };
181 282
     if (field && sort) {
182 283
       postData.sort = sort === "ascend" ? field : `${field} desc`;
@@ -194,6 +295,53 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
194 295
   hospital: string; //选中院区
195 296
   getAllHos() {
196 297
     this.hospital = this.tool.getCurrentHospital().id + "";
298
+    this.getDeptList();
299
+    this.getBuildingList();
300
+  }
301
+
302
+  // 边输边搜节流阀
303
+  changeInp(e, fn) {
304
+    this.searchTimer(this[fn], e);
305
+  }
306
+  // 获取科室
307
+  deptList: any = [];
308
+  getDeptList(keyword = '') {
309
+    let postData = {
310
+      department: {
311
+        searchType: 1,// 简单查询
312
+        cascadeHosId: this.hospital,
313
+        dept: keyword,
314
+      },
315
+      idx: 0,
316
+      sum: 10,
317
+    };
318
+    this.isLoading = true;
319
+    this.mainService
320
+      .getFetchDataList("data", "department", postData)
321
+      .subscribe((result) => {
322
+        this.isLoading = false;
323
+        this.deptList = result.list;
324
+      });
325
+  }
326
+
327
+  // 获取楼栋
328
+  buildingList: any = [];
329
+  getBuildingList(keyword = '') {
330
+    let postData = {
331
+      building: {
332
+        cascadeHosId: this.hospital,
333
+        buildingName: keyword
334
+      },
335
+      idx: 0,
336
+      sum: 10,
337
+    };
338
+    this.isLoading = true;
339
+    this.mainService
340
+      .getFetchDataList("data", "building", postData)
341
+      .subscribe((result) => {
342
+        this.isLoading = false;
343
+        this.buildingList = result.list;
344
+      });
197 345
   }
198 346
 
199 347
   // 修改时间展示维度
@@ -432,17 +580,17 @@ export class QuiltWashingDepartmentStatisticsComponent implements OnInit {
432 580
 
433 581
   // 边输入边搜索节流阀
434 582
   isLoading: boolean = false;
435
-  searchTimer(fun, e, those) {
436
-    let that = this;
437
-    that.isLoading = true;
438
-    fun(e, those);
583
+  searchTimer(fun, e) {
584
+    this.isLoading = true;
585
+    this.searchTimerSubject.next([fun, e]);
439 586
   }
440 587
   // 列表排序
441 588
   sortCurrent = {
442
-    source1: null,
443
-    source2: null,
444
-    source3: null,
445
-    source4: null,
589
+    clothesTypeNum: null,
590
+    getOrder: null,
591
+    sendOrder: null,
592
+    sendClothesNum: null,
593
+    price: null,
446 594
   };
447 595
   sortCurrentKey: string = "";
448 596
   sortCurrentValue: string | null = "";

+ 10 - 16
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.html

@@ -46,28 +46,22 @@
46 46
         <thead (nzSortChange)="sort($event)" nzSingleSort>
47 47
           <tr class="thead">
48 48
             <th nzWidth="5%">序号</th>
49
-            <th nzWidth="5%">人员姓名</th>
50
-            <th nzShowSort nzWidth="10%" nzSortKey="totalTrip" [(nzSort)]="sortCurrent.totalTrip">总趟数</th>
51
-            <th nzShowSort nzWidth="10%" nzSortKey="totalOrder" [(nzSort)]="sortCurrent.totalOrder">总单数</th>
52
-            <th nzShowSort nzWidth="10%" nzSortKey="getTrip" [(nzSort)]="sortCurrent.getTrip">回收趟数</th>
53
-            <th nzShowSort nzWidth="10%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
54
-            <th nzShowSort nzWidth="10%" nzSortKey="getClothesNum" [(nzSort)]="sortCurrent.getClothesNum">回收被服数量</th>
55
-            <th nzShowSort nzWidth="10%" nzSortKey="sendTrip" [(nzSort)]="sortCurrent.sendTrip">送回趟数</th>
56
-            <th nzShowSort nzWidth="10%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
57
-            <th nzShowSort nzWidth="10%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">送回被服数量</th>
58
-            <th nzShowSort nzWidth="10%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
49
+            <th nzWidth="11%">日期</th>
50
+            <th nzShowSort nzWidth="14%" nzSortKey="deptNum" [(nzSort)]="sortCurrent.deptNum">科室数</th>
51
+            <th nzShowSort nzWidth="14%" nzSortKey="clothesTypeNum" [(nzSort)]="sortCurrent.clothesTypeNum">被服种类数</th>
52
+            <th nzShowSort nzWidth="14%" nzSortKey="getOrder" [(nzSort)]="sortCurrent.getOrder">回收工单数</th>
53
+            <th nzShowSort nzWidth="14%" nzSortKey="sendOrder" [(nzSort)]="sortCurrent.sendOrder">送回工单数</th>
54
+            <th nzShowSort nzWidth="14%" nzSortKey="sendClothesNum" [(nzSort)]="sortCurrent.sendClothesNum">洗涤数量</th>
55
+            <th nzShowSort nzWidth="14%" nzSortKey="price" [(nzSort)]="sortCurrent.price">费用(元)</th>
59 56
           </tr>
60 57
         </thead>
61 58
         <tbody>
62 59
           <tr *ngFor="let data of listOfData;let index=index;">
63 60
             <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
64
-            <td>{{ data.userName }}</td>
65
-            <td>{{ data.totalTrip }}</td>
66
-            <td>{{ data.totalOrder }}</td>
67
-            <td>{{ data.getTrip }}</td>
61
+            <td>{{ data.date }}</td>
62
+            <td>{{ data.deptNum }}</td>
63
+            <td>{{ data.clothesTypeNum }}</td>
68 64
             <td>{{ data.getOrder }}</td>
69
-            <td>{{ data.getClothesNum }}</td>
70
-            <td>{{ data.sendTrip }}</td>
71 65
             <td>{{ data.sendOrder }}</td>
72 66
             <td>{{ data.sendClothesNum }}</td>
73 67
             <td>{{ data.price }}</td>

+ 13 - 9
src/app/views/quilt-washing-hospital-statistics/quilt-washing-hospital-statistics.component.ts

@@ -26,7 +26,7 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
26 26
     this.coopBtns = this.tool.initCoopBtns(this.route);
27 27
     this.getAllHos();
28 28
     this.changeDateRange(this.defRange);
29
-    this.search();
29
+    // this.search();
30 30
   }
31 31
 
32 32
   dateType: string = "day"; //选中时间维度
@@ -159,10 +159,12 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
159 159
     this.sortCurrentKey = "";
160 160
     this.sortCurrentValue = "";
161 161
     this.sortCurrent = {
162
-      source1: null,
163
-      source2: null,
164
-      source3: null,
165
-      source4: null,
162
+      deptNum: null,
163
+      clothesTypeNum: null,
164
+      getOrder: null,
165
+      sendOrder: null,
166
+      sendClothesNum: null,
167
+      price: null,
166 168
     };
167 169
     this.search();
168 170
   }
@@ -439,10 +441,12 @@ export class QuiltWashingHospitalStatisticsComponent implements OnInit {
439 441
   }
440 442
   // 列表排序
441 443
   sortCurrent = {
442
-    source1: null,
443
-    source2: null,
444
-    source3: null,
445
-    source4: null,
444
+    deptNum: null,
445
+    clothesTypeNum: null,
446
+    getOrder: null,
447
+    sendOrder: null,
448
+    sendClothesNum: null,
449
+    price: null,
446 450
   };
447 451
   sortCurrentKey: string = "";
448 452
   sortCurrentValue: string | null = "";

+ 18 - 0
src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.html

@@ -33,6 +33,24 @@
33 33
             <nz-option nzLabel="{{data.label}}" nzValue="{{data.id}}" *ngFor="let data of defRanges"></nz-option>
34 34
           </nz-select>
35 35
         </div>
36
+        <div class="list-template__searchItem">
37
+          <span class="label">人员名称</span>:
38
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch
39
+            (nzOnSearch)="changeInp($event)" nzAllowClear nzPlaceHolder="请选择人员名称" [(ngModel)]="searchDto.user">
40
+            <ng-container *ngFor="let option of userList">
41
+              <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
42
+            </ng-container>
43
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
44
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
45
+            </nz-option>
46
+          </nz-select>
47
+        </div>
48
+        <div class="list-template__searchItem">
49
+          <span class="label">人员分组</span>:
50
+          <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" [nzShowSearch]="false" nzPlaceHolder="请选择人员分组" [(ngModel)]="searchDto.group">
51
+            <nz-option [nzLabel]="data.groupName" [nzValue]="data.id" *ngFor="let data of groupList"></nz-option>
52
+          </nz-select>
53
+        </div>
36 54
       </div>
37 55
       <div nz-col nzXl='6' class="list-template__btns">
38 56
         <button nz-button class="btn default" (click)='search(1)'>搜索</button>

+ 85 - 13
src/app/views/quilt-washing-personnel-statistics/quilt-washing-personnel-statistics.component.ts

@@ -6,6 +6,8 @@ import { MainService } from "../../services/main.service";
6 6
 import { DateService } from "../../services/date.service";
7 7
 import { MyServiceService } from "../../services/my-service.service";
8 8
 import { ToolService } from "../../services/tool.service";
9
+import { Subject } from 'rxjs';
10
+import { debounceTime } from 'rxjs/operators';
9 11
 
10 12
 @Component({
11 13
   selector: "app-quilt-washing-personnel-statistics",
@@ -22,11 +24,17 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
22 24
     private tool: ToolService
23 25
   ) {}
24 26
 
27
+  searchTimerSubject = new Subject();
28
+
25 29
   ngOnInit() {
30
+    this.searchTimerSubject.pipe(debounceTime(500)).subscribe((v) => {
31
+      let fun = v[0];
32
+      fun.call(this, v[1]);
33
+    });
26 34
     this.coopBtns = this.tool.initCoopBtns(this.route);
27 35
     this.getAllHos();
28 36
     this.changeDateRange(this.defRange);
29
-    this.search();
37
+    // this.search();
30 38
   }
31 39
 
32 40
   dateType: string = "day"; //选中时间维度
@@ -77,6 +85,11 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
77 85
   promptInfo: string; //操作结果提示信息
78 86
   promptModalShow: boolean; //操作提示框是否展示
79 87
 
88
+  searchDto: any = {
89
+    group: null,
90
+    user: null,
91
+  }
92
+
80 93
   // 初始化增删改按钮
81 94
   coopBtns: any = {};
82 95
   searchData: any = {}; // 综合统计页面带过来的参数
@@ -96,6 +109,46 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
96 109
     that.changeDateRange(that.defRange);
97 110
     that.search();
98 111
   }
112
+  // 获取分组
113
+  groupList: any = []; //分组
114
+  getGroupList(id) {
115
+    let groupData = {
116
+      group2: {
117
+        hospitals: id,
118
+        type:1
119
+      },
120
+      idx: 0,
121
+      sum: 9999,
122
+    };
123
+    this.mainService
124
+      .getFetchDataList("data", "group2", groupData)
125
+      .subscribe((result) => {
126
+        this.groupList = result.list;
127
+      });
128
+  }
129
+  // 边输边搜节流阀
130
+  changeInp(e) {
131
+    this.searchTimer(this.getUserList, e);
132
+  }
133
+  // 获取人员
134
+  userList: any = []; //人员
135
+  getUserList(keyword = '') {
136
+    let postData = {
137
+      user: {
138
+        hospital: { id: this.hospital },
139
+        name: keyword
140
+      },
141
+      idx: 0,
142
+      sum: 10,
143
+    };
144
+    this.isLoading = true;
145
+    this.mainService
146
+      .getFetchDataList("data", "user", postData)
147
+      .subscribe((result) => {
148
+        this.isLoading = false;
149
+        this.userList = result.list;
150
+      });
151
+  }
99 152
   // 搜索
100 153
   search(num?: number) {
101 154
     if (this.hospital) {
@@ -122,6 +175,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
122 175
       endTime: this.endDate + " " + "23:59:59",
123 176
       hosId: that.hospital,
124 177
       type: this.dateType,
178
+      userId: this.searchDto.user || undefined,
179
+      groupId: this.searchDto.group || undefined,
125 180
     };
126 181
     if (this.sortCurrentKey && this.sortCurrentValue) {
127 182
       postData.sort =
@@ -159,11 +214,20 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
159 214
     this.sortCurrentKey = "";
160 215
     this.sortCurrentValue = "";
161 216
     this.sortCurrent = {
162
-      source1: null,
163
-      source2: null,
164
-      source3: null,
165
-      source4: null,
217
+      totalTrip: null,
218
+      totalOrder: null,
219
+      getTrip: null,
220
+      getOrder: null,
221
+      getClothesNum: null,
222
+      sendTrip: null,
223
+      sendOrder: null,
224
+      sendClothesNum: null,
225
+      price: null,
166 226
     };
227
+    this.searchDto = {
228
+      group: null,
229
+      user: null,
230
+    }
167 231
     this.search();
168 232
   }
169 233
   // 表格数据
@@ -177,6 +241,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
177 241
       endTime: this.searchData.dateRange.end,
178 242
       hosId: this.searchData.hosId,
179 243
       type: this.dateType,
244
+      userId: this.searchDto.user || undefined,
245
+      groupId: this.searchDto.group || undefined,
180 246
     };
181 247
     if (field && sort) {
182 248
       postData.sort = sort === "ascend" ? field : `${field} desc`;
@@ -194,6 +260,8 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
194 260
   hospital: string; //选中院区
195 261
   getAllHos() {
196 262
     this.hospital = this.tool.getCurrentHospital().id + "";
263
+    this.getGroupList(this.hospital);
264
+    this.getUserList();
197 265
   }
198 266
 
199 267
   // 修改时间展示维度
@@ -432,17 +500,21 @@ export class QuiltWashingPersonnelStatisticsComponent implements OnInit {
432 500
 
433 501
   // 边输入边搜索节流阀
434 502
   isLoading: boolean = false;
435
-  searchTimer(fun, e, those) {
436
-    let that = this;
437
-    that.isLoading = true;
438
-    fun(e, those);
503
+  searchTimer(fun, e) {
504
+    this.isLoading = true;
505
+    this.searchTimerSubject.next([fun, e]);
439 506
   }
440 507
   // 列表排序
441 508
   sortCurrent = {
442
-    source1: null,
443
-    source2: null,
444
-    source3: null,
445
-    source4: null,
509
+    totalTrip: null,
510
+    totalOrder: null,
511
+    getTrip: null,
512
+    getOrder: null,
513
+    getClothesNum: null,
514
+    sendTrip: null,
515
+    sendOrder: null,
516
+    sendClothesNum: null,
517
+    price: null,
446 518
   };
447 519
   sortCurrentKey: string = "";
448 520
   sortCurrentValue: string | null = "";

+ 2 - 0
src/common.less

@@ -253,6 +253,8 @@
253 253
         display: flex;
254 254
         justify-content: flex-end;
255 255
         align-items: center;
256
+        flex-wrap: wrap;
257
+        row-gap: 8px;
256 258
       }
257 259
     }
258 260
     .list-template__checkBoxes {