Home.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <el-container>
  3. <el-aside width="260px">
  4. <Overview ref="overview" :showSelection="isUploadPage" />
  5. </el-aside>
  6. <el-main>
  7. <el-container>
  8. <el-header height="36px" style="margin-top: 6px">
  9. <el-select v-model="search.current" style="width: 70px" @change="handleSelectSearchMehtod">
  10. <el-option v-for="item in search.methods" :key="item.code" :value="item.code" :label="item.name"></el-option>
  11. </el-select>
  12. <span v-if="permission < 10">
  13. <el-input v-model="search.zyh" style="width: 100px" clearable @keyup.enter="searchPatient" placeholder="住院号"></el-input>
  14. <el-button type="primary" icon="el-icon-search" @click="searchPatient">检索</el-button>
  15. </span>
  16. &nbsp;&nbsp;
  17. <el-button type="primary" icon="el-icon-postcard" @click="checkIdCard">身份信息</el-button>
  18. <el-button type="primary" icon="el-icon-download" @click="downloadReadCard" style="margin-left: 10px"> 下载读卡程序 </el-button>
  19. <el-button style="margin-left: 10px" type="success" icon="el-icon-document" @click="getRegInfo">登记信息 </el-button>
  20. <el-button style="margin-left: 10px" type="danger" icon="el-icon-magic-stick" @click="toEmpiView">360视图 </el-button>
  21. </el-header>
  22. <el-main>
  23. <router-view v-slot="{ Component }">
  24. <transition name="fade-transform" mode="out-in">
  25. <keep-alive>
  26. <component :is="Component" />
  27. </keep-alive>
  28. </transition>
  29. </router-view>
  30. <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
  31. <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes" @close="showIdCardImg = false"></IdentifyImage>
  32. </el-main>
  33. </el-container>
  34. </el-main>
  35. </el-container>
  36. </template>
  37. <script>
  38. import { computed, reactive, ref } from 'vue'
  39. import store from '@/store'
  40. import dismissIcon from '@/assets/dismiss-icon.png'
  41. import { getPatientInfo, getEmpiViewUrl } from '@/api/yibao/patient'
  42. import { nullPatient } from '@/utils/validate'
  43. import { getGreatestRole } from '@/utils/permission'
  44. import { baseinfo, setBaseinfo } from '@/data/inpatient'
  45. import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
  46. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  47. import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
  48. export default {
  49. components: {
  50. Overview,
  51. IdentifyImage,
  52. Registinfo,
  53. },
  54. setup() {
  55. const search = initSearchParam()
  56. const permission = getGreatestRole()
  57. const handleSelectSearchMehtod = (val) => {
  58. store.commit('ptnt/setSearchMethod', val)
  59. }
  60. const patient = computed(() => {
  61. return baseinfo()
  62. })
  63. const isUploadPage = computed(() => {
  64. return store.state.app.currentPageName === 'inHospFeeUpload'
  65. })
  66. const overview = ref(null)
  67. const searchPatient = () => {
  68. if (!search.zyh) {
  69. overview.value.fetchOverviews()
  70. setBaseinfo({})
  71. } else {
  72. if (permission < 10) {
  73. overview.value.overviews = []
  74. store.commit('ptnt/setBaseinfo', { totalCharge: '0.00', chargeYb: '0.00' })
  75. getPatientInfo(search.zyh).then((res) => {
  76. overview.value.currentWard = res.admissWard
  77. store.commit('user/wardChange', res.admissWard)
  78. store.commit('ptnt/setCurrentMedType', res.medType)
  79. setBaseinfo(res)
  80. overview.value.overviews.push(makeOverview(res))
  81. })
  82. }
  83. }
  84. }
  85. const showRegisterInfo = ref(false)
  86. const getRegInfo = () => {
  87. if (nullPatient()) return
  88. showRegisterInfo.value = true
  89. }
  90. const toEmpiView = () => {
  91. if (nullPatient()) return
  92. getEmpiViewUrl(patient.value.inpatientNo).then((res) => {
  93. window.open(res, '_blank')
  94. })
  95. }
  96. const showIdCardImg = ref(false)
  97. const checkIdCard = () => {
  98. if (nullPatient()) return
  99. showIdCardImg.value = true
  100. }
  101. return {
  102. patient,
  103. permission,
  104. search,
  105. showRegisterInfo,
  106. isUploadPage,
  107. dismissIcon,
  108. showIdCardImg,
  109. overview,
  110. checkIdCard,
  111. getRegInfo,
  112. toEmpiView,
  113. searchPatient,
  114. downloadReadCard,
  115. handleSelectSearchMehtod,
  116. }
  117. },
  118. }
  119. function initSearchParam() {
  120. const search = reactive({
  121. current: 'alpha',
  122. methods: [
  123. { code: 'alpha', name: '拼音' },
  124. { code: 'code', name: '编码' },
  125. { code: 'name', name: '名称' },
  126. ],
  127. zyh: '',
  128. })
  129. return search
  130. }
  131. function makeOverview(val) {
  132. return {
  133. bedNo: val.bedNo,
  134. inpatientNo: val.inpatientNo,
  135. admissTimes: val.admissTimes,
  136. name: val.name,
  137. sex: val.sex,
  138. medType: val.medType,
  139. dismissOrder: val.dismissOrder,
  140. mdtrtId: val.mdtrtId,
  141. injurySerialNo: val.injurySerialNo,
  142. status: val.mdtrtId || val.injurySerialNo ? 1 : 0,
  143. }
  144. }
  145. function downloadReadCard() {
  146. window.open('http://172.16.32.160:8888/readcard/ReadCard(解压到D盘根目录).zip', '_blank')
  147. }
  148. </script>