Browse Source

检查科室异常配置

seimin 3 years ago
parent
commit
a94c704ede

+ 0 - 12
src/app/services/main.service.ts

@@ -518,16 +518,4 @@ export class MainService {
518 518
       headers: this.headers,
519 519
     });
520 520
   }
521
-  // 获取检查科室异常配置列表
522
-  getUnusualDept(data) {
523
-    return this.http.post(host.host + "/dept/unusualDept", data, {
524
-      headers: this.headers,
525
-    });
526
-  }
527
-  // 修改,删除检查科室异常配置
528
-  upDictionary(data) {
529
-    return this.http.post(host.host + "/common/common/upDictionary", data, {
530
-      headers: this.headers,
531
-    });
532
-  }
533 521
 }

+ 18 - 19
src/app/views/check-dept-exception/check-dept-exception.component.html

@@ -4,7 +4,7 @@
4 4
       <div nz-col nzXl='12' class="list-template__searchBox">
5 5
       </div>
6 6
       <div nz-col nzXl="12" class="list-template__btns">
7
-        <!-- <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button> -->
7
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
8 8
       </div>
9 9
     </div>
10 10
     <div class="list-template__bottom">
@@ -20,15 +20,15 @@
20 20
           </tr>
21 21
         </thead>
22 22
         <tbody>
23
-          <tr *ngFor="let data of listOfData;let i = index" (click)="selectedListData(data[4])">
23
+          <tr *ngFor="let data of listOfData;let i = index" (click)="selectedListData(data.id)">
24 24
             <td>{{ i+1 }}</td>
25
-            <td>{{ data[0] }}</td>
26
-            <td>{{ data[2] }}</td>
27
-            <td>{{ data[3] }}</td>
25
+            <td>{{ data.dept }}</td>
26
+            <td>{{ data.code }}</td>
27
+            <td>{{ data.matchingDept }}</td>
28 28
             <td>
29 29
               <div class="coop">
30 30
                 <span *ngIf="coopBtns.edit" (click)="edit($event,data)">修改</span>
31
-                <span *ngIf="coopBtns.del" (click)="showDelModal($event,data[4],'您确认要删除吗?','删除','del')">删除</span>
31
+                <span *ngIf="coopBtns.del" (click)="showDelModal($event,data.id,'您确认要删除吗?','删除','del')">删除</span>
32 32
               </div>
33 33
             </td>
34 34
           </tr>
@@ -52,11 +52,12 @@
52 52
           <nz-form-item>
53 53
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="startDepartment">检查原科室</nz-form-label>
54 54
             <nz-form-control nzErrorTip="请选择检查原科室!">
55
-              <nz-select [nzDisabled]="!add" [nzDropdownMatchSelectWidth]="false" formControlName="startDepartment"
56
-                nzShowSearch nzAllowClear nzPlaceHolder="请选择检查原科室" nzServerSearch
57
-                (nzOnSearch)="changeInp($event,'form')" (nzOpenChange)="changeForm($event)">
55
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="startDepartment" nzShowSearch
56
+                nzAllowClear nzPlaceHolder="请选择检查原科室" nzServerSearch (nzOnSearch)="changeInp($event,'form')"
57
+                (nzOpenChange)="changeForm($event)">
58 58
                 <ng-container *ngFor="let data of department">
59
-                  <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
59
+                  <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}"
60
+                    nzValue="{{data.id+'&&'+data.dept+'&&'+data.type.id}}"></nz-option>
60 61
                 </ng-container>
61 62
                 <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
62 63
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
@@ -68,26 +69,24 @@
68 69
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="keyword">关键字</nz-form-label>
69 70
             <nz-form-control nzErrorTip="请输入关键字!">
70 71
               <nz-input-group>
71
-                <input nz-input formControlName="keyword" placeholder="请输入关键字" [disabled]="!add" />
72
+                <input nz-input formControlName="keyword" placeholder="请输入关键字" />
72 73
               </nz-input-group>
73 74
             </nz-form-control>
74 75
           </nz-form-item>
75 76
           <nz-form-item>
76 77
             <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="endDepartment">匹配的科室</nz-form-label>
77 78
             <nz-form-control nzErrorTip="请选择匹配的科室!">
78
-              <!-- <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment"
79
-                nzShowSearch nzAllowClear nzPlaceHolder="请选择匹配的科室" nzServerSearch
80
-                (nzOnSearch)="changeInp($event,'formEnd')" (nzOpenChange)="changeFormEnd($event)">
79
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment" nzShowSearch nzAllowClear
80
+                nzPlaceHolder="请选择匹配的科室" nzServerSearch (nzOnSearch)="changeInp($event,'formEnd')"
81
+                (nzOpenChange)="changeFormEnd($event)">
81 82
                 <ng-container *ngFor="let data of department1">
