Jelajahi Sumber

添加查询病理报告的功能

lighter 1 tahun lalu
induk
melakukan
20923c2c63

+ 8 - 0
src/api/check-exam.js

@@ -30,4 +30,12 @@ export function checkTestDetail(data) {
     method: 'post',
     data,
   })
+}
+
+export function checkPathologyIndex(data) {
+  return request({
+    url: '/inspections/checkPathologyIndex',
+    method: 'post',
+    data,
+  })
 }

+ 18 - 8
src/router/index.js

@@ -136,23 +136,33 @@ export const constantRoutes = [
   },
   {
     path: '/checkExamIndex/:patientId',
-    component: () => import('../views/hospital-service/check-exam/CheckExamIndex.vue'),
-    meta: { title: '报告查询' },
+    component: () => import('../views/hospital-service/check-exam/exam/CheckExamIndex.vue'),
+    meta: { title: '检验报告查询' },
   },
   {
     path: '/checkExamDetail/:patientId',
-    component: () => import('../views/hospital-service/check-exam/CheckExamDetail.vue'),
-    meta: { title: '报告详情' },
+    component: () => import('../views/hospital-service/check-exam/exam/CheckExamDetail.vue'),
+    meta: { title: '检验报告详情' },
   },
   {
     path: '/checkTestIndex/:patientId',
-    component: () => import('../views/hospital-service/check-exam/CheckTestIndex.vue'),
-    meta: { title: '报告查询' },
+    component: () => import('../views/hospital-service/check-exam/test/CheckTestIndex.vue'),
+    meta: { title: '检查报告查询' },
   },
   {
     path: '/checkTestDetail/:patientUid/:patientId',
-    component: () => import('../views/hospital-service/check-exam/CheckTestDetail.vue'),
-    meta: { title: '报告详情' },
+    component: () => import('../views/hospital-service/check-exam/test/CheckTestDetail.vue'),
+    meta: { title: '检查报告详情' },
+  },
+  {
+    path: '/checkPathologyIndex/:patientId',
+    component: () => import('../views/hospital-service/check-exam/pathology/CheckPathologyIndex.vue'),
+    meta: { title: '病理报告查询' },
+  },
+  {
+    path: '/checkPathologyDetail/:patientId',
+    component: () => import('../views/hospital-service/check-exam/pathology/CheckPathologyDetail.vue'),
+    meta: { title: '病理报告详情' },
   },
   {
     path: '/selectPhysicalExamPatient',

+ 15 - 7
src/store/index.js

@@ -16,8 +16,9 @@ export default createStore({
     examDateRange: [],
     examIndexArray: [],
     currentExamIndex: {},
-    testDateRange: [],
     testIndexArray: [],
+    pathologyIndexArray: [],
+    currentPathologyIndex: {},
     covidExamIdCard: null,
     covidExamIndexes: [],
     currentBook: {},
@@ -40,8 +41,10 @@ export default createStore({
     SET_EXAMDATERANGE: (state, payload) => (state.examDateRange = payload),
     SET_EXAMINDEXARRAY: (state, payload) => (state.examIndexArray = payload),
     SET_CURRENTEXAMINDEX: (state, payload) => (state.currentExamIndex = payload),
-    SET_TESTDATERANGE: (state, payload) => (state.testDateRange = payload),
+    SET_CURRENTPATHOLOGYINDEX: (state, payload) => (state.currentPathologyIndex = payload),
     SET_TESTINDEXARRAY: (state, payload) => (state.testIndexArray = payload),
+    SET_PATHOLOGYINDEXARRAY: (state, payload) => (state.pathologyIndexArray = payload),
+
     SET_COVIDEXAMIDCARD: (state, payload) => (state.covidExamIdCard = payload),
     SET_COVIDEXAMINDEXES: (state, payload) => (state.covidExamIndexes = payload),
     SET_CURRENTBOOK: (state, payload) => (state.currentBook = payload),
@@ -101,6 +104,10 @@ export default createStore({
 
     getCurrentExamIndex(state) {
       return state.currentExamIndex
+    },
+
+    getCurrentPathologyIndex(state) {
+      return state.currentPathologyIndex
     }
   },
 
@@ -134,10 +141,6 @@ export default createStore({
       commit('SET_EXAMDATERANGE', payload['dateRange'])
     },
 
-    storeTestDateRange({ commit }, payload) {
-      commit('SET_TESTDATERANGE', payload['dateRange'])
-    },
-
     storeCurrentBookItem({ commit }, payload) {
       commit('SET_CURRENTBOOK', payload['bookItem'])
     },
@@ -148,6 +151,11 @@ export default createStore({
 
     storeCurrentExamIndex({ commit }, payload) {
       commit('SET_CURRENTEXAMINDEX', payload['currentExamIndex'])
-    }
+    },
+
+    storeCurrentPathologyIndex({ commit }, payload) {
+      commit('SET_CURRENTPATHOLOGYINDEX', payload['currentPathologyIndex'])
+    },
+
   },
 })

+ 1 - 0
src/views/hospital-service/check-exam/SelectExamBranch.vue

@@ -2,6 +2,7 @@
   <window-size>
     <van-cell title="检验报告" is-link @click="go('/checkExamIndex')"></van-cell>
     <van-cell title="检查报告" is-link @click="go('/checkTestIndex')"></van-cell>
+    <van-cell title="病理报告" is-link @click="go('/checkPathologyIndex')"></van-cell>
   </window-size>
 </template>
 <script setup>

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

@@ -109,7 +109,7 @@
 
 <script setup>
 import { useRouter } from 'vue-router'
-import { checkExamDetail } from '../../../api/check-exam'
+import { checkExamDetail } from '../../../../api/check-exam'
 import { computed, onMounted, reactive } from 'vue'
 import {useStore} from "vuex";
 

+ 4 - 4
src/views/hospital-service/check-exam/CheckExamIndex.vue → src/views/hospital-service/check-exam/exam/CheckExamIndex.vue

@@ -42,12 +42,12 @@
 </template>
 
 <script setup>
-import store from '../../../store'
-import empty from '../../../assets/empty.png'
+import store from '../../../../store'
+import empty from '../../../../assets/empty.png'
 import { useRouter } from 'vue-router'
 import { computed, onMounted, ref } from 'vue'
-import { checkExamIndex } from '../../../api/check-exam'
-import {formatDate, getDateRangeByOffsetDays} from '../../../utils/date'
+import { checkExamIndex } from '../../../../api/check-exam'
+import {formatDate, getDateRangeByOffsetDays} from '../../../../utils/date'
 
 const router = useRouter()
 const patientId = router.currentRoute.value.params.patientId

+ 28 - 0
src/views/hospital-service/check-exam/pathology/CheckPathologyDetail.vue

@@ -0,0 +1,28 @@
+<template>
+  <window-size>
+    <van-image width="100%" :src="pathologyIndex.nginxUrl" fit="cover"/>
+  </window-size>
+</template>
+
+<script setup>
+import {onMounted, ref} from 'vue'
+import {useStore} from "vuex";
+
+const store = useStore()
+const pathologyIndex = store.getters.getCurrentPathologyIndex
+
+console.log(pathologyIndex)
+
+onMounted(() => {
+
+})
+
+</script>
+
+<style scoped>
+.test-result-text {
+  font-size: 14px;
+  color: black;
+  padding: 4px 20px;
+}
+</style>

+ 163 - 0
src/views/hospital-service/check-exam/pathology/CheckPathologyIndex.vue

@@ -0,0 +1,163 @@
+<template>
+  <window-size>
+    <van-cell title="选择日期区间" :value="date" @click="showDateShortcuts = true" />
+
+    <van-dialog v-model:show="showDateShortcuts" @confirm="onConfirmShortcuts">
+      <div style="display:flex; justify-content: center; padding: 30px 0 20px 0">
+        <van-radio-group v-model="chosenShortcut">
+          <van-radio name="oneWeek" style="margin-bottom: 12px">近一周</van-radio>
+          <van-radio name="threeMonths" style="margin-bottom: 12px">近三月</van-radio>
+          <van-radio name="halfYear" style="margin-bottom: 12px">近半年</van-radio>
+          <van-radio name="oneYear" style="margin-bottom: 12px">近一年</van-radio>
+          <van-radio name="diy">自定义</van-radio>
+        </van-radio-group>
+      </div>
+    </van-dialog>
+
+    <van-calendar
+        v-model:show="showDateRange"
+        :min-date="minDate"
+        :max-date="maxDate"
+        type="range"
+        @confirm="onConfirm"
+    />
+
+    <div v-show="pathologyIndex.length > 0">
+      <div style="height: 5px"></div>
+      <van-tag type="success" size="large" round plain>已发布报告</van-tag>
+      <div style="height: 5px"></div>
+      <div :style="scrollStyle">
+        <div v-for="item in pathologyIndex" :key="item.reportId">
+          <van-cell
+              :title="item.examItem"
+              :label="item.applyDate"
+              is-link
+              center
+              @click="handleClickPathologyIndex(item)"
+          >
+          </van-cell>
+          <div style="height: 5px"></div>
+        </div>
+      </div>
+    </div>
+    <van-empty :image="empty" description="您当前没有报告项目" v-show="pathologyIndex.length === 0" />
+  </window-size>
+</template>
+
+<script setup>
+import store from '../../../../store'
+import empty from '../../../../assets/empty.png'
+import { useRouter } from 'vue-router'
+import { computed, onMounted, ref } from 'vue'
+import {checkPathologyIndex} from '../../../../api/check-exam'
+import {formatDate, getDateRangeByOffsetDays} from '../../../../utils/date'
+
+const router = useRouter()
+const patientId = router.currentRoute.value.params.patientId
+
+const scrollStyle = {
+  height: store.state.screenSize.h - 125 + 'px',
+  overflowY: 'auto',
+}
+const date = ref('')
+const minDate = ref(new Date(2012, 0, 1))
+const maxDate = ref(new Date())
+
+const showDateShortcuts = ref(false)
+const chosenShortcut = ref('oneWeek')
+
+const onConfirmShortcuts = () => {
+  switch (chosenShortcut.value) {
+    case 'oneWeek':
+      makeOffset(7).then((range) => {
+        queryPathologyIndex(range[0], range[1])
+      })
+      return
+    case 'threeMonths':
+      makeOffset(90).then((range) => {
+        queryPathologyIndex(range[0], range[1])
+      })
+      return;
+    case 'halfYear':
+      makeOffset(183).then((range) => {
+        queryPathologyIndex(range[0], range[1])
+      })
+      return
+    case 'oneYear':
+      makeOffset(365).then((range) => {
+        queryPathologyIndex(range[0], range[1])
+      })
+      return;
+    default:
+      showDateRange.value = true
+      return;
+  }
+}
+
+const makeOffset = (offsetDays) => {
+  return new Promise((resolve, reject) => {
+    const temp = getDateRangeByOffsetDays(offsetDays)
+    const dateRange = [temp.start, temp.end]
+    store.dispatch({
+      type: 'storeExamDateRange',
+      dateRange: dateRange
+    }).then(() => {
+      date.value = dateRange[0] + ' - ' + dateRange[1]
+      resolve(dateRange)
+    })
+  })
+}
+
+const showDateRange = ref(false)
+const pathologyIndex = computed(() => {
+  return store.state.pathologyIndexArray
+})
+
+const onConfirm = (values) => {
+  showDateRange.value = false
+  const start = formatDate(values[0])
+  const end = formatDate(values[1])
+  store.dispatch({
+    type: 'storeExamDateRange',
+    dateRange: [start, end]
+  }).then(() => {
+    date.value = `${start} - ${end}`
+    queryPathologyIndex(start, end)
+  })
+}
+
+const queryPathologyIndex = (start, end) => {
+  const param = {
+    patientId,
+    reqStartTime: start,
+    reqEndTime: end,
+  }
+  checkPathologyIndex(param).then((res) => {
+    store.commit('SET_PATHOLOGYINDEXARRAY', res)
+  })
+}
+
+function handleClickPathologyIndex(item) {
+  store.dispatch({
+    type: 'storeCurrentPathologyIndex',
+    currentPathologyIndex: item
+  }).then(() => {
+    router.push('/checkPathologyDetail/' + patientId);
+  })
+}
+
+onMounted(() => {
+  let storeRange = store.state.examDateRange
+  if (storeRange.length === 0) {
+    makeOffset(30).then((range) => {
+      date.value = range[0] + ' - ' + range[1]
+      queryPathologyIndex(range[0], range[1])
+    })
+  } else {
+    date.value = storeRange[0] + ' - ' + storeRange[1]
+    if (pathologyIndex.value.length === 0) {
+      queryPathologyIndex(storeRange[0], storeRange[1])
+    }
+  }
+})
+</script>

+ 1 - 1
src/views/hospital-service/check-exam/CheckTestDetail.vue → src/views/hospital-service/check-exam/test/CheckTestDetail.vue

@@ -20,7 +20,7 @@
 
 <script setup>
 import { useRouter } from 'vue-router'
-import { checkTestDetail } from '../../../api/check-exam'
+import { checkTestDetail } from '../../../../api/check-exam'
 import { onMounted, ref} from 'vue'
 
 const router = useRouter()

+ 5 - 5
src/views/hospital-service/check-exam/CheckTestIndex.vue → src/views/hospital-service/check-exam/test/CheckTestIndex.vue

@@ -45,12 +45,12 @@
 </template>
 
 <script setup>
-import store from '../../../store'
-import empty from '../../../assets/empty.png'
+import store from '../../../../store'
+import empty from '../../../../assets/empty.png'
 import { useRouter } from 'vue-router'
 import { computed, onMounted, ref } from 'vue'
-import { checkTestIndex } from '../../../api/check-exam'
-import {formatDate, getDateRangeByOffsetDays} from '../../../utils/date'
+import { checkTestIndex } from '../../../../api/check-exam'
+import {formatDate, getDateRangeByOffsetDays} from '../../../../utils/date'
 
 const router = useRouter()
 const patientId = router.currentRoute.value.params.patientId
@@ -117,7 +117,7 @@ const onConfirm = (values) => {
   const start = formatDate(values[0])
   const end = formatDate(values[1])
   store.dispatch({
-    type: 'storeTestDateRange',
+    type: 'storeExamDateRange',
     dateRange: [start, end]
   }).then(() => {
     date.value = `${start} - ${end}`