Others.vue 6.1 KB

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