瀏覽代碼

巡检点的关联科室不必填

seimin 3 月之前
父節點
當前提交
548f979ccd

+ 4 - 2
src/app/views/inspection-address/inspection-address.component.html

@@ -102,9 +102,11 @@
102 102
             </nz-form-control>
103 103
           </nz-form-item>
104 104
           <nz-form-item>
105
-            <nz-form-label [nzSpan]="5" nzRequired nzFor="deptId">关联科室</nz-form-label>
105
+            <!-- <nz-form-label [nzSpan]="5" nzRequired nzFor="deptId">关联科室</nz-form-label> -->
106
+            <nz-form-label [nzSpan]="5" nzFor="deptId">关联科室</nz-form-label>
106 107
             <nz-form-control [nzSpan]="19" nzErrorTip="请选择关联科室!">
107
-              <nz-select (nzOnSearch)="changeInp('add', 'department', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="deptId" nzPlaceHolder="请选择关联科室" (ngModelChange)="changeDepartment($event)" [nzDisabled]="!add" (nzOpenChange)="changeInp('add', 'department', '')">
108
+              <!-- <nz-select (nzOnSearch)="changeInp('add', 'department', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="deptId" nzPlaceHolder="请选择关联科室" (ngModelChange)="changeDepartment($event)" [nzDisabled]="!add" (nzOpenChange)="changeInp('add', 'department', '')"> -->
109
+              <nz-select (nzOnSearch)="changeInp('add', 'department', $event)" [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear formControlName="deptId" nzPlaceHolder="请选择关联科室" (ngModelChange)="changeDepartment($event)" (nzOpenChange)="changeInp('add', 'department', '')">
108 110
                 <ng-container *ngFor="let option of departmentAddList">
109 111
                   <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
110 112
                 </ng-container>

+ 4 - 3
src/app/views/inspection-address/inspection-address.component.ts

@@ -244,7 +244,8 @@ export class InspectionAddressComponent implements OnInit {
244 244
     this.floorList = [];
245 245
     this.validateForm = this.fb.group({
246 246
       name: ['', [Validators.required, Validators.pattern(/\S/)]],
247
-      deptId: [null, [Validators.required]],
247
+      // deptId: [null, [Validators.required]],
248
+      deptId: [null],
248 249
       buildId: [null, [Validators.required]],
249 250
       floorId: [null, [Validators.required]],
250 251
       tagIds: [[], [Validators.required]],
@@ -510,7 +511,7 @@ export class InspectionAddressComponent implements OnInit {
510 511
       postData = {
511 512
         inspectionNode: {
512 513
           name: this.validateForm.value.name,
513
-          deptId: this.validateForm.value.deptId,
514
+          deptId: this.validateForm.value.deptId || undefined,
514 515
           buildId: this.validateForm.value.buildId,
515 516
           floorId: this.validateForm.value.floorId,
516 517
           tagIds: tagIds.toString(),
@@ -525,7 +526,7 @@ export class InspectionAddressComponent implements OnInit {
525 526
           ...this.coopData,
526 527
           ...{
527 528
             name: this.validateForm.value.name,
528
-            deptId: this.validateForm.value.deptId,
529
+            deptId: this.validateForm.value.deptId || undefined,
529 530
             buildId: this.validateForm.value.buildId,
530 531
             floorId: this.validateForm.value.floorId,
531 532
             tagIds: tagIds.toString(),