|
@@ -31,6 +31,7 @@ export class HospitalConfigComponent implements OnInit {
|
31
|
31
|
deptList2 = []; //科室列表
|
32
|
32
|
groupList = []; //组列表
|
33
|
33
|
onSearchSubject = new Subject(); //搜索防抖
|
|
34
|
+ onSearchInspectionDepartmentScopeSubject = new Subject(); //搜索防抖
|
34
|
35
|
coopBtns: any = {};
|
35
|
36
|
repairSpecimenStatus = "0"; //是否执行标本验证机制
|
36
|
37
|
repairSpecimenStatusMinute = 0; //验证时间
|
|
@@ -58,6 +59,14 @@ export class HospitalConfigComponent implements OnInit {
|
58
|
59
|
}
|
59
|
60
|
});
|
60
|
61
|
});
|
|
62
|
+ this.onSearchInspectionDepartmentScopeSubject.pipe(debounceTime(500)).subscribe((v) => {
|
|
63
|
+ this.getDeptList2(this.hosId, v).then((result) => {
|
|
64
|
+ this.searchLoading = false;
|
|
65
|
+ if (result.status == 200) {
|
|
66
|
+ this.deptList2 = result.list;
|
|
67
|
+ }
|
|
68
|
+ });
|
|
69
|
+ });
|
61
|
70
|
this.coopBtns = this.tool.initCoopBtns(this.route);
|
62
|
71
|
this.getInit();
|
63
|
72
|
}
|
|
@@ -222,9 +231,26 @@ export class HospitalConfigComponent implements OnInit {
|
222
|
231
|
this.classesList
|
223
|
232
|
);
|
224
|
233
|
} else if (config.key === "repairSpecimenStatusCheckDeptIds") {
|
225
|
|
- this.validateForm.controls[config.key].setValue(
|
226
|
|
- config.value ? config.value.split(",").map(Number) : []
|
227
|
|
- );
|
|
234
|
+ let arr = config.value ? config.value.split(",").map(Number) : [];
|
|
235
|
+ arr.forEach(v => {
|
|
236
|
+ let flag = this.deptList2.some(
|
|
237
|
+ (item) => item.id == v
|
|
238
|
+ );
|
|
239
|
+ console.log(this.deptList2);
|
|
240
|
+ if (!flag) {
|
|
241
|
+ this.getDeptById(v).subscribe((item) => {
|
|
242
|
+ this.isLoading = false;
|
|
243
|
+ if (item.status == 200) {
|
|
244
|
+ if (item.data.hospital.id == this.hosId) {
|
|
245
|
+ this.deptList2.unshift(item.data);
|
|
246
|
+ }
|
|
247
|
+ }
|
|
248
|
+ });
|
|
249
|
+ } else {
|
|
250
|
+ this.isLoading = false;
|
|
251
|
+ }
|
|
252
|
+ })
|
|
253
|
+ this.validateForm.controls[config.key].setValue(arr);
|
228
|
254
|
} else {
|
229
|
255
|
this.validateForm.controls[config.key].setValue(config.value);
|
230
|
256
|
}
|
|
@@ -311,12 +337,13 @@ export class HospitalConfigComponent implements OnInit {
|
311
|
337
|
* @param dept 模糊搜索
|
312
|
338
|
* @returns
|
313
|
339
|
*/
|
314
|
|
- getDeptList2(hosId) {
|
|
340
|
+ getDeptList2(hosId, dept: any = "") {
|
315
|
341
|
let postData = {
|
316
|
342
|
idx: 0,
|
317
|
343
|
sum: 10,
|
318
|
344
|
department: {
|
319
|
345
|
hospital: { id: hosId },
|
|
346
|
+ dept,
|
320
|
347
|
type: { id: "282" },
|
321
|
348
|
},
|
322
|
349
|
};
|
|
@@ -341,6 +368,12 @@ export class HospitalConfigComponent implements OnInit {
|
341
|
368
|
this.onSearchSubject.next(e);
|
342
|
369
|
}
|
343
|
370
|
|
|
371
|
+ //验证检验科室范围
|
|
372
|
+ onSearchInspectionDepartmentScope(e){
|
|
373
|
+ this.searchLoading = true;
|
|
374
|
+ this.onSearchInspectionDepartmentScopeSubject.next(e);
|
|
375
|
+ }
|
|
376
|
+
|
344
|
377
|
// 保存
|
345
|
378
|
submitForm(): void {
|
346
|
379
|
for (const i in this.validateForm.controls) {
|