seimin hace 3 años
padre
commit
0d0a0b0ab8

+ 9 - 1
src/app/views/specimen-search/specimen-search.component.html

@@ -25,7 +25,8 @@
25 25
         </div>
26 26
       </div>
27 27
       <div nz-col nzXl="8" class="list-template__btns">
28
-        <button nz-button class="btn default" (click)='reset()'>重置</button>
28
+        <button nz-button class="btn default" (click)="showDelModal('您确认要清空标本吗?')">清空标本</button>
29
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
29 30
         <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
30 31
       </div>
31 32
     </div>
@@ -71,6 +72,13 @@
71 72
     </div>
72 73
   </div>
73 74
 </div>
75
+<!-- 清空标本模态框 -->
76
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
77
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
74 78
 <!-- 标本历史记录查看 -->
75 79
 <app-history-prompt-modal *ngIf="historyPromptModalShow" [show]="historyPromptModalShow" [scode]="scode"
76 80
   (closeModelHs)="closeModelHistory($event)"></app-history-prompt-modal>
81
+<!-- 操作成功/失败提示框 -->
82
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
83
+  [info]="promptInfo">
84
+</app-prompt-modal>

+ 44 - 0
src/app/views/specimen-search/specimen-search.component.ts

@@ -34,6 +34,50 @@ export class SpecimenSearchComponent implements OnInit {
34 34
     })
35 35
     this.getAllHospital()
36 36
   }
37
+  // 清空标本
38
+  delModal: boolean = false; //删除模态框
39
+  tipsMsg1: string; //提示框信息
40
+  showDelModal(
41
+    tipsMsg1: string
42
+  ) {
43
+    this.delModal = true;
44
+    this.tipsMsg1 = tipsMsg1;
45
+  }
46
+  // 隐藏删除框
47
+  hideDelModal() {
48
+    this.delModal = false;
49
+  }
50
+  // 确认
51
+  btnLoading: boolean = false; //提交按钮loading状态
52
+  confirmDel() {
53
+    this.btnLoading = true;
54
+    this.mainService
55
+      .coopDataM("api/emptySpecimenData", {"hosId":1,"isEmpty":'ok'})
56
+      .subscribe((data) => {
57
+        this.btnLoading = false;
58
+        this.delModal = false;
59
+        if (data.status == 200) {
60
+          this.showPromptModal("标本清空", true, "");
61
+        } else {
62
+          this.showPromptModal("标本清空", false, "");
63
+        }
64
+      });
65
+  }
66
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
67
+  promptContent: string; //操作提示框提示信息
68
+  ifSuccess: boolean; //操作成功/失败
69
+  promptInfo: string; //操作结果提示信息
70
+  promptModalShow: boolean; //操作提示框是否展示
71
+  showPromptModal(con, success, promptInfo?) {
72
+    this.promptModalShow = false;
73
+    this.promptContent = con;
74
+    this.ifSuccess = success;
75
+    this.promptInfo = promptInfo;
76
+    setTimeout(() => {
77
+      this.promptModalShow = true;
78
+    }, 100);
79
+    this.getList(0);
80
+  }
37 81
   // 查看标本历史记录
38 82
   historyPromptModalShow = false;//标本历史记录弹窗开关
39 83
   scode = '';//查看历史记录携带