Просмотр исходного кода

工作分配自选排班的科室绑定人员添加科室类型

seimin 1 год назад
Родитель
Сommit
4d0d396030

+ 15 - 0
src/app/views/quick-combination/quick-combination.component.html

@@ -157,6 +157,21 @@
157
               </nz-radio-group>
157
               </nz-radio-group>
158
             </nz-form-control>
158
             </nz-form-control>
159
           </nz-form-item>
159
           </nz-form-item>
160
+          <nz-form-item *ngIf="queryParamsType == 2 && quickCombinationModel == 3">
161
+            <nz-form-label [nzSm]="6" [nzXs]="24" [nzRequired]="requireDept" nzFor="deptTypeIds">选择科室类型
162
+            </nz-form-label>
163
+            <nz-form-control nzErrorTip="请选择科室类型!">
164
+              <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false"
165
+                formControlName="deptTypeIds" nzShowSearch nzAllowClear nzPlaceHolder="请选择科室类型" nzServerSearch (nzOpenChange)="getDeptTypeList($event)">
166
+                <ng-container *ngFor="let data of deptTypeList">
167
+                  <nz-option *ngIf="!dLoading" nzLabel="{{data.name}}" nzValue="{{data.id}}"></nz-option>
168
+                </ng-container>
169
+                <nz-option *ngIf="dLoading" nzDisabled nzCustomContent>
170
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
171
+                </nz-option>
172
+              </nz-select>
173
+            </nz-form-control>
174
+          </nz-form-item>
160
           <nz-form-item *ngIf="queryParamsType==1"
175
           <nz-form-item *ngIf="queryParamsType==1"
161
             [hidden]="quickCombinationModel == 1||quickCombinationModel==2||quickCombinationModel===''">
176
             [hidden]="quickCombinationModel == 1||quickCombinationModel==2||quickCombinationModel===''">
162
             <nz-form-label [nzSm]="6" [nzXs]="24" [nzRequired]="requireDept" nzFor="quickCombinationDept">选择科室
177
             <nz-form-label [nzSm]="6" [nzXs]="24" [nzRequired]="requireDept" nzFor="quickCombinationDept">选择科室

+ 65 - 1
src/app/views/quick-combination/quick-combination.component.ts

