Bläddra i källkod

添加查看检查报告功能

lighter 1 år sedan
förälder
incheckning
e5d29a1621

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

@@ -15,3 +15,19 @@ export function checkExamDetail(data) {
     data,
   })
 }
+
+export function checkTestIndex(data) {
+  return request({
+    url: '/inspections/checkTestIndex',
+    method: 'post',
+    data,
+  })
+}
+
+export function checkTestDetail(data) {
+  return request({
+    url: '/inspections/checkTestDetail',
+    method: 'post',
+    data,
+  })
+}

+ 15 - 0
src/router/index.js

@@ -129,6 +129,11 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/check-exam/SelectExamPatient.vue'),
     meta: { title: '选择就诊人' },
   },
+  {
+    path: '/selectExamBranch/:patientId',
+    component: () => import('../views/hospital-service/check-exam/SelectExamBranch.vue'),
+    meta: { title: '报告类别' },
+  },
   {
     path: '/checkExamIndex/:patientId',
     component: () => import('../views/hospital-service/check-exam/CheckExamIndex.vue'),
@@ -139,6 +144,16 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/check-exam/CheckExamDetail.vue'),
     meta: { title: '报告详情' },
   },
+  {
+    path: '/checkTestIndex/:patientId',
+    component: () => import('../views/hospital-service/check-exam/CheckTestIndex.vue'),
+    meta: { title: '报告查询' },
+  },
+  {
+    path: '/checkTestDetail/:patientUid/:patientId',
+    component: () => import('../views/hospital-service/check-exam/CheckTestDetail.vue'),
+    meta: { title: '报告详情' },
+  },
   {
     path: '/selectPhysicalExamPatient',
     component: () => import('../views/hospital-service/physical-exam/PhysicalExamPatient.vue'),

+ 8 - 0
src/store/index.js

@@ -15,6 +15,8 @@ export default createStore({
     currentExamDate: null,
     examDateRange: [],
     examIndexArray: [],
+    testDateRange: [],
+    testIndexArray: [],
     covidExamIdCard: null,
     covidExamIndexes: [],
     currentBook: {},
@@ -36,6 +38,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_TESTDATERANGE: (state, payload) => (state.testDateRange = payload),
+    SET_TESTINDEXARRAY: (state, payload) => (state.testIndexArray = payload),
     SET_COVIDEXAMIDCARD: (state, payload) => (state.covidExamIdCard = payload),
     SET_COVIDEXAMINDEXES: (state, payload) => (state.covidExamIndexes = payload),
     SET_CURRENTBOOK: (state, payload) => (state.currentBook = payload),
@@ -124,6 +128,10 @@ export default createStore({
       commit('SET_EXAMDATERANGE', payload['dateRange'])
     },
 
+    storeTestDateRange({ commit }, payload) {
+      commit('SET_TESTDATERANGE', payload['dateRange'])
+    },
+
     storeCurrentBookItem({ commit }, payload) {
       commit('SET_CURRENTBOOK', payload['bookItem'])
     },

+ 44 - 0
src/views/hospital-service/check-exam/CheckTestDetail.vue

@@ -0,0 +1,44 @@
+<template>
+  <window-size>
+    <van-notice-bar left-icon="warning-o" text="仅供查阅参考,最终结果以医院纸质报告为准。" />
+    <van-cell title="就诊人" :value="testResult.patientName"></van-cell>
+    <van-cell title="送检医生" :value="testResult.doctorName"></van-cell>
+    <van-cell title="报告时间" :value="testResult.checkTime"></van-cell>
+    <van-cell title="报告单号" :value="testResult.patientUid"></van-cell>
+    <div style="height: 5px"></div>
+    <van-tag type="primary" plain style="margin-left: 8px">检查所见</van-tag>
+    <div class="test-result-text">
+      <p v-html="testResult.examinationSee"></p>
+    </div>
+    <div style="height: 12px"></div>
+    <van-tag type="primary" plain style="margin-left: 8px">检查结论</van-tag>
+    <div class="test-result-text">
+      <p v-html="testResult.examinationreSult"></p>
+    </div>
+  </window-size>
+</template>
+
+<script setup>
+import { useRouter } from 'vue-router'
+import { checkTestDetail } from '../../../api/check-exam'
+import { onMounted, ref} from 'vue'
+
+const router = useRouter()
+
+const testResult = ref({})
+
+onMounted(() => {
+  const params = router.currentRoute.value.params
+  checkTestDetail(params).then((res) => {
+    testResult.value = res
+  })
+})
+</script>
+
+<style scoped>
+.test-result-text {
+  font-size: 14px;
+  color: black;
+  padding: 4px 20px;
+}
+</style>

+ 153 - 0
src/views/hospital-service/check-exam/CheckTestIndex.vue

@@ -0,0 +1,153 @@
+<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="testIndex.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 testIndex" :key="item.patientUid">
+          <van-cell
+              :title="item.examinEparts"
+              :label="item.checkTime"
+              is-link
+              center
+              :to="'/checkTestDetail/' + item.patientUid + '/' + patientId"
+          >
+          </van-cell>
+          <div style="height: 5px"></div>
+        </div>
+      </div>
+    </div>
+    <van-empty :image="empty" description="您当前没有报告项目" v-show="testIndex.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 { checkTestIndex } 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) => {
+        queryInspectionIndex(range[0], range[1])
+      })
+      return
+    case 'threeMonths':
+      makeOffset(90).then((range) => {
+        queryInspectionIndex(range[0], range[1])
+      })
+      return;
+    case 'halfYear':
+      makeOffset(183).then((range) => {
+        queryInspectionIndex(range[0], range[1])
+      })
+      return
+    case 'oneYear':
+      makeOffset(365).then((range) => {
+        queryInspectionIndex(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 testIndex = computed(() => {
+  return store.state.testIndexArray
+})
+
+const onConfirm = (values) => {
+  showDateRange.value = false
+  const start = formatDate(values[0])
+  const end = formatDate(values[1])
+  store.dispatch({
+    type: 'storeTestDateRange',
+    dateRange: [start, end]
+  }).then(() => {
+    date.value = `${start} - ${end}`
+    queryInspectionIndex(start, end)
+  })
+}
+
+const queryInspectionIndex = (start, end) => {
+  const param = {
+    patientId,
+    start: start,
+    end: end,
+  }
+  checkTestIndex(param).then((res) => {
+    store.commit('SET_TESTINDEXARRAY', res)
+  })
+}
+
+onMounted(() => {
+  let storeRange = store.state.examDateRange
+  if (storeRange.length === 0) {
+    makeOffset(30).then((range) => {
+      date.value = range[0] + ' - ' + range[1]
+      queryInspectionIndex(range[0], range[1])
+    })
+  } else {
+    date.value = storeRange[0] + ' - ' + storeRange[1]
+    if (testIndex.value.length === 0) {
+      queryInspectionIndex(storeRange[0], storeRange[1])
+    }
+  }
+})
+</script>

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

@@ -0,0 +1,16 @@
+<template>
+  <window-size>
+    <van-cell title="检验报告" is-link @click="go('/checkExamIndex')"></van-cell>
+    <van-cell title="检查报告" is-link @click="go('/checkTestIndex')"></van-cell>
+  </window-size>
+</template>
+<script setup>
+import {useRouter} from "vue-router";
+
+const router = useRouter()
+const patientId = router.currentRoute.value.params.patientId
+
+function go(path) {
+  router.push(path + '/' + patientId)
+}
+</script>

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

@@ -4,14 +4,16 @@
       left-icon="warning-o"
       text="微信服务目前无法使用医保卡看病,持有医保卡的患者请到前台直接办理手续,敬请谅解。"
     />
-    <select-card to="checkExamIndex"></select-card>
+    <select-card to="selectExamBranch"></select-card>
   </window-size>
 </template>
 
 <script>
 import { onMounted } from 'vue'
 import store from '../../../store'
+import SelectCard from "../../../components/select-card/index.vue";
 export default {
+  components: {SelectCard},
   setup() {
     onMounted(() => {
       store.commit('SET_EXAMINDEXARRAY', [])