Home.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. <LayoutRouterView/>
  26. <Registinfo v-if="showRegisterInfo" :params="patient" @close="showRegisterInfo = false"></Registinfo>
  27. <IdentifyImage v-if="showIdCardImg" :pat-no="patient.inpatientNo" :times="patient.admissTimes"
  28. @close="showIdCardImg = false"></IdentifyImage>
  29. <Insuinfo v-if="showPsnInsuinfo" :params="checkTreatmentParams" @close="showPsnInsuinfo = false"
  30. @row-click="checkTreatmentinfos"/>
  31. <Treatmentinfo v-if="showTreatmentinfos" :params="checkTreatmentParams" @close="showTreatmentinfos = false"/>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script setup>
  37. import {computed, reactive, ref} from 'vue'
  38. import {getPatientInfo} from '@/api/inpatient/patient'
  39. import {nullPatient} from '@/utils/validate'
  40. import {getGreatestRole} from '@/utils/permission'
  41. import { baseinfo, getReadCardData, setBaseinfo } from "@/data/inpatient";
  42. import Overview from '../../../components/medical-insurance/patient-overview/Index.vue'
  43. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  44. import Registinfo from '../../../components/medical-insurance/registinfo/Index.vue'
  45. import {
  46. emrStateEnum,
  47. getEmrUrl
  48. } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
  49. import Treatmentinfo from "@/components/medical-insurance/treatmentinfo/Index.vue";
  50. import Insuinfo from "@/components/medical-insurance/insuinfo/Index.vue";
  51. import {ElMessage} from "element-plus";
  52. import {getDatetime} from "@/utils/date";
  53. import {getLodop, initLodop} from "@/utils/c-lodop";
  54. import {useMedinsStore} from "@/pinia/medins-store";
  55. import BloodSugar from "@/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/components/BloodSugar.vue";
  56. import {useCompRef} from "@/utils/useCompRef";
  57. import LayoutRouterView from "@/layout/LayoutRouterView.vue";
  58. const search = initSearchParam()
  59. const permission = getGreatestRole()
  60. const patient = computed(() => {
  61. return baseinfo()
  62. })
  63. const medinsStore = useMedinsStore()
  64. const injuryMode = computed(() => {
  65. return medinsStore.isInjuryMode
  66. })
  67. const isUploadPage = computed(() => {
  68. return medinsStore.currentPageName === 'inHospFeeUpload' && !injuryMode.value
  69. })
  70. const overview = useCompRef(Overview)
  71. const searchPatient = () => {
  72. if (!search.zyh) {
  73. overview.value.fetchOverviews()
  74. setBaseinfo({})
  75. } else {
  76. if (permission < 10) {
  77. setBaseinfo({
  78. totalCharge: '0.00',
  79. chargeYb: '0.00'
  80. })
  81. getPatientInfo(search.zyh).then((res) => {
  82. medinsStore.setCurrentWard(res.admissWard)
  83. medinsStore.setCurrentMedType(res.medType)
  84. setBaseinfo(res)
  85. overview.value.makeOverview(res)
  86. // overview.value.currentWard = res.admissWard
  87. // overview.value.overviews.push(makeOverview(res))
  88. })
  89. }
  90. }
  91. }
  92. const showRegisterInfo = ref(false)
  93. const getRegInfo = () => {
  94. if (nullPatient()) return
  95. showRegisterInfo.value = true
  96. }
  97. const showIdCardImg = ref(false)
  98. const checkIdCard = () => {
  99. if (nullPatient()) return
  100. showIdCardImg.value = true
  101. }
  102. function initSearchParam() {
  103. return reactive({
  104. current: 'alpha',
  105. methods: [
  106. {code: 'alpha', name: '拼音'},
  107. {code: 'code', name: '编码'},
  108. {code: 'name', name: '名称'},
  109. ],
  110. zyh: '',
  111. })
  112. }
  113. const openEmr = () => {
  114. if (nullPatient()) return
  115. window.open(getEmrUrl(patient.value.inpatientNo, patient.value.admissTimes, emrStateEnum.在院只读), '_blank')
  116. }
  117. const showPsnInsuinfo = ref(false)
  118. const showTreatmentinfos = ref(false)
  119. const checkTreatmentParams = ref({})
  120. const beforeGetTreatinfo = async () => {
  121. if (nullPatient()) return
  122. if (!patient.value.medType) {
  123. ElMessage({
  124. message: '医疗类别不能为空!',
  125. type: 'warning',
  126. duration: 2600,
  127. showClose: true,
  128. })
  129. return true
  130. }else {
  131. medinsStore.setInjuryMode((patient.value.medType === "gs21") || (patient.value.medType === "gs22") || (patient.value.medType === "gs23"));
  132. }
  133. if(injuryMode.value) {
  134. let inpatient_no = patient.value.patNo
  135. let admiss_times = patient.value.admissTimes
  136. // 调用工伤患者关系列表接口
  137. const loading = ElMessage({
  138. message: '正在获取工伤患者信息,请稍候...',
  139. type: 'info',
  140. duration: 0,
  141. showClose: true,
  142. grouping: true,
  143. });
  144. try {
  145. //const response = await fetch(`http://localhost:9205/thyy/api/public/injury/getWorkInjuryPatientRelationList?inpatient_no=${inpatient_no}&admiss_times=${admiss_times}`, {
  146. const response = await fetch(`http://localhost:9205/thyy/api/public/injury/getWorkInjuryPatientRelationList?inpatient_no=${inpatient_no}&admiss_times=${admiss_times}`, {
  147. method: 'GET',
  148. headers: {
  149. 'Content-Type': 'application/json',
  150. },
  151. });
  152. const result = await response.json();
  153. if (result && result.code === 1 && result.data && Array.isArray(result.data) && result.data.length > 0) {
  154. // 取数组的第一个值
  155. const firstItem = result.data[0];
  156. checkTreatmentParams.value = {
  157. medType: patient.value.medType,
  158. patNo: patient.value.patNo,
  159. times: patient.value.admissTimes,
  160. ledgerSn: patient.value.ledgerSn,
  161. socialNo: patient.value.socialNo,
  162. name: patient.value.name,
  163. admdvs: patient.value.admdvs,
  164. readCardResult: {
  165. data:{
  166. output: {
  167. inpatient_no: firstItem.inpatientNo,
  168. admiss_times: firstItem.admissTimes,
  169. psn_no: firstItem.psnNo,
  170. emp_no: firstItem.empNo,
  171. emp_name: firstItem.empName,
  172. certno: firstItem.certno,
  173. psn_name: firstItem.psnName,
  174. gend: firstItem.gend,
  175. age: firstItem.age,
  176. psn_type: firstItem.psnType,
  177. insu_admdvs: firstItem.insuAdmdvs,
  178. inhosp_stas: firstItem.inhospStas,
  179. certificate_type: firstItem.certificateType,
  180. birthday: firstItem.birthday,
  181. QualificationId: firstItem.QualificationId,
  182. injury_part_desc: firstItem.injuryPartDesc,
  183. visit_type: firstItem.visitType,
  184. exam_ccls: firstItem.examCcls
  185. }
  186. }
  187. },
  188. mdtrtCertType: 'injurySicard',
  189. };
  190. showPsnInsuinfo.value = true;
  191. } else {
  192. ElMessage({
  193. message: '未找到工伤患者关系信息',
  194. type: 'warning',
  195. duration: 2500,
  196. showClose: true,
  197. });
  198. }
  199. } catch (error) {
  200. ElMessage({
  201. message: '获取工伤患者信息失败',
  202. type: 'error',
  203. duration: 2500,
  204. showClose: true,
  205. });
  206. } finally {
  207. loading.close && loading.close();
  208. }
  209. } else {
  210. let cd = getReadCardData()
  211. checkTreatmentParams.value = {
  212. medType: patient.value.medType,
  213. patNo: patient.value.patNo,
  214. times: patient.value.admissTimes,
  215. ledgerSn: patient.value.ledgerSn,
  216. socialNo: patient.value.socialNo,
  217. name: patient.value.name,
  218. admdvs: patient.value.admdvs,
  219. readCardResult: cd.readCardResult,
  220. mdtrtCertType: cd.mdtrtCertType,
  221. busCardInfo: cd.busCardInfo,
  222. }
  223. showPsnInsuinfo.value = true
  224. }
  225. }
  226. const checkTreatmentinfos = (row) => {
  227. if (injuryMode.value) {
  228. }else {
  229. checkTreatmentParams.value.psnNo = row.psnNo
  230. checkTreatmentParams.value.begntime = getDatetime()
  231. checkTreatmentParams.value.insutype = row.insutype
  232. showPsnInsuinfo.value = false
  233. showTreatmentinfos.value = true
  234. }
  235. }
  236. const childrenDepts = ['1040000', '1040100', '1700015']
  237. function printWristStrap() {
  238. if (nullPatient()) return
  239. if (childrenDepts.indexOf(patient.value.smallDept) !== -1) {
  240. printChildWristStrap()
  241. } else {
  242. printNormalWristStrap()
  243. }
  244. }
  245. let LODOP;
  246. function printNormalWristStrap() {
  247. LODOP = getLodop();
  248. LODOP.PRINT_INIT('inpatient_info2')
  249. // LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
  250. LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
  251. LODOP.SET_PRINT_STYLE('FontSize', 9)
  252. LODOP.SET_PRINT_STYLE('Bold', 1)
  253. LODOP.ADD_PRINT_BARCODE('7mm', '27mm', '18.5mm', '18.5mm', 'QRCode', patient.value.inpatientNo)
  254. LODOP.SET_PRINT_STYLE('Angle', 90)
  255. LODOP.ADD_PRINT_TEXT('22mm', '44.5mm', '20mm', '7mm', patient.value.inpatientNo)
  256. LODOP.SET_PRINT_STYLE('Angle', 0)
  257. LODOP.ADD_PRINT_TEXT('8mm', '49mm', '220mm', '7mm',
  258. `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
  259. LODOP.ADD_PRINT_TEXT('14mm', '49mm', '220mm', '7mm', `入院科室:${patient.value.smallDeptName}`)
  260. LODOP.ADD_PRINT_TEXT('20mm', '49mm', '220mm', '7mm', `紧急联系人:${patient.value.contactPhone}`)
  261. LODOP.PREVIEW()
  262. }
  263. function printChildWristStrap() {
  264. LODOP = getLodop()
  265. LODOP.PRINT_INIT('inpatient_info3')
  266. // LODOP.SET_PRINTER_INDEX('DASCOM DL-520Z')
  267. LODOP.SET_PRINT_PAGESIZE(2, 0, 0, '')
  268. LODOP.SET_PRINT_STYLE('FontSize', 6)
  269. LODOP.SET_PRINT_STYLE('Bold', 1)
  270. LODOP.ADD_PRINT_BARCODE('10mm', '32mm', '15mm', '15mm', 'QRCode', patient.value.inpatientNo)
  271. LODOP.SET_PRINT_STYLE('Angle', 90)
  272. LODOP.ADD_PRINT_TEXT('20mm', '43.7mm', '20mm', '7mm', patient.value.inpatientNo)
  273. LODOP.SET_PRINT_STYLE('Angle', 0)
  274. LODOP.ADD_PRINT_TEXT('11mm', '46.2mm', '50mm', '3mm',
  275. `姓名:${patient.value.name} / 性别:${patient.value.sexName} / 年龄:${patient.value.age}`)
  276. LODOP.ADD_PRINT_TEXT('14.75mm', '46.2mm', '50mm', '3mm', `入院科室:${patient.value.smallDeptName}`)
  277. LODOP.ADD_PRINT_TEXT('18.5mm', '46.2mm', '50mm', '3mm', `紧急联系人:${patient.value.contactPhone}`)
  278. LODOP.PREVIEW()
  279. }
  280. onMounted(() => {
  281. initLodop()
  282. })
  283. </script>