@@ -50,6 +50,7 @@ export class QuickCombinationComponent implements OnInit {
50
   quickCombinationModel;
50
   quickCombinationModel;
51
   requireGroup = false;
51
   requireGroup = false;
52
   requireDept = false;
52
   requireDept = false;
53
+  requireDeptType = false;
53
   queryParamsId = ""; //方案id
54
   queryParamsId = ""; //方案id
54
   queryParamsName = ""; //方案名称
55
   queryParamsName = ""; //方案名称
55
   queryParamsType: any = ""; //方案类型,1是综合排班,2是自选排班
56
   queryParamsType: any = ""; //方案类型,1是综合排班,2是自选排班
@@ -212,7 +213,13 @@ export class QuickCombinationComponent implements OnInit {
212
               if (!this.copyFlag) {
213
               if (!this.copyFlag) {
213
                 if (this.info.ruleType == 2) {
214
                 if (this.info.ruleType == 2) {
214
                   this.getGroupList(true, "", true);
215
                   this.getGroupList(true, "", true);
215
-                } else if (this.info.ruleType == 3 || this.info.ruleType == 4) {
216
+                } else if (this.info.ruleType == 3) {
217
+                  if(this.queryParamsType == 1){
218
+                    this.getDeptList(true, "", true);
219
+                  }else{
220
+                    this.getDeptTypeList(true, true);
221
+                  }
222
+                } else if (this.info.ruleType == 4) {
216
                   this.getDeptList(true, "", true);
223
                   this.getDeptList(true, "", true);
217
                 } else {
224
                 } else {
218
                   this.message.remove(this.maskFlag);
225
                   this.message.remove(this.maskFlag);
@@ -417,26 +424,33 @@ export class QuickCombinationComponent implements OnInit {
417
     if (this.quickCombinationModel == 1) {
424
     if (this.quickCombinationModel == 1) {
418
       this.requireGroup = false;
425
       this.requireGroup = false;
419
       this.requireDept = false;
426
       this.requireDept = false;
427
+      this.requireDeptType = false;
420
     } else if (this.quickCombinationModel == 2) {
428
     } else if (this.quickCombinationModel == 2) {
421
       this.requireGroup = false;
429
       this.requireGroup = false;
422
       this.requireDept = false;
430
       this.requireDept = false;
431
+      this.requireDeptType = false;
423
     } else if (this.quickCombinationModel == 3) {
432
     } else if (this.quickCombinationModel == 3) {
424
       if (this.queryParamsType == 1) {
433
       if (this.queryParamsType == 1) {
425
         this.requireGroup = false;
434
         this.requireGroup = false;
426
         this.requireDept = true;
435
         this.requireDept = true;
436
+        this.requireDeptType = false;
427
       } else if (this.queryParamsType == 2) {
437
       } else if (this.queryParamsType == 2) {
428
         this.requireGroup = false;
438
         this.requireGroup = false;
429
         this.requireDept = false;
439
         this.requireDept = false;
440
+        this.requireDeptType = true;
430
       }
441
       }
431
     } else if (this.quickCombinationModel == 4) {
442
     } else if (this.quickCombinationModel == 4) {
432
       this.requireGroup = false;
443
       this.requireGroup = false;
433
       this.requireDept = true;
444
       this.requireDept = true;
445
+      this.requireDeptType = false;
434
     }else if (this.quickCombinationModel == 5) {
446
     }else if (this.quickCombinationModel == 5) {
435
       this.requireGroup = false;
447
       this.requireGroup = false;
436
       this.requireDept = false;
448
       this.requireDept = false;
449
+      this.requireDeptType = false;
437
     }else if (this.quickCombinationModel == 6) {
450
     }else if (this.quickCombinationModel == 6) {
438
       this.requireGroup = false;
451
       this.requireGroup = false;
439
       this.requireDept = false;
452
       this.requireDept = false;
453
+      this.requireDeptType = false;
440
     }
454
     }
441
     if (!this.requireGroup) {
455
     if (!this.requireGroup) {
442
       this.validateForm.get("quickCombinationGroup")!.clearValidators();
456
       this.validateForm.get("quickCombinationGroup")!.clearValidators();
@@ -460,6 +474,17 @@ export class QuickCombinationComponent implements OnInit {
460
     }
474
     }
461
     this.validateForm.get("quickCombinationDept")!.updateValueAndValidity();
475
     this.validateForm.get("quickCombinationDept")!.updateValueAndValidity();
462
     // ------
476
     // ------
477
+    if (!this.requireDeptType) {
478
+      this.validateForm.get("deptTypeIds")!.clearValidators();
479
+      this.validateForm.get("deptTypeIds")!.markAsPristine();
480
+    } else {
481
+      this.validateForm
482
+        .get("deptTypeIds")!
483
+        .setValidators(Validators.required);
484
+      this.validateForm.get("deptTypeIds")!.markAsDirty();
485
+    }
486
+    this.validateForm.get("deptTypeIds")!.updateValueAndValidity();
487
+    // ------
463
     if (!(this.queryParamsType == 1 && this.quickCombinationModel == 1)) {
488
     if (!(this.queryParamsType == 1 && this.quickCombinationModel == 1)) {
464
       this.validateForm.get("quickCombinationDispatchMethod")!.clearValidators();
489
       this.validateForm.get("quickCombinationDispatchMethod")!.clearValidators();
465
       this.validateForm.get("quickCombinationDispatchMethod")!.markAsPristine();
490
       this.validateForm.get("quickCombinationDispatchMethod")!.markAsPristine();
@@ -540,6 +565,39 @@ export class QuickCombinationComponent implements OnInit {
540
     this.validateForm.get("quickCombinationDispatchWeight")!.updateValueAndValidity();
565
     this.validateForm.get("quickCombinationDispatchWeight")!.updateValueAndValidity();
541
     this.validateForm.controls.quickCombinationDispatchWeight.setValue(null);
566
     this.validateForm.controls.quickCombinationDispatchWeight.setValue(null);
542
   }
567
   }
568
+
569
+  //获取科室类型列表
570
+  deptTypeList:any[] = [];
571
+  getDeptTypeList(flag?, fedit?) {
572
+    if (!flag) {
573
+      return;
574
+    }
575
+    this.dLoading = true;
576
+    this.mainService
577
+      .getDictionary("list", "dept_type")
578
+      .subscribe((data) => {
579
+        this.dLoading = false;
580
+        this.deptTypeList = data;
581
+        if (fedit) {
582
+          switch (this.info.ruleType) {
583
+            case 1:
584
+              break;
585
+            case 2:
586
+              break;
587
+            case 3:
588
+              if(this.queryParamsType == 2){
589
+                console.log(this.info);
590
+                let deptTypeList = this.info.deptTypeList || [];
591
+                this.validateForm.controls.deptTypeIds.setValue(deptTypeList.map(v => v.id.toString()));
592
+              }
593
+              break;
594
+            case 4:
595
+              break;
596
+          }
597
+        }
598
+      });
599
+  }
600
+
543
   deptList = []; //科室列表
601
   deptList = []; //科室列表
544
   dLoading = false;
602
   dLoading = false;
545
   dNum = 0;
603
   dNum = 0;
@@ -1002,6 +1060,7 @@ export class QuickCombinationComponent implements OnInit {
1002
       quickCombinationModel: [null, [Validators.required]],
1060
       quickCombinationModel: [null, [Validators.required]],
1003
       quickCombinationDept: this.requireGroup ? [null, [Validators.required]] : [null],
1061
       quickCombinationDept: this.requireGroup ? [null, [Validators.required]] : [null],
1004
       quickCombinationGroup: this.requireDept ? [null, [Validators.required]] : [null],
1062
       quickCombinationGroup: this.requireDept ? [null, [Validators.required]] : [null],
1063
+      deptTypeIds: this.requireDeptType ? [null, [Validators.required]] : [null],
1005
       quickCombinationDispatchMethod: [null],
1064
       quickCombinationDispatchMethod: [null],
1006
       quickCombinationDispatchType: [null],
1065
       quickCombinationDispatchType: [null],
1007
       quickCombinationDispatchWeight: [null],
1066
       quickCombinationDispatchWeight: [null],
@@ -1079,6 +1138,11 @@ export class QuickCombinationComponent implements OnInit {
1079
         maxWeight: (this.validateForm.value.quickCombinationDispatchMethod == 2 && this.validateForm.value.quickCombinationDispatchType == 1) ? this.validateForm.value.quickCombinationDispatchWeight : undefined,
1138
         maxWeight: (this.validateForm.value.quickCombinationDispatchMethod == 2 && this.validateForm.value.quickCombinationDispatchType == 1) ? this.validateForm.value.quickCombinationDispatchWeight : undefined,
1080
       },
1139
       },
1081
     };
1140
     };
1141
+    console.log(this.validateForm.value.deptTypeIds);
1142
+    //添加科室类型字段
1143
+    if (this.validateForm.value.deptTypeIds && this.quickCombinationModel == 3 && this.queryParamsType == 2) {
1144
+      data["workAllocationQuickConfig"]["deptTypeIds"] = this.validateForm.value.deptTypeIds.toString();
1145
+    }
1082
     //添加科室字段,绑定人字段
1146
     //添加科室字段,绑定人字段
1083
     if (
1147
     if (
1084
       this.validateForm.value.quickCombinationDept &&
1148
       this.validateForm.value.quickCombinationDept &&

+ 1 - 1
src/main.ts

@@ -8,7 +8,7 @@ if (environment.production) {
8
   enableProdMode();
8
   enableProdMode();
9
   if (window) {
9
   if (window) {
10
     window.console.log = function () { };
10
     window.console.log = function () { };
11
-    console.info('v2.4.41');
11
+    console.info('v2.4.42');
12
   }
12
   }
13
 }
13
 }
14
 platformBrowserDynamic().bootstrapModule(AppModule)
14
 platformBrowserDynamic().bootstrapModule(AppModule)