UsualSymptom.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <portal to="notification-usual">
  3. <div class="usual-symptom" @touchmove.prevent>
  4. <p class="title-bar">
  5. <!--<a href="javascript:void(0)">--><img @click="back" src="../images/back.png" alt="返回"/><!--</a>-->
  6. <span>您哪里不舒服?</span>
  7. </p>
  8. <ul class="radio-item clearfix">
  9. <li
  10. v-for="(item,idx) in symptoms"
  11. :class="[{'liSelect':item.select,'big':item.explains}]"
  12. :key="idx"
  13. @click="selectResult(item,idx)"
  14. >
  15. {{item.description||item.name}}
  16. <img src="../images/icon_que.png" alt="解释说明" @click.stop="showExplain(item)" v-if="item.explains"/>
  17. </li>
  18. </ul>
  19. <div class="searchWrap" @click="search(true)">
  20. <img class="searchImg" src="../images/search.png" alt="">
  21. <span class="placeholder">找不到?也可点击搜索症状</span>
  22. </div>
  23. <Search
  24. v-if="this.$store.state.searchShow"
  25. @search="search"
  26. @showDetil="showDetil"
  27. ></Search>
  28. <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
  29. <!-- <ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox> -->
  30. </div>
  31. </portal>
  32. </template>
  33. <script>
  34. import Radio from './Radio';
  35. import Search from '../components/Search.vue';
  36. // import ConfirmBox from '../common/ConfirmBox'
  37. import Tiptoast from '../common/Tiptoast.vue';
  38. export default {
  39. name:'UsualSymptom',
  40. props:[],
  41. data(){
  42. const data = this.$store.state.usualSymptom;
  43. return {
  44. symptoms:this.formatData(data),
  45. portaled:false, //是否将radio渲染到最外层
  46. showConfirm:false,
  47. len:10, //显示常用症状个数
  48. showExp:false,
  49. message:{
  50. title:'',
  51. text:''
  52. },
  53. }
  54. },
  55. methods:{
  56. back(){
  57. this.$router.go(-1);
  58. },
  59. showExplain(it){
  60. if(it.explains){
  61. this.message.title = it.description || it.name;
  62. this.message.text = it.explains;
  63. }else{
  64. this.message.title = "";
  65. this.message.text = "暂无资料";
  66. }
  67. this.showExp = true
  68. },
  69. closeTip(){
  70. this.showExp = false;
  71. this.message.title = '';
  72. this.message.text = '';
  73. },
  74. formatData(data){
  75. data.length=data.length>10?10:data.length;
  76. return data.map((i)=>{
  77. return Object.assign({},i,{
  78. name:i.name,
  79. value:i.questionId,
  80. special:'',
  81. connectId:[]
  82. })
  83. });
  84. },
  85. selectResult(item,idx){
  86. this.$emit('selectUsual',item,idx);
  87. this.$store.commit('setSearchShow', false);
  88. this.$store.commit('setText', { type: 1, text: '患者出现'+item.name,textP: '患者出现'+(item.description||item.name),flag:true,arrFlag:true, pId: item.questionId,idx:1 });
  89. let obj = {
  90. "labelName": item.tagName||item.name,//标签名称
  91. "operationNum": 1,//次数
  92. "operationType": 1,//1常见2搜索
  93. }
  94. this.$store.commit('addBuriedSome', obj);
  95. },
  96. confirmDialog(){
  97. },
  98. cancelDialog(){
  99. },
  100. search(flag){
  101. this.$store.commit('setSearchShow', flag);
  102. },
  103. showDetil(item,flg) {//搜索点开的详情
  104. this.$emit('selectUsual',item,flg);
  105. this.$store.commit('setSearchShow', false);
  106. },
  107. },
  108. components:{
  109. Radio,
  110. // ConfirmBox,
  111. Search,
  112. Tiptoast
  113. }
  114. }
  115. </script>
  116. <style lang="less" scoped>
  117. @import "../less/base.less";
  118. .usual-symptom{
  119. position: fixed;
  120. bottom: 0;
  121. background: #fff;
  122. padding: .2rem .1rem;
  123. box-shadow: 0 0 30px -10px rgba(104, 124, 189, 0.25);
  124. }
  125. .title-bar{
  126. font-size: #font[title];
  127. overflow: hidden;
  128. img{
  129. width: .16rem;
  130. padding: .2rem .4rem .4rem .2rem;
  131. float: left;
  132. }
  133. span {
  134. padding-top: .1rem;
  135. float: left;
  136. }
  137. }
  138. .radio-item{
  139. li {
  140. padding: 0.14rem 0.2rem;
  141. border:1px #DFE0E4 solid;
  142. border-radius: 0.36rem;
  143. font-size: #font[select];
  144. margin: 0.15rem 0.12rem 0.15rem 0.15rem;
  145. float: left;
  146. color: #colors[text];
  147. position: relative;
  148. &.big{
  149. margin: 0.15rem .65rem .15rem .15rem;
  150. }
  151. img{
  152. width: .35rem;
  153. position: absolute;
  154. right: -0.55rem;
  155. }
  156. }
  157. .liSelect {
  158. color: #fff;
  159. background-color: #colors[btn];
  160. border-color: #colors[btn];
  161. }
  162. }
  163. .searchWrap {
  164. margin:.8rem .2rem 0 .2rem;
  165. height: .68rem;
  166. line-height: .25rem;
  167. box-sizing: border-box;
  168. position: relative;
  169. background: #F5F5F5;
  170. border-radius: .32rem;
  171. padding-left:.7rem;
  172. color: #AAAAAA;
  173. .placeholder{
  174. font-size: #font[placeholder];
  175. }
  176. .searchImg {
  177. width: 0.44rem;
  178. height: 0.44rem;
  179. position: absolute;
  180. left: .2rem;
  181. top: .1rem;
  182. }
  183. }
  184. </style>