浏览代码

Merge branch 'develop' of http://git.dashitech.com/seimin/zy-pc into develop

seimin 1 月之前
父节点
当前提交
84ab624c68

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

@@ -21,7 +21,7 @@
21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
21
         <nz-form-item [hidden]="!fieldConfig.config.groupAndUser">
22
           <nz-form-label [nzSpan]="6" nzFor="userId">维修人员</nz-form-label>
22
           <nz-form-label [nzSpan]="6" nzFor="userId">维修人员</nz-form-label>
23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修人员!">
23
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修人员!">
24
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择维修人员" (nzOpenChange)="openChangeUser($event)">
24
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeUserInp($event)" formControlName="userId" nzPlaceHolder="请选择维修人员" (nzOpenChange)="openChangeUser($event)" (ngModelChange)="setIsSelecting()">
25
               <ng-container *ngFor="let option of userList">
25
               <ng-container *ngFor="let option of userList">
26
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
26
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
27
               </ng-container>
27
               </ng-container>
@@ -63,7 +63,7 @@
63
         <nz-form-item [hidden]="!fieldConfig.config.category123">
63
         <nz-form-item [hidden]="!fieldConfig.config.category123">
64
           <nz-form-label [nzSpan]="6" nzFor="category3Id">三级分类</nz-form-label>
64
           <nz-form-label [nzSpan]="6" nzFor="category3Id">三级分类</nz-form-label>
65
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择三级分类!">
65
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择三级分类!">
66
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeCategory3Inp($event)" formControlName="category3Id" nzPlaceHolder="请选择三级分类" (nzOpenChange)="openChangeCategory3($event)">
66
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeCategory3Inp($event)" formControlName="category3Id" nzPlaceHolder="请选择三级分类" (nzOpenChange)="openChangeCategory3($event)" (ngModelChange)="setIsSelecting()">
67
               <ng-container *ngFor="let option of category3List">
67
               <ng-container *ngFor="let option of category3List">
68
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
68
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.category" [nzValue]="option.id"></nz-option>
69
               </ng-container>
69
               </ng-container>
@@ -105,7 +105,7 @@
105
         <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
105
         <nz-form-item [hidden]="!fieldConfig.config.buildingAndFloor">
106
           <nz-form-label [nzSpan]="6" nzFor="floorId">楼<span style="visibility: hidden;">囧囧</span>层</nz-form-label>
106
           <nz-form-label [nzSpan]="6" nzFor="floorId">楼<span style="visibility: hidden;">囧囧</span>层</nz-form-label>
107
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼层!">
107
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择楼层!">
108
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeFloorInp($event)" formControlName="floorId" nzPlaceHolder="请选择楼层" (nzOpenChange)="openChangeFloor($event)">
108
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeFloorInp($event)" formControlName="floorId" nzPlaceHolder="请选择楼层" (nzOpenChange)="openChangeFloor($event)" (ngModelChange)="setIsSelecting()">
109
               <ng-container *ngFor="let option of floorList">
109
               <ng-container *ngFor="let option of floorList">
110
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
110
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.floorName" [nzValue]="option.id"></nz-option>
111
               </ng-container>
111
               </ng-container>
@@ -119,7 +119,7 @@
119
         <nz-form-item [hidden]="!fieldConfig.config.company">
119
         <nz-form-item [hidden]="!fieldConfig.config.company">
120
           <nz-form-label [nzSpan]="6" nzFor="companyId">三方公司</nz-form-label>
120
           <nz-form-label [nzSpan]="6" nzFor="companyId">三方公司</nz-form-label>
121
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择三方公司!">
121
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择三方公司!">
122
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeCompanyInp($event)" formControlName="companyId" nzPlaceHolder="请选择三方公司" (nzOpenChange)="openChangeCompany($event)">
122
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeCompanyInp($event)" formControlName="companyId" nzPlaceHolder="请选择三方公司" (nzOpenChange)="openChangeCompany($event)" (ngModelChange)="setIsSelecting()">
123
               <ng-container *ngFor="let option of companyList">
123
               <ng-container *ngFor="let option of companyList">
124
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
124
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
125
               </ng-container>
125
               </ng-container>
