Explorar o código

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

maotao hai 8 meses
pai
achega
11089d0de1

+ 5 - 7
src/app/services/tool.service.ts

@@ -246,7 +246,7 @@ export class ToolService {
246 246
   }
247 247
 
248 248
   /**
249
-   * @description: 扁平化结构转成树形结构-ng-zorro树形结构专用
249
+   * @description: 扁平化结构转成树形结构-ng-zorro级联组件专用
250 250
    * @param {*} list 扁平化的数组
251 251
    * @param {*} rootValue 顶级parentKeyName的值
252 252
    * @param {*} parentKeyName 父级字段名称
@@ -267,12 +267,10 @@ export class ToolService {
267 267
   }
268 268
 
269 269
   /**
270
-   * @description: 树形结构根据id回显-ng-zorro树形结构专用
271
-   * @param {*} list 扁平化的数组
272
-   * @param {*} rootValue 顶级parentKeyName的值
273
-   * @param {*} parentKeyName 父级字段名称
274
-   * @param {*} keyName 字段名称
275
-   * @return {*} 返回树形结构
270
+   * @description: 树形结构根据id回显-ng-zorro级联组件专用
271
+   * @param {*} tree 树形结构
272
+   * @param {*} id 要查询的id
273
+   * @return {*} 返回数组-用于回显
276 274
    * @author: seimin
277 275
    */
278 276
   tranListToTreeDataFindIdsLeaf(tree: Array<any>, id: number, arr = []):Array<number> {

+ 1 - 1
src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.html

@@ -24,7 +24,7 @@
24 24
             </thead>
25 25
             <tbody>
26 26
               <tr *ngFor="let data of historySpecimenList;let i = index;">
27
-                <td>{{ data.incidentCategoryDTO?.category }}</td>
27
+                <td>{{ data.incidentCategoryDTO?.mutiCategory }}</td>
28 28
                 <td>{{ data.alias }}</td>
29 29
                 <td>{{ data.status?.name }}</td>
30 30
                 <td>

+ 1 - 0
src/app/share/assets-product-management-prompt-modal/assets-product-management-prompt-modal.component.ts

@@ -41,6 +41,7 @@ export class AssetsProductManagementPromptModalComponent implements OnInit {
41 41
       return;
42 42
     };
43 43
     let postData = {
44
+      hasThird: 'true',//只差有三级的故障现象列表
44 45
       category: {
45 46
         dutyIds: this.currentHospital.type.value === '6' ? this.currentHospital.id.toString()  : undefined,
46 47
       },

+ 2 - 2
src/app/views/assets-info/assets-info.component.html

@@ -105,7 +105,7 @@
105 105
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择关联产品!">
106 106
               <nz-select (nzOnSearch)="changeInp('add', 'assetProduct', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch formControlName="productId" nzPlaceHolder="请选择关联产品" (ngModelChange)="changeAssetProduct($event)" (nzOpenChange)="changeInp('add', 'assetProduct', '')">
107 107
                 <ng-container *ngFor="let option of assetProductList">
108
-                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
108
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name + '(' + option.brand + ')' + '(' + option.model + ')'" [nzValue]="option.id"></nz-option>
109 109
                 </ng-container>
110 110
                 <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
111 111
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -203,7 +203,7 @@
203 203
           <nz-form-item>
204 204
             <nz-form-label [nzSpan]="5" nzRequired nzFor="dutyId">责任部门</nz-form-label>
205 205
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择责任部门!">
206
-              <nz-select (nzOnSearch)="changeInp('add', 'hospital', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="dutyId" nzPlaceHolder="请选择责任部门" (nzOpenChange)="changeInp('add', 'hospital', '')">
206
+              <nz-select [nzDisabled]="disableDutyId" (nzOnSearch)="changeInp('add', 'hospital', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="dutyId" nzPlaceHolder="请选择责任部门" (nzOpenChange)="changeInp('add', 'hospital', '')">
207 207
                 <ng-container *ngFor="let option of dutyList">
208 208
                   <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
209 209
                 </ng-container>

+ 7 - 0
src/app/views/assets-info/assets-info.component.ts

@@ -114,11 +114,18 @@ export class AssetsInfoComponent implements OnInit {
114 114
   }
115 115
 
116 116
   // 新增弹框
117
+  disableDutyId:boolean = false;
117 118
   addModal() {
118 119
     this.modelName = "新增";
119 120
     this.add = true; //新增
120 121
     this.modal = true;
121 122
     this.initForm();
123
+    if(this.currentHospital.type && this.currentHospital.type.value === '6'){
124
+      this.disableDutyId = true;
125
+      this.validateForm.controls.dutyId.setValue(this.currentHospital.id);
126
+    }else{
127
+      this.disableDutyId = false;
128
+    }
122 129
   }
123 130
   //关闭新增/编辑弹框
124 131
   hideAddModal() {

+ 12 - 12
src/app/views/configuration-center/configuration-center.component.html

@@ -332,12 +332,12 @@
332 332
             </nz-radio-group>
333 333
           </nz-form-control>
334 334
         </nz-form-item>
335
-        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 1">
336
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">维修人</nz-form-label>
337
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修!">
338
-            <nz-select (nzOnSearch)="changeInp('add', 'user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择维修人">
339
-              <ng-container *ngFor="let option of userList">
340
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
335
+        <nz-form-item>
336
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维修组</nz-form-label>
337
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修!">
338
+            <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (ngModelChange)="changeGroup($event)">
339
+              <ng-container *ngFor="let option of groupList">
340
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
341 341
               </ng-container>
342 342
               <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
343 343
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -345,12 +345,12 @@
345 345
             </nz-select>
346 346
           </nz-form-control>
347 347
         </nz-form-item>
348
-        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 2">
349
-          <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维修组</nz-form-label>
350
-          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修!">
351
-            <nz-select (nzOnSearch)="changeInp('add', 'group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组">
352
-              <ng-container *ngFor="let option of groupList">
353
-                <nz-option *ngIf="!isLoading" [nzLabel]="option.groupName" [nzValue]="option.id"></nz-option>
348
+        <nz-form-item *ngIf="validateConfigForm.value.userGroup === 1">
349
+          <nz-form-label [nzSpan]="5" nzRequired nzFor="userId">维修人</nz-form-label>
350
+          <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修!">
351
+            <nz-select (nzOnSearch)="changeInp('user', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="userId" nzPlaceHolder="请选择维修人">
352
+              <ng-container *ngFor="let option of userList">
353
+                <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
354 354
               </ng-container>
355 355
               <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
356 356
                 <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...

+ 31 - 21
src/app/views/configuration-center/configuration-center.component.ts

@@ -144,7 +144,6 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
144 144
 
145 145
     this.userList = [];
146 146
     this.groupList = [];
147
-    this.getUsers();
148 147
     this.getGroups();
149 148
   }
150 149
 
@@ -415,7 +414,6 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
415 414
     this.modalConfig = true;
416 415
     this.initConfigForm();
417 416
     this.requiredConfigChange('userId', true);
418
-    this.requiredConfigChange('groupId', false);
419 417
   }
420 418
   //关闭新增/编辑弹框
421 419
   hideConfigModal() {
@@ -432,7 +430,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
432 430
       score: [null, [Validators.required]],//积分
433 431
       userGroup: [1, [Validators.required]],//分配方式
434 432
       userId: [null],//维修人
435
-      groupId: [null],//维修组
433
+      groupId: [null, [Validators.required]],//维修组
436 434
     });
