Home.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div class="m-b_8px round-header">
  4. <el-select v-model="search.current" style="width: 70px">
  5. <el-option v-for="item in search.methods" :key="item.code" :value="item.code"
  6. :label="item.name"></el-option>
  7. </el-select>
  8. <span v-if="permission < 10" style="margin-left: 8px">
  9. <el-input v-model="search.zyh" style="width: 100px" clearable @keyup.enter="searchPatient"
  10. placeholder="住院号"></el-input>
  11. <el-button type="primary" icon="Search" @click="searchPatient">检索</el-button>
  12. </span>
  13. <el-button type="primary" icon="Postcard" @click="checkIdCard" style="margin-left: 8px">身份信息</el-button>
  14. <el-button type="success" icon="Document" @click="getRegInfo">登记信息</el-button>
  15. <el-button type="primary" icon="Tickets" @click="beforeGetTreatinfo">待遇检查</el-button>
  16. <el-button icon="Document" @click="openEmr">电子病历</el-button>
  17. <el-button @click="printWristStrap">打印腕带</el-button>
  18. <BloodSugar :pat-no="patient.inpatientNo" :times="patient.admissTimes" :old-button="false"/>
  19. </div>
  20. <div class="layout_flex_1-y layout_display_flex">
  21. <div style="width: max-content;margin-right: 8px">
  22. <Overview ref="overview" :showSelection="isUploadPage"/>
  23. </div>
  24. <div class="layout_flex_1-x">
  25. <router-view v-slot="{ Component }">
  26. <transition name="fade-transform" mode="out-in">
  27. <keep-alive>
  28. <component :is="Component"/>
  29. </keep-alive>
  30. </transition>
  31. </router-view>
  32. <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
  33. <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes"
  34. @close="showIdCardImg = false"></IdentifyImage>
  35. <Insuinfo v-if="showPsnInsuinfo" :params="checkTreatmentParams" @close="showPsnInsuinfo = false"
  36. @row-click="checkTreatmentinfos"/>
  37. <Treatmentinfo v-if="showTreatmentinfos" :params="checkTreatmentParams" @close="showTreatmentinfos = false"/>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script setup>
  43. import {computed, reactive, ref} from 'vue'
  44. import {getPatientInfo} from '@/api/inpatient/patient'
  45. import {nullPatient} from '@/utils/validate'
  46. import {getGreatestRole} from '@/utils/permission'
  47. import {baseinfo, setBaseinfo} from '@/data/inpatient'
  48. import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
  49. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  50. import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
  51. import PageLayer from "@/layout/PageLayer";
  52. import {
  53. emrStateEnum,
  54. getEmrUrl
  55. } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
  56. import Treatmentinfo from "@/components/medical-insurance/treatmentinfo/Index.vue";
  57. import Insuinfo from "@/components/medical-insurance/insuinfo/Index.vue";
  58. import {ElMessage} from "element-plus";
  59. import {getDatetime} from "@/utils/date";
  60. import {getLodop, initLodop} from "@/utils/c-lodop";
  61. import {useMedinsStore} from "@/pinia/medins-store";
  62. import BloodSugar from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/BloodSugar.vue";
  63. const search = initSearchParam()
  64. const permission = getGreatestRole()
  65. const patient = computed(() => {
  66. return baseinfo()
  67. })
  68. const medinsStore = useMedinsStore()
  69. const injuryMode = computed(() => {
  70. return medinsStore.isInjuryMode
  71. })
  72. const isUploadPage = computed(() => {
  73. return medinsStore.currentPageName === 'inHospFeeUpload' && !injuryMode.value
  74. })
  75. const overview = ref(null)
  76. const searchPatient = () => {
  77. if (!search.zyh) {
  78. overview.value.fetchOverviews()
  79. setBaseinfo({})
  80. } else {
  81. if (permission < 10) {
  82. overview.value.overviews = []
  83. setBaseinfo({
  84. totalCharge: '0.00',
  85. chargeYb: '0.00'
  86. })
  87. getPatientInfo(search.zyh).then((res) => {
  88. overview.value.currentWard = res.admissWard
  89. medinsStore.setCurrentWard(res.admissWard)
  90. medinsStore.setCurrentMedType(res.medType)
  91. setBaseinfo(res)
  92. overview.value.overviews.push(makeOverview(res))
  93. })
  94. }
  95. }
  96. }
  97. const showRegisterInfo = ref(false)
  98. const getRegInfo = () => {
  99. if (nullPatient()) return
  100. showRegisterInfo.value = true
  101. }
  102. const showIdCardImg = ref(false)
  103. const checkIdCard = () => {
  104. if (nullPatient()) return
  105. showIdCardImg.value = true
  106. }
  107. function initSearchParam() {
  108. return reactive({
  109. current: 'alpha',
  110. methods: [
  111. {code: 'alpha', name: '拼音'},
  112. {code: 'code', name: '编码'},
  113. {code: 'name', name: '名称'},
  114. ],
  115. zyh: '',
  116. })
  117. }
  118. const openEmr = () => {
  119. if (nullPatient()) return
  120. window.open(getEmrUrl(patient.value.inpatientNo, patient.value.admissTimes, emrStateEnum.在院只读), '_blank')
  121. }
  122. function makeOverview(val) {
  123. return {
  124. bedNo: val.bedNo,
  125. inpatientNo: val.inpatientNo,
  126. admissTimes: val.admissTimes,
  127. name: val.name,
  128. sex: val.sex,
  129. medType: val.medType,
  130. dismissOrder: val.dismissOrder,
  131. mdtrtId: val.mdtrtId,
  132. injurySerialNo: val.injurySerialNo,
  133. status: val.mdtrtId || val.injurySerialNo ? 1 : 0,
  134. }
  135. }
  136. const showPsnInsuinfo = ref(false)
  137. const showTreatmentinfos = ref(false)
  138. const checkTreatmentParams = ref({})
  139. const beforeGetTreatinfo = () => {
  140. if (nullPatient()) return
  141. if (!patient.value.medType) {
  142. ElMessage({
  143. message: '医疗类别不能为空!',
  144. type: 'warning',
  145. duration: 2600,
  146. showClose: true,
  147. })
  148. return true
  149. }
  150. checkTreatmentParams.value = {
  151. medType: patient.value.medType,
  152. patNo: patient.value.patNo,
  153. times: patient.value.admissTimes,
  154. ledgerSn: patient.value.ledgerSn,
  155. socialNo: patient.value.socialNo,
  156. name: patient.value.name,
  157. admdvs: patient.value.admdvs,
  158. }
  159. showPsnInsuinfo.value = true
  160. }
  161. const checkTreatmentinfos = (row) => {
  162. checkTreatmentParams.value.psnNo = row.psnNo
  163. checkTreatmentParams.value.begntime = getDatetime()
  164. checkTreatmentParams.value.insutype = row.insutype
  165. showPsnInsuinfo.value = false
  166. showTreatmentinfos.value = true
  167. }
  168. const childrenDepts = ['1040000','1040100', '1700015']
  169. function printWristStrap() {
  170. if (nullPatient()) return
  171. if (childrenDepts.indexOf(patient.value.smallDept) !== -1) {
  172. printChildWristStrap()
  173. } else {
  174. printNormalWristStrap()
  175. }
  176. }
  177. let LODOP;
  178. function printNormalWristStrap() {
  179. LODOP = getLodop();
  180. LODOP.PRINT_INIT('inpatient_info2')
  181. LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
  182. LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
  183. LODOP.SET_PRINT_STYLE('FontSize', 9)
  184. LODOP.SET_PRINT_STYLE('Bold', 1)
  185. LODOP.ADD_PRINT_BARCODE('7mm', '27mm', '18.5mm', '18.5mm', 'QRCode', patient.value.inpatientNo)
  186. LODOP.ADD_PRINT_TEXT('8mm', '45mm', '220mm', '7mm',
  187. `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
  188. LODOP.ADD_PRINT_TEXT('14mm', '45mm', '220mm', '7mm', `入院科室:${patient.value.smallDeptName}`)
  189. LODOP.ADD_PRINT_TEXT('20mm', '45mm', '220mm', '7mm', `紧急联系人:${patient.value.contactPhone}`)
  190. LODOP.PREVIEW()
  191. }
  192. function printChildWristStrap() {
  193. LODOP = getLodop()
  194. LODOP.PRINT_INIT('inpatient_info3')
  195. LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
  196. LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
  197. LODOP.SET_PRINT_STYLE('FontSize', 6)
  198. LODOP.SET_PRINT_STYLE('Bold', 1)
  199. LODOP.ADD_PRINT_BARCODE('10mm', '32mm', '15mm', '15mm', 'QRCode', patient.value.inpatientNo)
  200. LODOP.ADD_PRINT_TEXT('11mm', '45mm', '50mm', '3mm',
  201. `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
  202. LODOP.ADD_PRINT_TEXT('14.75mm', '45mm', '50mm', '3mm', `入院科室:${patient.value.smallDeptName}`)
  203. LODOP.ADD_PRINT_TEXT('18.5mm', '45mm', '50mm', '3mm', `紧急联系人:${patient.value.contactPhone}`)
  204. LODOP.PREVIEW()
  205. }
  206. onMounted(() => {
  207. initLodop()
  208. })
  209. </script>