|
@@ -30,6 +30,8 @@ export class QuickCombinationComponent implements OnInit {
|
30
|
30
|
this.allWorkModel = [
|
31
|
31
|
{ id: 1, name: "自由抢单" },
|
32
|
32
|
{ id: 3, name: "科室绑定人员" },
|
|
33
|
+ { id: 4, name: "科室绑定分组" },
|
|
34
|
+ { id: 2, name: "绑定分组" },
|
33
|
35
|
];
|
34
|
36
|
}
|
35
|
37
|
});
|
|
@@ -193,7 +195,17 @@ export class QuickCombinationComponent implements OnInit {
|
193
|
195
|
this.validateForm.controls.quickCombinationType.setValue(
|
194
|
196
|
this.info.taskTypesId
|
195
|
197
|
); //任务类型
|
196
|
|
- this.quickCombinationModel = this.info.ruleType + "";
|
|
198
|
+ if(this.queryParamsType == 1){
|
|
199
|
+ this.quickCombinationModel = this.info.ruleType + "";
|
|
200
|
+ }else if(this.queryParamsType == 2){
|
|
201
|
+ if(this.info.ruleType == 2){
|
|
202
|
+ this.quickCombinationModel = '6';
|
|
203
|
+ }else if(this.info.ruleType == 4){
|
|
204
|
+ this.quickCombinationModel = '5';
|
|
205
|
+ }else{
|
|
206
|
+ this.quickCombinationModel = this.info.ruleType + "";
|
|
207
|
+ }
|
|
208
|
+ }
|
197
|
209
|
this.taskListFlag = false;
|
198
|
210
|
if (!this.copyFlag) {
|
199
|
211
|
if (this.info.ruleType == 2) {
|
|
@@ -265,7 +277,17 @@ export class QuickCombinationComponent implements OnInit {
|
265
|
277
|
);
|
266
|
278
|
console.log(obj);
|
267
|
279
|
if (obj) {
|
268
|
|
- this.quickCombinationModel = obj.ruleType + "";
|
|
280
|
+ if(this.queryParamsType == 1){
|
|
281
|
+ this.quickCombinationModel = obj.ruleType + "";
|
|
282
|
+ }else if(this.queryParamsType == 2){
|
|
283
|
+ if(obj.ruleType == 2){
|
|
284
|
+ this.quickCombinationModel = '6';
|
|
285
|
+ }else if(obj.ruleType == 4){
|
|
286
|
+ this.quickCombinationModel = '5';
|
|
287
|
+ }else{
|
|
288
|
+ this.quickCombinationModel = obj.ruleType + "";
|
|
289
|
+ }
|
|
290
|
+ }
|
269
|
291
|
this.radioIt(1); //选择任务类型
|
270
|
292
|
this.taskListFlag = false;
|
271
|
293
|
} else {
|
|
@@ -324,6 +346,17 @@ export class QuickCombinationComponent implements OnInit {
|
324
|
346
|
this.searchTaskList("");
|
325
|
347
|
}
|
326
|
348
|
}
|
|
349
|
+ //对应ruleType与quickCombinationModel
|
|
350
|
+ get quickCombinationModelComputed(){
|
|
351
|
+ console.log(this.quickCombinationModel,'---------------------')
|
|
352
|
+ if(this.quickCombinationModel == 5){//科室绑定分组
|
|
353
|
+ return 4;
|
|
354
|
+ }else if(this.quickCombinationModel == 6){//绑定分组
|
|
355
|
+ return 2;
|
|
356
|
+ }else{
|
|
357
|
+ return this.quickCombinationModel;
|
|
358
|
+ }
|
|
359
|
+ }
|
327
|
360
|
// 选中工作模式
|
328
|
361
|
radioIt(flag?) {
|
329
|
362
|
//undefined 打开复制弹窗,1 选择任务类型
|
|
@@ -332,21 +365,29 @@ export class QuickCombinationComponent implements OnInit {
|
332
|
365
|
// 回显储存的值
|
333
|
366
|
console.log(this.info, this.quickCombinationModel);
|
334
|
367
|
if (
|
335
|
|
- this.info.ruleType == this.quickCombinationModel &&
|
336
|
|
- this.quickCombinationModel == 2
|
|
368
|
+ this.info.ruleType == this.quickCombinationModelComputed &&
|
|
369
|
+ (this.quickCombinationModel == 2 || this.quickCombinationModel == 5 || this.quickCombinationModel == 6)
|
337
|
370
|
) {
|
338
|
371
|
this.groupList = this.info.groups;
|
339
|
372
|
if (!this.copyFlag) {
|
340
|
|
- this.validateForm.controls.quickCombinationGroup.setValue(
|
341
|
|
- this.info.groupsId
|
342
|
|
- );
|
|
373
|
+ if(this.quickCombinationModel == 6){
|
|
374
|
+ this.validateForm.controls.quickCombinationGroup.setValue((this.info.groupsId?this.info.groupsId[0] + '':null));
|
|
375
|
+ }else{
|
|
376
|
+ this.validateForm.controls.quickCombinationGroup.setValue(
|
|
377
|
+ this.info.groupsId
|
|
378
|
+ );
|
|
379
|
+ }
|
343
|
380
|
} else {
|
344
|
381
|
if (!flag) {
|
345
|
382
|
this.validateForm.controls.quickCombinationGroup.setValue(null);
|
346
|
383
|
} else {
|
347
|
|
- this.validateForm.controls.quickCombinationGroup.setValue(
|
348
|
|
- this.info.groupsId
|
349
|
|
- );
|
|
384
|
+ if(this.quickCombinationModel == 6){
|
|
385
|
+ this.validateForm.controls.quickCombinationGroup.setValue((this.info.groupsId?this.info.groupsId[0] + '':null));
|
|
386
|
+ }else{
|
|
387
|
+ this.validateForm.controls.quickCombinationGroup.setValue(
|
|
388
|
+ this.info.groupsId
|
|
389
|
+ );
|
|
390
|
+ }
|
350
|
391
|
}
|
351
|
392
|
}
|
352
|
393
|
}
|
|
@@ -388,6 +429,12 @@ export class QuickCombinationComponent implements OnInit {
|
388
|
429
|
} else if (this.quickCombinationModel == 4) {
|
389
|
430
|
this.requireGroup = false;
|
390
|
431
|
this.requireDept = true;
|
|
432
|
+ }else if (this.quickCombinationModel == 5) {
|
|
433
|
+ this.requireGroup = false;
|
|
434
|
+ this.requireDept = false;
|
|
435
|
+ }else if (this.quickCombinationModel == 6) {
|
|
436
|
+ this.requireGroup = false;
|
|
437
|
+ this.requireDept = false;
|
391
|
438
|
}
|
392
|
439
|
if (!this.requireGroup) {
|
393
|
440
|
this.validateForm.get("quickCombinationGroup")!.clearValidators();
|
|
@@ -460,19 +507,23 @@ export class QuickCombinationComponent implements OnInit {
|
460
|
507
|
this.validateForm.controls.quickCombinationDept.setValue(arr);
|
461
|
508
|
break;
|
462
|
509
|
case 4:
|
463
|
|
- let arr1 = [];
|
464
|
|
- let arr11 = [];
|
465
|
|
- this.info.departmentDTOS.forEach((item) => {
|
466
|
|
- arr1.push(item.id + "");
|
467
|
|
- });
|
468
|
|
- this.info.departmentDTOS.forEach((item) => {
|
469
|
|
- let flag = this.deptList.some((v) => v.id == item.id);
|
470
|
|
- if (!flag) {
|
471
|
|
- arr11.push(item);
|
472
|
|
- }
|
473
|
|
- });
|
474
|
|
- this.deptList = [...arr11, ...this.deptList];
|
475
|
|
- this.validateForm.controls.quickCombinationDept.setValue(arr1);
|
|
510
|
+ if(this.queryParamsType == 1){
|
|
511
|
+ let arr1 = [];
|
|
512
|
+ let arr11 = [];
|
|
513
|
+ this.info.departmentDTOS.forEach((item) => {
|
|
514
|
+ arr1.push(item.id + "");
|
|
515
|
+ });
|
|
516
|
+ this.info.departmentDTOS.forEach((item) => {
|
|
517
|
+ let flag = this.deptList.some((v) => v.id == item.id);
|
|
518
|
+ if (!flag) {
|
|
519
|
+ arr11.push(item);
|
|
520
|
+ }
|
|
521
|
+ });
|
|
522
|
+ this.deptList = [...arr11, ...this.deptList];
|
|
523
|
+ this.validateForm.controls.quickCombinationDept.setValue(arr1);
|
|
524
|
+ }else if(this.queryParamsType == 2){
|
|
525
|
+ this.validateForm.controls.quickCombinationDept.setValue(null);
|
|
526
|
+ }
|
476
|
527
|
break;
|
477
|
528
|
}
|
478
|
529
|
}
|
|
@@ -543,13 +594,33 @@ export class QuickCombinationComponent implements OnInit {
|
543
|
594
|
});
|
544
|
595
|
this.groupList = [...arrr, ...this.groupList];
|
545
|
596
|
console.log(this.groupList, arrr, arr);
|
546
|
|
- this.validateForm.controls.quickCombinationGroup.setValue(arr);
|
|
597
|
+ if(this.queryParamsType == 1){
|
|
598
|
+ this.validateForm.controls.quickCombinationGroup.setValue(arr);
|
|
599
|
+ }else if(this.queryParamsType == 2){
|
|
600
|
+ this.validateForm.controls.quickCombinationGroup.setValue(arr[0] + '');
|
|
601
|
+ }
|
547
|
602
|
break;
|
548
|
603
|
case 3:
|
549
|
604
|
this.validateForm.controls.quickCombinationGroup.setValue(null);
|
550
|
605
|
break;
|
551
|
606
|
case 4:
|
552
|
|
- this.validateForm.controls.quickCombinationGroup.setValue(null);
|
|
607
|
+ if(this.queryParamsType == 1){
|
|
608
|
+ this.validateForm.controls.quickCombinationGroup.setValue(null);
|
|
609
|
+ }else if(this.queryParamsType == 2){
|
|
610
|
+ let arr = [];
|
|
611
|
+ let arrr = [];
|
|
612
|
+ this.info.groups.forEach((item) => {
|
|
613
|
+ let flag = this.groupList.some((v) => v.id == item.id);
|
|
614
|
+ arr.push(item.id + "");
|
|
615
|
+ console.log(flag);
|
|
616
|
+ if (!flag) {
|
|
617
|
+ arrr.push(item);
|
|
618
|
+ }
|
|
619
|
+ });
|
|
620
|
+ this.groupList = [...arrr, ...this.groupList];
|
|
621
|
+ console.log(this.groupList, arrr, arr);
|
|
622
|
+ this.validateForm.controls.quickCombinationGroup.setValue(arr);
|
|
623
|
+ }
|
553
|
624
|
break;
|
554
|
625
|
}
|
555
|
626
|
}
|
|
@@ -906,7 +977,7 @@ export class QuickCombinationComponent implements OnInit {
|
906
|
977
|
id: this.validateForm.value.quickCombinationClass,
|
907
|
978
|
},
|
908
|
979
|
taskTypes: taskTypesIds,
|
909
|
|
- ruleType: this.validateForm.value.quickCombinationModel,
|
|
980
|
+ ruleType: this.quickCombinationModelComputed,
|
910
|
981
|
workSchemeId: this.queryParamsId,
|
911
|
982
|
},
|
912
|
983
|
};
|
|
@@ -973,21 +1044,34 @@ export class QuickCombinationComponent implements OnInit {
|
973
|
1044
|
console.log(this.validateForm.value.quickCombinationGroup);
|
974
|
1045
|
if (
|
975
|
1046
|
this.validateForm.value.quickCombinationGroup &&
|
976
|
|
- this.quickCombinationModel == 2
|
|
1047
|
+ (this.quickCombinationModel == 2 || this.quickCombinationModel == 5 || this.quickCombinationModel == 6)
|
977
|
1048
|
) {
|
978
|
|
- let groups = this.validateForm.value.quickCombinationGroup.map((item) => {
|
979
|
|
- return {
|
980
|
|
- id: item,
|
981
|
|
- };
|
982
|
|
- });
|
983
|
|
- if (groups.length > 0) {
|
984
|
|
- if (this.copyFlag) {
|
985
|
|
- data["workAllocationQuickConfig"]["groups"] = null;
|
|
1049
|
+ if(this.quickCombinationModel == 5){
|
|
1050
|
+ let groups = this.validateForm.value.quickCombinationGroup.map((item) => {
|
|
1051
|
+ return {
|
|
1052
|
+ id: item,
|
|
1053
|
+ };
|
|
1054
|
+ });
|
|
1055
|
+ if (groups.length > 0) {
|
|
1056
|
+ if (this.copyFlag) {
|
|
1057
|
+ data["workAllocationQuickConfig"]["groups"] = null;
|
|
1058
|
+ } else {
|
|
1059
|
+ data["workAllocationQuickConfig"]["groups"] = groups;
|
|
1060
|
+ }
|
986
|
1061
|
} else {
|
987
|
|
- data["workAllocationQuickConfig"]["groups"] = groups;
|
|
1062
|
+ data["workAllocationQuickConfig"]["groups"] = null;
|
|
1063
|
+ }
|
|
1064
|
+ }else if(this.quickCombinationModel == 6){
|
|
1065
|
+ if(this.validateForm.value.quickCombinationGroup){
|
|
1066
|
+ let groups = [{id:this.validateForm.value.quickCombinationGroup}];
|
|
1067
|
+ if (this.copyFlag) {
|
|
1068
|
+ data["workAllocationQuickConfig"]["groups"] = null;
|
|
1069
|
+ } else {
|
|
1070
|
+ data["workAllocationQuickConfig"]["groups"] = groups;
|
|
1071
|
+ }
|
|
1072
|
+ }else{
|
|
1073
|
+ data["workAllocationQuickConfig"]["groups"] = null;
|
988
|
1074
|
}
|
989
|
|
- } else {
|
990
|
|
- data["workAllocationQuickConfig"]["groups"] = null;
|
991
|
1075
|
}
|
992
|
1076
|
}
|
993
|
1077
|
if (!this.add && !this.copyFlag) {
|