@@ -133,7 +133,7 @@
133
         <nz-form-item [hidden]="!fieldConfig.config.repairDept">
133
         <nz-form-item [hidden]="!fieldConfig.config.repairDept">
134
           <nz-form-label [nzSpan]="6" nzFor="repairDeptId">报修科室</nz-form-label>
134
           <nz-form-label [nzSpan]="6" nzFor="repairDeptId">报修科室</nz-form-label>
135
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择报修科室!">
135
           <nz-form-control [nzSpan]="18" nzErrorTip="请选择报修科室!">
136
-            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" formControlName="repairDeptId" nzPlaceHolder="请选择报修科室" (nzOpenChange)="openChangeRepairDept($event)">
136
+            <nz-select [nzDropdownMatchSelectWidth]="false" nzAllowClear nzServerSearch nzShowSearch (nzOnSearch)="changeRepairDeptInp($event)" formControlName="repairDeptId" nzPlaceHolder="请选择报修科室" (nzOpenChange)="openChangeRepairDept($event)" (ngModelChange)="setIsSelecting()">
137
               <ng-container *ngFor="let option of repairDeptList">
137
               <ng-container *ngFor="let option of repairDeptList">
138
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
138
                 <nz-option *ngIf="!isLoading" [nzLabel]="option.hospital.hosName + '-' + option.dept" [nzValue]="option.id"></nz-option>
139
               </ng-container>
139
               </ng-container>

+ 34 - 20
src/app/views/new-statistics/components/search-more/search-more.component.ts

@@ -126,11 +126,21 @@ export class SearchMoreComponent implements OnInit {
126
 
126
 
127
   // 防抖
127
   // 防抖
128
   isLoading = false;
128
   isLoading = false;
129
+  isSelecting:boolean = false; // 是否在选中状态
129
   searchTimer(fun, e) {
130
   searchTimer(fun, e) {
131
+    if (this.isSelecting) {
132
+      this.isSelecting = false; // 重置标志
133
+      return; // 跳过处理
134
+    }
130
     this.isLoading = true;
135
     this.isLoading = true;
131
     this.searchTimerSubject.next([fun, e]);
136
     this.searchTimerSubject.next([fun, e]);
132
   }
137
   }
133
 
138
 
139
+  // 设置标志
140
+  setIsSelecting(){
141
+    this.isSelecting = true; // 设置标志
142
+  }
143
+
134
   // =================维修分组===================
144
   // =================维修分组===================
135
 
145
 
136
   // 维修分组搜索
146
   // 维修分组搜索
@@ -165,9 +175,10 @@ export class SearchMoreComponent implements OnInit {
165
   }
175
   }
166
 
176
 
167
   changeGroup(id){
177
   changeGroup(id){
178
+    this.setIsSelecting();
168
     this.userList = [];
179
     this.userList = [];
169
     this.validateForm.controls.userId.setValue(null);
180
     this.validateForm.controls.userId.setValue(null);
170
-    this.getUserList('', id);
181
+    this.getUserList();
171
   }
182
   }
172
 
183
 
173
   // =================维修人员===================
184
   // =================维修人员===================
@@ -179,8 +190,8 @@ export class SearchMoreComponent implements OnInit {
179
 
190
 
180
   // 获取维修人员列表
191
   // 获取维修人员列表
181
   userList:any[] = [];
192
   userList:any[] = [];
182
-  getUserList(keyword = '', groupId = ''){
183
-    if(!groupId){
193
+  getUserList(keyword = ''){
194
+    if(!this.validateForm.value.groupId){
184
       this.isLoading = false;
195
       this.isLoading = false;
185
       this.userList = [];
196
       this.userList = [];
186
       return;
197
       return;
@@ -191,7 +202,7 @@ export class SearchMoreComponent implements OnInit {
191
       user: {
202
       user: {
192
         name: keyword,
203
         name: keyword,
193
         simpleQuery: true,
204
         simpleQuery: true,
194
-        groupdata: { id: groupId },
205
+        groupdata: { id: this.validateForm.value.groupId },
195
         roleCodes: 'first-line support,second-line support,incident manager',
206
         roleCodes: 'first-line support,second-line support,incident manager',
196
         engineer: 1,
207
         engineer: 1,
197
       },
208
       },
@@ -207,7 +218,7 @@ export class SearchMoreComponent implements OnInit {
207
     });
218
     });
208
   }
219
   }
209
   openChangeUser(flag){
220
   openChangeUser(flag){
210
-    flag && this.getUserList('', this.validateForm.value.groupId);
221
+    flag && this.getUserList();
211
   }
222
   }
212
 
223
 
213
   // =================一级分类===================
224
   // =================一级分类===================
@@ -243,9 +254,10 @@ export class SearchMoreComponent implements OnInit {
243
   }
254
   }
