Ver código fonte

院区系统配置增加是否允许核酸打印

seimin 2 anos atrás
pai
commit
48c5354d64

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

@@ -316,7 +316,7 @@
316 316
                     nzAllowClear
317 317
                     nzPlaceHolder="请选择验证检验科室范围"
318 318
                     nzServerSearch
319
-                    [formControlName]="config.key" 
319
+                    [formControlName]="config.key"
320 320
                     (nzOnSearch)="onSearchInspectionDepartmentScope($event)"
321 321
                   >
322 322
                     <ng-container *ngFor="let o of deptList2">
@@ -374,6 +374,64 @@
374 374
                 </nz-radio-group>
375 375
               </nz-form-control>
376 376
             </ng-container>
377
+            <ng-container *ngSwitchCase="'allowNucleicAcidPrinting'">
378
+              <nz-form-label
379
+                [nzSpan]="24"
380
+                [nzFor]="config.key"
381
+                class="label"
382
+                [nzRequired]="config.required"
383
+                >是否允许核酸打印</nz-form-label
384
+              >
385
+              <nz-form-control
386
+                [nzSpan]="24"
387
+                [nzErrorTip]="'请选择是否允许核酸打印!'"
388
+              >
389
+                <nz-radio-group
390
+                  [formControlName]="config.key"
391
+                  (ngModelChange)="changeAllowNucleicAcidPrinting($event)"
392
+                >
393
+                  <label nz-radio nzValue="1">是</label>
394
+                  <label nz-radio nzValue="0">否</label>
395
+                </nz-radio-group>
396
+              </nz-form-control>
397
+            </ng-container>
398
+            <ng-container *ngSwitchCase="'nucleicAcidPrintingTaskType'">
399
+              <ng-container *ngIf="config.show">
400
+                <nz-form-label
401
+                  [nzSpan]="24"
402
+                  [nzFor]="config.key"
403
+                  class="label"
404
+                  [nzRequired]="config.required"
405
+                  >核酸打印任务类型</nz-form-label
406
+                >
407
+                <nz-form-control
408
+                  [nzSpan]="24"
409
+                  [nzErrorTip]="'请选择核酸打印任务类型!'"
410
+                >
411
+                  <nz-select
412
+                    [nzDropdownMatchSelectWidth]="false"
413
+                    nzShowSearch
414
+                    nzAllowClear
415
+                    nzPlaceHolder="请选择核酸打印任务类型"
416
+                    nzServerSearch
417
+                    [formControlName]="config.key"
418
+                    (nzOnSearch)="onSearchNucleicAcidPrintingTaskType($event)"
419
+                  >
420
+                    <ng-container *ngFor="let o of allTaskTypeList">
421
+                      <nz-option
422
+                        *ngIf="!searchLoading"
423
+                        [nzLabel]="o.taskName"
424
+                        [nzValue]="o.id"
425
+                      ></nz-option>
426
+                    </ng-container>
427
+                    <nz-option *ngIf="searchLoading" nzDisabled nzCustomContent>
428
+                      <i nz-icon nzType="loading" class="loading-icon"></i>
429
+                      搜索中...
430
+                    </nz-option>
431
+                  </nz-select>
432
+                </nz-form-control>
433
+              </ng-container>
434
+            </ng-container>
377 435
             <ng-container *ngSwitchDefault>
378 436
               <nz-form-label
379 437
                 [nzSpan]="24"

+ 76 - 1
src/app/views/hospital-config/hospital-config.component.ts

@@ -27,15 +27,19 @@ export class HospitalConfigComponent implements OnInit {
27 27
   hospitalConfigList = []; //院区系统配置列表
28 28
   roleList = []; //角色列表
29 29
   taskTypeList = []; //任务类型列表
30
+  allTaskTypeList = []; //任务类型列表
30 31
   deptList = []; //科室列表
31 32
   deptList2 = []; //科室列表
32 33
   groupList = []; //组列表
33 34
   onSearchSubject = new Subject(); //搜索防抖
34 35
   onSearchInspectionDepartmentScopeSubject = new Subject(); //搜索防抖
36
+  onSearchNucleicAcidPrintingTaskTypeSubject = new Subject(); //搜索防抖
35 37
   coopBtns: any = {};
36 38
   repairSpecimenStatus = "0"; //是否执行标本验证机制
37 39
   repairSpecimenStatusMinute = 0; //验证时间
38 40
   repairSpecimenStatusCheckDeptIds = []; //验证检验科范围
41
+  allowNucleicAcidPrinting = "0"; //是否允许核酸打印
42
+  nucleicAcidPrintingTaskType = []; //核酸打印任务类型
39 43
   formatterDollar = (value) => Number(value);
40 44
   constructor(
41 45
     private mainService: MainService,
@@ -67,6 +71,15 @@ export class HospitalConfigComponent implements OnInit {
67 71
         }
68 72
       });
69 73
     });
74
+    // liao
75
+    this.onSearchNucleicAcidPrintingTaskTypeSubject.pipe(debounceTime(500)).subscribe((v) => {
76
+      this.getTaskTypeList(undefined, v).then((result) => {
77
+        this.searchLoading = false;
78
+        if (result.status == 200) {
79
+          this.allTaskTypeList = result.list;
80
+        }
81
+      });
82
+    });
70 83
     this.coopBtns = this.tool.initCoopBtns(this.route);