437 435
     console.log(this.validateConfigForm.controls)
438 436
   }
@@ -441,14 +439,13 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
441 439
   changeUserGroup(id){
442 440
     this.validateConfigForm.controls.userId.setValue(null);
443 441
     this.validateConfigForm.controls.groupId.setValue(null);
442
+    this.userList = [];
444 443
     if(id === 1){
445 444
       // 人
446 445
       this.requiredConfigChange('userId', true);
447
-      this.requiredConfigChange('groupId', false);
448 446
     }else if(id === 2){
449 447
       // 组
450 448
       this.requiredConfigChange('userId', false);
451
-      this.requiredConfigChange('groupId', true);
452 449
     }
453 450
   }
454 451
 
@@ -480,14 +477,18 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
480 477
     this.validateConfigForm.controls.groupId.setValue(data.groupId);
481 478
     if(data.userGroup === 1){
482 479
       this.requiredConfigChange('userId', true);
483
-      this.requiredConfigChange('groupId', false);
484 480
     }else if(data.userGroup === 2){
485 481
       this.requiredConfigChange('userId', false);
486
-      this.requiredConfigChange('groupId', true);
487 482
     }
488 483
     data.hosId && this.getHospitals(2, data.hosId);
489
-    data.dutyId && this.getUsers();
490
-    data.dutyId && this.getGroups();
484
+    data.dutyId && this.getUsers('', true);
485
+    data.dutyId && this.getGroups('', true);
486
+  }
487
+
488
+  // 修改组
489
+  changeGroup(id){
490
+    this.validateConfigForm.controls.userId.setValue(null);
491
+    this.getUsers();
491 492
   }
