seimin 2 years ago
parent
commit
2c5e0b608c

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

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

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

@@ -31,6 +31,7 @@ export class HospitalConfigComponent implements OnInit {
31
   deptList2 = []; //科室列表
31
   deptList2 = []; //科室列表
32
   groupList = []; //组列表
32
   groupList = []; //组列表
33
   onSearchSubject = new Subject(); //搜索防抖
33
   onSearchSubject = new Subject(); //搜索防抖
34
+  onSearchInspectionDepartmentScopeSubject = new Subject(); //搜索防抖
34
   coopBtns: any = {};
35
   coopBtns: any = {};
35
   repairSpecimenStatus = "0"; //是否执行标本验证机制
36
   repairSpecimenStatus = "0"; //是否执行标本验证机制
36
   repairSpecimenStatusMinute = 0; //验证时间
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
     this.coopBtns = this.tool.initCoopBtns(this.route);
70
     this.coopBtns = this.tool.initCoopBtns(this.route);
62
     this.getInit();
71
     this.getInit();
63
   }
72
   }
@@ -222,9 +231,26 @@ export class HospitalConfigComponent implements OnInit {
222
                     this.classesList
231
                     this.classesList
223
                   );
232
                   );
224
                 } else if (config.key === "repairSpecimenStatusCheckDeptIds") {
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
                 } else {
254
                 } else {
229
                   this.validateForm.controls[config.key].setValue(config.value);
255
                   this.validateForm.controls[config.key].setValue(config.value);
230
                 }
256
                 }
@@ -311,12 +337,13 @@ export class HospitalConfigComponent implements OnInit {
311
    * @param dept 模糊搜索
337
    * @param dept 模糊搜索
312
    * @returns
338
    * @returns
313
    */
339
    */
314
-  getDeptList2(hosId) {
340
+  getDeptList2(hosId, dept: any = "") {
315
     let postData = {
341
     let postData = {
316
       idx: 0,
342
       idx: 0,
317
       sum: 10,
343
       sum: 10,
318
       department: {
344
       department: {
319
         hospital: { id: hosId },
345
         hospital: { id: hosId },
346
+        dept,
320
         type: { id: "282" },
347
         type: { id: "282" },
321
       },
348
       },
322
     };
349
     };
@@ -341,6 +368,12 @@ export class HospitalConfigComponent implements OnInit {
341
     this.onSearchSubject.next(e);
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
   submitForm(): void {
378
   submitForm(): void {
346
     for (const i in this.validateForm.controls) {
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
   checkOptionsOne: Array<any> = [
69
   checkOptionsOne: Array<any> = [
70
     { label: "超时工单", value: "0", checked: false },
70
     { label: "超时工单", value: "0", checked: false },
71
     { label: "异常工单", value: "1", checked: false },
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
         specialCloseFlag: that.specialCloseFlag,
198
         specialCloseFlag: that.specialCloseFlag,
199
         createDept: that.department,
199
         createDept: that.department,
200
         hosId: that.hospital,
200
         hosId: that.hospital,
201
-        abnormityType: that.checkOptionsOne[1].checked ? 1 : 0,
201
+        abnormityType: that.checkOptionsOne[1].checked ? 1 : undefined,
202
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
202
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
203
       },
203
       },
204
     };
204
     };
@@ -387,7 +387,7 @@ export class OrderManagementComponent implements OnInit {
387
         gdState: { id: that.gdState },
387
         gdState: { id: that.gdState },
388
         createDept: that.department,
388
         createDept: that.department,
389
         hosId: that.hospital,
389
         hosId: that.hospital,
390
-        abnormityType: that.checkOptionsOne[1].checked ? 1 : 0,
390
+        abnormityType: that.checkOptionsOne[1].checked ? 1 : undefined,
391
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
391
         timeOut: that.checkOptionsOne[0].checked ? 1 : 0,
392
       },
392
       },
393
     };
393
     };