Преглед на файлове

完善核酸检测结果查询(包括单管与混采)

lighter преди 3 години
родител
ревизия
294fc5e982

+ 1 - 1
index.html

@@ -5,7 +5,7 @@
     <link rel="icon" href="/favicon.ico" />
     <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite App</title>
+    <title>医疗服务</title>
   </head>
   <body>
     <div id="app"></div>

+ 5 - 5
src/api/check-exam.js

@@ -8,17 +8,17 @@ export function checkExamIndex(data) {
   })
 }
 
-export function checkExamDetail(orderId) {
+export function checkExamDetail(data) {
   return request({
     url: '/inspections/checkExamDetail',
-    method: 'get',
-    params: { orderId },
+    method: 'post',
+    data,
   })
 }
 
-export function checkIndexBySocialNo(socialNo) {
+export function checkCovidExamIndexBySocialNo(socialNo) {
   return request({
-    url: '/inspections/checkIndexBySocialNo',
+    url: '/inspections/checkCovidExamIndexBySocialNo',
     method: 'get',
     params: { socialNo },
   })

+ 1 - 1
src/router/index.js

@@ -104,7 +104,7 @@ export const constantRoutes = [
     meta: { title: '报告查询' },
   },
   {
-    path: '/checkExamDetail/:orderId',
+    path: '/checkExamDetail/:orderId/:patNo?/:patType?',
     component: () => import('../views/hospital-service/check-exam/CheckExamDetail.vue'),
     meta: { title: '报告详情' },
   },

+ 10 - 0
src/store/index.js

@@ -13,6 +13,8 @@ export default createStore({
     currentExamDate: null,
     examDateRange: [],
     examIndexArray: [],
+    covidExamIdCard: null,
+    covidExamIndexes: [],
     currentBook: {},
     yjReqNo: null,
     weappApiExist: false,
@@ -26,6 +28,8 @@ export default createStore({
     SET_CURRENTEXAMDATE: (state, payload) => (state.currentExamDate = payload),
     SET_EXAMDATERANGE: (state, payload) => (state.examDateRange = payload),
     SET_EXAMINDEXARRAY: (state, payload) => (state.examIndexArray = payload),
+    SET_COVIDEXAMIDCARD: (state, payload) => (state.covidExamIdCard = payload),
+    SET_COVIDEXAMINDEXES: (state, payload) => (state.covidExamIndexes = payload),
     SET_CURRENTBOOK: (state, payload) => (state.currentBook = payload),
     SET_YJREQNO: (state, payload) => (state.yjReqNo = payload),
     SET_WEAPPAPIEXIST: (state, payload) => (state.weappApiExist = payload),
@@ -55,6 +59,12 @@ export default createStore({
     SET_EXAMINDEXARRAY({ commit }, payload) {
       commit('SET_EXAMINDEXARRAY', payload)
     },
+    SET_COVIDEXAMIDCARD({ commit }, payload) {
+      commit('SET_COVIDEXAMIDCARD', payload)
+    },
+    SET_COVIDEXAMINDEXES({ commit }, payload) {
+      commit('SET_COVIDEXAMINDEXES', payload)
+    },
     SET_CURRENTBOOK({ commit }, payload) {
       commit('SET_CURRENTBOOK', payload)
     },

+ 8 - 2
src/views/Home.vue

@@ -12,8 +12,7 @@ import Cookies from 'js-cookie'
 import { getOpenId, getPatientIdByOpenId } from '../api/patient-id-cards'
 import store from '../store'
 import { useRouter } from 'vue-router'
-import { computed, onMounted } from 'vue'
-import { Dialog } from 'vant'
+import { computed, onMounted, onUpdated } from 'vue'
 
 export default {
   name: 'Home',
@@ -66,6 +65,13 @@ export default {
         toFirstTab()
       })
     })
+
+    onUpdated(() => {
+      if (router.currentRoute.value.path === '/wxService') {
+        toFirstTab()
+      }
+    })
+
     return {}
   },
 }

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

@@ -123,7 +123,7 @@
 </template>
 
 <script>
-import { computed, onMounted, ref } from 'vue'
+import { computed, onActivated, onMounted, ref } from 'vue'
 import store from '../../store'
 import { getDate } from '../../utils/date'
 import router from '../../router'

+ 3 - 3
src/views/hospital-service/check-exam/CheckExamDetail.vue

@@ -80,7 +80,6 @@ export default {
   name: 'CheckExamDetail',
   setup() {
     const router = useRouter()
-    const orderId = router.currentRoute.value.params.orderId
     const exam = reactive({
       reportHeader: {},
       reportItems: [],
@@ -118,7 +117,8 @@ export default {
       return item.range
     }
     onMounted(() => {
-      checkExamDetail(orderId).then((res) => {
+      const params = router.currentRoute.value.params
+      checkExamDetail(params).then((res) => {
         exam.reportHeader = res.reportHeader
         exam.reportItems = res.reportItems
         if (res.reportItems) {
@@ -142,4 +142,4 @@ export default {
     }
   },
 }
-</script>
+</script>

+ 21 - 12
src/views/hospital-service/covid-exam/CheckExamResult.vue

@@ -1,19 +1,19 @@
 <template>
   <window-size>
-    <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号">
+    <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号" clearable>
       <template #button>
         <van-button size="small" type="primary" @click="startQuery">查询</van-button>
       </template>
     </van-field>
     <div style="height: 5px"></div>
-    <div v-for="(item, index) in list" :key="index">
+    <div v-for="(item, index) in covidExamIndexes" :key="index">
       <van-cell
         :title="item.aply_CTNT"
         :label="item.ordr_CREATE_DATE"
         :value="filterType(item.patient_TYPE, item.ptnt_ID)"
         is-link
         center
-        :to="'/checkExamDetail/' + item.ordr_ID"
+        :to="'/checkExamDetail/' + item.ordr_ID + '/' + item.ptnt_ID + '/' + item.patient_TYPE"
       ></van-cell>
     </div>
   </window-size>
@@ -21,17 +21,21 @@
 
 <script>
 import { onMounted, ref } from 'vue'
-import { checkIndexBySocialNo } from '../../../api/check-exam'
+import { checkCovidExamIndexBySocialNo } from '../../../api/check-exam'
 import { Toast } from 'vant'
 import { useRouter } from 'vue-router'
 import { getPatientInfo } from '../../../api/assessments'
+import { computed } from '@vue/reactivity'
+import store from '../../../store'
 
 export default {
   setup() {
     const router = useRouter()
     const patientId = router.currentRoute.value.params.patientId
     const socialNo = ref(null)
-    const list = ref([])
+    const covidExamIndexes = computed(() => {
+      return store.state.covidExamIndexes
+    })
     const startQuery = () => {
       if (!socialNo.value) {
         Toast({
@@ -39,19 +43,24 @@ export default {
           position: 'top',
         })
       } else {
-        checkIndexBySocialNo(socialNo.value).then((res) => {
-          list.value = res
+        checkCovidExamIndexBySocialNo(socialNo.value).then((res) => {
+          store.commit('SET_COVIDEXAMIDCARD', socialNo.value)
+          store.commit('SET_COVIDEXAMINDEXES', res)
         })
       }
     }
     onMounted(() => {
-      getPatientInfo(patientId).then((res) => {
-        socialNo.value = res.idcard
-      })
+      if (covidExamIndexes.value.length === 0) {
+        getPatientInfo(patientId).then((res) => {
+          socialNo.value = res.idcard
+        })
+      } else {
+        socialNo.value = store.state.covidExamIdCard
+      }
     })
     return {
       socialNo,
-      list,
+      covidExamIndexes,
       startQuery,
       filterType,
     }
@@ -68,4 +77,4 @@ function filterType(val, no) {
   }
   return ''
 }
-</script>
+</script>