|
@@ -58,6 +58,7 @@ export class HospitalConfigComponent implements OnInit {
|
58
|
58
|
this.getDeptList(this.hosId),
|
59
|
59
|
this.getGroupList(this.hosId),
|
60
|
60
|
this.getTaskTypeList([255]),
|
|
61
|
+ this.getClassesList(),
|
61
|
62
|
])
|
62
|
63
|
.then((result) => {
|
63
|
64
|
if (result[0].status == 200) {
|
|
@@ -72,6 +73,14 @@ export class HospitalConfigComponent implements OnInit {
|
72
|
73
|
if (result[3].status == 200) {
|
73
|
74
|
this.taskTypeList = result[3].list;
|
74
|
75
|
}
|
|
76
|
+ if (result[4].status == 200) {
|
|
77
|
+ this.classesList = result[4].list;
|
|
78
|
+ this.classesList = this.classesList.map((item) => ({
|
|
79
|
+ label: item.name,
|
|
80
|
+ value: item.id,
|
|
81
|
+ checked: false,
|
|
82
|
+ }));
|
|
83
|
+ }
|
75
|
84
|
this.getHospitalConfigList(this.hosId).subscribe((res) => {
|
76
|
85
|
if (res.status == 200) {
|
77
|
86
|
this.hospitalConfigList = res.list;
|
|
@@ -82,6 +91,10 @@ export class HospitalConfigComponent implements OnInit {
|
82
|
91
|
//坐席号码
|
83
|
92
|
fbGroup[item.key] = [null];
|
84
|
93
|
item.required = false;
|
|
94
|
+ } else if (item.key === "rushNoticeShift") {
|
|
95
|
+ //抢单通知班次
|
|
96
|
+ fbGroup[item.key] = [];
|
|
97
|
+ item.required = false;
|
85
|
98
|
} else {
|
86
|
99
|
fbGroup[item.key] = [null, [Validators.required]];
|
87
|
100
|
item.required = true;
|
|
@@ -122,6 +135,14 @@ export class HospitalConfigComponent implements OnInit {
|
122
|
135
|
this.validateForm.controls[config.key].setValue(
|
123
|
136
|
config.value - 0
|
124
|
137
|
);
|
|
138
|
+ } else if (config.key === "rushNoticeShift") {
|
|
139
|
+ let arr = config.value ? config.value.split(",") : [];
|
|
140
|
+ this.classesList.forEach((item) => {
|
|
141
|
+ item.checked = arr.includes(item.value + "");
|
|
142
|
+ });
|
|
143
|
+ this.validateForm.controls[config.key].setValue(
|
|
144
|
+ this.classesList
|
|
145
|
+ );
|
125
|
146
|
} else {
|
126
|
147
|
this.validateForm.controls[config.key].setValue(config.value);
|
127
|
148
|
}
|
|
@@ -135,6 +156,20 @@ export class HospitalConfigComponent implements OnInit {
|
135
|
156
|
this.isLoading = false;
|
136
|
157
|
});
|
137
|
158
|
}
|
|
159
|
+ // 获取当前院区的班次列表
|
|
160
|
+ classesList = [];
|
|
161
|
+ getClassesList() {
|
|
162
|
+ let postData = {
|
|
163
|
+ idx: 0,
|
|
164
|
+ sum: 9999,
|
|
165
|
+ scheduleClass: {
|
|
166
|
+ hospital: { id: this.hosId },
|
|
167
|
+ },
|
|
168
|
+ };
|
|
169
|
+ return this.mainService
|
|
170
|
+ .getFetchDataList("configuration", "scheduleClass", postData)
|
|
171
|
+ .toPromise();
|
|
172
|
+ }
|
138
|
173
|
// 获取系统配置列表
|
139
|
174
|
getHospitalConfigList(hosId) {
|
140
|
175
|
let postData = { idx: 0, sum: 100, hospitalConfig: { hosId } };
|
|
@@ -215,7 +250,14 @@ export class HospitalConfigComponent implements OnInit {
|
215
|
250
|
JSON.stringify(this.hospitalConfigList)
|
216
|
251
|
);
|
217
|
252
|
hospitalConfigList.forEach((config) => {
|
218
|
|
- config.value = this.validateForm.controls[config.key].value;
|
|
253
|
+ if (config.key === "rushNoticeShift") {
|
|
254
|
+ config.value = this.validateForm.controls[config.key].value
|
|
255
|
+ .filter((item) => item.checked)
|
|
256
|
+ .map((item) => item.value)
|
|
257
|
+ .toString();
|
|
258
|
+ } else {
|
|
259
|
+ config.value = this.validateForm.controls[config.key].value;
|
|
260
|
+ }
|
219
|
261
|
delete config.required;
|
220
|
262
|
});
|
221
|
263
|
this.saveLoading = true;
|