Browse Source

feat: 对接医保2.0预结算接口

carver 1 year ago
parent
commit
0e8888e7e9

+ 26 - 0
antbuilder/core/utils/ywtService.js

@@ -105,3 +105,29 @@ export async function recordOpLog({ type }) {
   if (err || !res) return [err, null];
   return [null, res];
 }
+
+// 医保2.0预结算
+export async function prePayConfirm({
+  patientId,
+  clinicCode,
+  hisOrdNum,
+  orderSum,
+  payInsType,
+  orderInsType,
+  authCode, }) {
+  const [err, res] = await ywtRequest({
+    url: "/outpatient/prePayConfirm",
+    method: "post",
+    data: {
+      patientId,
+      clinicCode,
+      hisOrdNum,
+      orderSum,
+      payInsType,
+      orderInsType,
+      authCode,
+    },
+  });
+  if (err || !res) return [err, null];
+  return [null, res];
+}

+ 5 - 2
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.axml

@@ -43,13 +43,16 @@
             查看明细
           </View>
         </View>
-        <View className="personal-pay">
+
+        <!-- 个帐支付 -->
+        <!-- <View className="personal-pay">
           <View className="title">个人账户支付</View>
           <View className="btns">
             <button  data-valuex="{{ true }}" onTap="handleIsUserPersonalAccount" className="{{isUserPersonalAccount ? 'y' : 'n'}}">使用</button>
             <button  data-valuex="{{ false }}" onTap="handleIsUserPersonalAccount" className="{{!isUserPersonalAccount ? 'y' : 'n'}}">不使用</button>
           </View>
-        </View>
+        </View> -->
+        
         <View class="bd-append">
           <view class="bd-append-icon"></view>
           <View class="bd-append-text">医保移动支付</View>

+ 25 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail-yibao/index.js

@@ -1,5 +1,6 @@
 import { getYbParams } from "./service";
 import { tradePay } from "../../utils/tradePay";
+import { prePayConfirm } from "../../../../core/utils/ywtService";
 import history from "../../utils/history";
 // import { reportApi, reportCmPV_YL } from "../../utils/cloudMonitorHelper";
 // import { getSubscribeAuth } from "../../../../core/utils/ywtService";
@@ -20,6 +21,7 @@ Component({
 
   didMount() {
     this.getPayDetail(this.$page.data.query);
+    this.handlePrePayConfirm()
   },
 
   methods: {
@@ -27,6 +29,29 @@ Component({
       this.subscribe = ref;
     },
 
+    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 {
+        my.hideLoading()
+      }
+    },
+
     parseDetailItems(detailItems) {
       const list = detailItems
         ? JSON.parse(decodeURIComponent(detailItems || ""))

+ 3 - 0
antbuilder/industry/hospitalV2/components/hospital-payment-detail/index.js

@@ -101,6 +101,7 @@ Component(createSubscribe({
     reportCmPV_YL({
       title: "门诊缴费",
     });
+
   },
 
   methods: {
@@ -108,6 +109,8 @@ Component(createSubscribe({
       this.subscribe = ref;
     },
 
+
+
     payDetail(send) {
       const { orderItems } = send;
       const status0OrderItems = JSON.parse(

+ 5 - 1
antbuilder/industry/hospitalV2/components/hospital-payment/index.js

@@ -51,7 +51,7 @@ Component(
 				title: "门诊缴费",
 			});
 		},
-		onInit() {},
+		onInit() { },
 
 		methods: {
 			onFilterHandel(filters) {
@@ -156,6 +156,7 @@ Component(
 						hisClinicCode,
 						deptName,
 						orderItems,
+						orderInsType
 					},
 				} = e.target.dataset;
 				history.push({
@@ -180,6 +181,7 @@ Component(
 						total,
 						hisClinicCode,
 						deptName,
+						orderInsType,
 						orderItems: encodeURIComponent(JSON.stringify(orderItems || "")),
 					},
 					pageType: "hospital-payment-detail",
@@ -188,6 +190,8 @@ Component(
 
 			// 付款
 			async onPayment(e) {
+				this.toDetail(e)
+				return
 				const { medicareBinded = false, item } = e.target.dataset; // 同意订阅消息后发起支付
 				try {
 					my.showLoading();