Department.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="department">
  3. <div class="departmentView">
  4. <div class="content">
  5. <div class="list" v-for="(item,index) in departmentLis" @click="goStart(index,item.recordTime)" :key="item.hospitalDeptName">
  6. <div class="top">
  7. <p>挂号科室:{{item.hospitalDeptName}} <img src="../images/right.png" alt=""></p>
  8. </div>
  9. <div class="main">
  10. <p>预约时间:{{item.recordTime}}</p>
  11. <p>姓名:{{item.patientName}}</p>
  12. <p>病历号:{{item.recordId}}</p>
  13. <p>挂号信息:{{item.registerNum}}</p>
  14. <p v-if="item.dided">您已完成过一次预问诊,是否再次录入</p>
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import {setScroll,compare} from '@utils/tools.js';
  23. import BScroll from 'better-scroll';
  24. export default {
  25. name: "Department",
  26. data(){
  27. return {
  28. scroll:null,
  29. departmentLis:[]
  30. }
  31. },
  32. created(){
  33. let tmpList = JSON.parse(localStorage.getItem('loginData'))
  34. let tmpTime = JSON.parse(localStorage.getItem('recordTime'))
  35. let sortArr = tmpList.sort(compare("recordTime"));
  36. if(tmpTime){
  37. for(let j = 0;j < tmpTime.length;j++){
  38. for(let i = 0;i < sortArr.length;i++){
  39. if(tmpTime[j] == (new Date((sortArr[i].recordTime).replace(/\-/g, "/"))).getTime()){
  40. sortArr[i].dided = 1
  41. }
  42. }
  43. }
  44. }
  45. this.departmentLis = sortArr
  46. },
  47. mounted(){
  48. this.$nextTick(()=>{
  49. let scroll = setScroll(BScroll,true,'.departmentView')
  50. this.scroll = scroll
  51. })
  52. },
  53. methods:{
  54. goStart(num,time){
  55. let msg = this.departmentLis[num]
  56. let params = {
  57. hospitalCode:msg.hospitalCode,
  58. hospitalDeptCode:msg.hospitalDeptCode,
  59. doctorCode:msg.doctorCode,
  60. patientCode:msg.patientCode,
  61. recordId:msg.recordId,
  62. time:(new Date(time.replace(/\-/g, "/"))).getTime()
  63. }
  64. localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入徐删除该参数
  65. this.$router.push({
  66. path:'/home',
  67. query:params
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="less" scoped>
  74. @import '../less/base.less';
  75. .department {
  76. font-size: .3rem;
  77. padding: .3rem 0 1rem 0;
  78. .departmentView {
  79. position: absolute;
  80. width: 100%;
  81. height: 100%;
  82. overflow: hidden;
  83. padding: 0 .3rem 1rem .3rem;
  84. box-sizing: border-box;
  85. .content {
  86. padding-bottom: 1rem;
  87. }
  88. .list {
  89. background:rgba(255,255,255,1);
  90. box-shadow:0px 3px 20px 0px rgba(192,187,224,0.23);
  91. border-radius:.1rem;
  92. overflow: hidden;
  93. margin-bottom: .3rem;
  94. }
  95. .top {
  96. height: 1rem;
  97. line-height: 1rem;
  98. background: url('../images/bg-title.png') 100% 100% no-repeat;
  99. padding: 0 .3rem;
  100. box-sizing: border-box;
  101. p {
  102. position: relative;
  103. color: #fff;
  104. img {
  105. position: absolute;
  106. right: 0;
  107. top: 50%;
  108. width: .4rem;
  109. height: .4rem;
  110. margin-top: -0.2rem;
  111. }
  112. }
  113. }
  114. .main {
  115. font-size: .28rem;
  116. padding: .3rem;
  117. p {
  118. line-height: .5rem;
  119. }
  120. }
  121. }
  122. }
  123. </style>