فهرست منبع

优化页面。

lighter 4 سال پیش
والد
کامیت
b325fec3b4

+ 2 - 2
src/api/pay-mz-fee.js

@@ -16,10 +16,10 @@ export function getUnPaidDetail(patientId, hisOrdNum) {
   })
 }
 
-export function saveMzChargeInfo(tradeNo, hisOrdNum) {
+export function saveMzChargeInfo(tradeNo) {
   return request({
     url: '/payMzFee/saveMzChargeInfo',
     method: 'get',
-    params: { tradeNo, hisOrdNum },
+    params: { tradeNo },
   })
 }

+ 1 - 2
src/components/window-size/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div :style="windowSize">
     <back-nav v-show="showBackNav"></back-nav>
-    <div style="height: 5px"></div>
     <div :style="bodyStyle">
       <slot></slot>
     </div>
@@ -26,7 +25,7 @@ export default {
     const windowSize = store.state.windowSize
     windowSize.height = windowSize.h - props.offset + 'px'
     const bodyStyle = {
-      height: windowSize.h - props.offset - 50 + 'px',
+      height: windowSize.h - props.offset - 45 + 'px',
       overflowY: 'auto',
     }
     return {

+ 4 - 4
src/router/index.js

@@ -8,26 +8,26 @@ export const constantRoutes = [
     },
   },
   {
-    path: '/wxService/:code?',
+    path: '/wxService/:code?/:to?',
     component: () => import('../views/Home.vue'),
     meta: { title: '医疗服务' },
     children: [
       {
-        path: '/hospitalService/:code?',
+        path: '/hospitalService/:code?/:to?',
         component: () => import('../views/hospital-service/HospitalServiceHome.vue'),
         meta: {
           title: '医疗服务',
         },
       },
       {
-        path: '/hospitalIntroduction/:code?',
+        path: '/hospitalIntroduction/:code?/:to?',
         component: () => import('../views/hospital-info/HospitalIntroduction.vue'),
         meta: {
           title: '医院信息',
         },
       },
       {
-        path: '/mine/:code?',
+        path: '/mine/:code?/:to?',
         component: () => import('../views/mine/MineHome.vue'),
         meta: {
           title: '个人中心',

+ 5 - 0
src/store/index.js

@@ -10,6 +10,7 @@ export default createStore({
     patientCards: [],
     appointmentInfo: {},
     currentExamDate: null,
+    examIndexArray: [],
   },
   mutations: {
     SET_LOADING: (state, payload) => (state.loading = payload),
@@ -17,6 +18,7 @@ export default createStore({
     SET_PATIENTCARDS: (state, payload) => (state.patientCards = payload),
     SET_APPOINTMENTINFO: (state, payload) => (state.appointmentInfo = payload),
     SET_CURRENTEXAMDATE: (state, payload) => (state.currentExamDate = payload),
+    SET_EXAMINDEXARRAY: (state, payload) => (state.examIndexArray = payload),
   },
   actions: {
     SET_LOADING({ commit }, payload) {
@@ -34,5 +36,8 @@ export default createStore({
     SET_CURRENTEXAMDATE({ commit }, payload) {
       commit('SET_CURRENTEXAMDATE', payload)
     },
+    SET_EXAMINDEXARRAY({ commit }, payload) {
+      commit('SET_EXAMINDEXARRAY', payload)
+    },
   },
 })

+ 1 - 3
src/utils/date.js

@@ -32,7 +32,6 @@ export function getOneMonthOffset() {
 
 export function getOneWeekOffset(start) {
   const weekAgo = new Date(start).getTime() + 7 * 24 * 3600 * 1000
-
   const endDate = new Date(weekAgo)
   const year = endDate.getFullYear()
   const month = endDate.getMonth() + 1
@@ -46,8 +45,7 @@ export function getOneWeekText() {
   const weeks = new Array('日', '一', '二', '三', '四', '五', '六')
   const arr = new Array(7)
   for (let index = 0; index < 7; index++) {
-    let tempDay = day + index
-    tempDay = tempDay > 6 ? 0 : tempDay
+    let tempDay = (day + index) % 7
     arr[index] = weeks[tempDay]
   }
   return arr

+ 2 - 2
src/utils/request.js

@@ -3,8 +3,8 @@ import { Toast, Dialog } from 'vant'
 import store from '../store/index'
 
 const service = axios.create({
-  // baseURL: 'http://172.16.30.26:8805/wxserver/', // dev
-  baseURL: 'http://218.104.151.241:8805/wxserver', // prod
+  baseURL: 'http://172.16.30.26:8805/wxserver/', // dev
+  // baseURL: 'http://218.104.151.241:8805/wxserver', // prod
   withCredentials: true,
   timeout: 0,
 })

+ 5 - 5
src/views/Home.vue

@@ -29,17 +29,18 @@ export default {
     const router = useRouter()
     const openId = getLocalOpenId()
     const images = [blueprint, hall, nurseStation, childrenCenter]
-
     const cardSize = computed(() => {
       return store.state.patientCards.length
     })
-
     const toFirstTab = () => {
+      let to = router.currentRoute.value.params.to
+      if (!to) {
+        to = 'hospitalService'
+      }
       if (router.currentRoute.value.path.startsWith('/wxService')) {
-        router.push('/hospitalService')
+        router.push('/' + to)
       }
     }
-
     const queryPatientCards = (openId) => {
       getPatientIdByOpenId(openId).then((res) => {
         if (res.length > 0) {
@@ -48,7 +49,6 @@ export default {
         toFirstTab()
       })
     }
-
     onMounted(() => {
       if (cardSize.value === 0) {
         if (openId) {

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

@@ -1,5 +1,6 @@
 <template>
   <window-size :showBackNav="false" :offset="170">
+    <div style="height: 5px"></div>
     <van-grid :gutter="5" clickable :column-num="3">
       <van-grid-item icon="phone" text="预约挂号" to="/appointment" />
       <van-grid-item icon="gold-coin" text="门诊缴费" :to="filterPath('/unPaidList/', '/selectPayPatient')" />

+ 8 - 10
src/views/hospital-service/appointment/Appointment.vue

@@ -1,15 +1,13 @@
 <template>
   <window-size>
-    <div style="position: absolute; left: 0; right: 0; bottom: 0">
-      <van-tree-select
-        v-model:active-id="data.activeCode"
-        v-model:main-active-index="data.activeIndex"
-        :height="treeHeight"
-        :items="data.depts"
-        @click-nav="handleSelectNav"
-        @click-item="handleSelectDept"
-      />
-    </div>
+    <van-tree-select
+      v-model:active-id="data.activeCode"
+      v-model:main-active-index="data.activeIndex"
+      :height="treeHeight"
+      :items="data.depts"
+      @click-nav="handleSelectNav"
+      @click-item="handleSelectDept"
+    />
   </window-size>
 </template>
 

+ 2 - 1
src/views/hospital-service/appointment/PayAppointmentFee.vue

@@ -69,7 +69,7 @@ export default {
               patientId: data.appointment.patientId,
               paymode: 'WX',
               psordnum: res.tradeNo,
-              agtordnum: res.nonceStr,
+              agtordnum: res.serialNo,
             },
             mzyRequestId: data.appointment.mzyRequestId,
             totalFee: data.appointment.fee,
@@ -90,6 +90,7 @@ export default {
         totalFee: data.appointment.fee,
         openId: getLocalOpenId(),
         patientId: data.appointment.patientId,
+        mzyRequestId: data.appointment.mzyRequestId,
       }
       wxPay(param, wxPayCallback)
     }

+ 16 - 20
src/views/hospital-service/appointment/SelectDoctorAndDate.vue

@@ -1,11 +1,10 @@
 <template>
   <window-size>
-    <div style="margin-left: 5px">
-      <van-tag round type="primary">
-        {{ getDate() }}
-      </van-tag>
-    </div>
-    <div style="height: 5px"></div>
+    <van-notice-bar
+      v-show="data.doctorSources.length > 0"
+      left-icon="warning-o"
+      text="挂号后,号源仅就诊当天有效,逾时失效!"
+    />
     <van-grid direction="horizontal" :column-num="7">
       <van-grid-item v-for="item in data.oneWeekText" :key="item" :text="'周' + item" />
     </van-grid>
@@ -19,17 +18,11 @@
       </van-grid-item>
     </van-grid>
     <div style="height: 5px"></div>
-    <van-notice-bar
-      v-show="data.doctorSources.length > 0"
-      left-icon="warning-o"
-      text="挂号后,号源仅就诊当天有效,逾时失效!"
-    />
-    <div style="height: 5px"></div>
     <div v-for="(item, index) in data.doctorSources" :key="index">
       <van-cell
         center
-        :title="item.doctorName"
-        :label="item.chargeType"
+        :title="item.doctorName + ' | ' + item.chargeType"
+        :label="selectDate"
         is-link
         :to="'/doctorArrangement/' + data.dateSelected + '/' + deptCode + '/' + item.doctorCode"
       >
@@ -45,8 +38,8 @@
 <script>
 import empty from '../../../assets/empty.png'
 import { useRouter } from 'vue-router'
-import { getDate, getOneWeekText, getNextSevenDate } from '../../../utils/date'
-import { onMounted, reactive } from 'vue'
+import { getOneWeekText, getNextSevenDate } from '../../../utils/date'
+import { onMounted, reactive, ref } from 'vue'
 import { getSourcesByDate, getDoctorSources } from '../../../api/appointment'
 import Cookies from 'js-cookie'
 export default {
@@ -54,6 +47,7 @@ export default {
   setup() {
     const router = useRouter()
     const deptCode = router.currentRoute.value.params.deptCode
+    const selectDate = ref('')
     const data = reactive({
       currentIndex: 0,
       oneWeekText: getOneWeekText(),
@@ -72,9 +66,10 @@ export default {
       return data.nextSevenDaySources[index].status === 1 ? 'green' : 'red'
     }
     const hasLeftNum = (val) => {
-      return val > 0
-        ? '<span style="font-size: 12px;color:green">有号</span>'
-        : '<span style="font-size: 12px;color:red">无号</span>'
+      selectDate.value
+      const yes = '<span style="font-size: 12px;color:green">有号</span>'
+      const no = '<span style="font-size: 12px;color:red">无号</span>'
+      return val > 0 ? yes : no
     }
     const handleClickDate = (index, isFromMounted) => {
       data.currentIndex = index
@@ -85,6 +80,7 @@ export default {
         date: data.dateSelected,
         deptCode: deptCode,
       }
+      selectDate.value = param.date
       getDoctorSources(param)
         .then((res) => {
           data.doctorSources = res
@@ -109,7 +105,7 @@ export default {
     })
     return {
       empty,
-      getDate,
+      selectDate,
       deptCode,
       getOneWeekText,
       handleClickDate,

+ 29 - 15
src/views/hospital-service/check-exam/CheckExamIndex.vue

@@ -1,23 +1,25 @@
 <template>
   <window-size>
     <van-cell title="选择年月" is-link arrow-direction="down" :value="dateText" @click="data.showDatePicker = true" />
-    <div v-show="data.examIndex.length > 0">
+    <div v-show="examIndex.length > 0">
       <div style="height: 5px"></div>
       <van-tag type="success" size="large" round plain>已发布报告</van-tag>
       <div style="height: 5px"></div>
-      <div v-for="item in data.examIndex" :key="item.ordr_ID">
-        <van-cell
-          :title="item.aply_CTNT"
-          :label="item.ordr_CREATE_DATE"
-          is-link
-          center
-          :to="'/checkExamDetail/' + item.ordr_ID"
-        >
-        </van-cell>
-        <div style="height: 5px"></div>
+      <div :style="scrollStyle">
+        <div v-for="item in examIndex" :key="item.ordr_ID">
+          <van-cell
+            :title="item.aply_CTNT"
+            :label="item.ordr_CREATE_DATE"
+            is-link
+            center
+            :to="'/checkExamDetail/' + item.ordr_ID"
+          >
+          </van-cell>
+          <div style="height: 5px"></div>
+        </div>
       </div>
     </div>
-    <van-empty :image="empty" description="您当前没有报告项目" v-show="data.examIndex.length === 0" />
+    <van-empty :image="empty" description="您当前没有报告项目" v-show="examIndex.length === 0" />
     <van-popup v-model:show="data.showDatePicker" position="bottom" :style="{ height: '50%' }">
       <van-datetime-picker
         v-model="data.currentDate"
@@ -43,12 +45,18 @@ export default {
   setup() {
     const router = useRouter()
     const patientId = router.currentRoute.value.params.patientId
+    const scrollStyle = {
+      height: store.state.windowSize.h - 125 + 'px',
+      overflowY: 'auto',
+    }
     const data = reactive({
       showDatePicker: true,
       minDate: new Date(2015, 0, 1),
       maxDate: new Date(),
       currentDate: store.state.currentExamDate ? store.state.currentExamDate : new Date(),
-      examIndex: [],
+    })
+    const examIndex = computed(() => {
+      return store.state.examIndexArray
     })
     const dateText = computed(() => {
       return data.currentDate.getFullYear() + '年' + (data.currentDate.getMonth() + 1) + '月'
@@ -72,17 +80,23 @@ export default {
         month,
       }
       checkExamIndex(param).then((res) => {
-        data.examIndex = res
+        store.commit('SET_EXAMINDEXARRAY', res)
       })
     }
     onMounted(() => {
-      confirmPickDate(data.currentDate)
+      if (examIndex.value.length === 0) {
+        confirmPickDate(data.currentDate)
+      } else {
+        data.showDatePicker = false
+      }
     })
     return {
+      scrollStyle,
       empty,
       data,
       dateText,
       formatter,
+      examIndex,
       confirmPickDate,
     }
   },

+ 13 - 1
src/views/hospital-service/check-exam/SelectExamPatient.vue

@@ -6,4 +6,16 @@
     />
     <select-card to="checkExamIndex"></select-card>
   </window-size>
-</template>
+</template>
+
+<script>
+import { onMounted } from 'vue'
+import store from '../../../store'
+export default {
+  setup() {
+    onMounted(() => {
+      store.commit('SET_EXAMINDEXARRAY', [])
+    })
+  },
+}
+</script>

+ 37 - 4
src/views/hospital-service/inpatient-service/DisplayPrepaid.vue

@@ -8,7 +8,7 @@
     </van-cell>
     <van-cell title="医院名称" value="湖南泰和医院"></van-cell>
     <van-cell title="住院科室" :value="params.deptName"></van-cell>
-    <van-cell title="押金余额">
+    <van-cell title="可用余额">
       <template #default>
         <span style="color: orangered">¥ {{ params.lastBalance }}</span>
       </template>
@@ -51,8 +51,20 @@
         </van-button>
       </van-col>
     </van-row>
+    <div style="height: 5px"></div>
+    <van-row gutter="10">
+      <van-col :span="24">
+        <van-field
+          v-model="otherAmount"
+          label="其他金额"
+          type="digit"
+          placeholder="请输入大于 0 的整数"
+          clearable
+        ></van-field>
+      </van-col>
+    </van-row>
     <div style="height: 20px"></div>
-    <van-button type="primary" block @click="pay">微信支付</van-button>
+    <van-button type="primary" block @click="beforePay">微信支付</van-button>
   </window-size>
 </template>
 
@@ -61,7 +73,7 @@ import { ref } from 'vue'
 import { useRouter } from 'vue-router'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { wxPay } from '../../../utils/wx-pay'
-import { Toast } from 'vant'
+import { Dialog, Toast } from 'vant'
 import { payYjjSuccessful } from '../../../api/inpatient-service'
 import { queryOrderState } from '../../../api/wx-jsapi'
 export default {
@@ -69,10 +81,12 @@ export default {
     const router = useRouter()
     const params = router.currentRoute.value.params
     const prepaidAmount = ref(500)
+    const otherAmount = ref(null)
     const isPlainButton = (val) => {
       return val !== prepaidAmount.value
     }
     const setPrepaidAmount = (val) => {
+      otherAmount.value = null
       prepaidAmount.value = val
     }
     const wxPayCallback = (res) => {
@@ -82,13 +96,30 @@ export default {
           res.admissTimes = params.admissTimes
           payYjjSuccessful(res).then((res2) => {
             Toast.success(res2)
-            router.push('/hospitalService')
+            router.go(-1)
           })
         } else {
           Toast.fail('支付失败')
         }
       })
     }
+
+    const beforePay = () => {
+      if (otherAmount.value) {
+        prepaidAmount.value = otherAmount.value
+      }
+      Dialog.confirm({
+        message: '您正在为【' + params.name + '】缴纳住院预交金,金额为【' + prepaidAmount.value + '】。确认支付吗?',
+        title: '提示',
+        confirmButtonText: '支付',
+        cancelButtonText: '取消',
+      })
+        .then(() => {
+          pay()
+        })
+        .catch(() => {})
+    }
+
     const pay = () => {
       const param = {
         body: '住院预交金',
@@ -105,6 +136,8 @@ export default {
       params,
       isPlainButton,
       setPrepaidAmount,
+      otherAmount,
+      beforePay,
       pay,
     }
   },

+ 6 - 2
src/views/hospital-service/inpatient-service/InPatientService.vue

@@ -2,7 +2,6 @@
   <window-size>
     <van-empty :image="empty" description="未找到您的在院信息" v-if="showEmpty"></van-empty>
     <div v-else>
-      <div style="height: 5px"></div>
       <van-cell title="姓名" :value="data.name"></van-cell>
       <van-cell title="住院号" :value="data.inpatientNo"></van-cell>
       <van-cell title="住院科室" :value="data.deptName"></van-cell>
@@ -12,7 +11,12 @@
           <span style="color: orangered">¥ {{ data.totalCharge }}</span>
         </template>
       </van-cell>
-      <van-cell title="余额">
+      <van-cell title="医保报销费用">
+        <template #default>
+          <span style="color: orangered">¥ {{ data.fundPay }}</span>
+        </template>
+      </van-cell>
+      <van-cell title="可用余额">
         <template #default>
           <span style="color: orangered">¥ {{ data.lastBalance }}</span>
         </template>

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

@@ -57,7 +57,7 @@ export default {
     const wxPayCallback = (res) => {
       queryOrderState(res.tradeNo).then((tradeState) => {
         if (tradeState === 'SUCCESS') {
-          saveMzChargeInfo(res.tradeNo, params.hisOrdNum).then((res2) => {
+          saveMzChargeInfo(res.tradeNo).then((res2) => {
             Toast.success(res2)
             router.go(-1)
           })

+ 8 - 1
src/views/mine/my-collection/MyCollection.vue

@@ -1,5 +1,6 @@
 <template>
   <window-size>
+    <van-empty v-if="showEmpty" :image="empty" description="暂无数据"></van-empty>
     <div v-for="item in collections" :key="item.doctorCode">
       <van-cell
         center
@@ -25,8 +26,9 @@
 </template>
 
 <script>
+import empty from '../../../assets/empty.png'
 import { getMyCollections } from '../../../api/my-collection'
-import { onMounted, ref } from 'vue'
+import { computed, onMounted, ref } from 'vue'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { getDate } from '../../../utils/date'
 import { genTextPortrait } from '../../../utils/portrait'
@@ -34,6 +36,9 @@ export default {
   name: 'MyCollection',
   setup() {
     const collections = ref([])
+    const showEmpty = computed(() => {
+      return collections.value.length === 0
+    })
     const date = getDate()
     const openId = getLocalOpenId()
     onMounted(() => {
@@ -47,7 +52,9 @@ export default {
       })
     })
     return {
+      empty,
       collections,
+      showEmpty,
       date,
     }
   },

+ 1 - 1
src/views/mine/patient-id-cards/BindPatientCard.vue

@@ -22,7 +22,7 @@
         <van-radio name="2">身份证</van-radio>
       </van-radio-group>
     </van-cell>
-    <van-field v-model="card.cardNo" type="tel" :placeholder="cardNoHint" />
+    <van-field v-model="card.cardNo" :placeholder="cardNoHint" />
     <div style="height: 5px"></div>
     <van-field v-model="card.phone" type="tel" placeholder="请输入手机号" />
     <div style="height: 5px"></div>

+ 1 - 0
src/views/mine/patient-id-cards/CreatePatientCard.vue

@@ -1,5 +1,6 @@
 <template>
   <window-size>
+    <div style="height: 5px"></div>
     <van-tag>请拍摄身份证的人像面照片</van-tag>
     <div :style="uploadHeight" id="capBox">
       <div :style="uploadWidth">