82
-                  <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
83
+                  <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id+'&&'+data.dept}}">
84
+                  </nz-option>
83 85
                 </ng-container>
84 86
                 <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
85 87
                   <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
86 88
                 </nz-option>
87
-              </nz-select> -->
88
-              <nz-input-group>
89
-                <input nz-input formControlName="endDepartment" placeholder="请输入匹配的科室" />
90
-              </nz-input-group>
89
+              </nz-select>
91 90
             </nz-form-control>
92 91
           </nz-form-item>
93 92
         </form>

+ 69 - 77
src/app/views/check-dept-exception/check-dept-exception.component.ts

@@ -230,17 +230,22 @@ export class CheckDeptExceptionComponent implements OnInit {
230 230
     let postData = {
231 231
       idx: this.pageIndex - 1,
232 232
       sum: this.pageSize,
233
+      inspectDeptAbnormalSettings: {
234
+        hospitalId: this.hosId,
235
+      },
233 236
     };
234 237
     this.mapOfCheckedId = {};
235 238
     this.checkedDepIds = [];
236 239
     this.loading1 = true;
237
-    this.mainService.getUnusualDept(postData).subscribe((result: any) => {
238
-      this.loading1 = false;
239
-      if (result.status == 200) {
240
-        this.listOfData = result.list;
241
-        this.listLength = result.totalNum;
242
-      }
243
-    });
240
+    this.mainService
241
+      .getFetchDataList("simple/data", "inspectDeptAbnormalSettings", postData)
242
+      .subscribe((result: any) => {
243
+        this.loading1 = false;
244
+        if (result.status == 200) {
245
+          this.listOfData = result.list;
246
+          this.listLength = result.totalNum;
247
+        }
248
+      });
244 249
   }
245 250
 
246 251
   // 新增/编辑弹框
@@ -276,28 +281,50 @@ export class CheckDeptExceptionComponent implements OnInit {
276 281
       return;
277 282
     }
278 283
     let data = {};
284
+    let startDepartmentInfo =
285
+      this.validateForm.controls.startDepartment.value.split("&&");
286
+    let endDepartmentInfo =
287
+      this.validateForm.controls.endDepartment.value.split("&&");
279 288
 
280 289
     if (this.add) {
281
-      //新增
290
+      //新增baba
291
+      data = {
292
+        hospitalId: this.hosId,
293
+        deleteFlag: 0, //1是删除,0是不删除
294
+        dept: startDepartmentInfo[1], //原科室名字
295
+        deptId: startDepartmentInfo[0], //原科室id
296
+        type: startDepartmentInfo[2], //原科室的科室类型id
297
+        matchingDept: endDepartmentInfo[1], //匹配科室名称
298
+        matchingDeptId: endDepartmentInfo[0], //匹配科室id
299
+        code: this.validateForm.controls.keyword.value, //关键字
300
+      };
282 301
     } else {
283 302
       //编辑
284 303
       data = {
285 304
         id: this.coopId,
286
-        deleted: false,
287
-        desc: this.validateForm.controls.endDepartment.value,
305
+        hospitalId: this.hosId,
306
+        deleteFlag: 0, //1是删除,0是不删除
307
+        dept: startDepartmentInfo[1], //原科室名字
308
+        deptId: startDepartmentInfo[0], //原科室id
309
+        type: startDepartmentInfo[2], //原科室的科室类型id
310
+        matchingDept: endDepartmentInfo[1], //匹配科室名称
311
+        matchingDeptId: endDepartmentInfo[0], //匹配科室id
312
+        code: this.validateForm.controls.keyword.value, //关键字
288 313
       };
289 314
     }
290
-    this.mainService.upDictionary(data).subscribe((result: any) => {
291
-      this.btnLoading = false;
292
-      this.hideAddModal();
293
-      this.initForm();
294
-      if (result.status == 200) {
295
-        this.listLength++;
296
-        this.showPromptModal(this.add ? "新增" : "修改", true, "");
297
-      } else {
298
-        this.showPromptModal(this.add ? "新增" : "修改", false, "");
299
-      }
300
-    });
315
+    this.mainService
316
+      .simplePost("addData", "inspectDeptAbnormalSettings", data)
317
+      .subscribe((result: any) => {
318
+        this.btnLoading = false;
319
+        this.hideAddModal();
320
+        this.initForm();
321
+        if (result.status == 200) {
322
+          this.listLength++;
323
+          this.showPromptModal(this.add ? "新增" : "修改", true, "");
324
+        } else {
325
+          this.showPromptModal(this.add ? "新增" : "修改", false, "");
326
+        }
327
+      });
301 328
   }
