Explorar o código

修复升级vant引起的问题

lighter %!s(int64=2) %!d(string=hai) anos
pai
achega
6318e733fc

+ 2 - 5
src/utils/check-patient-id.js

@@ -3,20 +3,17 @@ import store from '../store'
 import { getPatientIdByOpenId } from '../api/patient-id-cards'
 import { showDialog } from 'vant'
 import Cookies from 'js-cookie'
+import {setStoreCards} from "./pat-card";
 export function checkPatientId() {
   const openId = getLocalOpenId()
   if (!openId) {
     return
   }
   getPatientIdByOpenId(openId).then((cards) => {
-    cards.length > 0 ? commitPatientCards(cards) : showNotification()
+    cards.length > 0 ? setStoreCards(cards) : showNotification()
   })
 }
 
-function commitPatientCards(cards) {
-  store.commit('SET_PATIENTCARDS', cards)
-}
-
 function showNotification() {
   setTimeout(() => {
     if (router.currentRoute.value.fullPath.indexOf('newUserRegForElectronicHealthCard') === -1) {

+ 8 - 0
src/utils/pat-card.js

@@ -0,0 +1,8 @@
+import store from "../store";
+
+export function setStoreCards(cards) {
+    cards.forEach(item => {
+        item['value'] = item['patientId']
+    })
+    store.commit('SET_PATIENTCARDS', cards)
+}

+ 2 - 1
src/views/Home.vue

@@ -13,6 +13,7 @@ import { getOpenId, getPatientIdByOpenId } from '../api/patient-id-cards'
 import store from '../store'
 import { useRouter } from 'vue-router'
 import { computed, onMounted, onUpdated } from 'vue'
+import {setStoreCards} from "../utils/pat-card";
 
 export default {
   name: 'Home',
@@ -50,7 +51,7 @@ export default {
               localStorage.openId = res
               getPatientIdByOpenId(res).then((cards) => {
                 if (cards.length > 0) {
-                  store.commit('SET_PATIENTCARDS', cards)
+                  setStoreCards(cards)
                 }
                 resolve()
               })

+ 5 - 12
src/views/hospital-service/appointment/night-clinic/ChooseDepartment.vue

@@ -35,18 +35,11 @@ export default {
             data.activeIndex = Cookies.get('activeNightIndex')
         }
         const onConfirm = (val) => {
-            let id = ''
-            let text = ''
-            if (val instanceof Array) {
-                id = val[0].id
-                text = val[0].text
-            } else {
-                id = val.id
-                text = val.text
-            }
-            Cookies.set('appointmentDeptCode', id)
-            Cookies.set('appointmentDeptName', text)
-            router.push('/selectDoctorAndDate/' + id + '/' + text + '/yes')
+          let id = val.selectedOptions[0].id
+          let text = val.selectedOptions[0].text
+          Cookies.set('appointmentDeptCode', id)
+          Cookies.set('appointmentDeptName', text)
+          router.push('/selectDoctorAndDate/' + id + '/' + text + '/yes')
         }
         const onCancel = () => {
             data.showPopup = false

+ 5 - 2
src/views/hospital-service/covid-vaccinate/ExcuteAppointment.vue

@@ -109,8 +109,8 @@ export default {
       text: 'name',
     }
     const confirmPickJobCategory = (val) => {
-      vaccinate.jobCategory = val.code
-      jobCategoryName.value = val.name
+      vaccinate.jobCategory = val.selectedOptions[0].code
+      jobCategoryName.value = val.selectedOptions[0].name
       showPickJobCategory.value = false
     }
     const vaccinate = reactive({
@@ -197,6 +197,9 @@ export default {
         vaccinate.phone = res2.phone
         vaccinate.socialNo = res2.socialNo
         jobCategories.value = res2.jobCategories
+        jobCategories.value.forEach(item => {
+          item.value = item.code
+        })
         getNextSevenDaysSources(vaccinate.vaccinateCode).then((res3) => {
           nextSevenDaySources.value = res3
           for (let i = 0; i < 7; i++) {

+ 2 - 1
src/views/hospital-service/electronic_health_card/LinkHealthCardResult.vue

@@ -48,6 +48,7 @@ import {useRouter} from "vue-router";
 import {linkHealthCard} from '../../../api/electronic-health-card'
 import {getPatientIdByOpenId} from "../../../api/patient-id-cards";
 import store from "../../../store";
+import {setStoreCards} from "../../../utils/pat-card";
 
 export default {
   setup() {
@@ -76,7 +77,7 @@ export default {
               resultCode.value = 0
               getPatientIdByOpenId(openId).then((cards) => {
                 if (cards.length > 0) {
-                  store.commit('SET_PATIENTCARDS', cards)
+                  setStoreCards(cards)
                 }
               })
             }

+ 5 - 4
src/views/hospital-service/electronic_health_card/NewUserReg.vue

@@ -40,6 +40,7 @@ import {resize} from "../../../utils/image";
 import {showToast} from "vant";
 import {getPatientIdByOpenId} from "../../../api/patient-id-cards";
 import store from "../../../store";
+import {setStoreCards} from "../../../utils/pat-card";
 
 export default {
   setup() {
@@ -67,10 +68,10 @@ export default {
       { text: '朋友', value: '5' },
       { text: '其他', value: '6' },
     ]
-    const onConfirmSelectRelation = (selectedOptions) => {
+    const onConfirmSelectRelation = (val) => {
       showRelationPicker.value = false
-      userinfo.relation = selectedOptions.value
-      userinfo.relationLabel = selectedOptions.text
+      userinfo.relation = val.selectedOptions[0].value
+      userinfo.relationLabel = val.selectedOptions[0].text
     }
 
     const applyHealthCard = () => {
@@ -81,7 +82,7 @@ export default {
         })
         getPatientIdByOpenId(localStorage.getItem('openId')).then((cards) => {
           if (cards.length > 0) {
-            store.commit('SET_PATIENTCARDS', cards)
+            setStoreCards(cards)
           }
           router.push('/electronicHealthCardHome')
         })

+ 5 - 5
src/views/isolations/StudentInspection.vue

@@ -56,17 +56,17 @@ export default {
     const student = reactive({})
     const showPickOrder = ref(false)
     const orderTypes = [
-      { code: 'XSTJ', name: '学生体检', price: 55 },
-      { code: 'PDD', name: 'PDD', price: 25 },
+      { code: 'XSTJ', name: '学生体检', price: 55, value: 'XSTJ' },
+      { code: 'PDD', name: 'PDD', price: 25, value: 'PDD' },
     ]
     const customFieldName = {
       code: 'code',
       text: 'name',
     }
     const confirmPickOrder = (val) => {
-      student.orderCode = val.code
-      student.orderName = val.name
-      student.orderPrice = val.price
+      student.orderCode = val.selectedOptions[0].code
+      student.orderName = val.selectedOptions[0].name
+      student.orderPrice = val.selectedOptions[0].price
       showPickOrder.value = false
     }
     const showQrcode = ref(false)

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

@@ -87,8 +87,8 @@ export default {
       text: 'name',
     }
     const onConfirm = (val) => {
-      Cookies.set('chosen-id', val.patientId)
-      currentCard.value = val
+      Cookies.set('chosen-id', val.selectedOptions[0].patientId)
+      currentCard.value = val.selectedOptions[0]
       showCardPicker.value = false
     }
 

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

@@ -94,6 +94,7 @@ import { bindPatientId, hasValidIdCard } from '../../../api/patient-id-cards'
 import { validateBindPatientId } from '../../../utils/validate'
 import { showDialog, showToast } from 'vant'
 import router from '../../../router'
+import {setStoreCards} from "../../../utils/pat-card";
 export default {
   name: 'BindPatientCard',
   setup() {
@@ -168,7 +169,7 @@ export default {
             message: '绑定成功',
             position: 'top'
           })
-          store.commit('SET_PATIENTCARDS', res.cards)
+          setStoreCards(res.cards)
           router.go(-1)
         } else {
           multipleCards.cards = res.cards
@@ -188,7 +189,7 @@ export default {
               message: '绑定成功',
               position: 'top'
             })
-            store.commit('SET_PATIENTCARDS', res.cards)
+            setStoreCards(res.cards)
             router.go(-1)
           })
         }

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

@@ -80,6 +80,7 @@ import { showToast } from 'vant'
 import router from '../../../router'
 import { getLocalOpenId } from '../../../utils/check-patient-id'
 import { resize } from '../../../utils/image'
+import {setStoreCards} from "../../../utils/pat-card";
 export default {
   setup() {
     const windowSize = store.state.windowSize
@@ -215,7 +216,7 @@ export default {
             readInput(inputInfo)
               .then((res) => {
                 showToast.success('绑卡成功!')
-                store.commit('SET_PATIENTCARDS', res.cards)
+                setStoreCards(res.cards)
                 resolve(true)
                 router.go(-1)
               })

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

@@ -43,6 +43,7 @@ import {checkPatientId, getLocalOpenId} from '../../../utils/check-patient-id'
 import {isValidIdcard, isValidPhone} from '../../../utils/validate'
 import {qrcanvas} from 'qrcanvas'
 import JsBarcode from "jsbarcode";
+import {setStoreCards} from "../../../utils/pat-card";
 
 export default {
   name: 'PatientCardInfo',
@@ -131,7 +132,7 @@ export default {
             message: '解除绑定成功!',
             position: 'top'
           })
-          store.commit('SET_PATIENTCARDS', res)
+          setStoreCards(res)
           router.go(-1)
         })
       }).catch(() => {