AddContent.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="symp-wrap addper">
  3. <div class="content">
  4. <div class="choose">
  5. <ul class="addPart">
  6. <li v-for="(item,idx) in dataTrd">
  7. <p class="question">{{idx+1 + '. ' +(item.description||item.name)}}</p>
  8. <img class="questionImg" :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
  9. <Radio v-if="item.controlType==1"
  10. :item="item"
  11. :key="item.id"
  12. @updata="updataData($event,idx,item)"/>
  13. <CheckBox v-if="item.controlType==2"
  14. :item="item"
  15. :key="item.id"
  16. @updata="updataData($event,idx,item)"/>
  17. <ComTextArea
  18. v-if="item.controlType == 5"
  19. :item="item"
  20. @updata="updataData($event,idx,item)"
  21. @changeAreaVal="changeAreaVal($event,idx)"
  22. ></ComTextArea>
  23. <Input v-if="item.controlType==6 || item.controlType==7"
  24. :item="item"
  25. :key="item.id"
  26. @updata="updataData($event,idx,item)"/>
  27. <template
  28. v-if="item.controlType == 3"
  29. v-for="(part,index) in item.questionDetailList"
  30. >
  31. <MultiLineInput
  32. v-if="item.controlType == 3"
  33. :msg="part.description||part.name"
  34. :part="part"
  35. @updata="updataData($event,index,item)"
  36. ></MultiLineInput>
  37. </template>
  38. </li>
  39. </ul>
  40. <div class="result" v-if="allStr">
  41. <p class="title">{{allMoudles.name}}</p>
  42. <p>{{allStr}}</p>
  43. </div>
  44. <div class="thanks">
  45. <p>感谢您的回答,您的病历已经自动生成。</p>
  46. <p>您可以点击预览并提交病历按钮预览病历。</p>
  47. <p>如果没有需要修改的内容,请点击提交,医生便能看到您的病历。</p>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="foot">
  52. <span class="back" @click="back">{{'返回'+ preName}}</span>
  53. <span class="next" @click="next">预览并提交病历</span>
  54. </div>
  55. </div>
  56. </template>
  57. <script type="text/javascript">
  58. import ComTextArea from '../common/ComTextArea.vue';
  59. import MultiLineInput from '../common/MultiLineInput.vue';
  60. import Input from '../common/Input.vue';
  61. import Radio from '../common/Radio.vue';
  62. import CheckBox from '../common/CheckBox.vue';
  63. import {imageUrlPrefix,getAllStr,setScroll} from '@utils/tools.js';
  64. import BScroll from 'better-scroll';
  65. export default {
  66. name: 'AddContent',
  67. props: ['allMoudles','preName'],
  68. data() {
  69. return {
  70. imgUrl:imageUrlPrefix,
  71. dataTrd: [],
  72. val: '',
  73. allStr:''
  74. }
  75. },
  76. created(){
  77. this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
  78. },
  79. mounted() {
  80. this.$nextTick(()=>{
  81. this.scroll = setScroll(BScroll,true,'.addper')
  82. })
  83. },
  84. methods: {
  85. back() {
  86. this.$emit("back");
  87. },
  88. changeAreaVal(value, idx) {
  89. this.val = value
  90. },
  91. next(){
  92. this.$store.commit('setText',{data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type});
  93. this.$emit('next','preview')
  94. },
  95. setDetail(obj){
  96. this.labelDetail = obj.detail;
  97. this.ppId = obj.ppId;
  98. this.show = true;
  99. },
  100. updateOrig(){
  101. let origin = this.$store.state.diagnose.origin;
  102. // this.dtoList = origin;console.log("更新:",origin)
  103. },
  104. updataData(data,idx,item){
  105. let mapping = this.dataTrd;
  106. let allData = this.$store.state.allMoudles;
  107. let tmpTrdData = allData.filter((item) => item.type == 52);
  108. // console.log(data,mapping,this.$store.state,999999)
  109. if(data.controlType == 3){//多行输入,多了一层需单独处理
  110. let tmpLis = item.questionDetailList;
  111. tmpLis.splice(idx,1,data);
  112. this.allStr=getAllStr({data:tmpTrdData&&tmpTrdData[0].moduleDetailDTOList,type:this.allMoudles&&this.allMoudles.type}).allStr;
  113. return;
  114. }
  115. for(let i in mapping){
  116. if(mapping[i].id==data.id){
  117. mapping.splice(i,1,data)
  118. }
  119. }
  120. // console.log(allData.filter((item) => item.type == 52))
  121. this.allStr=getAllStr({data:tmpTrdData&&tmpTrdData[0].moduleDetailDTOList,type:this.allMoudles&&this.allMoudles.type}).allStr
  122. this.$store.commit('setDataAll',{data:data,idx:idx});
  123. },
  124. },
  125. components: {
  126. ComTextArea,
  127. MultiLineInput,
  128. Input,
  129. Radio,
  130. CheckBox
  131. }
  132. }
  133. </script>
  134. <style lang="less" scoped>
  135. @import "../less/base.less";
  136. .questionImg {
  137. width: 100%;
  138. }
  139. .symp-wrap {
  140. font-size: 0.3rem;
  141. overflow: hidden;
  142. .content {
  143. // padding-right: .3rem;
  144. }
  145. .btscroll;
  146. h3 {
  147. color: #000;
  148. margin-bottom: 0.36rem;
  149. }
  150. }
  151. .choose {
  152. padding-bottom: 0.2rem;
  153. .addPart {
  154. li {
  155. margin-bottom: 0.1rem;
  156. clear: both;
  157. }
  158. .question {
  159. margin-bottom: 0.2rem;
  160. font-weight: bold;
  161. }
  162. }
  163. }
  164. .foot{
  165. .dbfooter;
  166. }
  167. .result{
  168. margin-bottom: .3rem;
  169. }
  170. .thanks {
  171. font-size: .28rem /* 28/100 */;
  172. color: #666666;
  173. letter-spacing: 0;
  174. text-align: justify;
  175. line-height: .48rem /* 48/100 */;
  176. }
  177. .label{
  178. .label;
  179. }
  180. </style>