seimin преди 3 години
родител
ревизия
e3e42f21af
променени са 3 файла, в които са добавени 34 реда и са изтрити 1 реда
  1. 7 0
      src/app/services/main.service.ts
  2. 5 1
      src/app/views/drug-search/drug-search.component.html
  3. 22 0
      src/app/views/drug-search/drug-search.component.ts

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

@@ -99,6 +99,13 @@ export class MainService {
99 99
     });
100 100
   }
101 101
 
102
+  // 通用操作data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
103
+  coopDataM(m,coop, type, data): any {
104
+    return this.http.post(host.host + "/"+ m +"/" + coop + "/" + type, data, {
105
+      headers: this.headers,
106
+    });
107
+  }
108
+
102 109
   // 通用操作user data信息(新增/更新/删除)//coop:操作类型addData:新增,updData更新,rmvData删除
103 110
   coopUserData(coop, type, data): any {
104 111
     return this.http.post(host.host + "/user/data/" + coop + "/" + type, data, {

+ 5 - 1
src/app/views/drug-search/drug-search.component.html

@@ -34,7 +34,8 @@
34 34
         </div>
35 35
       </div>
36 36
       <div nz-col nzXl="8" class="list-template__btns">
37
-        <button nz-button class="btn default" (click)='reset()'>重置</button>
37
+        <button nz-button class="btn default" (click)="showDelModal('您确认要清空药品吗?')">清空药品</button>
38
+        <button nz-button class="btn default ml8" (click)='reset()'>重置</button>
38 39
         <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
39 40
       </div>
40 41
     </div>
@@ -74,3 +75,6 @@
74 75
     </div>
75 76
   </div>
76 77
 </div>
78
+<!-- 清空药品模态框 -->
79
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
80
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>

+ 22 - 0
src/app/views/drug-search/drug-search.component.ts

@@ -31,6 +31,28 @@ export class DrugSearchComponent implements OnInit {
31 31
     });
32 32
     this.getHospital();
33 33
   }
34
+  // 清空药品
35
+  delModal: boolean = false; //删除模态框
36
+  tipsMsg1: string; //提示框信息
37
+  showDelModal(
38
+    tipsMsg1: string
39
+  ) {
40
+    this.delModal = true;
41
+    this.tipsMsg1 = tipsMsg1;
42
+  }
43
+  // 隐藏删除框
44
+  hideDelModal() {
45
+    this.delModal = false;
46
+  }
47
+  // 确认
48
+  confirmDel() {
49
+    this.mainService
50
+      .coopDataM("drugsBag","updData", "drugsBag", {"drugsBag":{"hosId":1,"isEmpty":'ok'}})
51
+      .subscribe((data) => {
52
+        this.delModal = false;
53
+        this.getList(1);
54
+      });
55
+  }
34 56
   // 重置
35 57
   reset() {
36 58
     this.searchCriteria = {