ソースを参照

增强部分接口的安全性

lighter 2 年 前
コミット
38ab228e9e

+ 2 - 26
src/api/physical-exam.js

@@ -1,33 +1,9 @@
 import request from '../utils/request'
 
-export function getIdCard(patientId) {
-    return request({
-        url: '/physicalCheck/getIdCard',
-        method: 'get',
-        params: {patientId},
-    })
-}
-
-export function getPhysicalCheckIndex(idCard, pageNo) {
+export function getPhysicalCheckIndex(idCard, patientId, pageNo) {
     return request({
         url: '/physicalCheck/getPhysicalCheckIndex',
         method: 'get',
-        params: {idCard, pageNo},
+        params: {idCard, patientId, pageNo},
     })
 }
-
-export function getPhysicalCheckResult(tjid) {
-    return request({
-        url: '/physicalCheck/getPhysicalCheckResult',
-        method: 'get',
-        params: {tjid},
-    })
-}
-
-// export function exportPDF(data) {
-//     return request({
-//         url: '/physicalCheck/exportPDF',
-//         method: 'post',
-//         data,
-//     })
-// }

+ 0 - 5
src/router/index.js

@@ -118,11 +118,6 @@ export const constantRoutes = [
     component: () => import('../views/hospital-service/physical-exam/PhysicalExamIndex.vue'),
     meta: { title: '体检报告' },
   },
-  {
-    path: '/physicalExamination/:tjid?',
-    component: () => import('../views/hospital-service/physical-exam/PhysicalExamination.vue'),
-    meta: { title: '体检报告' },
-  },
   {
     path: '/selectCovidVaccinatePatient',
     component: () => import('../views/hospital-service/covid-vaccinate/SelectCovidVaccinatePatient.vue'),

+ 0 - 23
src/views/hospital-service/external-page/PhysicalExamination.vue

@@ -1,23 +0,0 @@
-<template>
-  <window-size>
-    <iframe :style="frame" src="http://218.104.151.241:18888"></iframe>
-  </window-size>
-</template>
-
-<script>
-import store from '../../../store'
-export default {
-  name: 'PhysicalExamination',
-  setup() {
-    const windowSize = store.state.windowSize
-    const frame = {
-      width: windowSize.w + 'px',
-      height: windowSize.h - 45 + 'px',
-      border: 'none',
-    }
-    return {
-      frame,
-    }
-  },
-}
-</script>

+ 18 - 25
src/views/hospital-service/physical-exam/PhysicalExamIndex.vue

@@ -7,17 +7,15 @@
           <van-button size="small" type="primary" icon="search" @click="handleClickSearch">查询</van-button>
         </template>
       </van-field>
-
       <van-list :style="listBoxStyle" id="listWrapper" v-model:loading="listLoading" :finished="listFinished" finished-text="没有更多了" @load="onLoadingList">
         <van-cell v-for="item in examIndexes" :key="item.条码号" :title="item.工作单位" :value="item.checkTime"
                   center clickable @click="handleClickIndex(item)"></van-cell>
       </van-list>
     </div>
-
   </window-size>
 </template>
 <script setup lang="ts">
-import {getIdCard, getPhysicalCheckIndex} from '../../../api/physical-exam'
+import {getPhysicalCheckIndex} from '../../../api/physical-exam.js'
 import {RouteParamValue, useRouter} from "vue-router";
 import {onMounted, ref, Ref} from "vue";
 import {useStore} from "vuex";
@@ -64,7 +62,7 @@ const handleClickSearch = (): void => {
 }
 
 const fetchIndexData = (): void => {
-  getPhysicalCheckIndex(idCard.value, nextPage.value).then(index => {
+  getPhysicalCheckIndex(idCard.value, patientId, nextPage.value).then(index => {
     listLoading.value = false
     listFinished.value = index.pageInfo.nextPage === 0;
     examIndexes.value = examIndexes.value.concat(index.rows)
@@ -84,24 +82,22 @@ const handleClickIndex = (tjIndex:object): void => {
     url: 'http://staticweb.hnthyy.cn/wxserver/physicalCheck/exportPDF',
     data: tjIndex,
     responseType: 'blob',
+  }).then((res) => {
+    if (res.data.type === 'application/x-download') {
+      let blob = new Blob([res.data], { type: 'application/pdf' })
+      const link = document.createElement('a')
+      link.href = URL.createObjectURL(blob)
+      link.style.display = 'none'
+      link.download = fileName //下载的文件名
+      document.body.appendChild(link)
+      link.click()
+      document.body.removeChild(link)
+    } else {
+      Toast.fail('没有查询到可导出的体检报告。')
+    }
+  }).catch((error) => {
+    console.error(error)
   })
-      .then((res) => {
-        if (res.data.type === 'application/x-download') {
-          let blob = new Blob([res.data], { type: 'application/pdf' })
-          const link = document.createElement('a')
-          link.href = URL.createObjectURL(blob)
-          link.style.display = 'none'
-          link.download = fileName //下载的文件名
-          document.body.appendChild(link)
-          link.click()
-          document.body.removeChild(link)
-        } else {
-          Toast.fail('没有查询到可导出的体检报告。')
-        }
-      })
-      .catch((error) => {
-        console.error(error)
-      })
 }
 
 const isWxBrowser = ref(false)
@@ -113,10 +109,7 @@ const judgeWeChatBrowser = () => {
 
 onMounted((): void => {
   isWxBrowser.value = judgeWeChatBrowser()
-  getIdCard(patientId).then(res => {
-    idCard.value = res
-  })
-  nextPage.value = store.state.physicalExamNextPage
+  nextPage.value = store.state.physicalExamNextPage;
   examIndexes.value = store.state.physicalExamIndexes
   listFinished.value = store.state.physicalExamListFinished
   const currentTjid = store.state.currentTjid

+ 0 - 115
src/views/hospital-service/physical-exam/PhysicalExamination.vue

@@ -1,115 +0,0 @@
-<template>
-  <window-size>
-    <van-empty description="暂无数据" v-show="!examPackageData.checkItems"></van-empty>
-    <div style="height: 5px"></div>
-    <van-tag type="success" size="large" v-show="examPackageData.checkItems" round plain>已发布体检</van-tag>
-    <van-cell v-for="item in examPackageData.checkItems" :title="item.体检单元名称" :value="item.checkTime" is-link
-              @click="handleClickExamItem(item)"></van-cell>
-    <van-cell v-show="examPackageData.summary" title="体检总结" is-link @click="showSummary"></van-cell>
-
-    <div class="exam-item-result" v-show="currentExamTitle">
-      <van-nav-bar :title="currentExamTitle" left-text="返回" left-arrow @click-left="currentExamTitle = null"
-                   @click-right="showSwitchItem = true">
-        <template #right>
-          <van-icon name="wap-nav" size="18"/>
-          <span style="color: #1989fa">&nbsp;切换</span></template>
-      </van-nav-bar>
-
-      <van-action-sheet v-model:show="showSwitchItem" :actions="examPackageData.checkItems" @select="handleClickExamItem" close-on-click-action
-      close-on-click-overlay/>
-
-      <div :style="itemResultStyle">
-        <van-grid :column-num="4">
-          <van-grid-item text="体检项目"></van-grid-item>
-          <van-grid-item text="体检结果"></van-grid-item>
-          <van-grid-item text="单位"></van-grid-item>
-          <van-grid-item text="参考值"></van-grid-item>
-        </van-grid>
-        <div v-for="item in currentExamResult">
-          <van-grid :column-num="4">
-            <van-grid-item :text="item.检查项目"></van-grid-item>
-            <van-grid-item>
-              <template #text>
-                <span class="van-grid-item__text">
-                  {{ item.结果 }}
-                  <van-tag type="danger" v-if="item.阳性标识">
-                    {{ item.阳性标识 }}
-                  </van-tag>
-                </span>
-              </template>
-            </van-grid-item>
-            <van-grid-item :text="item.单位"></van-grid-item>
-            <van-grid-item :text="item.参考范围显示效果"></van-grid-item>
-          </van-grid>
-        </div>
-        <div class="department-summary">
-          科室小结:{{ currentDiagnose }}
-        </div>
-      </div>
-    </div>
-  </window-size>
-</template>
-
-<script setup lang="ts">
-import {onMounted, ref, Ref} from "vue";
-import {getPhysicalCheckResult} from '../../../api/physical-exam'
-import {Dialog} from "vant";
-import {useStore} from "vuex";
-import {useRouter} from "vue-router";
-
-const router = useRouter()
-const store = useStore()
-const itemResultStyle = {
-  height: store.state.windowSize['h'] - 48 + 'px',
-  overflowY: 'auto'
-}
-
-const examPackageData: Ref<object> = ref({})
-
-const currentExamTitle: Ref<string> = ref()
-const currentDiagnose: Ref<string> = ref()
-const currentExamResult: Ref<[]> = ref([])
-
-const handleClickExamItem = (checkItem: object): void => {
-  checkItem.color = '#00c278'
-  currentExamTitle.value = checkItem['体检单元名称']
-  currentDiagnose.value = checkItem['诊断内容']
-  currentExamResult.value = examPackageData.value['examResult'][currentExamTitle.value]
-}
-
-const showSummary = (): void => {
-  Dialog.alert({
-    title: '体检总结',
-    message: examPackageData.value.summary.汇总建议,
-    messageAlign: 'left',
-  })
-}
-
-const showSwitchItem:Ref<boolean> = ref(false)
-
-onMounted(() => {
-  const tjid = <string> router.currentRoute.value.params.tjid;
-  getPhysicalCheckResult(tjid).then(res => {
-    examPackageData.value = res
-  })
-})
-
-</script>
-
-<style scoped>
-.exam-item-result {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: white;
-  z-index: 99
-}
-
-.department-summary {
-  padding: 8px 8px 12px 8px;
-  font-size: 13px;
-  color: darkred;
-}
-</style>