Home.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <el-container>
  3. <el-header height="36px" style="margin-top: 8px">
  4. <el-select v-model="ward.current" style="width: 120px" @change="fetchOverviews">
  5. <el-option v-for="item in ward.wards" :key="item.code" :value="item.code" :label="item.name"></el-option>
  6. </el-select>
  7. <el-select v-model="currentMedType" style="width: 110px" @change="handleMedTypeChange">
  8. <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name" :disabled="item.disabled"></el-option>
  9. </el-select>
  10. <span>
  11. <span>&nbsp;&nbsp;查询方式:</span>
  12. <el-select v-model="search.current" style="width: 70px" @change="handleSelectSearchMehtod">
  13. <el-option v-for="item in search.methods" :key="item.code" :value="item.code" :label="item.name"></el-option>
  14. </el-select>
  15. </span>
  16. <span v-if="permission < 10">
  17. &nbsp;
  18. <el-input v-model="search.zyh" style="width: 100px" clearable @keyup.enter="searchPatient" placeholder="住院号"></el-input>
  19. <el-button type="primary" icon="el-icon-search" @click="searchPatient">检索</el-button>
  20. </span>
  21. &nbsp;&nbsp;
  22. <el-button type="primary" icon="el-icon-postcard" @click="checkIdCard">身份信息</el-button>
  23. <el-button type="primary" icon="el-icon-download" @click="downloadReadCard" style="margin-left: 10px"> 下载读卡程序 </el-button>
  24. <el-button style="margin-left: 10px" type="success" icon="el-icon-document" @click="getRegInfo">查询登记信息 </el-button>
  25. <el-button style="margin-left: 10px" type="danger" icon="el-icon-magic-stick" @click="toEmpiView">患者360视图 </el-button>
  26. </el-header>
  27. <el-container>
  28. <el-aside width="260px" style="background-color: white">
  29. <el-table
  30. :data="cptOverviews.slice((currentPage - 1) * 15, currentPage * 15)"
  31. stripe
  32. :height="tableHieght"
  33. highlight-current-row
  34. @row-click="handleClickOverview"
  35. @selection-change="handleSelectionChange"
  36. >
  37. <el-table-column v-if="isUploadPage" type="selection" width="20"></el-table-column>
  38. <el-table-column prop="bedNo" label="床" width="30"></el-table-column>
  39. <el-table-column label="姓名" width="70">
  40. <template #default="scope">
  41. <div style="display: flex; align-items: center">
  42. <img class="sex-icon" :src="scope.row.sex === 1 ? maleIcon : femaleIcon" />
  43. {{ scope.row.name }}
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column prop="inpatientNo" label="住院号" width="65"></el-table-column>
  48. <el-table-column label="次数" width="45">
  49. <template #default="scope">
  50. <div style="display: flex; align-items: center">
  51. {{ scope.row.admissTimes }}&nbsp;
  52. <img v-if="scope.row.dismissOrder > 0" class="sex-icon" :src="dismissIcon" />
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="状态" width="45" align="center">
  57. <template #default="scope">
  58. <span v-html="getStatusFlag(scope.row.mdtrtId, scope.row.injurySerialNo)"></span>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <el-pagination small :hide-on-single-page="false" :page-size="15" layout="prev, pager, next" @current-change="handleCurrentPageChange" :total="cptOverviews.length">
  63. </el-pagination>
  64. </el-aside>
  65. <el-main>
  66. <router-view v-slot="{ Component }">
  67. <transition name="fade-transform" mode="out-in">
  68. <keep-alive>
  69. <component :is="Component" />
  70. </keep-alive>
  71. </transition>
  72. </router-view>
  73. </el-main>
  74. </el-container>
  75. <el-dialog v-model="showRegisterInfo" width="60%">
  76. <div v-if="injuryMode">
  77. <el-descriptions title="工伤患者在院信息" :column="3" size="small" border>
  78. <el-descriptions-item>
  79. <template #label> 姓名 </template>
  80. {{ registerInfo.name }}
  81. </el-descriptions-item>
  82. <el-descriptions-item>
  83. <template #label> 住院号 </template>
  84. {{ registerInfo.patient_id }}
  85. </el-descriptions-item>
  86. <el-descriptions-item>
  87. <template #label> 个人电脑号 </template>
  88. {{ registerInfo.indi_id }}
  89. </el-descriptions-item>
  90. <el-descriptions-item>
  91. <template #label> 性别 </template>
  92. {{ cptSex(registerInfo.sex) }}
  93. </el-descriptions-item>
  94. <el-descriptions-item>
  95. <template #label> 身份证 </template>
  96. {{ registerInfo.idcard }}
  97. </el-descriptions-item>
  98. <el-descriptions-item>
  99. <template #label> 出生日期 </template>
  100. {{ registerInfo.birthday }}
  101. </el-descriptions-item>
  102. <el-descriptions-item>
  103. <template #label> 医疗类别 </template>
  104. {{ registerInfo.treatment_name }}
  105. </el-descriptions-item>
  106. <el-descriptions-item>
  107. <template #label> 入院科室 </template>
  108. {{ registerInfo.out_dept_name }}
  109. </el-descriptions-item>
  110. <el-descriptions-item>
  111. <template #label> 入院病房 </template>
  112. {{ registerInfo.area_name }}
  113. </el-descriptions-item>
  114. <el-descriptions-item>
  115. <template #label> 诊断编码 </template>
  116. {{ registerInfo.in_diagnose }}
  117. </el-descriptions-item>
  118. <el-descriptions-item>
  119. <template #label> 诊断名称 </template>
  120. {{ registerInfo.in_disease_name }}
  121. </el-descriptions-item>
  122. <el-descriptions-item>
  123. <template #label> 就诊登记号 </template>
  124. {{ registerInfo.serial_no }}
  125. </el-descriptions-item>
  126. <el-descriptions-item>
  127. <template #label> 工伤业务序号 </template>
  128. {{ registerInfo.serial_bo_no }}
  129. </el-descriptions-item>
  130. <el-descriptions-item>
  131. <template #label> 入院登记时间 </template>
  132. {{ registerInfo.reg_date }}
  133. </el-descriptions-item>
  134. <el-descriptions-item>
  135. <template #label> 单位名称 </template>
  136. {{ registerInfo.corp_name }}
  137. </el-descriptions-item>
  138. </el-descriptions>
  139. </div>
  140. <div v-else>
  141. <el-descriptions title="患者医保在院信息" :column="3" size="small" border>
  142. <el-descriptions-item>
  143. <template #label> 姓名 </template>
  144. {{ registerInfo.psnName }}
  145. </el-descriptions-item>
  146. <el-descriptions-item>
  147. <template #label> 住院号 </template>
  148. {{ registerInfo.iptOtpNo }}
  149. </el-descriptions-item>
  150. <el-descriptions-item>
  151. <template #label> 性别 </template>
  152. {{ cptSex(registerInfo.gend) }}
  153. </el-descriptions-item>
  154. <el-descriptions-item>
  155. <template #label> 证件类型 </template>
  156. {{ cptPsnCertType(registerInfo.psnCertType) }}
  157. </el-descriptions-item>
  158. <el-descriptions-item>
  159. <template #label> 证件号码 </template>
  160. {{ registerInfo.certno }}
  161. </el-descriptions-item>
  162. <el-descriptions-item>
  163. <template #label> 出生日期 </template>
  164. {{ registerInfo.brdy }}
  165. </el-descriptions-item>
  166. <el-descriptions-item>
  167. <template #label> 险种类型 </template>
  168. {{ cptInsutype(registerInfo.insutype) }}
  169. </el-descriptions-item>
  170. <el-descriptions-item>
  171. <template #label> 医疗类别 </template>
  172. {{ cptMedType(registerInfo.medType) }}
  173. </el-descriptions-item>
  174. <el-descriptions-item>
  175. <template #label> 异地标志 </template>
  176. {{ cptYesOrNo(registerInfo.outFlag) }}
  177. </el-descriptions-item>
  178. <el-descriptions-item>
  179. <template #label> 开始日期 </template>
  180. {{ registerInfo.begndate }}
  181. </el-descriptions-item>
  182. <el-descriptions-item>
  183. <template #label> 就诊ID </template>
  184. {{ registerInfo.mdtrtId }}
  185. </el-descriptions-item>
  186. <el-descriptions-item>
  187. <template #label> 人员编号 </template>
  188. {{ registerInfo.psnNo }}
  189. </el-descriptions-item>
  190. </el-descriptions>
  191. </div>
  192. </el-dialog>
  193. <el-dialog v-model="showIdCardImg" title="身份信息" :close-on-click-modal="false" fullscreen :show-close="false">
  194. <IdentifyImage :timestamp="timestamp" :pat-no="patient.inpatientNo" :times="patient.admissTimes" @close="showIdCardImg = false"></IdentifyImage>
  195. </el-dialog>
  196. </el-container>
  197. </template>
  198. <script>
  199. import { computed, onMounted, reactive, ref } from 'vue'
  200. import store from '@/store'
  201. import maleIcon from '@/assets/male-icon.png'
  202. import femaleIcon from '@/assets/female-icon.png'
  203. import dismissIcon from '@/assets/dismiss-icon.png'
  204. import { getOverView, getPatientInfo, getEmpiViewUrl } from '@/api/yibao/patient'
  205. import { statusFlags, medTypes } from '@/data/index'
  206. import { nullPatient } from '@/utils/validate'
  207. import { getGreatestRole } from '@/utils/permission'
  208. import { getWards } from '@/api/login'
  209. import { queryInHospitalPatientsInfo } from '@/api/medical-insurance/si-query'
  210. import { cptSex, cptPsnCertType, cptInsutype, cptMedType, cptYesOrNo } from '@/utils/computed'
  211. import { baseinfo, setBaseinfo } from '@/data/inpatient'
  212. import { getInjuryRegisterInfo } from '@/api/medical-insurance/si-injury'
  213. import IdentifyImage from '../../../components/inpatient/IdentifyImage.vue'
  214. export default {
  215. components: {
  216. IdentifyImage,
  217. },
  218. setup() {
  219. const ward = reactive({
  220. current: '',
  221. wards: [],
  222. })
  223. const search = initSearchParam()
  224. const tableHieght = store.state.app.windowSize.h - 75
  225. const permission = getGreatestRole()
  226. const handleSelectSearchMehtod = (val) => {
  227. store.commit('ptnt/setSearchMethod', val)
  228. }
  229. const patient = computed(() => {
  230. return baseinfo()
  231. })
  232. const isUploadPage = computed(() => {
  233. return store.state.app.currentPageName === 'inHospFeeUpload'
  234. })
  235. const statusFlag = ref('1')
  236. const overviews = ref([])
  237. const fetchOverviews = () => {
  238. store.commit('user/wardChange', ward.current)
  239. getOverView(ward.current).then((res) => {
  240. overviews.value = res
  241. })
  242. }
  243. const cptOverviews = computed(() => {
  244. if (currentMedType.value === '00') {
  245. return overviews.value
  246. }
  247. return overviews.value.filter((item) => {
  248. return item.medType === currentMedType.value
  249. })
  250. })
  251. const handleClickOverview = (row) => {
  252. store.commit('ptnt/setOverview', row)
  253. getPatientInfo(row.inpatientNo).then((res) => {
  254. setBaseinfo(res)
  255. })
  256. }
  257. const searchPatient = () => {
  258. if (!search.zyh) {
  259. fetchOverviews()
  260. } else {
  261. if (permission < 10) {
  262. overviews.value = []
  263. store.commit('ptnt/setBaseinfo', { totalCharge: '0.00', chargeYb: '0.00' })
  264. getPatientInfo(search.zyh).then((res) => {
  265. ward.current = res.admissWard
  266. store.commit('user/wardChange', ward.current)
  267. store.commit('ptnt/setCurrentMedType', res.medType)
  268. setBaseinfo(res)
  269. overviews.value.push(makeOverview(res))
  270. })
  271. }
  272. }
  273. }
  274. const currentMedType = computed({
  275. get: () => {
  276. return store.state.ptnt.currentMedType
  277. },
  278. set: (val) => {
  279. store.commit('ptnt/setCurrentMedType', val)
  280. store.commit('ptnt/setBaseinfo', { totalCharge: '0.00', chargeYb: '0.00' })
  281. },
  282. })
  283. const handleSelectionChange = (val) => {
  284. store.commit('SET_SELECTIONS', val)
  285. }
  286. const injuryMode = computed(() => {
  287. return store.state.ptnt.injuryMode
  288. })
  289. const registerInfo = ref({})
  290. const showRegisterInfo = ref(false)
  291. const getRegInfo = () => {
  292. if (nullPatient()) return
  293. if (injuryMode.value) {
  294. getInjuryRegisterInfo(patient.value).then((res) => {
  295. registerInfo.value = res
  296. showRegisterInfo.value = true
  297. })
  298. } else {
  299. const param = {
  300. patNo: patient.value.inpatientNo,
  301. times: patient.value.admissTimes,
  302. ledgerSn: patient.value.ledgerSn,
  303. begntime: patient.value.admissDate,
  304. }
  305. queryInHospitalPatientsInfo(param).then((res) => {
  306. registerInfo.value = res[0]
  307. showRegisterInfo.value = true
  308. })
  309. }
  310. }
  311. const currentPage = ref(1)
  312. const handleCurrentPageChange = (val) => {
  313. currentPage.value = val
  314. }
  315. const toEmpiView = () => {
  316. if (nullPatient()) return
  317. getEmpiViewUrl(patient.value.inpatientNo).then((res) => {
  318. window.open(res, '_blank')
  319. })
  320. }
  321. const handleMedTypeChange = (val) => {
  322. store.commit('ptnt/setInjuryMode', val === '42')
  323. }
  324. const timestamp = ref(0)
  325. const showIdCardImg = ref(false)
  326. const checkIdCard = () => {
  327. if (nullPatient()) return
  328. timestamp.value = new Date().getTime()
  329. showIdCardImg.value = true
  330. }
  331. onMounted(() => {
  332. getWards().then((res) => {
  333. ward.wards = res
  334. ward.current = res[0].code
  335. fetchOverviews()
  336. })
  337. })
  338. return {
  339. ward,
  340. patient,
  341. permission,
  342. tableHieght,
  343. injuryMode,
  344. handleSelectSearchMehtod,
  345. currentMedType,
  346. medTypes,
  347. search,
  348. searchPatient,
  349. downloadReadCard,
  350. cptOverviews,
  351. maleIcon,
  352. femaleIcon,
  353. fetchOverviews,
  354. getStatusFlag,
  355. handleClickOverview,
  356. handleSelectionChange,
  357. registerInfo,
  358. showRegisterInfo,
  359. getRegInfo,
  360. currentPage,
  361. handleCurrentPageChange,
  362. statusFlag,
  363. statusFlags,
  364. isUploadPage,
  365. toEmpiView,
  366. cptSex,
  367. cptPsnCertType,
  368. cptInsutype,
  369. cptMedType,
  370. cptYesOrNo,
  371. dismissIcon,
  372. handleMedTypeChange,
  373. timestamp,
  374. showIdCardImg,
  375. checkIdCard,
  376. }
  377. },
  378. }
  379. function initSearchParam() {
  380. const search = reactive({
  381. current: 'alpha',
  382. methods: [
  383. { code: 'alpha', name: '拼音' },
  384. { code: 'code', name: '编码' },
  385. { code: 'name', name: '名称' },
  386. ],
  387. zyh: '',
  388. })
  389. return search
  390. }
  391. function makeOverview(val) {
  392. return {
  393. bedNo: val.bedNo,
  394. inpatientNo: val.inpatientNo,
  395. admissTimes: val.admissTimes,
  396. name: val.name,
  397. sex: val.sex,
  398. medType: val.medType,
  399. dismissOrder: val.dismissOrder,
  400. mdtrtId: val.mdtrtId,
  401. injurySerialNo: val.injurySerialNo,
  402. }
  403. }
  404. function getStatusFlag(mdtrtId, injurySerialNo) {
  405. if (mdtrtId || injurySerialNo) {
  406. return '<span style="color: green">已登记</span>'
  407. }
  408. return '<span style="color:red">未登记</span>'
  409. }
  410. function initIdentityFiles() {
  411. const identityFiles = reactive({
  412. idCard: [],
  413. scanFile: [],
  414. })
  415. return identityFiles
  416. }
  417. function downloadReadCard() {
  418. window.open('http://172.16.32.160:8888/readcard/ReadCard.exe', '_self')
  419. }
  420. </script>
  421. <style>
  422. .router-parent {
  423. width: calc(100% - 8px);
  424. }
  425. </style>