فهرست منبع

fix: 优化预结算loading

carver 1 سال پیش
والد
کامیت
454ee84303
1فایلهای تغییر یافته به همراه21 افزوده شده و 17 حذف شده
  1. 21 17
      antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.js

+ 21 - 17
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.js

@@ -31,23 +31,27 @@ Component({
 
     async handlePrePayConfirm() {
       my.showLoading({ mask: true });
-      const { hisOrderNo: hisOrdNum, hisPatientId: patientId, hisClinicCode: clinicCode, authCode, total: orderSum, orderInsType } = this.$page.data.query
-      const [err, result] = await prePayConfirm({
-        patientId,
-        clinicCode,
-        hisOrdNum,
-        orderSum,
-        payInsType: '2',
-        orderInsType,
-        authCode,
-      })
-      if (!err) {
-        // 预结算成功
-        this.setData({
-        }, () => {
-          my.hideLoading()
-        });
-      } else {
+      try {
+        const { hisOrderNo: hisOrdNum, hisPatientId: patientId, hisClinicCode: clinicCode, authCode, total: orderSum, orderInsType } = this.$page.data.query
+        const [err, result] = await prePayConfirm({
+          patientId,
+          clinicCode,
+          hisOrdNum,
+          orderSum,
+          payInsType: '2',
+          orderInsType,
+          authCode,
+        })
+        if (!err) {
+          // 预结算成功
+          this.setData({
+          });
+        } else {
+          throw `${err}`
+        }
+      } catch (error) {
+        console.log('error ===>', error)
+      } finally {
         my.hideLoading()
       }
     },