244
 
255
 
245
   changeCategory1(id){
256
   changeCategory1(id){
257
+    this.setIsSelecting();
246
     this.category2List = [];
258
     this.category2List = [];
247
     this.validateForm.controls.category2Id.setValue(null);
259
     this.validateForm.controls.category2Id.setValue(null);
248
-    this.getCategory2List('', id);
260
+    this.getCategory2List();
249
 
261
 
250
     this.category3List = [];
262
     this.category3List = [];
251
     this.validateForm.controls.category3Id.setValue(null);
263
     this.validateForm.controls.category3Id.setValue(null);
@@ -260,8 +272,8 @@ export class SearchMoreComponent implements OnInit {
260
 
272
 
261
   // 获取二级分类列表
273
   // 获取二级分类列表
262
   category2List:any[] = [];
274
   category2List:any[] = [];
263
-  getCategory2List(keyword = '', parentId = ''){
264
-    if(!parentId){
275
+  getCategory2List(keyword = ''){
276
+    if(!this.validateForm.value.category1Id){
265
       this.isLoading = false;
277
       this.isLoading = false;
266
       this.category2List = [];
278
       this.category2List = [];
267
       return;
279
       return;
@@ -270,7 +282,7 @@ export class SearchMoreComponent implements OnInit {
270
       category: {
282
       category: {
271
         category: keyword,
283
         category: keyword,
272
         selectType: 'mutlQuery',
284
         selectType: 'mutlQuery',
273
-        parent: { id: parentId },
285
+        parent: { id: this.validateForm.value.category1Id },
274
       },
286
       },
275
     };
287
     };
276
     this.isLoading = true;
288
     this.isLoading = true;
@@ -284,13 +296,14 @@ export class SearchMoreComponent implements OnInit {
284
     });
296
     });
285
   }
297
   }
286
   openChangeCategory2(flag){
298
   openChangeCategory2(flag){
287
-    flag && this.getCategory2List('', this.validateForm.value.category1Id);
299
+    flag && this.getCategory2List();
288
   }
300
   }
289
 
301
 
290
   changeCategory2(id){
302
   changeCategory2(id){
303
+    this.setIsSelecting();
291
     this.category3List = [];
304
     this.category3List = [];
292
     this.validateForm.controls.category3Id.setValue(null);
305
     this.validateForm.controls.category3Id.setValue(null);
293
-    this.getCategory3List('', id);
306
+    this.getCategory3List();
294
   }
307
   }
295
 
308
 
296
   // =================三级分类===================
309
   // =================三级分类===================
@@ -302,8 +315,8 @@ export class SearchMoreComponent implements OnInit {
302
 
315
 
303
   // 获取三级分类列表
316
   // 获取三级分类列表
304
   category3List:any[] = [];
317
   category3List:any[] = [];
305
-  getCategory3List(keyword = '', parentId = ''){
306
-    if(!parentId){
318
+  getCategory3List(keyword = ''){
319
+    if(!this.validateForm.value.category2Id){
307
       this.isLoading = false;
320
       this.isLoading = false;
308
       this.category3List = [];
321
       this.category3List = [];
309
       return;
322
       return;
@@ -312,7 +325,7 @@ export class SearchMoreComponent implements OnInit {
312
       category: {
325
       category: {
313
         category: keyword,
326
         category: keyword,
314
         selectType: 'mutlQuery',
327
         selectType: 'mutlQuery',
315
-        parent: { id: parentId },
328
+        parent: { id: this.validateForm.value.category2Id },
316
       },
329
       },
317
     };
330
     };
318
     this.isLoading = true;
331
     this.isLoading = true;
@@ -326,7 +339,7 @@ export class SearchMoreComponent implements OnInit {
326
     });
339
     });
327
   }
340
   }
