Home.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <el-select v-model="search.current" style="width: 70px" @change="handleSelectSearchMehtod">
  5. <el-option v-for="item in search.methods" :key="item.code" :value="item.code" :label="item.name"></el-option>
  6. </el-select>
  7. <span v-if="permission < 10" style="margin-left: 8px">
  8. <el-input v-model="search.zyh" style="width: 100px" clearable @keyup.enter="searchPatient"
  9. placeholder="住院号"></el-input>
  10. <el-button type="primary" icon="Search" @click="searchPatient">检索</el-button>
  11. </span>
  12. <el-button type="primary" icon="Postcard" @click="checkIdCard" style="margin-left: 8px">身份信息</el-button>
  13. <el-button style="margin-left: 10px" type="success" icon="Document" @click="getRegInfo">登记信息</el-button>
  14. <el-button style="margin-left: 10px" type="danger" icon="MagicStick" @click="toEmpiView">360视图</el-button>
  15. </template>
  16. <template #aside>
  17. <Overview ref="overview" :showSelection="isUploadPage"/>
  18. </template>
  19. <template #main>
  20. <router-view v-slot="{ Component }">
  21. <transition name="fade-transform" mode="out-in">
  22. <keep-alive>
  23. <component :is="Component"/>
  24. </keep-alive>
  25. </transition>
  26. </router-view>
  27. <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
  28. <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes"
  29. @close="showIdCardImg = false"></IdentifyImage>
  30. </template>
  31. </page-layer>
  32. </template>
  33. <script setup>
  34. import {computed, reactive, ref} from 'vue'
  35. import store from '@/store'
  36. import {getEmpiViewUrl, getPatientInfo} from '@/api/inpatient/patient'
  37. import {nullPatient} from '@/utils/validate'
  38. import {getGreatestRole} from '@/utils/permission'
  39. import {baseinfo, setBaseinfo} from '@/data/inpatient'
  40. import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
  41. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  42. import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
  43. import PageLayer from "@/layout/PageLayer";
  44. const search = initSearchParam()
  45. const permission = getGreatestRole()
  46. const handleSelectSearchMehtod = (val) => {
  47. store.commit('ptnt/setSearchMethod', val)
  48. }
  49. const patient = computed(() => {
  50. return baseinfo()
  51. })
  52. const isUploadPage = computed(() => {
  53. return store.state.app.currentPageName === 'inHospFeeUpload' && !store.state.ptnt.injuryMode
  54. })
  55. const overview = ref(null)
  56. const searchPatient = () => {
  57. if (!search.zyh) {
  58. overview.value.fetchOverviews()
  59. setBaseinfo({})
  60. } else {
  61. if (permission < 10) {
  62. overview.value.overviews = []
  63. store.commit('ptnt/setBaseinfo', {totalCharge: '0.00', chargeYb: '0.00'})
  64. getPatientInfo(search.zyh).then((res) => {
  65. overview.value.currentWard = res.admissWard
  66. store.commit('user/wardChange', res.admissWard)
  67. store.commit('ptnt/setCurrentMedType', res.medType)
  68. setBaseinfo(res)
  69. overview.value.overviews.push(makeOverview(res))
  70. })
  71. }
  72. }
  73. }
  74. const showRegisterInfo = ref(false)
  75. const getRegInfo = () => {
  76. if (nullPatient()) return
  77. showRegisterInfo.value = true
  78. }
  79. const toEmpiView = () => {
  80. if (nullPatient()) return
  81. getEmpiViewUrl(patient.value.inpatientNo).then((res) => {
  82. window.open(res, '_blank')
  83. })
  84. }
  85. const showIdCardImg = ref(false)
  86. const checkIdCard = () => {
  87. if (nullPatient()) return
  88. showIdCardImg.value = true
  89. }
  90. function initSearchParam() {
  91. return reactive({
  92. current: 'alpha',
  93. methods: [
  94. {code: 'alpha', name: '拼音'},
  95. {code: 'code', name: '编码'},
  96. {code: 'name', name: '名称'},
  97. ],
  98. zyh: '',
  99. })
  100. }
  101. function makeOverview(val) {
  102. return {
  103. bedNo: val.bedNo,
  104. inpatientNo: val.inpatientNo,
  105. admissTimes: val.admissTimes,
  106. name: val.name,
  107. sex: val.sex,
  108. medType: val.medType,
  109. dismissOrder: val.dismissOrder,
  110. mdtrtId: val.mdtrtId,
  111. injurySerialNo: val.injurySerialNo,
  112. status: val.mdtrtId || val.injurySerialNo ? 1 : 0,
  113. }
  114. }
  115. </script>