Explorar o código

feat: 添加弹窗处理

carver hai 1 ano
pai
achega
2b692eb743

+ 10 - 0
antbuilder/industry/hospitalV2/components/edit-patient/index.axml

@@ -82,6 +82,16 @@
       <button class="submit-button" onTap="patientSave">保存</button>
     </view>
   </view>
+    <modal
+      show="{{ modalOpened }}"
+      showClose="{{ false }}"
+      onButtonClick="onButtonClick"
+      buttons="{{ buttons }}"
+      zIndex="10"
+    >
+      <view slot="header">温馨提醒</view>
+      属于初诊建卡的患者,请持有效证件(身份证、社保卡、公费医疗证)到我院门诊挂号窗核验医疗待遇(医保/公医),再前往诊室就医。
+    </modal>
   <select-card
     show="{{ show }}"
     onClose="onClosePopup"

+ 23 - 9
antbuilder/industry/hospitalV2/components/edit-patient/index.js

@@ -62,6 +62,7 @@ Component(
       medicCardsList: [],
       isAuthSuccess: false,
       editForm: getDefaultForm(),
+      modalOpened: false,
       genders: [
         {
           label: "男",
@@ -82,6 +83,12 @@ Component(
           name: "港澳台身份证",
         },
       ],
+      buttons: [
+        {
+          text: "确定",
+          extClass: "buttonBold",
+        },
+      ],
     },
 
     didMount() {
@@ -216,6 +223,19 @@ Component(
         });
       },
 
+      async onButtonClick() {
+        this.setData({
+          modalOpened: false,
+        });
+        const { editForm } = this.data;
+        const form = this.restForm(editForm);
+        /* 不是编辑的情况,才需要选择就诊卡 */
+        if (!editForm.id && !this.isEditCard()) {
+          form.bindCardNum = await this.onCheckCard(form);
+        }
+        await this.onSubmit(this.initData(form));
+      },
+
       /* 一键清除 */
       clearInput(value, key) {
         // eslint-disable-next-line no-param-reassign
@@ -344,18 +364,12 @@ Component(
       async patientSave() {
         const { editForm, isAuthSuccess } = this.data;
         /* 如果不是本人,校验字段 */
-
         if (!isAuthSuccess) {
           if (!this.vailForm(editForm)) return;
         }
-        /* 获取非脱敏的字段 */
-
-        const form = this.restForm(editForm);
-        /* 不是编辑的情况,才需要选择就诊卡 */
-        if (!editForm.id && !this.isEditCard()) {
-          form.bindCardNum = await this.onCheckCard(form);
-        }
-        await this.onSubmit(this.initData(form));
+        this.setData({
+          modalOpened: true,
+        });
       },
 
       /* 提交 */

+ 2 - 1
antbuilder/industry/hospitalV2/components/edit-patient/index.json

@@ -8,6 +8,7 @@
     "select-card": "../select-card/index",
     "select-relationship": "../select-relationship/index",
     "radio-custom-group": "../components/radio-custom-group/index",
-    "am-checkbox": "mini-ali-ui/es/am-checkbox/index"
+    "am-checkbox": "mini-ali-ui/es/am-checkbox/index",
+    "modal": "mini-ali-ui/es/modal/index"
   }
 }