328
   openChangeCategory3(flag){
341
   openChangeCategory3(flag){
329
-    flag && this.getCategory3List('', this.validateForm.value.category2Id);
342
+    flag && this.getCategory3List();
330
   }
343
   }
331
 
344
 
332
   // =================故障来源===================
345
   // =================故障来源===================
@@ -373,9 +386,10 @@ export class SearchMoreComponent implements OnInit {
373
   }
386
   }
374
 
387
 
375
   changeBuilding(id){
388
   changeBuilding(id){
389
+    this.setIsSelecting();
376
     this.floorList = [];
390
     this.floorList = [];
377
     this.validateForm.controls.floorId.setValue(null);
391
     this.validateForm.controls.floorId.setValue(null);
378
-    this.getFloorList('', id);
392
+    this.getFloorList();
379
   }
393
   }
380
 
394
 
381
   // =================楼层===================
395
   // =================楼层===================
@@ -387,8 +401,8 @@ export class SearchMoreComponent implements OnInit {
387
 
401
 
388
   // 获取楼层列表
402
   // 获取楼层列表
389
   floorList:any[] = [];
403
   floorList:any[] = [];
390
-  getFloorList(keyword = '', buildingId = ''){
391
-    if(!buildingId){
404
+  getFloorList(keyword = ''){
405
+    if(!this.validateForm.value.buildingId){
392
       this.isLoading = false;
406
       this.isLoading = false;
393
       this.floorList = [];
407
       this.floorList = [];
394
       return;
408
       return;
@@ -398,7 +412,7 @@ export class SearchMoreComponent implements OnInit {
398
       sum: 20,
412
       sum: 20,
399
       floor: {
413
       floor: {
400
         floorName: keyword,
414
         floorName: keyword,
401
-        buildId : buildingId,
415
+        buildId : this.validateForm.value.buildingId,
402
       },
416
       },
403
     };
417
     };
404
     this.isLoading = true;
418
     this.isLoading = true;
@@ -412,7 +426,7 @@ export class SearchMoreComponent implements OnInit {
412
     });
426
     });
413
   }
427
   }
414
   openChangeFloor(flag){
428
   openChangeFloor(flag){
415
-    flag && this.getFloorList('', this.validateForm.value.buildingId);
429
+    flag && this.getFloorList();
416
   }
430
   }
417
 
431
 
418
   // =================三方公司===================
432
   // =================三方公司===================

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

@@ -255,7 +255,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
255
   changeCategory1(id){
255
   changeCategory1(id){
256
     this.category2List = [];
256
     this.category2List = [];
257
     this.category2Id = null;
257
     this.category2Id = null;
258
-    this.getCategory2List('', id);
258
+    this.getCategory2List();
259
   }
259
   }
260
 
260
 
261
   // 获取一级分类列表
261
   // 获取一级分类列表
@@ -286,13 +286,13 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
286
   }
286
   }
287
 
287
 
288
   openChangeCategory2(flag){
288
   openChangeCategory2(flag){
289
-    flag && this.getCategory2List('', this.category1Id);
289
+    flag && this.getCategory2List();
290
   }
290
   }
291
 
291
 
292
   // 获取二级分类列表
292
   // 获取二级分类列表
293
   category2List:any[] = [];
293
   category2List:any[] = [];
294
-  getCategory2List(keyword = '', parentId = '') {
295
-    if(!parentId){
294
+  getCategory2List(keyword = '') {
295
+    if(!this.category1Id){
296
       this.isLoading = false;
296
       this.isLoading = false;
297
       this.category2List = [];
297
       this.category2List = [];
298
       return;
298
       return;
@@ -301,7 +301,7 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
301
       category: {
301
       category: {
302
         category: keyword,
302
         category: keyword,
303
         selectType: 'mutlQuery',
303
         selectType: 'mutlQuery',
304
-        parent: { id: parentId },
304
+        parent: { id: this.category1Id },
305
       },
305
       },
306
     };
306
     };
307
     this.isLoading = true;
307
     this.isLoading = true;