492 493
 
493 494
   // 新增/编辑表单提交
@@ -514,7 +515,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
514 515
           score: { id: this.validateConfigForm.value.score },
515 516
           dutyId: this.validateConfigForm.value.dutyId,
516 517
           userGroup: this.validateConfigForm.value.userGroup,
517
-          groupId: this.validateConfigForm.value.userGroup === 2 ? this.validateConfigForm.value.groupId : undefined,
518
+          groupId: this.validateConfigForm.value.groupId || undefined,
518 519
           userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
519 520
           hosId: this.currentHospital.id,
520 521
         }
@@ -528,11 +529,9 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
528 529
             categoryId,
529 530
             priority: this.validateConfigForm.value.priority,
530 531
             score: { id: this.validateConfigForm.value.score },
531
-            // dutyId: this.validateConfigForm.value.dutyId,
532 532
             userGroup: this.validateConfigForm.value.userGroup,
533
-            groupId: this.validateConfigForm.value.userGroup === 2 ? this.validateConfigForm.value.groupId : undefined,
533
+            groupId: this.validateConfigForm.value.groupId || undefined,
534 534
             userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
535
-            // hosId: this.currentHospital.id,
536 535
           }
537 536
         }
538 537
       };
@@ -575,10 +574,10 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
575 574
       if(this.coopType !== 0){
576 575
         this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
577 576
       }else{
578
-        this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + this.currentCategoryIndex].id);
577
+        this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
579 578
       }
580
-      if(this.activeCategory1.id || this.activeCategory2.id || this.activeCategory3.id){
581
-        this.getCategoryConfigList(this.activeCategory1.id || this.activeCategory2.id || this.activeCategory3.id);
579
+      if(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id){
580
+        this.getCategoryConfigList(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id);
582 581
       }
583 582
     } else if(this.activeTagId == 2){
584 583
       this.getPriorityList();
@@ -934,8 +933,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
934 933
   // 搜索
935 934
   // 获取用户
936 935
   userList: any = [];
937
-  getUsers(keyword = '') {
938
-    if(!this.validateConfigForm.value.dutyId){
936
+  getUsers(keyword = '', isShowValue = false) {
937
+    if((!this.validateConfigForm.value.groupId && this.validateConfigForm.value.userGroup === 1) || this.validateConfigForm.value.userGroup === 2){
939 938
       this.userList = [];
940 939
       return;
941 940
     }
@@ -944,6 +943,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
944 943
         hospital: { id: this.validateConfigForm.value.dutyId },
945 944
         name: keyword,
946 945
         simpleQuery: true,
946
+        groupdata: { id: this.validateConfigForm.value.groupId },
947 947
       },
948 948
       idx: 0,
949 949
       sum: 10,
@@ -952,13 +952,18 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
952 952
       .getFetchDataList("data", "user", postData)
953 953
       .subscribe((data) => {
954 954
         this.isLoading = false;
955
-        this.userList = data.list || [];
955
+        let userList = data.list || [];
956
+        if(isShowValue && this.coopData && this.coopData.userId){
957
+          userList = userList.filter(v => v.id !== this.coopData.userId)
958
+          userList.unshift(this.coopData.userDTO);
959
+        }
960
+        this.userList = userList;
956 961
       });
957 962
   }
958 963
 
959 964
   // 获取组
960 965
   groupList: any = []; //所有所属科室(搜索)
961
-  getGroups(keyword = '') {
966
+  getGroups(keyword = '', isShowValue = false) {
962 967
     if(!this.validateConfigForm.value.dutyId){
963 968
       this.groupList = [];
964 969
       return;
@@ -976,7 +981,12 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
976 981
       .getFetchDataList("data", "group2", postData)
977 982
       .subscribe((data) => {
978 983
         this.isLoading = false;
979
-        this.groupList = data.list || [];
984
+        let groupList = data.list || [];
985
+        if(isShowValue && this.coopData && this.coopData.groupId){
986
+          groupList = groupList.filter(v => v.id !== this.coopData.groupId)
987
+          groupList.unshift(this.coopData.groupDTO);
988
+        }
989
+        this.groupList = groupList;
980 990
       });
981 991
   }
982 992