123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- <template>
- <div class="symp-wrap addper">
- <div class="content">
- <div class="choose">
- <ul class="addPart">
- <li v-for="(item,idx) in dataTrd">
- <p class="question">{{idx+1 + '. ' +(item.description||item.name)}}</p>
- <img class="questionImg" :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
- <Radio v-if="item.controlType==1"
- :item="item"
- :key="item.id"
- @updata="updataData($event,idx,item)"/>
- <CheckBox v-if="item.controlType==2"
- :item="item"
- :key="item.id"
- @updata="updataData($event,idx,item)"/>
- <ComTextArea
- v-if="item.controlType == 5"
- :item="item"
- @updata="updataData($event,idx,item)"
- @changeAreaVal="changeAreaVal($event,idx)"
- ></ComTextArea>
- <Input v-if="item.controlType==6 || item.controlType==7"
- :item="item"
- :key="item.id"
- @updata="updataData($event,idx,item)"/>
- <template
- v-if="item.controlType == 3"
- v-for="(part,index) in item.questionDetailList"
- >
- <MultiLineInput
- v-if="item.controlType == 3"
- :msg="part.description||part.name"
- :part="part"
- @updata="updataData($event,index,item)"
- ></MultiLineInput>
- </template>
- </li>
- </ul>
- <div class="result" v-if="allStr">
- <p class="title">{{allMoudles.name}}</p>
- <p>{{allStr}}</p>
- </div>
- <div class="thanks">
- <p>感谢您的回答,您的病历已经自动生成。</p>
- <p>您可以点击预览并提交病历按钮预览病历。</p>
- <p>如果没有需要修改的内容,请点击提交,医生便能看到您的病历。</p>
- </div>
- </div>
- </div>
- <div class="foot">
- <span class="back" @click="back">{{'返回'+ preName}}</span>
- <span class="next" @click="next">预览并提交病历</span>
- </div>
- </div>
- </template>
- <script type="text/javascript">
- import ComTextArea from '../common/ComTextArea.vue';
- import MultiLineInput from '../common/MultiLineInput.vue';
- import Input from '../common/Input.vue';
- import Radio from '../common/Radio.vue';
- import CheckBox from '../common/CheckBox.vue';
- import {imageUrlPrefix,getAllStr,setScroll} from '@utils/tools.js';
- import BScroll from 'better-scroll';
- export default {
- name: 'AddContent',
- props: ['allMoudles','preName'],
- data() {
- return {
- imgUrl:imageUrlPrefix,
- dataTrd: [],
- val: '',
- allStr:'',
- scroll:null
- }
- },
- created(){
- this.dataTrd = this.allMoudles && this.allMoudles.moduleDetailDTOList
- },
- mounted() {
- this.$nextTick(()=>{
- let scroll = setScroll(BScroll,true,'.addper')
- this.scroll = scroll
- scroll.on('scroll', this.onScroll)
- })
- },
- methods: {
- onScroll() {
- document.activeElement.scrollIntoViewIfNeeded(true);
- },
- back() {
- this.$emit("back");
- },
- changeAreaVal(value, idx) {
- this.val = value
- },
- next(){
- this.$store.commit('setText',{data:this.dataTrd,type:this.allMoudles&&this.allMoudles.type});
- this.$emit('next','preview')
- },
- setDetail(obj){
- this.labelDetail = obj.detail;
- this.ppId = obj.ppId;
- this.show = true;
- },
- updateOrig(){
- let origin = this.$store.state.diagnose.origin;
- // this.dtoList = origin;console.log("更新:",origin)
- },
- updataData(data,idx,item){
- let mapping = this.dataTrd;
- let allData = this.$store.state.allMoudles;
- let tmpTrdData = allData.filter((item) => item.type == 52);
- if(data.controlType == 3){//多行输入,多了一层需单独处理
- let tmpLis = item.questionDetailList;
- tmpLis.splice(idx,1,data);
- this.allStr=getAllStr({data:tmpTrdData&&tmpTrdData[0].moduleDetailDTOList,type:this.allMoudles&&this.allMoudles.type}).allStr;
- }else{
- for(let i in mapping){
- if(mapping[i].id==data.id){
- mapping.splice(i,1,data)
- }
- }
- this.allStr=getAllStr({data:tmpTrdData&&tmpTrdData[0].moduleDetailDTOList,type:this.allMoudles&&this.allMoudles.type}).allStr
- this.$store.commit('setDataAll',{data:data,idx:idx});
- }
- this.$nextTick(()=>{
- this.scroll.refresh()
- })
- },
- },
- components: {
- ComTextArea,
- MultiLineInput,
- Input,
- Radio,
- CheckBox
- }
- }
- </script>
- <style lang="less" scoped>
- @import "../less/base.less";
- .questionImg {
- width: 100%;
- }
- .symp-wrap {
- font-size: 0.3rem;
- overflow: hidden;
- .content {
- // padding-right: .3rem;
- }
- .btscroll;
- h3 {
- color: #000;
- margin-bottom: 0.36rem;
- }
- }
- .choose {
- padding-bottom: 0.2rem;
- .addPart {
- li {
- margin-bottom: 0.1rem;
- clear: both;
- }
- .question {
- margin-bottom: 0.2rem;
- font-weight: bold;
- }
- }
- }
- .foot{
- .dbfooter;
- }
-
- .result{
- margin-bottom: .3rem;
- }
- .thanks {
- font-size: .28rem /* 28/100 */;
- color: #666666;
- letter-spacing: 0;
- text-align: justify;
- line-height: .48rem /* 48/100 */;
- }
- .label{
- .label;
- }
- </style>
|