Submit.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div>
  3. <div class="modalWrap"></div>
  4. <div
  5. v-if="showType=='success'"
  6. class="submitSuccess"
  7. >
  8. <img
  9. src="../images/complete.png"
  10. alt=""
  11. >
  12. <p class="success">{{msg}}</p>
  13. <p class="tip">{{tip}}</p>
  14. <span @click="goStart">完 成</span>
  15. </div>
  16. <div
  17. v-if="showType=='fail'"
  18. class="submitFail"
  19. >
  20. <p>{{fail}}</p>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. showType:{
  28. default:'',
  29. type:String
  30. },
  31. fail:{
  32. default:'提交失败请稍后再试',
  33. type:String
  34. }
  35. },
  36. data() {
  37. return {
  38. msg: '提交成功',
  39. tip: '您的病历信息已提交至医生问诊系统,点击完成按钮结束本次预问诊服务。'
  40. }
  41. },
  42. methods: {
  43. goStart() {
  44. // this.$store.commit('initAllData') //已在患者页进行初始化
  45. let scan = localStorage.getItem('scan');
  46. let params = JSON.parse(localStorage.getItem('infoParam'));
  47. let param = JSON.parse(localStorage.getItem('loginParam'));
  48. let data = JSON.parse(localStorage.getItem('loginData'));
  49. let tmpArr = localStorage.getItem('recordTime')
  50. let tmpTime = tmpArr&&Array.isArray(JSON.parse(tmpArr))?JSON.parse(tmpArr):[];
  51. if(!scan){
  52. if(data.length>1){
  53. this.$router.replace({path:'/department'});
  54. }else{
  55. this.$router.replace({path:'/home',query:param});
  56. }
  57. tmpTime.push(param.time)
  58. localStorage.setItem('recordTime',JSON.stringify(tmpTime))
  59. }else{
  60. this.$router.replace({path:'/home',query:Object.assign({}, params,{scan:true})});
  61. tmpTime.push(params.time)
  62. localStorage.setItem('recordTime',JSON.stringify(tmpTime))
  63. }
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="less" scoped>
  69. @import "../less/base.less";
  70. .modalWrap {
  71. .mask;
  72. position: fixed;
  73. top: 0;
  74. left: 0;
  75. width: 100%;
  76. z-index: 999;
  77. height: 100%;
  78. }
  79. .submitSuccess {
  80. width: 6rem;
  81. height: 7rem;
  82. background: #fff;
  83. z-index: 999;
  84. position: fixed;
  85. top: 50%;
  86. left: 50%;
  87. transform: translate(-50%, -50%);
  88. padding: 0.8rem 0.5rem 0.5rem 0.5rem;
  89. box-sizing: border-box;
  90. border-radius: 0.2rem;
  91. text-align: center;
  92. img {
  93. width: 1.28rem;
  94. height: 1.28rem;
  95. }
  96. .success {
  97. font-size: 0.36rem;
  98. color: #333333;
  99. font-weight: bold;
  100. margin-top: 0.5rem;
  101. margin-bottom: 0.24rem;
  102. }
  103. .tip {
  104. font-size: 0.24rem;
  105. color: #666666;
  106. line-height: 0.44rem;
  107. margin-bottom: 1.2rem;
  108. }
  109. span {
  110. width: 4.9rem;
  111. height: 0.88rem;
  112. line-height: 0.88rem;
  113. font-size: 0.32rem;
  114. color: #ffffff;
  115. font-weight: bold;
  116. display: inline-block;
  117. background: -webkit-gradient(
  118. linear,
  119. right top,
  120. left top,
  121. from(#4f8bff),
  122. to(#4f4fff)
  123. );
  124. background: -webkit-linear-gradient(right, #4f8bff, #4f4fff);
  125. box-shadow: 0 0.12rem 0.24rem 0 rgba(79, 129, 255, 0.4);
  126. border-radius: 0.44rem;
  127. }
  128. }
  129. .submitFail {
  130. width: 6rem;
  131. height: 0.88rem;
  132. font-size:.3rem;
  133. line-height: 0.88rem;
  134. z-index: 999;
  135. position: absolute;
  136. top: 50%;
  137. left: 50%;
  138. transform: translate(-50%, -50%);
  139. box-sizing: border-box;
  140. border-radius: 0.2rem;
  141. text-align: center;
  142. background-color: #fff;
  143. }
  144. </style>