71 84
     this.getInit();
72 85
   }
@@ -114,6 +127,37 @@ export class HospitalConfigComponent implements OnInit {
114 127
       });
115 128
     }
116 129
   }
130
+  // 选择是否允许核酸打印
131
+  changeAllowNucleicAcidPrinting(e) {
132
+    if (e == 1) {
133
+      this.validateForm.addControl(
134
+        "nucleicAcidPrintingTaskType",
135
+        new FormControl(null, Validators.required)
136
+      );
137
+      //赋值
138
+      this.hospitalConfigList.forEach((config) => {
139
+        if (
140
+          config.key === "nucleicAcidPrintingTaskType"
141
+        ) {
142
+          config.show = true;
143
+        }
144
+        if (config.key === "nucleicAcidPrintingTaskType") {
145
+          this.validateForm.controls[config.key].setValue(
146
+            config.value ? config.value.split(",").map(Number) : []
147
+          );
148
+        }
149
+      });
150
+    } else {
151
+      this.validateForm.removeControl("nucleicAcidPrintingTaskType");
152
+      this.hospitalConfigList.forEach((v) => {
153
+        if (
154
+          v.key === "nucleicAcidPrintingTaskType"
155
+        ) {
156
+          v.show = false;
157
+        }
158
+      });
159
+    }
160
+  }
117 161
   //初始化请求数据
118 162
   getInit() {
119 163
     this.isLoading = true;
@@ -124,6 +168,7 @@ export class HospitalConfigComponent implements OnInit {
124 168
       this.getTaskTypeList([255]),
125 169
       this.getClassesList(),
126 170
       this.getDeptList2(this.hosId),
171
+      this.getTaskTypeList(),
127 172
     ])
128 173
       .then((result) => {
129 174
         if (result[0].status == 200) {
@@ -149,6 +194,9 @@ export class HospitalConfigComponent implements OnInit {
149 194
         if (result[5].status == 200) {
150 195
           this.deptList2 = result[5].list;
151 196
         }
197
+        if (result[6].status == 200) {
198
+          this.allTaskTypeList = result[6].list;
199
+        }
152 200
         this.getHospitalConfigList(this.hosId).subscribe((res) => {
153 201
           if (res.status == 200) {
154 202
             this.hospitalConfigList = res.list;
@@ -171,6 +219,21 @@ export class HospitalConfigComponent implements OnInit {
171 219
               } else {
172 220
                 item.show = true;
173 221
               }
222
+              if (
223
+                item.key === "nucleicAcidPrintingTaskType"
224
+              ) {
225
+                if (
226
+                  this.hospitalConfigList.filter(
227
+                    (v) => v.key === "allowNucleicAcidPrinting"
228
+                  )[0].value == 1
229
+                ) {
230
+                  item.show = true;
231
+                } else {
232
+                  item.show = false;
233
+                }
234
+              } else {
235
+                item.show = true;
236
+              }
174 237
               if (item.key.includes("phone_num_port")) {
175 238
                 //坐席号码
176 239
                 fbGroup[item.key] = [null];
@@ -251,6 +314,8 @@ export class HospitalConfigComponent implements OnInit {
251 314
                     }
252 315
                   })
253 316
                   this.validateForm.controls[config.key].setValue(arr);
317
+                } else if (config.key === "nucleicAcidPrintingTaskType") {
318
+                  this.validateForm.controls[config.key].setValue(parseInt(config.value));
254 319
                 } else {
255 320
                   this.validateForm.controls[config.key].setValue(config.value);
256 321
                 }
@@ -296,12 +361,13 @@ export class HospitalConfigComponent implements OnInit {
296 361
       .toPromise();
297 362
   }
298 363
   // 获取任务类型列表(患者其他服务)
299
-  getTaskTypeList(associationTypeIds?) {
364
+  getTaskTypeList(associationTypeIds?,keyword?) {
300 365
     let postData: any = {
301 366
       idx: 0,
302 367
       sum: 999,
303 368
       taskType: {
304 369
         hosIds: this.hosId,
370
+        taskName: keyword,
305 371
         simpleQuery: true,
306 372
       },
307 373
     };
@@ -374,6 +440,12 @@ export class HospitalConfigComponent implements OnInit {
374 440
     this.onSearchInspectionDepartmentScopeSubject.next(e);
375 441
   }
376 442
 
443
+  //核酸打印任务类型
444
+  onSearchNucleicAcidPrintingTaskType(e){
445
+    this.searchLoading = true;
446
+    this.onSearchNucleicAcidPrintingTaskTypeSubject.next(e);
447
+  }
448
+
377 449
   // 保存
378 450
   submitForm(): void {
379 451
     for (const i in this.validateForm.controls) {
@@ -394,6 +466,9 @@ export class HospitalConfigComponent implements OnInit {
394 466
         } else if (config.key === "repairSpecimenStatusCheckDeptIds") {
395 467
           config.value =
396 468
             this.validateForm.controls[config.key].value.toString();
469
+        } else if (config.key === "nucleicAcidPrintingTaskType") {
470
+          config.value =
471
+            this.validateForm.controls[config.key].value.toString();
397 472
         } else {
398 473
           config.value = this.validateForm.controls[config.key].value;
399 474
         }