|
@@ -50,6 +50,7 @@ export class QuickCombinationComponent implements OnInit {
|
50
|
50
|
quickCombinationModel;
|
51
|
51
|
requireGroup = false;
|
52
|
52
|
requireDept = false;
|
|
53
|
+ requireDeptType = false;
|
53
|
54
|
queryParamsId = ""; //方案id
|
54
|
55
|
queryParamsName = ""; //方案名称
|
55
|
56
|
queryParamsType: any = ""; //方案类型,1是综合排班,2是自选排班
|
|
@@ -212,7 +213,13 @@ export class QuickCombinationComponent implements OnInit {
|
212
|
213
|
if (!this.copyFlag) {
|
213
|
214
|
if (this.info.ruleType == 2) {
|
214
|
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
|
223
|
this.getDeptList(true, "", true);
|
217
|
224
|
} else {
|
218
|
225
|
this.message.remove(this.maskFlag);
|
|
@@ -417,26 +424,33 @@ export class QuickCombinationComponent implements OnInit {
|
417
|
424
|
if (this.quickCombinationModel == 1) {
|
418
|
425
|
this.requireGroup = false;
|
419
|
426
|
this.requireDept = false;
|
|
427
|
+ this.requireDeptType = false;
|
420
|
428
|
} else if (this.quickCombinationModel == 2) {
|
421
|
429
|
this.requireGroup = false;
|
422
|
430
|
this.requireDept = false;
|
|
431
|
+ this.requireDeptType = false;
|
423
|
432
|
} else if (this.quickCombinationModel == 3) {
|
424
|
433
|
if (this.queryParamsType == 1) {
|
425
|
434
|
this.requireGroup = false;
|
426
|
435
|
this.requireDept = true;
|
|
436
|
+ this.requireDeptType = false;
|
427
|
437
|
} else if (this.queryParamsType == 2) {
|
428
|
438
|
this.requireGroup = false;
|
429
|
439
|
this.requireDept = false;
|
|
440
|
+ this.requireDeptType = true;
|
430
|
441
|
}
|
431
|
442
|
} else if (this.quickCombinationModel == 4) {
|
432
|
443
|
this.requireGroup = false;
|
433
|
444
|
this.requireDept = true;
|
|
445
|
+ this.requireDeptType = false;
|
434
|
446
|
}else if (this.quickCombinationModel == 5) {
|
435
|
447
|
this.requireGroup = false;
|
436
|
448
|
this.requireDept = false;
|
|
449
|
+ this.requireDeptType = false;
|
437
|
450
|
}else if (this.quickCombinationModel == 6) {
|
438
|
451
|
this.requireGroup = false;
|
439
|
452
|
this.requireDept = false;
|
|
453
|
+ this.requireDeptType = false;
|
440
|
454
|
}
|
441
|
455
|
if (!this.requireGroup) {
|
442
|
456
|
this.validateForm.get("quickCombinationGroup")!.clearValidators();
|
|
@@ -460,6 +474,17 @@ export class QuickCombinationComponent implements OnInit {
|
460
|
474
|
}
|
461
|
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
|
488
|
if (!(this.queryParamsType == 1 && this.quickCombinationModel == 1)) {
|
464
|
489
|
this.validateForm.get("quickCombinationDispatchMethod")!.clearValidators();
|
465
|
490
|
this.validateForm.get("quickCombinationDispatchMethod")!.markAsPristine();
|
|
@@ -540,6 +565,39 @@ export class QuickCombinationComponent implements OnInit {
|
540
|
565
|
this.validateForm.get("quickCombinationDispatchWeight")!.updateValueAndValidity();
|
541
|
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
|
601
|
deptList = []; //科室列表
|
544
|
602
|
dLoading = false;
|
545
|
603
|
dNum = 0;
|
|
@@ -1002,6 +1060,7 @@ export class QuickCombinationComponent implements OnInit {
|
1002
|
1060
|
quickCombinationModel: [null, [Validators.required]],
|
1003
|
1061
|
quickCombinationDept: this.requireGroup ? [null, [Validators.required]] : [null],
|
1004
|
1062
|
quickCombinationGroup: this.requireDept ? [null, [Validators.required]] : [null],
|
|
1063
|
+ deptTypeIds: this.requireDeptType ? [null, [Validators.required]] : [null],
|
1005
|
1064
|
quickCombinationDispatchMethod: [null],
|
1006
|
1065
|
quickCombinationDispatchType: [null],
|
1007
|
1066
|
quickCombinationDispatchWeight: [null],
|
|
@@ -1079,6 +1138,11 @@ export class QuickCombinationComponent implements OnInit {
|
1079
|
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
|
1147
|
if (
|
1084
|
1148
|
this.validateForm.value.quickCombinationDept &&
|