UsualSymptom.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <div class="usual-symptom">
  3. <p class="title-bar">
  4. <a href="javascript:void(0)" @click="back"><img src="../images/back.png" alt="返回"/></a>
  5. <span>您哪里不舒服?</span>
  6. </p>
  7. <ul class="radio-item clearfix">
  8. <li
  9. v-for="(item,idx) in symptoms"
  10. :class="[{'liSelect':item.select}]"
  11. :key="idx"
  12. @click="selectResult(item,idx)"
  13. >
  14. {{item.description||item.name}}
  15. <img src="../images/icon_que.png" alt="解释说明" @click.stop="showExplain(item)" v-if="item.explains"/>
  16. </li>
  17. </ul>
  18. <div class="searchWrap" @click="search(true)">
  19. <img class="searchImg" src="../images/search.png" alt="">
  20. <span class="placeholder">找不到?也可点击搜索症状...</span>
  21. </div>
  22. <Search
  23. v-if="this.$store.state.searchShow"
  24. @search="search"
  25. @showDetil="showDetil"
  26. ></Search>
  27. <Tiptoast :show="showExp" :data="message" @close="closeTip"/>
  28. <!-- <ConfirmBox :show="showConfirm" @confirmDialog="confirmDialog" @cancelDialog = "cancelDialog"></ConfirmBox> -->
  29. </div>
  30. </template>
  31. <script>
  32. import Radio from './Radio';
  33. import Search from '../components/Search.vue';
  34. // import ConfirmBox from '../common/ConfirmBox'
  35. import Tiptoast from '../common/Tiptoast.vue';
  36. import {mapState} from 'vuex';
  37. import api from '@utils/api.js';
  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. computed:{
  56. ...mapState({
  57. pathInfo: state => state.pathInfo,
  58. }),
  59. },
  60. methods:{
  61. back(){
  62. this.$router.go(-1);
  63. },
  64. showExplain(it){
  65. if(it.explains){
  66. this.message.title = it.description || it.name;
  67. this.message.text = it.explains;
  68. }else{
  69. this.message.title = "";
  70. this.message.text = "暂无资料";
  71. }
  72. this.showExp = true
  73. },
  74. closeTip(){
  75. this.showExp = false;
  76. this.message.title = '';
  77. this.message.text = '';
  78. },
  79. formatData(data){
  80. data.length=data.length>10?10:data.length;
  81. return data.map((i)=>{
  82. return Object.assign({},i,{
  83. name:i.name,
  84. value:i.questionId,
  85. special:'',
  86. connectId:[]
  87. })
  88. });
  89. },
  90. selectResult(item,idx){
  91. this.$emit('selectUsual',item,idx);
  92. this.$store.commit('setSearchShow', false);
  93. let obj = {
  94. "labelName": item.tagName,//标签名称
  95. "operationNum": 1,//次数
  96. "operationType": 1,//1常见2搜索
  97. }
  98. this.$store.commit('addBuriedSome', obj);
  99. },
  100. saveBuriedSome(){
  101. let params = {
  102. "doctorId": this.pathInfo.doctorId||'',
  103. "hospitalDeptId": this.pathInfo.hospitalDeptId||'',
  104. "hospitalId": this.pathInfo.hospitalDeptId||'',
  105. "inquiryCode": this.pathInfo.hospitalDeptId||'',
  106. "patientId": this.pathInfo.hospitalDeptId||'',
  107. "taggeds": [
  108. {
  109. "labelName": "string",//标签名称
  110. "operationNum": 0,//次数
  111. "operationType": "string",//1常见2搜索
  112. }
  113. ]
  114. }
  115. api.saveBuriedSome(params).then((res)=>{
  116. })
  117. },
  118. confirmDialog(){
  119. },
  120. cancelDialog(){
  121. },
  122. search(flag){
  123. this.$store.commit('setSearchShow', flag);
  124. },
  125. showDetil(item,flg) {//搜索点开的详情
  126. this.$emit('selectUsual',item,flg);
  127. this.$store.commit('setSearchShow', false);
  128. },
  129. },
  130. components:{
  131. Radio,
  132. // ConfirmBox,
  133. Search,
  134. Tiptoast
  135. }
  136. }
  137. </script>
  138. <style lang="less" scoped>
  139. @import "../less/base.less";
  140. .usual-symptom{
  141. position: fixed;
  142. bottom: 0;
  143. background: #fff;
  144. padding: .4rem .1rem;
  145. }
  146. .title-bar{
  147. font-size: .28rem;
  148. margin:0 0 .5rem .2rem;
  149. img{
  150. width: .16rem;
  151. margin-right:.4rem;
  152. }
  153. }
  154. .radio-item{
  155. li {
  156. padding: 0.14rem 0.2rem;
  157. border:1px #DFE0E4 solid;
  158. border-radius: 0.36rem;
  159. font-size: 0.26rem;
  160. margin: 0.15rem .65rem .15rem .15rem;
  161. float: left;
  162. color: #666;
  163. position: relative;
  164. img{
  165. width: .35rem;
  166. position: absolute;
  167. right: -0.55rem;
  168. }
  169. }
  170. .liSelect {
  171. color: #fff;
  172. background-color: #colors[btn];
  173. border-color: #colors[btn];
  174. }
  175. }
  176. .searchWrap {
  177. margin:1.2rem .2rem 0 .2rem;
  178. height: .68rem;
  179. line-height: .25rem;
  180. box-sizing: border-box;
  181. position: relative;
  182. background: #F5F5F5;
  183. border-radius: .32rem;
  184. padding-left:.7rem;
  185. color: #AAAAAA;
  186. .placeholder{
  187. font-size: .28rem;
  188. }
  189. .searchImg {
  190. width: 0.44rem;
  191. height: 0.44rem;
  192. position: absolute;
  193. left: .2rem;
  194. top: .1rem;
  195. }
  196. }
  197. </style>