Submit.vue 3.3 KB

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