Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

PatientSidebar.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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-2',
  101. label: '病程管理'
  102. },
  103. {
  104. name: '1-9',
  105. label: '阶段小结'
  106. },
  107. {
  108. name: '1-10',
  109. label: '出院小结'
  110. },
  111. {
  112. name: '1-3',
  113. label: '检验检查'
  114. },
  115. {
  116. name:'1-8',
  117. label:'传染病管理'
  118. },
  119. {
  120. name: '1-5',
  121. label: '抢救记录'
  122. },
  123. {
  124. name: '1-11',
  125. label: '首次病程记录'
  126. }
  127. ]
  128. },
  129. {
  130. name: '2',
  131. label: '透析管理',
  132. children: [
  133. {
  134. name: '2-1',
  135. label: '长期透析处方'
  136. },
  137. {
  138. name: '2-2',
  139. label: '透析记录'
  140. },
  141. {
  142. name: '2-4',
  143. label: '排班信息'
  144. },
  145. {
  146. name: '2-5',
  147. label: '宣教信息'
  148. }
  149. ]
  150. }
  151. ],
  152. name:""
  153. }
  154. },
  155. methods: {
  156. handleNodeClick(data) {
  157. var name = data.name
  158. this.name = data.name
  159. window.sessionStorage.setItem('patientKey',data.name)
  160. if (name == '1-1') {
  161. this.$router.push({ path: '/patients/patient/' + this.id })
  162. } else if (name == '1-2') {
  163. this.$router.push({ path: '/patients/course?id=' + this.id })
  164. } else if (name == '1-3') {
  165. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  166. } else if (name == '1-4') {
  167. this.$router.push({
  168. path: '/patients/patient/' + this.id + '/doctorAdvice'
  169. })
  170. } else if (name == '1-6') {
  171. this.$router.push({
  172. path: '/patients/patient/' + this.id + '/dryWeight'
  173. })
  174. } else if (name == '1-5') {
  175. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  176. } else if (name == '2-1') {
  177. this.$router.push({
  178. path: '/patients/patient/' + this.id + '/dialysisSolution'
  179. })
  180. } else if (name == '2-2') {
  181. this.$router.push({
  182. path: '/patients/patient/' + this.id + '/dialysisRecord'
  183. })
  184. } else if (name == '2-4') {
  185. this.$router.push({
  186. path: '/patients/patient/' + this.id + '/scheduling'
  187. })
  188. } else if (name == '2-5') {
  189. this.$router.push({
  190. path: '/patients/patient/' + this.id + '/proeducation'
  191. })
  192. }else if (name == '1-7'){
  193. this.$router.push({path:'/patients/patient/'+this.id+'/vascularAccess'})
  194. }else if (name == '1-8'){
  195. this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
  196. }else if (name == '1-9'){
  197. this.$router.push({path:'/patient/patient/'+this.id+'/templateSummary'})
  198. }else if(name == '1-10'){
  199. this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
  200. }else if(name == '1-11'){
  201. this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
  202. }
  203. },
  204. changePatient(value) {
  205. console.log(value)
  206. if(this.$route.path.indexOf('edit') > -1){
  207. this.$confirm('是否保存当前病历', '保存', {
  208. confirmButtonText: '确 定',
  209. cancelButtonText: '取 消',
  210. type: 'warning'
  211. }).then(() => {
  212. this.$emit('updateInfo')
  213. setTimeout(() => {
  214. this.$router.push('/patients/patient/' + value)
  215. },1000)
  216. }).catch(() => {
  217. this.$router.push('/patients/patient/' + value)
  218. })
  219. }else{
  220. this.$router.push('/patients/patient/' + value)
  221. }
  222. },
  223. getList() {
  224. fetchAllList().then(response => {
  225. if (response.data.state == 1) {
  226. this.patientsList = response.data.data.patients
  227. var len = this.patientsList.length
  228. if (len > 0) {
  229. for (let index = 0; index < len; index++) {
  230. if (this.patientsList[index].id == this.id) {
  231. this.currentPatient = this.patientsList[index]
  232. // console.log("curr", this.currentPatient);
  233. this.selectID = this.patientsList[index].id
  234. this.$emit('tran-patient', this.currentPatient)
  235. break
  236. }
  237. }
  238. }
  239. }
  240. })
  241. },
  242. tranAge(birthday) {
  243. var birth = uParseTime(birthday, '{y}-{m}-{d}')
  244. return jsGetAge(birth, '-')
  245. },
  246. tranSex(gender) {
  247. var sex = '未知'
  248. switch (gender) {
  249. case 1:
  250. sex = '男'
  251. break
  252. case 2:
  253. sex = '女'
  254. break
  255. default:
  256. break
  257. }
  258. return sex
  259. },
  260. querySearchAsync(keyword, cb) {
  261. let key = ''
  262. if (keyword != undefined) {
  263. key = keyword
  264. }
  265. let searchArray = []
  266. PostSearch(key).then(response => {
  267. if (response.data.state == 1) {
  268. searchArray = response.data.data.patient
  269. cb(searchArray)
  270. } else {
  271. this.$message.error(response.data.msg)
  272. cb([])
  273. }
  274. })
  275. },
  276. handleSelect(val) {
  277. this.$router.push('/patients/patient/' + val.id)
  278. },
  279. getAge: function(val) {
  280. if (val.id_card_no == undefined) {
  281. return false
  282. }
  283. var thisLen = val.id_card_no.length
  284. var birth = ''
  285. if (thisLen == 15) {
  286. birth = '19' + val.id_card_no.substr(6, 6)
  287. } else {
  288. birth = val.id_card_no.substr(6, 8)
  289. }
  290. var birthtwo =
  291. birth.substr(0, 4) +
  292. '-' +
  293. birth.substr(4, 2) +
  294. '-' +
  295. birth.substr(6, 2)
  296. var age = jsGetAge(birthtwo, '-')
  297. return age
  298. }
  299. },
  300. created() {
  301. var patientKey = window.sessionStorage.getItem('patientKey')
  302. console.log("patient",patientKey)
  303. var query = this.$route.path
  304. console.log("query",this.$route.path)
  305. if(patientKey){
  306. this.treeKey = patientKey
  307. if(query.indexOf('edit') == -1){
  308. if (patientKey == '1-1') {
  309. this.$router.push({ path: '/patients/patient/' + this.id })
  310. } else if (patientKey == '1-2') {
  311. this.$router.push({ path: '/patients/course?id=' + this.id })
  312. } else if (patientKey == '1-3') {
  313. this.$router.push({ path: '/patients/inspection?id=' + this.id })
  314. } else if (patientKey == '1-4') {
  315. this.$router.push({
  316. path: '/patients/patient/' + this.id + '/doctorAdvice'
  317. })
  318. } else if (patientKey == '1-6') {
  319. this.$router.push({
  320. path: '/patients/patient/' + this.id + '/dryWeight'
  321. })
  322. }else if(patientKey == '1-11'){
  323. this.$router.push({
  324. path: '/patients/patient/' + this.id + '/firstDisease'
  325. })
  326. }
  327. else if (patientKey == '1-5') {
  328. this.$router.push({ path: '/patients/rescue?id=' + this.id })
  329. }else if (patientKey == '2-1') {
  330. this.$router.push({
  331. path: '/patients/patient/' + this.id + '/dialysisSolution'
  332. })
  333. } else if (patientKey == '2-2') {
  334. this.$router.push({
  335. path: '/patients/patient/' + this.id + '/dialysisRecord'
  336. })
  337. } else if (patientKey == '2-4') {
  338. this.$router.push({
  339. path: '/patients/patient/' + this.id + '/scheduling'
  340. })
  341. } else if (patientKey == '2-5') {
  342. this.$router.push({
  343. path: '/patients/patient/' + this.id + '/proeducation'
  344. })
  345. }
  346. }else{
  347. this.treeKey = "1-1"
  348. }
  349. }else{
  350. this.treeKey = this.defaultActive
  351. }
  352. this.getList()
  353. },
  354. }
  355. </script>
  356. <style>
  357. .patient-menu .el-tree-node__content {
  358. font-size: 14px;
  359. height: 40px;
  360. font-weight: 400;
  361. }
  362. .patient-menu .el-tree-node__label:hover {
  363. color: #409eff;
  364. }
  365. .patient-menu .el-tree-node:focus > .el-tree-node__content {
  366. color: #409eff;
  367. }
  368. .patient-menu .el-tree-node .el-tree-node.is-current > .el-tree-node__content {
  369. color: #409eff;
  370. }
  371. .patient-menu .el-tree {
  372. background: #f6f8f9;
  373. }
  374. .patient-menu {
  375. -webkit-transition: width 0.28s;
  376. transition: width 0.28s;
  377. width: 180px !important;
  378. height: 100%;
  379. position: relative;
  380. font-size: 0px;
  381. top: 0;
  382. float: left;
  383. bottom: 0;
  384. left: 0;
  385. /* z-index: 99; */
  386. overflow: hidden;
  387. }
  388. .patient-center-menu .el-icon-arrow-down:before {
  389. content: "";
  390. }
  391. </style>