Home.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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-dropdown style="margin: 0 10px" trigger="click" @command="downloadReadCard">
  19. <el-button type="primary">下载读卡程序<i class="el-icon-arrow-down el-icon--right"></i> </el-button>
  20. <template #dropdown>
  21. <el-dropdown-menu>
  22. <el-dropdown-item command="thcardreader">读卡插件安装包</el-dropdown-item>
  23. <el-dropdown-item command="framework" divided>.Net Framework</el-dropdown-item>
  24. </el-dropdown-menu>
  25. </template>
  26. </el-dropdown>
  27. <el-button style="margin-left: 10px" type="success" icon="el-icon-document" @click="getRegInfo">登记信息 </el-button>
  28. <el-button style="margin-left: 10px" type="danger" icon="el-icon-magic-stick" @click="toEmpiView">360视图 </el-button>
  29. </el-header>
  30. <el-main>
  31. <router-view v-slot="{ Component }">
  32. <transition name="fade-transform" mode="out-in">
  33. <keep-alive>
  34. <component :is="Component" />
  35. </keep-alive>
  36. </transition>
  37. </router-view>
  38. <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
  39. <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes" @close="showIdCardImg = false"></IdentifyImage>
  40. </el-main>
  41. </el-container>
  42. </el-main>
  43. </el-container>
  44. </template>
  45. <script>
  46. import { computed, reactive, ref } from 'vue'
  47. import store from '@/store'
  48. import dismissIcon from '@/assets/dismiss-icon.png'
  49. import { getPatientInfo, getEmpiViewUrl } from '@/api/yibao/patient'
  50. import { nullPatient } from '@/utils/validate'
  51. import { getGreatestRole } from '@/utils/permission'
  52. import { baseinfo, setBaseinfo } from '@/data/inpatient'
  53. import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
  54. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  55. import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
  56. export default {
  57. components: {
  58. Overview,
  59. IdentifyImage,
  60. Registinfo,
  61. },
  62. setup() {
  63. const search = initSearchParam()
  64. const permission = getGreatestRole()
  65. const handleSelectSearchMehtod = (val) => {
  66. store.commit('ptnt/setSearchMethod', val)
  67. }
  68. const patient = computed(() => {
  69. return baseinfo()
  70. })
  71. const isUploadPage = computed(() => {
  72. return store.state.app.currentPageName === 'inHospFeeUpload'
  73. })
  74. const overview = ref(null)
  75. const searchPatient = () => {
  76. if (!search.zyh) {
  77. overview.value.fetchOverviews()
  78. setBaseinfo({})
  79. } else {
  80. if (permission < 10) {
  81. overview.value.overviews = []
  82. store.commit('ptnt/setBaseinfo', { totalCharge: '0.00', chargeYb: '0.00' })
  83. getPatientInfo(search.zyh).then((res) => {
  84. overview.value.currentWard = res.admissWard
  85. store.commit('user/wardChange', res.admissWard)
  86. store.commit('ptnt/setCurrentMedType', res.medType)
  87. setBaseinfo(res)
  88. overview.value.overviews.push(makeOverview(res))
  89. })
  90. }
  91. }
  92. }
  93. const showRegisterInfo = ref(false)
  94. const getRegInfo = () => {
  95. if (nullPatient()) return
  96. showRegisterInfo.value = true
  97. }
  98. const toEmpiView = () => {
  99. if (nullPatient()) return
  100. getEmpiViewUrl(patient.value.inpatientNo).then((res) => {
  101. window.open(res, '_blank')
  102. })
  103. }
  104. const showIdCardImg = ref(false)
  105. const checkIdCard = () => {
  106. if (nullPatient()) return
  107. showIdCardImg.value = true
  108. }
  109. return {
  110. patient,
  111. permission,
  112. search,
  113. showRegisterInfo,
  114. isUploadPage,
  115. dismissIcon,
  116. showIdCardImg,
  117. overview,
  118. checkIdCard,
  119. getRegInfo,
  120. toEmpiView,
  121. searchPatient,
  122. downloadReadCard,
  123. handleSelectSearchMehtod,
  124. }
  125. },
  126. }
  127. function initSearchParam() {
  128. const search = reactive({
  129. current: 'alpha',
  130. methods: [
  131. { code: 'alpha', name: '拼音' },
  132. { code: 'code', name: '编码' },
  133. { code: 'name', name: '名称' },
  134. ],
  135. zyh: '',
  136. })
  137. return search
  138. }
  139. function makeOverview(val) {
  140. return {
  141. bedNo: val.bedNo,
  142. inpatientNo: val.inpatientNo,
  143. admissTimes: val.admissTimes,
  144. name: val.name,
  145. sex: val.sex,
  146. medType: val.medType,
  147. dismissOrder: val.dismissOrder,
  148. mdtrtId: val.mdtrtId,
  149. injurySerialNo: val.injurySerialNo,
  150. status: val.mdtrtId || val.injurySerialNo ? 1 : 0,
  151. }
  152. }
  153. function downloadReadCard(command) {
  154. const filename = command === 'thcardreader' ? '读卡插件.msi' : '.NET Framework 4.6.1.exe'
  155. window.open(`http://172.16.32.160:8888/readcard/${filename}`, '_blank')
  156. }
  157. </script>