inHospitalHistory.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="cell clearfix">
  8. <!-- <el-input style="width: 180px;" v-model.trim="search_input" class="filter-item"/> -->
  9. <el-autocomplete
  10. style="margin:16px 5px"
  11. popper-class="my-autocomplete"
  12. v-model.trim="search_input"
  13. :fetch-suggestions="querySearchAsync"
  14. :trigger-on-focus="false"
  15. placeholder="病人名字或者透析号"
  16. @select="handleSelect"
  17. >
  18. <i class="el-icon-search el-input__icon" slot="suffix"> </i>
  19. <template slot-scope="{ item }">
  20. <div class="name">{{ item.name }}</div>
  21. </template>
  22. </el-autocomplete>
  23. <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
  24. @click="searchAction">搜索
  25. </el-button>
  26. <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
  27. placeholder="选择时间" v-model="start_time" style="width:200px"
  28. @change="changeStart"
  29. >
  30. </el-date-picker>
  31. -
  32. <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
  33. placeholder="选择时间" v-model="end_time" style="width:200px"
  34. @change="changeEnd"
  35. >
  36. </el-date-picker>
  37. </div>
  38. <el-table :data="tableData" border :row-style="{ color: '#303133' }"
  39. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  40. highlight-current-row>
  41. <el-table-column align="center" type="index" label="序号" width="60">
  42. </el-table-column>
  43. <el-table-column align="center" prop="dialysis_no" label="姓名" width="80">
  44. <template slot-scope="scope">{{scope.row.name }}</template>
  45. </el-table-column>
  46. <el-table-column align="center" prop="name" label="证件号" width='180'>
  47. <template slot-scope="scope">{{ scope.row.id_card_no }}</template>
  48. </el-table-column>
  49. <el-table-column align="center" prop="name" label="就诊号" width="80">
  50. <template slot-scope="scope">
  51. {{scope.row.number}}
  52. </template>
  53. </el-table-column>
  54. <el-table-column align="center" prop="name" label="入院科室" width="80">
  55. <template slot-scope="scope">{{getDepartMent(scope.row.departments)}}</template>
  56. </el-table-column>
  57. <el-table-column align="center" prop="name" label="入院时间" width="100">
  58. <template slot-scope="scope">{{scope.row.in_hosptial_time}}</template>
  59. </el-table-column>
  60. <el-table-column align="center" prop="name" label="出院时间" width="100">
  61. <template slot-scope="scope">{{scope.row.out_hosptial_time}}</template>
  62. </el-table-column>
  63. <el-table-column align="center" prop="name" label="疾病类型" width="100">
  64. <template slot-scope="scope">{{GetSickType(scope.row.sick_type)}}</template>
  65. </el-table-column>
  66. <el-table-column align="center" prop="name" label="诊断" width="100">
  67. <template slot-scope="scope">{{GetDiagnosisName(parseInt(scope.row.diagnosis))}}</template>
  68. </el-table-column>
  69. <el-table-column align="center" prop="name" label="医疗类别" width="100">
  70. <template slot-scope="scope">
  71. <div v-if="scope.row.med_type == 11">普通住院</div>
  72. <div v-if="scope.row.med_type == 14">门诊特殊病</div>
  73. <div v-if="scope.row.med_type == 240101">门诊视同住院</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column align="center" prop="name" label="结算类型" width="70">
  77. <template slot-scope="scope">{{getBanlance(scope.row.balance_accounts_type) }}</template>
  78. </el-table-column>
  79. <el-table-column align="center" prop="name" label="医生" width="80">
  80. <template slot-scope="scope">{{getDoctor(scope.row.doctor) }}</template>
  81. </el-table-column>
  82. <el-table-column align="center" prop="name" label="状态" width="70">
  83. <template slot-scope="scope">
  84. <div v-if="scope.row.status == 0">{{"已经撤销出院"}}</div>
  85. <div v-if="scope.row.status == 1 && scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 0">{{"在院"}}</div>
  86. <div v-if="scope.row.status == 1 && scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 1">{{"已出院"}}</div>
  87. </template>
  88. </el-table-column>
  89. <!-- <el-table-column align="center" prop="name" label="操作" width="180">-->
  90. <!-- <template slot-scope="scope">-->
  91. <!-- <el-button size="mini" type="primary" v-if="scope.row.status == 1"-->
  92. <!-- @click="toReturnPatient(scope.row)">退号-->
  93. <!-- </el-button>-->
  94. <!-- </template>-->
  95. <!-- </el-table-column>-->
  96. </el-table>
  97. <el-pagination
  98. @size-change="handleSizeChange"
  99. @current-change="handleCurrentChange"
  100. :page-sizes="[10, 50, 100]"
  101. :page-size="10"
  102. background
  103. style="margin-top:20px;float: right"
  104. layout="total, sizes, prev, pager, next, jumper"
  105. :total="total"
  106. >
  107. </el-pagination>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. const moment = require('moment')
  113. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  114. import {getInHospitalHistory,getInitData} from '@/api/his/his'
  115. import { uParseTime } from '@/utils/tools'
  116. import { getDictionaryDataConfig } from '@/utils/data'
  117. import axios from 'axios'
  118. export default {
  119. components: {
  120. BreadCrumb
  121. },
  122. data() {
  123. return {
  124. crumbs: [
  125. { path: false, name: '住院登记' },
  126. { path: false, name: '住院历史' }
  127. ],
  128. register_type: 0,
  129. search_input: '',
  130. value1: '',
  131. tableData: [],
  132. register: [
  133. { value: 0, label: '全部' },
  134. { value: 1, label: '普通' },
  135. { value: 2, label: '主治' },
  136. { value: 3, label: '主任' },
  137. { value: 4, label: '免收诊金' },
  138. { value: 5, label: '专家' }
  139. ],
  140. start_time: moment().format('YYYY-MM-DD HH:mm'),
  141. end_time: moment().format('YYYY-MM-DD HH:mm'),
  142. limit: 10,
  143. page: 1,
  144. total: 0,
  145. departMent: [],
  146. doctorList: [],
  147. medicalCare: [{
  148. id: 1,
  149. name: '职工基本医疗保险'
  150. }, {
  151. id: 2,
  152. name: '公务员医疗补助'
  153. }, {
  154. id: 3,
  155. name: '大额医疗费用补助'
  156. }, {
  157. id: 4,
  158. name: '离休人员医疗'
  159. }, {
  160. id: 5,
  161. name: '城乡居民基本医疗保险'
  162. }, {
  163. id: 6,
  164. name: '城乡居民大病医疗保险'
  165. },
  166. {
  167. id: 7,
  168. name: '生育保险'
  169. }],
  170. certificates: [{
  171. value: 1,
  172. label: '内地身份证'
  173. }, {
  174. value: 2,
  175. label: '社保卡'
  176. }, {
  177. value: 3,
  178. label: '护照'
  179. }, {
  180. value: 4,
  181. label: '军官证'
  182. }, {
  183. value: 5,
  184. label: '台胞证'
  185. }, {
  186. value: 6,
  187. label: '港澳地区身份证'
  188. }],
  189. settlement:
  190. [
  191. { value: 1, label: '医保' },
  192. { value: 2, label: '自费' },
  193. { value: 3, label: '公费' },
  194. { value: 4, label: '农保' },
  195. { value: 5, label: '会员' },
  196. { value: 6, label: '职工' },
  197. { value: 7, label: '合同' },
  198. {value: 8, label: '医保自费'},
  199. ],
  200. // medicalCare: [{
  201. // value: 1,
  202. // label: '职工基本医疗保险'
  203. // }, {
  204. // value: 2,
  205. // label: "公务员医疗补助"
  206. // },{
  207. // value: 3,
  208. // label: "大额医疗费用补助"
  209. // },{
  210. // value: 4,
  211. // label: "离休人员医疗"
  212. // },{
  213. // value: 5,
  214. // label: "城乡居民基本医疗保险"
  215. // },{
  216. // value: 6,
  217. // label: "城乡居民大病医疗保险"
  218. // },
  219. // {
  220. // value: 7,
  221. // label: "生育保险"
  222. // }],
  223. newRegister: [{
  224. value: 1,
  225. label: '普通'
  226. }, {
  227. value: 2,
  228. label: '主治'
  229. }, {
  230. value: 3,
  231. label: '主任'
  232. }, {
  233. value: 4,
  234. label: '免收诊金'
  235. }, {
  236. value: 5,
  237. label: '专家'
  238. }],
  239. tablePatient: [],
  240. creator: '',
  241. startUnix: '',
  242. dialogVisible: false,
  243. form: {},
  244. is_Name: false,
  245. sick:[],
  246. diagnoses:[],
  247. }
  248. },
  249. created() {
  250. // let a = JSON.parse(localStorage.getItem("temp"))
  251. // let arr = []
  252. // a.map(item => {
  253. // if(item.org_id == this.$store.getters.xt_user.org_id){
  254. // item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
  255. // arr.push(item)
  256. // }
  257. // })
  258. // this.tableData = arr
  259. //获取所有挂号号的患者
  260. this.creator = this.$store.getters.xt_user.user.user_name
  261. var today = moment().startOf('day').format('YYYY-MM-DD')
  262. var todayUnix = Date.parse(today) / 1000
  263. this.startUnix = todayUnix - 28800
  264. this.getInitData()
  265. this.getlist()
  266. this.getDictionaryDataConfig()
  267. },
  268. methods: {
  269. getInitData() {
  270. getInitData().then((response) => {
  271. if (response.data.state == 0) {
  272. this.$message.error(response.data.msg);
  273. return false;
  274. } else {
  275. this.sick = response.data.data.sick;
  276. this.diagnoses = response.data.data.diagnose;
  277. }
  278. });
  279. },GetSickType(id){
  280. for(let i = 0;i < this.sick.length; i++){
  281. if(this.sick[i].id == id){
  282. return this.sick[i].class_name
  283. }
  284. }
  285. return ""
  286. },
  287. GetDiagnosisName(id){
  288. for(let i = 0;i < this.diagnoses.length; i++){
  289. if(this.diagnoses[i].id == id){
  290. return this.diagnoses[i].class_name
  291. }
  292. }
  293. return ""
  294. },
  295. searchAction() {
  296. this.getlist()
  297. },
  298. // changeTime(val){
  299. // let arr = JSON.parse(localStorage.getItem("temp"))
  300. // arr.map(item => {
  301. // item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
  302. // })
  303. // this.tableData = arr
  304. // console.log(new Date(val[0]).getTime() / 1000)
  305. // console.log(new Date(val[1]).getTime() / 1000)
  306. // let arr1 = this.tableData
  307. // let a = []
  308. // arr1.map(item => {
  309. // if(new Date(item.create_time).getTime() / 1000 > new Date(val[0]).getTime() / 1000 && new Date(item.create_time).getTime() / 1000 < new Date(val[1]).getTime() / 1000 && item.org_id == this.$store.getters.xt_user.org_id){
  310. // a.push(item)
  311. // }
  312. // })
  313. // this.tableData = a
  314. // },
  315. changeStart(val) {
  316. this.start_time = val
  317. this.getlist()
  318. },
  319. changeEnd(val) {
  320. this.end_time = val
  321. this.getlist()
  322. },
  323. changeRegister(val) {
  324. this.getlist()
  325. },
  326. handleSizeChange(val) {
  327. this.limit = val
  328. this.getlist()
  329. },
  330. handleCurrentChange(val) {
  331. this.page = val
  332. this.getlist()
  333. },
  334. getlist() {
  335. var params = {
  336. keyword: this.search_input,
  337. start_time: this.start_time,
  338. end_time: this.end_time,
  339. limit: this.limit,
  340. page: this.page
  341. }
  342. getInHospitalHistory(params).then(response => {
  343. if (response.data.state == 1) {
  344. var history = response.data.data.history
  345. console.log('history', history)
  346. this.tableData = history
  347. var total = response.data.data.total
  348. console.log('total', total)
  349. this.total = total
  350. var department = response.data.data.department
  351. console.log('department', department)
  352. this.departMent = department
  353. var doctor = response.data.data.doctor
  354. console.log('doctor', doctor)
  355. this.doctorList = doctor
  356. }
  357. })
  358. },
  359. getDepartMent(id) {
  360. var name = ''
  361. for (let i = 0; i < this.departMent.length; i++) {
  362. if (id == this.departMent[i].id) {
  363. name = this.departMent[i].name
  364. }
  365. }
  366. return name
  367. },
  368. getDoctor(id) {
  369. var user_name = ''
  370. for (let i = 0; i < this.doctorList.length; i++) {
  371. if (id == this.doctorList[i].admin_user_id) {
  372. user_name = this.doctorList[i].user_name
  373. }
  374. }
  375. return user_name
  376. },
  377. getMedicalTreatment(id) {
  378. var name = ''
  379. for (let i = 0; i < this.medicalCare.length; i++) {
  380. if (this.medicalCare[i].id == id) {
  381. name = this.medicalCare[i].name
  382. }
  383. }
  384. return name
  385. },
  386. getTime(value, temp) {
  387. if (value != undefined) {
  388. return uParseTime(value, temp)
  389. }
  390. return ''
  391. }, toReturnSZPatient(val) {
  392. if(val.balance_accounts_type == 2){
  393. this.$confirm('是否退号', '退号 ', {
  394. confirmButtonText: '确 定',
  395. cancelButtonText: '取 消',
  396. type: 'warning'
  397. }).then(() => {
  398. let params = {
  399. 'id': val.id,
  400. };
  401. refundNumber(params).then(response => {
  402. if (response.data.state == 0) {
  403. this.$message.error(response.data.msg);
  404. this.loadingtwo = false;
  405. return false
  406. } else {
  407. this.getlist()
  408. this.$message({ message: '退号成功', type: 'success' });
  409. }
  410. })
  411. }).catch(() => {
  412. })
  413. }else{
  414. var that = this
  415. this.$confirm('是否退号', '退号', {
  416. confirmButtonText: '确 定',
  417. cancelButtonText: '取 消',
  418. type: 'warning'
  419. }).then(() => {
  420. axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
  421. params: {
  422. his_patient_id: val.id,
  423. record_time: this.getTime(val.record_date, '{y}-{m}-{d}'),
  424. admin_user_id: this.$store.getters.xt_user.user.id,
  425. patient_id: val.patient_id
  426. }
  427. })
  428. .then(function(response) {
  429. if (response.data.state == 0) {
  430. that.$message.error(response.data.msg)
  431. return false
  432. } else {
  433. if (response.data.data.failed_code == -10) {
  434. that.$confirm(response.data.data.msg, '医保错误信息', {
  435. confirmButtonText: '确 定',
  436. type: 'warning'
  437. }).then(() => {
  438. }).catch(() => {
  439. })
  440. // that.$message.error(response.data.data.msg)
  441. } else {
  442. that.getlist()
  443. that.$message({ message: '退号成功', type: 'success' })
  444. }
  445. }
  446. })
  447. .catch(function(error) {
  448. })
  449. }).catch(() => {
  450. })
  451. }
  452. },
  453. toReturnPatient(row) {
  454. var that = this
  455. this.$confirm('确认退号吗?', '退号', {
  456. confirmButtonText: '确 定',
  457. cancelButtonText: '取 消',
  458. type: 'warning'
  459. }).then(() => {
  460. //
  461. let params = {
  462. 'id':row.id,
  463. 'patient_id': row.patient_id,
  464. 'record_time': that.getTimes(row.record_date),
  465. 'admin_user_id': this.$store.getters.xt_user.user.id
  466. }
  467. axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
  468. params: params
  469. })
  470. .then(function(response) {
  471. if (response.data.state == 0) {
  472. that.$message.error(response.data.msg)
  473. return false
  474. } else {
  475. if (response.data.data.failed_code == -10) {
  476. // that.$message.error(response.data.data.msg)
  477. that.$confirm(response.data.data.msg, '医保错误信息', {
  478. confirmButtonText: '确 定',
  479. type: 'warning'
  480. }).then(() => {
  481. }).catch(() => {
  482. })
  483. } else {
  484. that.$message({ message: '退号成功', type: 'success', duration: 5000 });
  485. that.getlist()
  486. }
  487. }
  488. })
  489. .catch(function(error) {
  490. })
  491. //
  492. // changePatient(id).then(response => {
  493. // if (response.data.state == 1) {
  494. // var msg = response.data.data.msg
  495. // this.$message.success('退号成功')
  496. // this.getlist()
  497. // } else {
  498. // this.$message.error('患者已就诊,退号失败')
  499. // }
  500. // })
  501. })
  502. .catch(() => {
  503. })
  504. }, getTimes(time) {
  505. return uParseTime(time, '{y}-{m}-{d}')
  506. },
  507. querySearchAsync(keyword, cb) {
  508. let key = '';
  509. if (keyword != undefined) {
  510. key = keyword
  511. }
  512. let searchArray = []
  513. var params = {
  514. keyword: key
  515. }
  516. console.log('params', params)
  517. getHisPatient(params).then(response => {
  518. if (response.data.state == 1) {
  519. searchArray = response.data.data.patient
  520. console.log('searcharrya', searchArray)
  521. cb(searchArray)
  522. }
  523. })
  524. return searchArray
  525. },
  526. handleSelect(val) {
  527. this.search_input = val.name
  528. this.getlist()
  529. },
  530. handleClose(done) {
  531. done()
  532. },
  533. open(obj) {
  534. this.dialogVisible = true
  535. this.form = obj
  536. console.log(obj)
  537. },
  538. getDictionaryDataConfig(type) {
  539. let arr = getDictionaryDataConfig('system', 'social_type')
  540. let str = ''
  541. arr.map(item => {
  542. if (item.id == type) {
  543. str = item.name
  544. }
  545. })
  546. return str
  547. },
  548. getCertificates(type) {
  549. let arr = this.certificates
  550. let str = ''
  551. arr.map(item => {
  552. if (item.value == type) {
  553. str = item.label
  554. }
  555. })
  556. return str
  557. },
  558. getSettlement(type) {
  559. let arr = this.settlement
  560. let str = ''
  561. arr.map(item => {
  562. if (item.value == type) {
  563. str = item.label
  564. }
  565. })
  566. return str
  567. },
  568. getMedicalCare(type) {
  569. let arr = this.medicalCare
  570. let str = ''
  571. arr.map(item => {
  572. if (item.id == type) {
  573. str = item.name
  574. }
  575. })
  576. return str
  577. },
  578. getRegister(type) {
  579. let arr = this.newRegister
  580. let str = ''
  581. arr.map(item => {
  582. if (item.value == type) {
  583. str = item.label
  584. }
  585. })
  586. return str
  587. },
  588. getDepartMent(type) {
  589. let arr = this.departMent
  590. let str = ''
  591. arr.map(item => {
  592. if (item.id == type) {
  593. str = item.name
  594. }
  595. })
  596. return str
  597. },
  598. getBanlance(id) {
  599. var label = ''
  600. for (let i = 0; i < this.settlement.length; i++) {
  601. if (id == this.settlement[i].value) {
  602. label = this.settlement[i].label
  603. }
  604. }
  605. return label
  606. }
  607. }
  608. }
  609. </script>
  610. <style lang="scss" scoped>
  611. .basicForm {
  612. display: flex;
  613. flex-wrap: wrap;
  614. justify-content: space-between;
  615. .el-form-item {
  616. width: 33%;
  617. }
  618. }
  619. </style>