302 329
 
303 330
   // 编辑
@@ -305,62 +332,23 @@ export class CheckDeptExceptionComponent implements OnInit {
305 332
   edit(e, data) {
306 333
     e.stopPropagation();
307 334
     this.add = false;
308
-    this.coopId = data[4];
309
-    this.validateForm.controls.keyword.setValue(data[2]); //关键字
310
-    this.validateForm.controls.endDepartment.setValue(data[3]); //匹配的科室
311
-    // --------检查原科室---
312
-    let startDeptArr = []; //临时检查原科室数组
313
-    let startDept = data[1]; //科室id
314
-    let startDeptShow = data[0]; //科室名称
315
-    startDeptArr.push({ id: startDept, dept: startDeptShow });
316
-    let startDept$ = this.mainService.getFetchDataList("data", "department", {
317
-      department: {
318
-        hospital: { id: data.hospital },
335
+    this.coopId = data.id;
336
+    this.validateForm.controls.keyword.setValue(data.code); //关键字
337
+    this.department = [
338
+      {
339
+        id: data.deptId,
340
+        dept: data.dept,
341
+        type: { id: data.type },
319 342
       },
320
-      idx: 0,
321
-      sum: 10,
322
-    });
323
-    // --------/检查原科室---
324
-    // --------匹配的科室---
325
-    // let targetDeptArr = []; //临时匹配的科室数组
326
-    // let targetDept = data.targetDept.split(","); //科室id
327
-    // let targetDeptShow = data.targetDeptShow.split(","); //科室名称
328
-    // targetDept.forEach((item, index) => {
329
-    //   targetDeptArr.push({ id: item, dept: targetDeptShow[index] });
330
-    // });
331
-    // let targetDept$ = this.mainService.getFetchDataList("data", "department", {
332
-    //   department: {
333
-    //     hospital: { id: data.hospital },
334
-    //     type: { id: 282 },
335
-    //   },
336
-    //   idx: 0,
337
-    //   sum: 20,
338
-    // });
339
-    // --------/匹配的科室---
340
-    this.maskFlag = this.message.loading("正在加载中..", {
341
-      nzDuration: 0,
342
-    }).messageId;
343
-    forkJoin(startDept$).subscribe((res) => {
344
-      this.message.remove(this.maskFlag);
345
-      this.maskFlag = false;
346
-      this.modal = true;
347
-      //检查原科室
348
-      if (res[0]["status"] == 200) {
349
-        let add = startDeptArr.filter(
350
-          (item) => !res[0]["list"].some((ele) => ele.id == item.id)
351
-        ); //过滤掉已有的选项
352
-        this.department = add.concat(res[0]["list"]); //拼接数组
353
-        this.validateForm.controls.startDepartment.setValue(data[1] + ""); //检查原科室
354
-      }
355
-      //匹配的科室
356
-      // if (res[2]["status"] == 200) {
357
-      //   let add = targetDeptArr.filter(
358
-      //     (item) => !res[2]["list"].some((ele) => ele.id == item.id)
359
-      //   ); //过滤掉已有的选项
360
-      //   this.department1 = add.concat(res[2]["list"]); //拼接数组
361
-      //   this.validateForm.controls.endDepartment.setValue(targetDept); //匹配的科室
362
-      // }
363
-    });
343
+    ];
344
+    this.validateForm.controls.startDepartment.setValue(
345
+      `${data.deptId}&&${data.dept}&&${data.type}`
346
+    ); //检查原科室
347
+    this.department1 = [{ id: data.matchingDeptId, dept: data.matchingDept }];
348
+    this.validateForm.controls.endDepartment.setValue(
349
+      `${data.matchingDeptId}&&${data.matchingDept}`
350
+    ); //匹配的科室
351
+    this.modal = true;
364 352
   }
365 353
 
366 354
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
@@ -406,8 +394,12 @@ export class CheckDeptExceptionComponent implements OnInit {
406 394
     this.btnLoading = true;
407 395
     if (this.confirmDelType === "del") {
408 396
       //删除
397
+      let postData = {
398
+        id: this.coopId,
399
+        deleteFlag: 1,
400
+      };
409 401
       this.mainService
410
-        .upDictionary({ id: this.coopId, deleted: true })
402
+        .simplePost("addData", "inspectDeptAbnormalSettings", postData)
411 403
         .subscribe((data: any) => {
412 404
           this.btnLoading = false;
413 405
           this.delModal = false;