seimin 1 月之前
父節點
當前提交
c6d63b30dd

+ 1 - 1
src/app/views/inspection-configuration/inspection-configuration.component.html

@@ -131,7 +131,7 @@
131
               </nz-radio-group>
131
               </nz-radio-group>
132
             </nz-form-control>
132
             </nz-form-control>
133
           </nz-form-item>
133
           </nz-form-item>
134
-          <nz-form-item>
134
+          <nz-form-item *ngIf="validateForm.value.userGroup == 1 || validateForm.value.userGroup == 2 || validateForm.value.userGroup == 3">
135
             <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维&nbsp;&nbsp;修&nbsp;&nbsp;组</nz-form-label>
135
             <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维&nbsp;&nbsp;修&nbsp;&nbsp;组</nz-form-label>
136
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
136
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
137
               <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (nzOpenChange)="changeInp('group', '')">
137
               <nz-select (nzOnSearch)="changeInp('group', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="groupId" nzPlaceHolder="请选择维修组" (nzOpenChange)="changeInp('group', '')">

+ 6 - 6
src/app/views/inspection-configuration/inspection-configuration.component.ts

@@ -148,8 +148,8 @@ export class InspectionConfigurationComponent implements OnInit {
148
       // 是责任部门
148
       // 是责任部门
149
       dutyIds = hospital.id.toString();
149
       dutyIds = hospital.id.toString();
150
     }else{
150
     }else{
151
-      this.isLoading = false;
152
       this.categoryList = [];
151
       this.categoryList = [];
152
+      this.isLoading = false;
153
       return;
153
       return;
154
     }
154
     }
155
     let postData:any = {
155
     let postData:any = {
@@ -233,7 +233,7 @@ export class InspectionConfigurationComponent implements OnInit {
233
       repairDeptId: [null],
233
       repairDeptId: [null],
234
       categoryId: [null],
234
       categoryId: [null],
235
       priorityId: [null],
235
       priorityId: [null],
236
-      userGroup: [1],
236
+      userGroup: [null],
237
       groupId: [null],
237
       groupId: [null],
238
       userId: [null],
238
       userId: [null],
239
     });
239
     });
@@ -335,7 +335,7 @@ export class InspectionConfigurationComponent implements OnInit {
335
 
335
 
336
         data.groupDTO && (this.groupList = [data.groupDTO]);
336
         data.groupDTO && (this.groupList = [data.groupDTO]);
337
         this.validateForm.controls.groupId.setValue(data.groupId);
337
         this.validateForm.controls.groupId.setValue(data.groupId);
338
-        this.requiredChange('groupId', true);
338
+        this.requiredChange('groupId', (data.userGroup == 1 || data.userGroup == 2 || data.userGroup == 3));
339
 
339
 
340
         data.userDTO && (this.userList = [data.userDTO]);
340
         data.userDTO && (this.userList = [data.userDTO]);
341
         this.validateForm.controls.userId.setValue(data.userId);
341
         this.validateForm.controls.userId.setValue(data.userId);
@@ -408,17 +408,17 @@ export class InspectionConfigurationComponent implements OnInit {
408
     this.requiredChange('userGroup', value == 1);
408
     this.requiredChange('userGroup', value == 1);
409
     this.validateForm.controls.userGroup.setValue(value == 1 ? 1 : null);
409
     this.validateForm.controls.userGroup.setValue(value == 1 ? 1 : null);
410
 
410
 
411
-    this.requiredChange('groupId', false);
411
+    this.requiredChange('groupId', (this.validateForm.value.userGroup == 1 || this.validateForm.value.userGroup == 2 || this.validateForm.value.userGroup == 3));
412
     this.validateForm.controls.groupId.setValue(null);
412
     this.validateForm.controls.groupId.setValue(null);
413
     this.groupList = [];
413
     this.groupList = [];
414
 
414
 
415
-    this.requiredChange('userId', false);
415
+    this.requiredChange('userId', this.validateForm.value.userGroup == 3);
416
     this.validateForm.controls.userId.setValue(null);
416
     this.validateForm.controls.userId.setValue(null);
417
     this.userList = [];
417
     this.userList = [];
418
   }
418
   }
419
 
419
 
420
   changeUserGroup(value){
420
   changeUserGroup(value){
421
-    this.requiredChange('groupId', true);
421
+    this.requiredChange('groupId', (value == 1 || value == 2 || value == 3));
422
     this.validateForm.controls.groupId.setValue(null);
422
     this.validateForm.controls.groupId.setValue(null);
423
     this.groupList = [];
423
     this.groupList = [];
424
 
424