|
@@ -144,7 +144,6 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
144
|
144
|
|
145
|
145
|
this.userList = [];
|
146
|
146
|
this.groupList = [];
|
147
|
|
- this.getUsers();
|
148
|
147
|
this.getGroups();
|
149
|
148
|
}
|
150
|
149
|
|
|
@@ -415,7 +414,6 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
415
|
414
|
this.modalConfig = true;
|
416
|
415
|
this.initConfigForm();
|
417
|
416
|
this.requiredConfigChange('userId', true);
|
418
|
|
- this.requiredConfigChange('groupId', false);
|
419
|
417
|
}
|
420
|
418
|
//关闭新增/编辑弹框
|
421
|
419
|
hideConfigModal() {
|
|
@@ -432,7 +430,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
432
|
430
|
score: [null, [Validators.required]],//积分
|
433
|
431
|
userGroup: [1, [Validators.required]],//分配方式
|
434
|
432
|
userId: [null],//维修人
|
435
|
|
- groupId: [null],//维修组
|
|
433
|
+ groupId: [null, [Validators.required]],//维修组
|
436
|
434
|
});
|
437
|
435
|
console.log(this.validateConfigForm.controls)
|
438
|
436
|
}
|
|
@@ -441,14 +439,13 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
441
|
439
|
changeUserGroup(id){
|
442
|
440
|
this.validateConfigForm.controls.userId.setValue(null);
|
443
|
441
|
this.validateConfigForm.controls.groupId.setValue(null);
|
|
442
|
+ this.userList = [];
|
444
|
443
|
if(id === 1){
|
445
|
444
|
// 人
|
446
|
445
|
this.requiredConfigChange('userId', true);
|
447
|
|
- this.requiredConfigChange('groupId', false);
|
448
|
446
|
}else if(id === 2){
|
449
|
447
|
// 组
|
450
|
448
|
this.requiredConfigChange('userId', false);
|
451
|
|
- this.requiredConfigChange('groupId', true);
|
452
|
449
|
}
|
453
|
450
|
}
|
454
|
451
|
|
|
@@ -480,14 +477,18 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
480
|
477
|
this.validateConfigForm.controls.groupId.setValue(data.groupId);
|
481
|
478
|
if(data.userGroup === 1){
|
482
|
479
|
this.requiredConfigChange('userId', true);
|
483
|
|
- this.requiredConfigChange('groupId', false);
|
484
|
480
|
}else if(data.userGroup === 2){
|
485
|
481
|
this.requiredConfigChange('userId', false);
|
486
|
|
- this.requiredConfigChange('groupId', true);
|
487
|
482
|
}
|
488
|
483
|
data.hosId && this.getHospitals(2, data.hosId);
|
489
|
|
- data.dutyId && this.getUsers();
|
490
|
|
- data.dutyId && this.getGroups();
|
|
484
|
+ data.dutyId && this.getUsers('', true);
|
|
485
|
+ data.dutyId && this.getGroups('', true);
|
|
486
|
+ }
|
|
487
|
+
|
|
488
|
+ // 修改组
|
|
489
|
+ changeGroup(id){
|
|
490
|
+ this.validateConfigForm.controls.userId.setValue(null);
|
|
491
|
+ this.getUsers();
|
491
|
492
|
}
|
492
|
493
|
|
493
|
494
|
// 新增/编辑表单提交
|
|
@@ -514,7 +515,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
514
|
515
|
score: { id: this.validateConfigForm.value.score },
|
515
|
516
|
dutyId: this.validateConfigForm.value.dutyId,
|
516
|
517
|
userGroup: this.validateConfigForm.value.userGroup,
|
517
|
|
- groupId: this.validateConfigForm.value.userGroup === 2 ? this.validateConfigForm.value.groupId : undefined,
|
|
518
|
+ groupId: this.validateConfigForm.value.groupId || undefined,
|
518
|
519
|
userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
|
519
|
520
|
hosId: this.currentHospital.id,
|
520
|
521
|
}
|
|
@@ -528,11 +529,9 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
528
|
529
|
categoryId,
|
529
|
530
|
priority: this.validateConfigForm.value.priority,
|
530
|
531
|
score: { id: this.validateConfigForm.value.score },
|
531
|
|
- // dutyId: this.validateConfigForm.value.dutyId,
|
532
|
532
|
userGroup: this.validateConfigForm.value.userGroup,
|
533
|
|
- groupId: this.validateConfigForm.value.userGroup === 2 ? this.validateConfigForm.value.groupId : undefined,
|
|
533
|
+ groupId: this.validateConfigForm.value.groupId || undefined,
|
534
|
534
|
userId: this.validateConfigForm.value.userGroup === 1 ? this.validateConfigForm.value.userId : undefined,
|
535
|
|
- // hosId: this.currentHospital.id,
|
536
|
535
|
}
|
537
|
536
|
}
|
538
|
537
|
};
|
|
@@ -575,10 +574,10 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
575
|
574
|
if(this.coopType !== 0){
|
576
|
575
|
this.getCategoryList(this.coopType, this.coopType === 1 ? undefined : this['activeCategory' + (this.coopType - 1)].id);
|
577
|
576
|
}else{
|
578
|
|
- this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + this.currentCategoryIndex].id);
|
|
577
|
+ this.getCategoryList(this.currentCategoryIndex, this.currentCategoryIndex === 1 ? undefined : this['activeCategory' + (this.currentCategoryIndex - 1)].id);
|
579
|
578
|
}
|
580
|
|
- if(this.activeCategory1.id || this.activeCategory2.id || this.activeCategory3.id){
|
581
|
|
- this.getCategoryConfigList(this.activeCategory1.id || this.activeCategory2.id || this.activeCategory3.id);
|
|
579
|
+ if(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id){
|
|
580
|
+ this.getCategoryConfigList(this.activeCategory3.id || this.activeCategory2.id || this.activeCategory1.id);
|
582
|
581
|
}
|
583
|
582
|
} else if(this.activeTagId == 2){
|
584
|
583
|
this.getPriorityList();
|
|
@@ -934,8 +933,8 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
934
|
933
|
// 搜索
|
935
|
934
|
// 获取用户
|
936
|
935
|
userList: any = [];
|
937
|
|
- getUsers(keyword = '') {
|
938
|
|
- if(!this.validateConfigForm.value.dutyId){
|
|
936
|
+ getUsers(keyword = '', isShowValue = false) {
|
|
937
|
+ if((!this.validateConfigForm.value.groupId && this.validateConfigForm.value.userGroup === 1) || this.validateConfigForm.value.userGroup === 2){
|
939
|
938
|
this.userList = [];
|
940
|
939
|
return;
|
941
|
940
|
}
|
|
@@ -944,6 +943,7 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
944
|
943
|
hospital: { id: this.validateConfigForm.value.dutyId },
|
945
|
944
|
name: keyword,
|
946
|
945
|
simpleQuery: true,
|
|
946
|
+ groupdata: { id: this.validateConfigForm.value.groupId },
|
947
|
947
|
},
|
948
|
948
|
idx: 0,
|
949
|
949
|
sum: 10,
|
|
@@ -952,13 +952,18 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
952
|
952
|
.getFetchDataList("data", "user", postData)
|
953
|
953
|
.subscribe((data) => {
|
954
|
954
|
this.isLoading = false;
|
955
|
|
- this.userList = data.list || [];
|
|
955
|
+ let userList = data.list || [];
|
|
956
|
+ if(isShowValue && this.coopData && this.coopData.userId){
|
|
957
|
+ userList = userList.filter(v => v.id !== this.coopData.userId)
|
|
958
|
+ userList.unshift(this.coopData.userDTO);
|
|
959
|
+ }
|
|
960
|
+ this.userList = userList;
|
956
|
961
|
});
|
957
|
962
|
}
|
958
|
963
|
|
959
|
964
|
// 获取组
|
960
|
965
|
groupList: any = []; //所有所属科室(搜索)
|
961
|
|
- getGroups(keyword = '') {
|
|
966
|
+ getGroups(keyword = '', isShowValue = false) {
|
962
|
967
|
if(!this.validateConfigForm.value.dutyId){
|
963
|
968
|
this.groupList = [];
|
964
|
969
|
return;
|
|
@@ -976,7 +981,12 @@ export class ConfigurationCenterComponent implements OnInit, AfterViewInit {
|
976
|
981
|
.getFetchDataList("data", "group2", postData)
|
977
|
982
|
.subscribe((data) => {
|
978
|
983
|
this.isLoading = false;
|
979
|
|
- this.groupList = data.list || [];
|
|
984
|
+ let groupList = data.list || [];
|
|
985
|
+ if(isShowValue && this.coopData && this.coopData.groupId){
|
|
986
|
+ groupList = groupList.filter(v => v.id !== this.coopData.groupId)
|
|
987
|
+ groupList.unshift(this.coopData.groupDTO);
|
|
988
|
+ }
|
|
989
|
+ this.groupList = groupList;
|
980
|
990
|
});
|
981
|
991
|
}
|
982
|
992
|
|