DiagTreat.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="treat-wrap">
  3. <div v-for="(it,i) in dtoList"
  4. v-if="dtoList"
  5. :key="it.id"
  6. class="label">
  7. <p class="quest">{{i + 1 +'.' + (it.description||it.name)}}</p>
  8. <img class="questionImg" :src="it.url.replace('{imageUrlPrefix}',imgUrl)" v-if="it.url">
  9. <Label v-if="it.controlType==0"
  10. :item="it"
  11. :indx="i"
  12. :ppId="it.id"
  13. :moduleType="datas.type"
  14. @setDetail="setDetail"/>
  15. <!-- 上传图片 -->
  16. <UploadImg v-if="it.controlType==4"
  17. :item="it"
  18. :moduleType="datas.type"
  19. :imgList="imgs"
  20. />
  21. <!-- 输入框 -->
  22. <Input v-if="it.controlType==6 || it.controlType==7"
  23. :item="it"
  24. :key="it.id"
  25. @updata="updataData($event,it.id)"/>
  26. <!-- 文本域 -->
  27. <ComTextArea v-if="it.controlType == 5"
  28. :item="it"
  29. @updata="updataData($event,it.id)"/>
  30. <Radio v-if="it.controlType==1"
  31. :item="it"
  32. :key="it.id"
  33. @updata="updataData($event,it.id)"/>
  34. <CheckBox v-if="it.controlType==2"
  35. :item="it"
  36. :key="it.id"
  37. @updata="updataData($event,it.id)"/>
  38. </div>
  39. <div class="result" v-if="checkText.length>0">
  40. <p class="title">{{datas.name}}</p>
  41. <!-- <p v-for="(v,i) in checkText">{{v.text}}</p> -->
  42. <p>{{getText()}}</p>
  43. </div>
  44. <div class="foot" v-if="modluesLen==2">
  45. <span class="back" @click="beBack">{{'返回'+ preName}}</span>
  46. <span class="next" @click="toNext">{{'预览并提交病历'}}</span>
  47. </div>
  48. <div class="foot" v-else>
  49. <span class="back" @click="beBack">{{'返回'+ preName}}</span>
  50. <span class="next" @click="toNext">{{'进入'+ nextName}}</span>
  51. </div>
  52. <div class="detail" v-if="show">
  53. <DetailBox @close="closeDetal"
  54. :data="labelDetail"
  55. :moduleType="datas.type"
  56. :ppId="ppId"
  57. v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
  58. @pComplete="complete"/>
  59. </div>
  60. </div>
  61. </template>
  62. <script type="text/javascript">
  63. import UploadImg from '../common/UploadImg.vue';
  64. import Label from '../common/Label.vue';
  65. import DetailBox from './DetailBox.vue';
  66. import Input from '../common/Input.vue';
  67. import ComTextArea from '../common/ComTextArea.vue';
  68. import {moduleCP,patt,imageUrlPrefix} from '@utils/tools';
  69. import Radio from '../common/Radio.vue';
  70. import CheckBox from '../common/CheckBox.vue';
  71. export default {
  72. name:'DiagTreat',
  73. data(){
  74. let {origin,text,datas} = this.$store.state.diagnose;
  75. return{
  76. msg:"诊疗情况",
  77. imgs:this.$store.state.diagnose.imgSrc,
  78. // dtoList:origin, //模板数据
  79. dtoList:datas, //模板数据
  80. labelDetail:{}, //标签明细
  81. checkText:text, //选中的文字-Arr
  82. show:false,
  83. ppId:null,
  84. imgUrl:imageUrlPrefix,
  85. }
  86. },
  87. props:['datas','preName','nextName','modluesLen'],
  88. methods:{
  89. beBack(){
  90. this.$emit('back');
  91. },
  92. toNext(){
  93. if(this.modluesLen==2){
  94. this.$emit('next','preview')
  95. }else{
  96. this.$emit('next');
  97. }
  98. },
  99. setDetail(obj){
  100. this.labelDetail = obj.detail;
  101. this.ppId = obj.ppId;
  102. this.show = true;
  103. },
  104. complete(){
  105. this.show = false;
  106. this.labelDetail = {};
  107. this.ppId = null;
  108. // 处理明细选中的值
  109. },
  110. closeDetal(){
  111. this.show = false;
  112. this.labelDetail = {};
  113. this.ppId = null;
  114. },
  115. getText(){
  116. let textArr = this.checkText;
  117. let msg = "";
  118. for(let k in textArr){
  119. if(textArr[k].textP){
  120. msg += textArr[k].textP + ';'
  121. }
  122. }
  123. return msg;
  124. },
  125. updataData(data,id){//输入框存值
  126. let list = this.dtoList;
  127. for(let i in list){
  128. if(list[i].id==data.id){
  129. list.splice(i,1,data)
  130. }
  131. }
  132. this.$store.commit('setDatas',{type:moduleCP['diagT'],data:data,pId:data.id,ppId:id});
  133. this.$store.commit('setText',{type:moduleCP['diagT'],text:data.value.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),textP:data.valueP.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:data.id,flag:true});
  134. }
  135. },
  136. components:{
  137. UploadImg,
  138. Label,
  139. DetailBox,
  140. Input,
  141. ComTextArea,
  142. Radio,
  143. CheckBox
  144. },
  145. /*watch:{
  146. dtoList:{
  147. handler(newVal,oldVal){
  148. },
  149. deep:true
  150. }
  151. },*/
  152. }
  153. </script>
  154. <style lang="less" scoped>
  155. @import '../less/base.less';
  156. .treat-wrap{
  157. font-size: .3rem;
  158. .quest{
  159. color: #000;
  160. margin-bottom: .36rem;
  161. font-weight: 700;
  162. }
  163. .label{
  164. .label;
  165. /* img{
  166. width:.56rem;
  167. height: .74rem;
  168. vertical-align: top;
  169. } */
  170. }
  171. .result{
  172. .result;
  173. }
  174. }
  175. .foot{
  176. .dbfooter;
  177. }
  178. .detail{
  179. .mask;
  180. z-index: 66;
  181. }
  182. .footer{
  183. .footer;
  184. }
  185. .questionImg {
  186. width: 96%;
  187. }
  188. </style>