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.recordTime">
  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. .department {
  75. font-size: .3rem;
  76. padding: .3rem 0 1rem 0;
  77. .departmentView {
  78. position: absolute;
  79. width: 100%;
  80. height: 100%;
  81. overflow: hidden;
  82. padding: 0 .3rem 1rem .3rem;
  83. box-sizing: border-box;
  84. .content {
  85. padding-bottom: 1rem;
  86. }
  87. .list {
  88. background:rgba(255,255,255,1);
  89. box-shadow:0px 3px 15px 0px rgba(217,217,217,0.5);
  90. border-radius:.1rem;
  91. overflow: hidden;
  92. margin-bottom: .3rem;
  93. }
  94. .top {
  95. height: 1rem;
  96. line-height: 1rem;
  97. background: url('../images/bg-title.png') 100% 100% no-repeat;
  98. padding: 0 .3rem;
  99. box-sizing: border-box;
  100. p {
  101. position: relative;
  102. color: #fff;
  103. img {
  104. position: absolute;
  105. right: 0;
  106. top: 50%;
  107. width: .4rem;
  108. height: .4rem;
  109. margin-top: -0.2rem;
  110. }
  111. }
  112. }
  113. .main {
  114. font-size: .28rem;
  115. padding: .3rem;
  116. p {
  117. line-height: .5rem;
  118. }
  119. }
  120. }
  121. }
  122. </style>