seimin 2 years ago
parent
commit
2c5e0b608c

+ 2 - 1
src/app/views/hospital-config/hospital-config.component.html

@@ -316,7 +316,8 @@
316 316
                     nzAllowClear
317 317
                     nzPlaceHolder="请选择验证检验科室范围"
318 318
                     nzServerSearch
319
-                    [formControlName]="config.key"
319
+                    [formControlName]="config.key" 
320
+                    (nzOnSearch)="onSearchInspectionDepartmentScope($event)"
320 321
                   >
321 322
                     <ng-container *ngFor="let o of deptList2">
322 323
                       <nz-option

+ 37 - 4
src/app/views/hospital-config/hospital-config.component.ts

@@ -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) {

+ 3 - 3
src/app/views/order-management/order-management.component.ts

@@ -69,7 +69,7 @@ export class OrderManagementComponent implements OnInit {
69 69
   checkOptionsOne: Array<any> = [
70 70
     { label: "超时工单", value: "0", checked: false },
71 71
     { label: "异常工单", value: "1", checked: false },
72
-    { label: "24小时未完成", value: "2", checked: false },
72
+    // { label: "24小时未完成", value: "2", checked: false },
73 73
   ]; //工单异常状态
74 74
 
75 75
   // 初始化工单异常状态选中状态
@@ -198,7 +198,7 @@ export class OrderManagementComponent implements OnInit {
198 198
         specialCloseFlag: that.specialCloseFlag,
199 199
         createDept: that.department,
200 200
         hosId: that.hospital,
201
-        abnormityType: that.checkOptionsOne[1].checked ? 1 : 0,
201
+        abnormityType: that.checkOptionsOne[1].checked ? 1 : undefined,
202 202
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
203 203
       },
204 204
     };
@@ -387,7 +387,7 @@ export class OrderManagementComponent implements OnInit {
387 387
         gdState: { id: that.gdState },
388 388
         createDept: that.department,
389 389
         hosId: that.hospital,
390
-        abnormityType: that.checkOptionsOne[1].checked ? 1 : 0,
390
+        abnormityType: that.checkOptionsOne[1].checked ? 1 : undefined,
391 391
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
392 392
       },
393 393
     };