|
@@ -11,7 +11,7 @@ import { Subject } from "rxjs";
|
11
|
11
|
import { debounceTime } from "rxjs/operators";
|
12
|
12
|
import { MainService } from "src/app/services/main.service";
|
13
|
13
|
import { ToolService } from "src/app/services/tool.service";
|
14
|
|
-import { OverlayScrollbarsComponent } from 'overlayscrollbars-ngx';
|
|
14
|
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
|
15
|
15
|
|
16
|
16
|
@Component({
|
17
|
17
|
selector: "app-hospital-config",
|
|
@@ -171,7 +171,7 @@ export class HospitalConfigComponent implements OnInit {
|
171
|
171
|
fbGroup[item.key] = [];
|
172
|
172
|
item.required = false;
|
173
|
173
|
} else {
|
174
|
|
- if(item.show){
|
|
174
|
+ if (item.show) {
|
175
|
175
|
fbGroup[item.key] = [null, [Validators.required]];
|
176
|
176
|
item.required = true;
|
177
|
177
|
}
|
|
@@ -180,52 +180,54 @@ export class HospitalConfigComponent implements OnInit {
|
180
|
180
|
this.validateForm = this.fb.group(fbGroup);
|
181
|
181
|
//赋值
|
182
|
182
|
this.hospitalConfigList.forEach((config) => {
|
183
|
|
- //默认角色,默认组
|
184
|
|
- if (
|
185
|
|
- config.key === "autoCreateUserRoleId" ||
|
186
|
|
- config.key === "rebackPatientTypeId" ||
|
187
|
|
- config.key === "transDeptTypeId" ||
|
188
|
|
- config.key === "autoCreateUserGroupId"
|
189
|
|
- ) {
|
190
|
|
- this.validateForm.controls[config.key].setValue(
|
191
|
|
- config.value - 0
|
192
|
|
- );
|
193
|
|
- } else if (config.key === "autoCreateUserDeptId") {
|
194
|
|
- //默认科室
|
195
|
|
- let flag = this.deptList.some(
|
196
|
|
- (item) => item.id == config.value
|
197
|
|
- );
|
198
|
|
- console.log(this.deptList);
|
199
|
|
- if (!flag) {
|
200
|
|
- this.getDeptById(config.value).subscribe((item) => {
|
201
|
|
- this.isLoading = false;
|
202
|
|
- if (item.status == 200) {
|
203
|
|
- if (item.data.hospital.id == this.hosId) {
|
204
|
|
- console.log(this.deptList);
|
205
|
|
- this.deptList.unshift(item.data);
|
|
183
|
+ if (config.show) {
|
|
184
|
+ //默认角色,默认组
|
|
185
|
+ if (
|
|
186
|
+ config.key === "autoCreateUserRoleId" ||
|
|
187
|
+ config.key === "rebackPatientTypeId" ||
|
|
188
|
+ config.key === "transDeptTypeId" ||
|
|
189
|
+ config.key === "autoCreateUserGroupId"
|
|
190
|
+ ) {
|
|
191
|
+ this.validateForm.controls[config.key].setValue(
|
|
192
|
+ config.value - 0
|
|
193
|
+ );
|
|
194
|
+ } else if (config.key === "autoCreateUserDeptId") {
|
|
195
|
+ //默认科室
|
|
196
|
+ let flag = this.deptList.some(
|
|
197
|
+ (item) => item.id == config.value
|
|
198
|
+ );
|
|
199
|
+ console.log(this.deptList);
|
|
200
|
+ if (!flag) {
|
|
201
|
+ this.getDeptById(config.value).subscribe((item) => {
|
|
202
|
+ this.isLoading = false;
|
|
203
|
+ if (item.status == 200) {
|
|
204
|
+ if (item.data.hospital.id == this.hosId) {
|
|
205
|
+ console.log(this.deptList);
|
|
206
|
+ this.deptList.unshift(item.data);
|
|
207
|
+ }
|
206
|
208
|
}
|
207
|
|
- }
|
|
209
|
+ });
|
|
210
|
+ } else {
|
|
211
|
+ this.isLoading = false;
|
|
212
|
+ }
|
|
213
|
+ this.validateForm.controls[config.key].setValue(
|
|
214
|
+ config.value - 0
|
|
215
|
+ );
|
|
216
|
+ } else if (config.key === "rushNoticeShift") {
|
|
217
|
+ let arr = config.value ? config.value.split(",") : [];
|
|
218
|
+ this.classesList.forEach((item) => {
|
|
219
|
+ item.checked = arr.includes(item.value + "");
|
208
|
220
|
});
|
|
221
|
+ this.validateForm.controls[config.key].setValue(
|
|
222
|
+ this.classesList
|
|
223
|
+ );
|
|
224
|
+ } else if (config.key === "repairSpecimenStatusCheckDeptIds") {
|
|
225
|
+ this.validateForm.controls[config.key].setValue(
|
|
226
|
+ config.value ? config.value.split(",").map(Number) : []
|
|
227
|
+ );
|
209
|
228
|
} else {
|
210
|
|
- this.isLoading = false;
|
|
229
|
+ this.validateForm.controls[config.key].setValue(config.value);
|
211
|
230
|
}
|
212
|
|
- this.validateForm.controls[config.key].setValue(
|
213
|
|
- config.value - 0
|
214
|
|
- );
|
215
|
|
- } else if (config.key === "rushNoticeShift") {
|
216
|
|
- let arr = config.value ? config.value.split(",") : [];
|
217
|
|
- this.classesList.forEach((item) => {
|
218
|
|
- item.checked = arr.includes(item.value + "");
|
219
|
|
- });
|
220
|
|
- this.validateForm.controls[config.key].setValue(
|
221
|
|
- this.classesList
|
222
|
|
- );
|
223
|
|
- } else if (config.key === "repairSpecimenStatusCheckDeptIds") {
|
224
|
|
- this.validateForm.controls[config.key].setValue(
|
225
|
|
- config.value ? config.value.split(",").map(Number) : []
|
226
|
|
- );
|
227
|
|
- } else {
|
228
|
|
- this.validateForm.controls[config.key].setValue(config.value);
|
229
|
231
|
}
|
230
|
232
|
});
|
231
|
233
|
} else {
|
|
@@ -328,7 +330,7 @@ export class HospitalConfigComponent implements OnInit {
|
328
|
330
|
* @returns
|
329
|
331
|
*/
|
330
|
332
|
getGroupList(hosId) {
|
331
|
|
- let postData = { idx: 0, sum: 100, group2: { hospitals: hosId,type:1 } };
|
|
333
|
+ let postData = { idx: 0, sum: 100, group2: { hospitals: hosId, type: 1 } };
|
332
|
334
|
return this.mainService
|
333
|
335
|
.getFetchDataList("data", "group2", postData)
|
334
|
336
|
.toPromise();
|