seimin 3 år sedan
förälder
incheckning
e34ea4518a

+ 4 - 0
src/app/views/drug-search/drug-search.component.html

@@ -78,3 +78,7 @@
78 78
 <!-- 清空药品模态框 -->
79 79
 <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
80 80
 (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
81
+<!-- 操作成功/失败提示框 -->
82
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
83
+  [info]="promptInfo">
84
+</app-prompt-modal>

+ 20 - 1
src/app/views/drug-search/drug-search.component.ts

@@ -53,9 +53,28 @@ export class DrugSearchComponent implements OnInit {
53 53
       .subscribe((data) => {
54 54
         this.btnLoading = false;
55 55
         this.delModal = false;
56
-        this.getList(1);
56
+        if (data.status == 200) {
57
+          this.showPromptModal("药品清空", true, "");
58
+        } else {
59
+          this.showPromptModal("药品清空", false, "");
60
+        }
57 61
       });
58 62
   }
63
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
64
+  promptContent: string; //操作提示框提示信息
65
+  ifSuccess: boolean; //操作成功/失败
66
+  promptInfo: string; //操作结果提示信息
67
+  promptModalShow: boolean; //操作提示框是否展示
68
+  showPromptModal(con, success, promptInfo?) {
69
+    this.promptModalShow = false;
70
+    this.promptContent = con;
71
+    this.ifSuccess = success;
72
+    this.promptInfo = promptInfo;
73
+    setTimeout(() => {
74
+      this.promptModalShow = true;
75
+    }, 100);
76
+    this.getList(0);
77
+  }
59 78
   // 重置
60 79
   reset() {
61 80
     this.searchCriteria = {