Browse Source

整合待缴费和已缴费

lighter 9 months ago
parent
commit
2bc554c170

+ 3 - 8
src/router/index.js

@@ -103,9 +103,9 @@ export const constantRoutes = [
     meta: { title: '选择就诊人' },
   },
   {
-    path: '/unPaidList/:patientId',
-    component: () => import('../views/hospital-service/pay-mz-fee/UnPaidList.vue'),
-    meta: { title: '待缴费列表' },
+    path: '/mzFeeList/:active/:patientId',
+    component: () => import('../views/hospital-service/pay-mz-fee/MzFeeList.vue'),
+    meta: { title: '门诊缴费' },
   },
   {
     path: '/fromGuideBillQrScan/:patientId',
@@ -251,11 +251,6 @@ export const constantRoutes = [
     component: () => import('../views/mine/mz-pay-record/SelectPatientCard.vue'),
     meta: { title: '选择就诊人' },
   },
-  {
-    path: '/mzFeePaymentRecords/:patientId',
-    component: () => import('../views/mine/mz-pay-record/MzFeePaymentRecords.vue'),
-    meta: { title: '门诊缴费记录' },
-  },
   {
     path: '/mzFeePaymentDetail/:deptName/:doctorName/:datetime/:hisOrdNum/:totalAmt',
     name: 'mzFeePaymentDetail',

+ 1 - 1
src/views/hospital-service/HospitalServiceHome.vue

@@ -114,7 +114,7 @@
           <img src="@/assets/hospital-service/night-clinic.png"/>
           <div class="icon-label">夜间门诊</div>
         </van-col>
-        <van-col span="6" @click="routeTo(filterPath('/unPaidList/', '/selectPayPatient'))">
+        <van-col span="6" @click="routeTo(filterPath('/mzFeeList/unpaid/', '/selectPayPatient'))">
           <img src="@/assets/hospital-service/menzhenjiaofei.png"/>
           <div class="icon-label">门诊缴费</div>
         </van-col>

+ 0 - 1
src/views/hospital-service/assessments/ClinicSatisfiedAssessment.vue

@@ -155,7 +155,6 @@ const submitAnswer = () => {
   if (!validAnswer()) {
     return
   }
-  console.log(answer)
   submitOutpatientQuestionnaire(answer).then(() => {
     disableSubmitButton.value = true
     if (couponGift) {

+ 0 - 1
src/views/hospital-service/assessments/InpatientSatisfiedAssessment.vue

@@ -151,7 +151,6 @@ const submitAnswer = () => {
   if (!validAnswer()) {
     return
   }
-  console.log(answer)
   submitInpatientQuestionnaire(answer).then(() => {
     disableSubmitButton.value = true
     if (couponGift) {

+ 1 - 1
src/views/hospital-service/health-cart/BookExam.vue

@@ -77,7 +77,7 @@ const executeBook = () => {
       message: '自助开单成功。',
       position: 'top',
     });
-    router.push('/unPaidList/' + bookItem.patientId)
+    router.push('/mzFeeList/unpaid/' + bookItem.patientId)
   })
 }
 const cancelBook = () => {

+ 1 - 1
src/views/hospital-service/health-cart/ExaminationCategory.vue

@@ -28,7 +28,7 @@ const beforeOrderItem = (bookableItem) => {
   }).then(() => {
     bookableItem.patientId = patientId
     applyDirectBookableItem(bookableItem).then(() => {
-      router.push(`/unPaidList/${patientId}`)
+      router.push(`/mzFeeList/unpaid/${patientId}`)
     })
   }).catch(() => {
   })

+ 40 - 0
src/views/hospital-service/pay-mz-fee/MzFeeList.vue

@@ -0,0 +1,40 @@
+<template>
+  <window-size>
+    <van-tabs v-model:active="activeTab" @click-tab="handleTabChange">
+      <van-tab title="待缴费" name="unpaid">
+        <div class="box-wrapper">
+          <UnPaidList :patient-id="patientId"/>
+        </div>
+      </van-tab>
+      <van-tab title="已缴费" name="paid">
+        <div class="box-wrapper">
+          <MzFeePaymentRecords :patient-id="patientId"/>
+        </div>
+      </van-tab>
+    </van-tabs>
+  </window-size>
+</template>
+
+<script setup>
+import {useRouter} from "vue-router";
+import {ref} from "vue";
+import UnPaidList from "@/views/hospital-service/pay-mz-fee/UnPaidList.vue";
+import MzFeePaymentRecords from "@/views/mine/mz-pay-record/MzFeePaymentRecords.vue";
+
+const router = useRouter()
+const params = router.currentRoute.value.params
+const patientId = params.patientId
+const activeTab = ref(params.active)
+
+const handleTabChange = (val) => {
+  activeTab.value = val.name
+}
+</script>
+
+<style scoped>
+.box-wrapper {
+  height: calc(100vh - 96px);
+  overflow-y: auto;
+  margin-top: 2px;
+}
+</style>

+ 1 - 1
src/views/hospital-service/pay-mz-fee/SelectPayPatient.vue

@@ -1,6 +1,6 @@
 <template>
   <window-size>
-    <SelectCard to="unPaidList" />
+    <SelectCard to="mzFeeList/unpaid" />
   </window-size>
 </template>
 

+ 0 - 308
src/views/hospital-service/pay-mz-fee/UnPaidList-back.vue

@@ -1,308 +0,0 @@
-<template>
-  <window-size>
-    <van-empty :image="empty" description="您没有待缴费记录" v-if="showEmpty"></van-empty>
-    <div v-for="item in unpaidFees" :key="item.hisOrdNum">
-      <van-cell
-          :title="makeTitle(item)"
-          :label="item.priceTime"
-          is-link
-          center
-          @click="handleClickHisItem(item)">
-        <template #default>
-          <span style="color: orangered">{{ makeMoney(item.totalAmt) }}</span>
-        </template>
-      </van-cell>
-      <div style="height: 5px"></div>
-    </div>
-    <van-popup v-model:show="showPayMethodPicker" position="bottom">
-      <van-picker
-          :columns="payMethodColumns"
-          @cancel="showPayMethodPicker = false"
-          @confirm="handleConfirmPayMethod"
-      ></van-picker>
-    </van-popup>
-
-      <van-overlay :show="showOverlay" z-index="9999">
-
-        <div class="med-ins-mobile-pay">
-          <div class="wrapper">
-            <div class="block">
-              <div class="title">正在为您办理医保业务,请耐心等待</div>
-              <van-steps :active="currentStep">
-                <van-step v-for="item in progressText">
-                  {{ item }}
-                </van-step>
-              </van-steps>
-              <div style="height: 50px"></div>
-              <van-loading
-                  v-if="currentStep < 3"
-                  type="spinner"
-                  color="#1989fa"
-                  size="45px"
-                  vertical
-              >
-                {{loadingText[currentStep+1]}}
-              </van-loading>
-              <div v-if="currentStep >= 3">
-                <div class="fund-title">
-                  试算结束,以下为医保明细:
-                </div>
-                <div class="fund-detail">
-                  <div>
-                    医疗总计金额:¥{{fundDetail.feeSumamt}}
-                  </div>
-                  <div>
-                    医保报销金额:¥{{fundDetail.fundPay}}
-                  </div>
-                </div>
-                <div class="fund-detail">
-                  <div>
-                    个账支付金额:¥{{fundDetail.psnAcctPay}}
-                  </div>
-                  <div>
-                    现金支付金额:
-                    <span style="color: orangered">
-                      ¥{{fundDetail.ownPayAmt}}
-                    </span>
-                  </div>
-                </div>
-                <div class="pay-button">
-                  <van-button
-                      type="success"
-                      size="small"
-                      style="width: 180px"
-                  >
-                    前往支付(¥{{fundDetail.ownPayAmt}})
-                  </van-button>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-
-      </van-overlay>
-
-
-  </window-size>
-</template>
-
-<script setup>
-import {getFundPayAmt, getUnPaidFee} from '@/api/pay-mz-fee'
-import empty from '@/assets/empty.png'
-import {useRouter} from 'vue-router'
-import {computed, onMounted, ref} from 'vue'
-import {getOpenid,medInsRegister,medInsUploadCost,medInsPreSettle} from "@/api/medins-mobile-pay";
-
-const router = useRouter()
-const patientId = router.currentRoute.value.params.patientId
-const unpaidFees = ref([])
-const showEmpty = computed(() => {
-  return unpaidFees.value.length === 0
-})
-
-const currentHisItem = ref({})
-function handleClickHisItem(item) {
-  localStorage.setItem('hisOrdNum', item.hisOrdNum)
-  currentHisItem.value = item
-  showPayMethodPicker.value = true
-}
-
-const beforeToWxPay = (item) => {
-  getFundPayAmt(item.hisOrdNum).then(res => {
-    const routeParams = {
-      patientId: patientId,
-      hisOrdNum: item.hisOrdNum,
-      patientName: item.patName,
-      deptName: item.deptName,
-      doctorCode: item.doctorCode,
-      doctorName: item.doctorName,
-      totalAmt: item.totalAmt,
-      fundPay: res.fundPaySumamt,
-      acctPay: res.acctPay,
-      selfAmt: item.totalAmt - res.fundPaySumamt - res.acctPay
-    }
-    if (res.mdtrtId && !res.setlId) {
-      routeParams.mdtrtId = res.mdtrtId;
-      toMedinsSettle(routeParams);
-    } else {
-      toDetail(routeParams);
-    }
-  })
-}
-
-const toMedinsSettle = (params) => {
-  router.push({
-    name: 'medinsSettle',
-    params,
-  })
-}
-
-const toDetail = (params) => {
-  router.push({
-    name: 'unPaidDetail',
-    params,
-  })
-}
-
-function makeTitle(item) {
-  return item.deptName + ' | ' + item.doctorName
-}
-
-function makeMoney(money) {
-  const m = money / 100
-  return '¥' + m.toFixed(2)
-}
-
-const showPayMethodPicker = ref(false)
-const payMethodColumns = [
-  {text: '医保支付(限本人)', value: 'YB'},
-  {text: '微信支付', value: 'WX'}
-]
-
-function handleConfirmPayMethod({selectedValues}) {
-  const payMethod = selectedValues[0]
-  if (payMethod === 'YB') {
-    askForMedinsAuth()
-  } else {
-    beforeToWxPay(currentHisItem.value)
-  }
-}
-
-function askForMedinsAuth() {
-  location.href = 'https://exp.wecity.qq.com/oauth/code?' +
-      'authType=2&' +
-      'isDepart=2&' +
-      'appid=wxbde6b16acad84204&' +
-      'cityCode=430100&' +
-      'channel=AAGt1YEW0gQit2g7flFIZ13K&' +
-      'orgChnlCrtfCodg=BqK1kMStlhVDgN2uHf4EsLK/F2LjZPYJ81nK2eYQqxuRcOtN/4mSdyZLhMkSo4hy&' +
-      'orgCodg=H43010500370&' +
-      'bizType=04107&' +
-      'orgAppId=1I14E7CSC05E4460C80A0000D6788E13&' +
-      'redirectUrl=https://staticweb.hnthyy.cn/unPaidList/' + patientId
-}
-
-const authCode = ref('')
-const showOverlay = ref(false)
-const currentStep = ref(-1)
-const progressText = ref([
-  '查询参保信息',
-  '医保登记',
-  '费用上传',
-  '医保试算',
-])
-const loadingText = ref([
-  '正在查询参保信息...',
-  '正在办理医保登记...',
-  '正在进行费用上传...',
-  '正在进行医保试算...',
-  ''
-])
-const fundDetail = ref({})
-function startMedInsMobilePay() {
-  showOverlay.value = true
-  const hisOrdNum = localStorage.getItem('hisOrdNum')
-  getOpenid({
-    hisOrdNum,
-    authCode: authCode.value,
-  }).then(wxUser => {
-    currentStep.value += 1
-
-    medInsRegister(hisOrdNum).then(mdtrtId => {
-      currentStep.value += 1
-
-      medInsUploadCost({
-        hisOrdNum,
-        payAuthNo: wxUser.pay_auth_no,
-        userLongLat: wxUser.user_longitude_latitude
-      }).then(orderInfo => {
-        currentStep.value += 1
-
-        medInsPreSettle(orderInfo).then(res4 => {
-          currentStep.value += 1
-          fundDetail.value = res4
-        }).catch(e => {
-          currentStep.value = -1
-          showOverlay.value = false
-        })
-      }).catch(e => {
-        currentStep.value = -1
-        showOverlay.value = false
-      })
-
-    }).catch(e => {
-      currentStep.value = -1
-      showOverlay.value = false
-    })
-
-  }).catch(e => {
-    currentStep.value = -1
-    showOverlay.value = false
-  })
-}
-
-onMounted(() => {
-  getUnPaidFee(patientId).then((res) => {
-    unpaidFees.value = res
-    let hisOrdNum = localStorage.getItem('hisOrdNum')
-    if (hisOrdNum) {
-      for (let i = 0; i < res.length; i++) {
-        if (res[i].hisOrdNum === hisOrdNum) {
-          currentHisItem.value = res[i]
-        }
-      }
-    }
-  })
-  const queryParams = router.currentRoute.value.query
-  if (queryParams.retCode === '0') {
-    authCode.value = queryParams.authCode
-    startMedInsMobilePay()
-  }
-})
-
-</script>
-
-<style lang="scss">
-.med-ins-mobile-pay {
-  .wrapper {
-    width: 100vw;
-    height: 100vh;
-    display: flex;
-    align-items: center;
-    justify-content: center;
-  }
-  .block {
-    border-radius: 8px;
-    width: 90%;
-    background-color: #fff;
-    padding-bottom: 80px;
-    .title {
-      padding: 20px 8px;
-      font-weight: bold;
-      margin-bottom: 30px;
-    }
-    .fund-title {
-      width: 100%;
-      text-align: center;
-      background-color: lightgrey;
-      padding: 4px 0;
-      font-size: 14px;
-      margin-bottom: 24px;
-    }
-    .fund-detail {
-      width: 100%;
-      display: flex;
-      > div {
-        font-size: 12px;
-        padding-left: 30px;
-        width: 50%;
-      }
-    }
-    .pay-button {
-      width: 100%;
-      text-align: center;
-      margin-top: 24px;
-    }
-  }
-}
-</style>

+ 38 - 28
src/views/hospital-service/pay-mz-fee/UnPaidList.vue

@@ -1,39 +1,42 @@
 <template>
-  <window-size>
-    <van-empty :image="empty" description="您没有待缴费记录" v-if="showEmpty"></van-empty>
-    <div v-for="item in unpaidFees" :key="item.hisOrdNum">
-      <van-cell
-          :title="makeTitle(item)"
-          :label="item.priceTime"
-          is-link
-          center
-          @click="handleClickHisItem(item)">
-        <template #default>
-          <span style="color: orangered">{{ makeMoney(item.totalAmt) }}</span>
-        </template>
-      </van-cell>
-      <div style="height: 5px"></div>
-    </div>
-    <van-popup v-model:show="showPayMethodPicker" position="bottom">
-      <van-picker
-          :columns="payMethodColumns"
-          @cancel="showPayMethodPicker = false"
-          @confirm="handleConfirmPayMethod"
-      ></van-picker>
-    </van-popup>
-  </window-size>
+  <van-empty :image="empty" description="您没有待缴费记录" v-if="showEmpty"></van-empty>
+  <div v-for="item in unpaidFees" :key="item.hisOrdNum">
+    <van-cell
+        :title="makeTitle(item)"
+        :label="item.priceTime"
+        is-link
+        center
+        @click="handleClickHisItem(item)">
+      <template #default>
+        <span style="color: orangered">{{ makeMoney(item.totalAmt) }}</span>
+      </template>
+    </van-cell>
+    <div style="height: 5px"></div>
+  </div>
+  <van-popup v-model:show="showPayMethodPicker" position="bottom">
+    <van-picker
+        :columns="payMethodColumns"
+        @cancel="showPayMethodPicker = false"
+        @confirm="handleConfirmPayMethod"
+    ></van-picker>
+  </van-popup>
 </template>
 
 <script setup>
 import {getUnPaidFee} from '@/api/pay-mz-fee'
 import empty from '@/assets/empty.png'
-import {useRouter} from 'vue-router'
 import {computed, onMounted, ref} from 'vue'
 import {lockOrder} from "@/api/medins-mobile-pay";
 import store from "@/store";
+import router from "@/router";
+
+const props = defineProps({
+  patientId: {
+    type: String,
+    required: true
+  }
+})
 
-const router = useRouter()
-const patientId = router.currentRoute.value.params.patientId
 const unpaidFees = ref([])
 const showEmpty = computed(() => {
   return unpaidFees.value.length === 0
@@ -42,6 +45,7 @@ const showEmpty = computed(() => {
 const showPayMethodPicker = ref(false)
 
 const currentHisItem = ref({})
+
 function handleClickHisItem(item) {
   localStorage.setItem('hisOrdNum', item.hisOrdNum)
   currentHisItem.value = item
@@ -50,7 +54,7 @@ function handleClickHisItem(item) {
 
 const toWxPay = (item) => {
   const params = {
-    patientId: patientId,
+    patientId: props.patientId,
     hisOrdNum: item.hisOrdNum,
     patientName: item.patName,
     deptName: item.deptName,
@@ -101,7 +105,7 @@ function startMedInsMobilePay(openid) {
 }
 
 onMounted(() => {
-  getUnPaidFee(patientId).then((res) => {
+  getUnPaidFee(props.patientId).then((res) => {
     unpaidFees.value = res
     let hisOrdNum = localStorage.getItem('hisOrdNum')
     if (hisOrdNum) {
@@ -125,16 +129,19 @@ onMounted(() => {
     align-items: center;
     justify-content: center;
   }
+
   .block {
     border-radius: 8px;
     width: 90%;
     background-color: #fff;
     padding-bottom: 80px;
+
     .title {
       padding: 20px 8px;
       font-weight: bold;
       margin-bottom: 30px;
     }
+
     .fund-title {
       width: 100%;
       text-align: center;
@@ -143,15 +150,18 @@ onMounted(() => {
       font-size: 14px;
       margin-bottom: 24px;
     }
+
     .fund-detail {
       width: 100%;
       display: flex;
+
       > div {
         font-size: 12px;
         padding-left: 30px;
         width: 50%;
       }
     }
+
     .pay-button {
       width: 100%;
       text-align: center;

+ 0 - 1
src/views/isolations/BuyCoupon.vue

@@ -77,7 +77,6 @@ function toCashier() {
 
 onMounted(() => {
   getCouponInfo(key).then(res => {
-    console.log(res)
     coupon.value = res
   }).catch(e => {
     console.log(e)

+ 1 - 1
src/views/mine/MineHome.vue

@@ -40,7 +40,7 @@
         icon="gold-coin"
         title="门诊缴费记录"
         is-link
-        :to="filterPath('/mzFeePaymentRecords/', '/selectMzFeePaymentRecordPatient')"
+        :to="filterPath('/mzFeeList/paid/', '/selectMzFeePaymentRecordPatient')"
       ></van-cell>
       <van-cell
         icon="balance-list"

+ 20 - 16
src/views/mine/mz-pay-record/MzFeePaymentRecords.vue

@@ -1,30 +1,34 @@
 <template>
-  <window-size>
-    <van-empty :image="empty" v-if="showEmpty" description="未查询到您的门诊缴费记录。"></van-empty>
-    <div v-for="item in records" :key="item.hisOrdNum">
-      <van-cell
+  <van-empty :image="empty" v-if="showEmpty" description="未查询到您的门诊已缴费记录。"></van-empty>
+  <div v-for="item in records" :key="item.hisOrdNum">
+    <van-cell
         :title="item.visitDeptName + ' | ' + item.doctorName"
         :label="item.chargeDate"
         is-link
         center
         @click="toDetail(item)"
-      >
-        <template #default>
-          <div style="color: orangered">¥ {{ item.amount }}</div>
-        </template>
-      </van-cell>
-    </div>
-  </window-size>
+    >
+      <template #default>
+        <div style="color: orangered">¥ {{ item.amount }}</div>
+      </template>
+    </van-cell>
+  </div>
 </template>
 
 <script setup>
-import { computed, onMounted, ref } from 'vue'
-import { useRouter } from 'vue-router'
+import {computed, onMounted, ref} from 'vue'
+import {useRouter} from 'vue-router'
 import empty from '@/assets/empty.png'
-import { getMzPaidList } from '@/api/pay-mz-fee'
+import {getMzPaidList} from '@/api/pay-mz-fee'
+
+const props = defineProps({
+  patientId: {
+    type: String,
+    required: true
+  }
+})
 
 const router = useRouter()
-const patientId = router.currentRoute.value.params.patientId
 const records = ref([])
 const showEmpty = computed(() => {
   return records.value.length === 0
@@ -42,7 +46,7 @@ const toDetail = (item) => {
   })
 }
 onMounted(() => {
-  getMzPaidList(patientId).then((res) => {
+  getMzPaidList(props.patientId).then((res) => {
     records.value = res
   })
 })

+ 1 - 1
src/views/mine/mz-pay-record/SelectPatientCard.vue

@@ -1,6 +1,6 @@
 <template>
   <window-size>
-    <SelectCard to="mzFeePaymentRecords" />
+    <SelectCard to="mzFeeList/paid" />
   </window-size>
 </template>