seimin hai 3 semanas
pai
achega
c6d63b30dd

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

@@ -131,7 +131,7 @@
131 131
               </nz-radio-group>
132 132
             </nz-form-control>
133 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 135
             <nz-form-label [nzSpan]="5" nzRequired nzFor="groupId">维&nbsp;&nbsp;修&nbsp;&nbsp;组</nz-form-label>
136 136
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择维修组!">
137 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 149
       dutyIds = hospital.id.toString();
150 150
     }else{
151
-      this.isLoading = false;
152 151
       this.categoryList = [];
152
+      this.isLoading = false;
153 153
       return;
154 154
     }
155 155
     let postData:any = {
@@ -233,7 +233,7 @@ export class InspectionConfigurationComponent implements OnInit {
233 233
       repairDeptId: [null],
234 234
       categoryId: [null],
235 235
       priorityId: [null],
236
-      userGroup: [1],
236
+      userGroup: [null],
237 237
       groupId: [null],
238 238
       userId: [null],
239 239
     });
@@ -335,7 +335,7 @@ export class InspectionConfigurationComponent implements OnInit {
335 335
 
336 336
         data.groupDTO && (this.groupList = [data.groupDTO]);
337 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 340
         data.userDTO && (this.userList = [data.userDTO]);
341 341
         this.validateForm.controls.userId.setValue(data.userId);
@@ -408,17 +408,17 @@ export class InspectionConfigurationComponent implements OnInit {
408 408
     this.requiredChange('userGroup', value == 1);
409 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 412
     this.validateForm.controls.groupId.setValue(null);
413 413
     this.groupList = [];
414 414
 
415
-    this.requiredChange('userId', false);
415
+    this.requiredChange('userId', this.validateForm.value.userGroup == 3);
416 416
     this.validateForm.controls.userId.setValue(null);
417 417
     this.userList = [];
418 418
   }
419 419
 
420 420
   changeUserGroup(value){
421
-    this.requiredChange('groupId', true);
421
+    this.requiredChange('groupId', (value == 1 || value == 2 || value == 3));
422 422
     this.validateForm.controls.groupId.setValue(null);
423 423
     this.groupList = [];
424 424