PatientSidebar.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <div>
  3. <div class="patient-menu">
  4. <el-autocomplete
  5. style="margin:16px 5px"
  6. popper-class="my-autocomplete"
  7. v-model.trim="value"
  8. :fetch-suggestions="querySearchAsync"
  9. :trigger-on-focus="false"
  10. placeholder="病人名字或者透析号"
  11. @select="handleSelect"
  12. >
  13. <i class="el-icon-search el-input__icon" slot="suffix"> </i>
  14. <template slot-scope="{ item }">
  15. <div class="name">{{ item.name }}</div>
  16. </template>
  17. </el-autocomplete>
  18. <el-select
  19. v-model="selectID"
  20. style="margin:0 5px 0px 5px;text-align: center;"
  21. @change="changePatient"
  22. placeholder="请选择"
  23. >
  24. <el-option
  25. v-for="item in patientsList"
  26. :key="item.id"
  27. :label="item.name"
  28. :value="item.id"
  29. >
  30. </el-option>
  31. </el-select>
  32. <el-tree
  33. :data="treeData"
  34. accordion
  35. node-key="name"
  36. :key="treeKey"
  37. :current-node-key="treeKey"
  38. :default-expanded-keys="[defaultActive]"
  39. @node-click="handleNodeClick"
  40. >
  41. </el-tree>
  42. </div>
  43. <div class="patient-app-container ">
  44. <span class="patient-name"
  45. >姓名:{{ currentPatient.name }} &nbsp;&nbsp; 性别:{{
  46. tranSex(currentPatient.gender)
  47. }}
  48. &nbsp;&nbsp; 年龄:{{ getAge(currentPatient) }} &nbsp;&nbsp; 透析号:{{
  49. currentPatient.dialysis_no
  50. }}
  51. </span>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import { fetchAllList, PostSearch } from '@/api/patient'
  57. import { jsGetAge, uParseTime } from '@/utils/tools'
  58. export default {
  59. name: 'patientSidebar',
  60. value: '',
  61. searchArray: [],
  62. props: {
  63. id: 0,
  64. defaultActive: {
  65. type: String,
  66. default: '1-1'
  67. }
  68. },
  69. data() {
  70. return {
  71. thedefaultActive: 1,
  72. patientsList: null,
  73. currentPatient: {},
  74. selectID: 0,
  75. keyword: '',
  76. value: '',
  77. treeKey: '',
  78. treeData: [
  79. {
  80. name: '1',
  81. label: '电子病历',
  82. children: [
  83. {
  84. name: '1-1',
  85. label: '基本信息'
  86. },
  87. {
  88. name: '1-4',
  89. label: '医嘱管理'
  90. },
  91. {
  92. name: '1-6',
  93. label: '干体重'
  94. },
  95. {
  96. name:'1-7',
  97. label:'血管通路'
  98. },
  99. // {
  100. // name:'1-12',
  101. // label:'血管通路图'
  102. // },
  103. // {
  104. // name: '1-2',
  105. // label: '病程管理'
  106. // },
  107. // {
  108. // name: '1-9',
  109. // label: '阶段小结'
  110. // },
  111. // {
  112. // name: '1-10',
  113. // label: '出院小结'
  114. // },
  115. // {
  116. // name: '1-3',
  117. // label: '检验检查'
  118. // },
  119. // {
  120. // name:'1-8',
  121. // label:'传染病管理'
  122. // },
  123. // {
  124. // name: '1-5',
  125. // label: '抢救记录'
  126. // },
  127. // {
  128. // name: '1-11',
  129. // label: '首次病程记录'
  130. // }
  131. ]
  132. },
  133. {
  134. name: '2',
  135. label: '透析管理',
  136. children: [
  137. {
  138. name: '2-1',
  139. label: '长期透析处方'
  140. },
  141. {
  142. name: '2-2',
  143. label: '透析记录'
  144. },
  145. {
  146. name: '2-4',
  147. label: '排班信息'
  148. },
  149. {
  150. name: '2-5',
  151. label: '宣教信息'
  152. }
  153. ]
  154. },
  155. {
  156. name: '3',
  157. label: '病情记录',
  158. children: [
  159. {
  160. name: '3-1',
  161. label: '病史'
  162. },
  163. {
  164. name: '3-2',
  165. label: '体格检查'
  166. },
  167. {
  168. name: '1-11',
  169. label: '首次病程记录'
  170. },
  171. {
  172. name: '1-2',
  173. label: '病程记录'
  174. }, {
  175. name: '1-5',
  176. label: '抢救记录'
  177. }, {
  178. name: '1-9',
  179. label: '阶段小结'
  180. }, {
  181. name: '1-10',
  182. label: '出院小结'
  183. }
  184. ]
  185. },
  186. {
  187. name: '4',
  188. label: '检验检查',
  189. children: [
  190. {
  191. name: '1-3',
  192. label: '肾科检验'
  193. },
  194. {
  195. name: '4-1',
  196. label: '肾科检查'
  197. },
  198. {
  199. name: '4-3',
  200. label: 'KT/V'
  201. },
  202. {
  203. name: '1-8',
  204. label: '传染病管理'
  205. },
  206. ]
  207. },
  208. // {
  209. // name: '5',
  210. // label: '评估工具',
  211. // children: [
  212. // {
  213. // name: '5-1',
  214. // label: '跌倒评估'
  215. // },
  216. // {
  217. // name: '5-2',
  218. // label: '小儿跌倒风险评估'
  219. // },
  220. // {
  221. // name: '5-3',
  222. // label: '压疮风险评估'
  223. // },
  224. // {
  225. // name: '5-4',
  226. // label: 'OH压疮评估'
  227. // },
  228. // {
  229. // name: '5-5',
  230. // label: '日常生活能力评估'
  231. // },
  232. // {
  233. // name: '5-6',
  234. // label: '导管脱落风险评估'
  235. // },
  236. // {
  237. // name: '5-7',
  238. // label: 'RASS及疼痛评估'
  239. // },
  240. // {
  241. // name: '5-8',
  242. // label: '营养状况评估'
  243. // },
  244. // {
  245. // name: '5-9',
  246. // label: '约束告知单'
  247. // },
  248. // {
  249. // name: '5-10',
  250. // label: '心理评估'
  251. // },
  252. // {
  253. // name: '5-11',
  254. // label: '瘙痒评估'
  255. // },
  256. // {
  257. // name: '5-12',
  258. // label: '血液透析患者评估'
  259. // },
  260. // {
  261. // name: '5-13',
  262. // label: 'Glasgow昏迷评分量表'
  263. // },
  264. // {
  265. // name: '5-14',
  266. // label: '肌力评估表'
  267. // },
  268. // ]
  269. // },
  270. ],
  271. name:""
  272. }
  273. },
  274. methods: {
  275. handleNodeClick(data) {
  276. var name = data.name
  277. this.name = data.name
  278. window.sessionStorage.setItem('patientKey',data.name)
  279. if (name == '1-1') {
  280. this.$router.push({ path: '/patients/patient/' + this.id })
  281. } else if (name == '1-2') {
  282. this.$router.push({ path: '/patients/course?id=' + this.id })
  283. } else if (name == '1-3') {
  284. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  285. } else if (name == '1-4') {
  286. this.$router.push({
  287. path: '/patients/patient/' + this.id + '/doctorAdvice'
  288. })
  289. } else if (name == '1-6') {
  290. this.$router.push({
  291. path: '/patients/patient/' + this.id + '/dryWeight'
  292. })
  293. } else if (name == '1-5') {
  294. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  295. } else if (name == '2-1') {
  296. this.$router.push({
  297. path: '/patients/patient/' + this.id + '/dialysisSolution'
  298. })
  299. } else if (name == '2-2') {
  300. this.$router.push({
  301. path: '/patients/patient/' + this.id + '/dialysisRecord'
  302. })
  303. } else if (name == '2-4') {
  304. this.$router.push({
  305. path: '/patients/patient/' + this.id + '/scheduling'
  306. })
  307. } else if (name == '2-5') {
  308. this.$router.push({
  309. path: '/patients/patient/' + this.id + '/proeducation'
  310. })
  311. } else if (name == '1-7'){
  312. this.$router.push({path:'/patients/patient/'+this.id+'/vascularAccess'})
  313. } else if (name == '1-8'){
  314. this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
  315. } else if (name == '1-9'){
  316. this.$router.push({path:'/patient/patient/'+this.id+'/templateSummary'})
  317. } else if(name == '1-10'){
  318. this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
  319. } else if(name == '1-11'){
  320. this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
  321. } else if(name == '3-1'){
  322. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  323. } else if(name == '3-2'){
  324. this.$router.push({path:'/patients/physicalexamination?id='+this.id})
  325. } else if(name == '4-1'){
  326. this.$router.push({path:'/patients/inspection_check?id='+this.id})
  327. } else if(name == '4-3'){
  328. this.$router.push({path:'/patients/ktv?id='+this.id})
  329. }
  330. // else if(name == '1-12'){
  331. // this.$router.push({path:'/patients/patient/'+this.id+'/angiogram'})
  332. // }
  333. else if (name == '5-1') {
  334. this.$router.push({
  335. path: '/patients/patient/'+ this.id +'/Fallassessment'
  336. })
  337. } else if (name == '5-2') {
  338. this.$router.push({
  339. path: '/patients/patient/' + this.id + '/pediatricFallAssessment'
  340. })
  341. } else if (name == '5-3') {
  342. this.$router.push({
  343. path: '/patients/patient/' + this.id + '/pressuresore'
  344. })
  345. } else if (name == '5-4') {
  346. this.$router.push({
  347. path: '/patients/patient/' + this.id + '/OHpressuresore'
  348. })
  349. } else if (name == '5-5'){
  350. this.$router.push({path:'/patients/patient/'+this.id+'/dailyLife'})
  351. } else if (name == '5-6'){
  352. this.$router.push({path:'/patients/patient/'+this.id+'/Cathetershedding'})
  353. } else if (name == '5-7'){
  354. this.$router.push({path:'/patients/patient/'+this.id+'/RassAssessment'})
  355. } else if(name == '5-8'){
  356. this.$router.push({path:'/patients/patient/'+this.id+'/nourishmentAssessment'})
  357. } else if(name == '5-9'){
  358. this.$router.push({path:'/patients/patient/'+this.id+'/Constraintnotification'})
  359. } else if(name == '5-10'){
  360. this.$router.push({ path: '/patients/patient/' + this.id+'/mindAssessment'})
  361. } else if(name == '5-11'){
  362. this.$router.push({path:'/patients/patient/' + this.id+'/pruritusAssessment'})
  363. } else if(name == '5-12'){
  364. this.$router.push({path:'/patients/patient/' + this.id+'/hemodialysis'})
  365. } else if(name == '5-13'){
  366. this.$router.push({path:'/patients/patient/' + this.id+'/Glasgow'})
  367. } else if(name == '5-14'){
  368. this.$router.push({path:'/patients/patient/' + this.id+'/Muscleforce'})
  369. }
  370. },
  371. changePatient(value) {
  372. console.log(value)
  373. if(this.$route.path.indexOf('edit') > -1){
  374. this.$confirm('是否保存当前病历', '保存', {
  375. confirmButtonText: '确 定',
  376. cancelButtonText: '取 消',
  377. type: 'warning'
  378. }).then(() => {
  379. this.$emit('updateInfo')
  380. setTimeout(() => {
  381. this.$router.push('/patients/patient/' + value)
  382. },1000)
  383. }).catch(() => {
  384. this.$router.push('/patients/patient/' + value)
  385. })
  386. }else{
  387. this.$router.push('/patients/patient/' + value)
  388. }
  389. },
  390. getList() {
  391. fetchAllList().then(response => {
  392. if (response.data.state == 1) {
  393. this.patientsList = response.data.data.patients
  394. var len = this.patientsList.length
  395. if (len > 0) {
  396. for (let index = 0; index < len; index++) {
  397. if (this.patientsList[index].id == this.id) {
  398. this.currentPatient = this.patientsList[index]
  399. // console.log("curr", this.currentPatient);
  400. this.selectID = this.patientsList[index].id
  401. this.$emit('tran-patient', this.currentPatient)
  402. break
  403. }
  404. }
  405. }
  406. }
  407. })
  408. },
  409. tranAge(birthday) {
  410. var birth = uParseTime(birthday, '{y}-{m}-{d}')
  411. return jsGetAge(birth, '-')
  412. },
  413. tranSex(gender) {
  414. var sex = '未知'
  415. switch (gender) {
  416. case 1:
  417. sex = '男'
  418. break
  419. case 2:
  420. sex = '女'
  421. break
  422. default:
  423. break
  424. }
  425. return sex
  426. },
  427. querySearchAsync(keyword, cb) {
  428. let key = ''
  429. if (keyword != undefined) {
  430. key = keyword
  431. }
  432. let searchArray = []
  433. PostSearch(key).then(response => {
  434. if (response.data.state == 1) {
  435. searchArray = response.data.data.patient
  436. cb(searchArray)
  437. } else {
  438. this.$message.error(response.data.msg)
  439. cb([])
  440. }
  441. })
  442. },
  443. handleSelect(val) {
  444. this.$router.push('/patients/patient/' + val.id)
  445. },
  446. getAge: function(val) {
  447. if (val.id_card_no == undefined) {
  448. return false
  449. }
  450. var thisLen = val.id_card_no.length
  451. var birth = ''
  452. if (thisLen == 15) {
  453. birth = '19' + val.id_card_no.substr(6, 6)
  454. } else {
  455. birth = val.id_card_no.substr(6, 8)
  456. }
  457. var birthtwo =
  458. birth.substr(0, 4) +
  459. '-' +
  460. birth.substr(4, 2) +
  461. '-' +
  462. birth.substr(6, 2)
  463. var age = jsGetAge(birthtwo, '-')
  464. return age
  465. }
  466. },
  467. created() {
  468. var patientKey = window.sessionStorage.getItem('patientKey')
  469. console.log("patient",patientKey)
  470. var query = this.$route.path
  471. console.log("query",this.$route.path)
  472. if(patientKey){
  473. this.treeKey = patientKey
  474. if(query.indexOf('edit') == -1){
  475. if (patientKey == '1-1') {
  476. this.$router.push({ path: '/patients/patient/' + this.id })
  477. } else if (patientKey == '1-2') {
  478. this.$router.push({ path: '/patients/course?id=' + this.id })
  479. } else if (patientKey == '1-3') {
  480. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  481. } else if (patientKey == '1-4') {
  482. this.$router.push({
  483. path: '/patients/patient/' + this.id + '/doctorAdvice'
  484. })
  485. } else if (patientKey == '1-6') {
  486. this.$router.push({
  487. path: '/patients/patient/' + this.id + '/dryWeight'
  488. })
  489. }else if(patientKey == '1-11'){
  490. this.$router.push({
  491. path: '/patients/patient/' + this.id + '/firstDisease'
  492. })
  493. }
  494. else if (patientKey == '1-5') {
  495. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  496. } else if (patientKey == '2-1') {
  497. this.$router.push({
  498. path: '/patients/patient/' + this.id + '/dialysisSolution'
  499. })
  500. } else if (patientKey == '2-2') {
  501. this.$router.push({
  502. path: '/patients/patient/' + this.id + '/dialysisRecord'
  503. })
  504. } else if (patientKey == '2-4') {
  505. this.$router.push({
  506. path: '/patients/patient/' + this.id + '/scheduling'
  507. })
  508. } else if (patientKey == '2-5') {
  509. this.$router.push({
  510. path: '/patients/patient/' + this.id + '/proeducation'
  511. })
  512. } else if (patientKey == '3-1') {
  513. this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
  514. }
  515. }else{
  516. this.treeKey = "1-1"
  517. }
  518. }else{
  519. this.treeKey = this.defaultActive
  520. }
  521. this.getList()
  522. },
  523. }
  524. </script>
  525. <style>
  526. .patient-menu .el-tree-node__content {
  527. font-size: 14px;
  528. height: 40px;
  529. font-weight: 400;
  530. }
  531. .patient-menu .el-tree-node__label:hover {
  532. color: #409eff;
  533. }
  534. .patient-menu .el-tree-node:focus > .el-tree-node__content {
  535. color: #409eff;
  536. }
  537. .patient-menu .el-tree-node .el-tree-node.is-current > .el-tree-node__content {
  538. color: #409eff;
  539. }
  540. .patient-menu .el-tree {
  541. background: #f6f8f9;
  542. }
  543. .patient-menu {
  544. -webkit-transition: width 0.28s;
  545. transition: width 0.28s;
  546. width: 180px !important;
  547. height: 100%;
  548. position: relative;
  549. font-size: 0px;
  550. top: 0;
  551. float: left;
  552. bottom: 0;
  553. left: 0;
  554. /* z-index: 99; */
  555. overflow: hidden;
  556. }
  557. .patient-center-menu .el-icon-arrow-down:before {
  558. content: "";
  559. }
  560. </style>