Browse Source

Merge branch 'dev' into byll

Luolei 5 years ago
parent
commit
1fe1910a2a

+ 2 - 2
build/webpack.dev.conf.js

@@ -33,8 +33,8 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     contentBase: false, // since we use CopyWebpackPlugin.
     compress: true,
     // host: HOST || config.dev.host,
-    // host: '192.168.3.6'/,
-    host: '192.168.3.126',
+    host: '192.168.3.6',
+    // host: '192.168.3.126',
     port: PORT || config.dev.port,
     open: config.dev.autoOpenBrowser,
     overlay: config.dev.errorOverlay

+ 74 - 10
src/common/CheckBox.vue

@@ -3,14 +3,24 @@
     <img :src="datas.url.replace('{imageUrlPrefix}',imgUrl)" v-if="datas.url">
     <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index)">
       <img :src="it.select==1?check:defaultPic">
-      <span :class="{'check':it.select==1}">{{it.name}}</span>
+      <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
+      <span v-if="(it.name.indexOf('${'))==-1" :class="[{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusion !== exclusion}]">{{it.name}}</span>
+      <MultiLineInput v-else 
+          @handleInp="inpVal($event,index)"
+          :msg="it.name" 
+          :part="it"
+          :border="false" 
+          :inline="true" 
+          :select="it.select==1" 
+          />
     </p>
   </div>
 </template>
 <script type="text/javascript">
 import tools from '@utils/tools.js';
-import icon from '../images/check-default.png'
-import checkIcon from '../images/check.png'
+import icon from '../images/check-default.png';
+import checkIcon from '../images/check.png';
+import MultiLineInput from '../common/MultiLineInput.vue';
   export default{
     name:'CheckBox',
     data(){
@@ -19,39 +29,89 @@ import checkIcon from '../images/check.png'
         defaultPic:icon,
         check:checkIcon,
         datas:{},
-        checkTxt:[]
+        exclusion:999 //互斥
       }
     },
     props:['item'],
     created(){
       // this.datas = JSON.parse(JSON.stringify(this.item));
       this.datas = this.item;
+      this.resetExc();
     },
     methods:{
       handleClick(it,index){
         const list = this.datas;
         let data = list.questionDetailList&&list.questionDetailList.slice(0);
-        let value = "";
+        // 处理互斥
+        const excluArr = data.filter(it=>it.exclusion==1);
+        const filArr = data.filter(it=>it.select==1);
+        if(excluArr.length>0){//有互斥
+          if(filArr.length>0){//有选中
+            if(it.exclusion !== filArr[0].exclusion){
+              return
+            }
+          }
+          this.exclusion = it.exclusion;  
+        }
+        // 处理选中状态
         if(data[index].select){
           data[index].select = 0;
-          this.checkTxt.splice(index,1);
         }else{
           data[index].select = 1;
-          this.checkTxt[index] = data[index].name;
+          this.exclusion = it.exclusion;
+        }
+        // 处理取消-互斥
+        const filArr1 = data.filter(it=>it.select==1);
+        if(excluArr.length>0){//有互斥
+          if(filArr1.length==0){//无选中
+            this.exclusion = 999;
+          }else{
+            this.exclusion = filArr1[0].exclusion;
+          }
+        }
+        let value = "";
+        for(let k in data){
+          if(data[k].select==1){
+            value += data[k].name + ','
+          }
         }
-        value = this.checkTxt.filter(item=>item).join(',');
-        const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value})
+        const newData = Object.assign({},this.datas,{questionDetailList:data},{value:value?value.substring(0,value.length-1):''})
         this.$emit("updata",newData);
+      },
+      inpVal(val,index){//输入框失焦处理
+        let valueStr = this.datas.value;
+        let patt = /\$\{[^\]]+\}/g;
+        let newVal =  val;
+        const str = valueStr.replace(patt,newVal);
+        this.datas.value = str;
+        // 输入框回读
+        let detailList = this.datas.questionDetailList;
+        let currItem = detailList[index];
+        currItem.value = val;
+        this.$emit("updata",this.datas);
+      },
+      resetExc(){
+        // 回读互斥项标识
+        const arr = this.datas.questionDetailList;
+        const filArr = arr.filter(it=>it.select==1);
+        if(filArr.length > 0){
+          this.exclusion = filArr[0].exclusion;
+        }else{
+          this.exclusion = 999;
+        }
       }
     },
     watch:{
       item:{
         handler(newVal,oldVal){
           this.datas = JSON.parse(JSON.stringify(newVal));
-          // this.$forceUpdate();
+          this.resetExc();
         },
         deep:true
       }
+    },
+    components:{
+      MultiLineInput
     }
   }
 </script>
@@ -65,6 +125,7 @@ import checkIcon from '../images/check.png'
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
+      white-space: nowrap;
       img{
         width: .38rem;
         vertical-align: middle;
@@ -73,5 +134,8 @@ import checkIcon from '../images/check.png'
     .check{
       color: #4F50FF;
     }
+    .exclu{
+      color:#e6e7e9;
+    }
   }
 </style>

+ 5 - 5
src/common/ComTextArea.vue

@@ -23,9 +23,6 @@ export default {
     item:{
       type:Object,
       require: true
-    },
-    uFlag:{
-      type:Boolean
     }
   },
   data() {
@@ -44,8 +41,11 @@ export default {
     }
   },
   watch:{
-    uFlag(newVal,oldVal){//清空时更新数据
-      this.txt = this.item.value;
+    item:{//清空时更新数据
+      handler(newVal,oldVal){
+        this.txt = newVal.value;
+      },
+      deep:true
     }
   }
 }

+ 6 - 3
src/common/Input.vue

@@ -17,7 +17,7 @@
         borColor:false
       }
     },
-    props:['item','uFlag'],
+    props:['item'],
     methods:{
       changeVal(){
         this.borColor = true;
@@ -29,8 +29,11 @@
       }
     },
     watch:{
-      uFlag(newVal,oldVal){
-        this.val = this.item.value;
+      item:{
+        handler(newVal,oldVal){
+          this.val = newVal.value;
+        },
+        deep:true
       }
     }
   }

+ 56 - 13
src/common/Label.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="label-wrap" v-if="item">
-    <span v-for="(it,index) in datas.questionMapping" :key="it.id" :class="['symp',{'check':it.select==1}]" @click="handleClick(it,index)">
+    <span v-for="(it,index) in datas.questionMapping" :key="it.id" :class="['symp',{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusionType !== exclusion}]" @click="handleClick(it,index)">
       <i>{{it.name}}</i>
       <i v-if="it.select==1" @click="deletSymp($event,it,index)"><img src="../images/delete.png" alt=""></i>
     </span>
@@ -20,20 +20,36 @@ import Toast from '../common/Toast.vue';
         checkTxt:[],
         showToast:false,
         delText:"是否取消当前选中内容?",
-        tempItem:{}
+        tempItem:{},
+        exclusion:999 //互斥
       }
     },
     props:['item','moduleType','ppId'],
     created(){
-      this.datas = JSON.parse(JSON.stringify(this.item));
+      this.datas = this.item;
+      // 回读互斥项标识
+      const arr = this.datas.questionMapping;
+      const filArr = arr.filter(it=>it.select==1);
+      if(filArr.length > 0){
+        this.exclusion = filArr[0].exclusionType;
+      }
     },
     components:{
       Toast
     },
     methods:{
       handleClick(it,index){
-        // store更新数据
-        // this.$emit('updateOrig');
+        const arr = this.datas.questionMapping;
+        const excluArr = arr.filter(it=>it.exclusionType==1);
+        const filArr = arr.filter(it=>it.select==1);
+        if(excluArr.length>0){//有互斥
+          if(filArr.length>0){//有选中
+            if(it.exclusionType !== filArr[0].exclusionType){
+              return
+            }
+          }
+          this.exclusion = it.exclusionType;
+        }
         const newItem = Object.assign({},it,{select:1});
         const origMapping = this.item.questionMapping;
         let mapping = this.datas.questionMapping;
@@ -43,7 +59,7 @@ import Toast from '../common/Toast.vue';
           }
         }
         // 存值到store
-        this.$store.commit('setOrigin',{type:this.moduleType,data:newItem,pId:this.datas.id});
+        this.$store.commit('setDatas',{type:this.moduleType,data:newItem,pId:this.datas.id,ppId:this.ppId});
         this.$store.commit('setText',{type:this.moduleType,text:it.name,pId:it.id});
         if(it.questionMapping&&it.questionMapping.length>0){//有明细
           this.$emit("setDetail",{detail:it,ppId:this.ppId})
@@ -56,15 +72,39 @@ import Toast from '../common/Toast.vue';
       },
       comfirnDel(){
         const temp = this.tempItem;
-        const newItem = Object.assign({},temp,{select:0});
-        const origMapping = this.item.questionMapping;
-        let mapping = this.datas.questionMapping;
-        for(let i in origMapping){
-          if(origMapping[i].id==temp.id){
-            mapping.splice(i,1,newItem)
+        // 从store中取origin的值
+        let origin,newItem;
+        if(this.moduleType==2){
+          origin = this.$store.state.diagnose.origin
+        }else if(this.moduleType == 3){
+          origin = this.$store.state.others.origin
+        }
+        if(origin){
+          for(let i in origin){
+            if(origin[i].id==this.ppId){
+              let origItem = origin[i].questionMapping;
+              for(let j in origItem){
+                if(origItem[j].id==temp.id){
+                  newItem = origItem[j];
+                }
+              }
+            }
+          }
+          let mapping = this.datas.questionMapping;
+          for(let n in mapping){
+            if(mapping[n].id==temp.id){
+              mapping.splice(n,1,newItem)
+            }
           }
         }
-        this.$store.commit('setOrigin',{type:this.moduleType,data:newItem,pId:this.datas.id});
+        // 是否解除互斥
+        const arr = this.datas.questionMapping;
+        const filArr = arr.filter(it=>it.select==1);
+        if(filArr.length==0){
+          this.exclusion = 999;
+        }
+        //存值
+        this.$store.commit('setDatas',{type:this.moduleType,data:newItem,pId:this.datas.id,ppId:this.ppId});
         this.$store.commit('delText',{type:this.moduleType,pId:temp.id});
         this.cancelDel();
       },
@@ -107,6 +147,9 @@ import Toast from '../common/Toast.vue';
       box-shadow: 0 .08rem .16rem 0 rgba(79,129,255,0.40);
       padding-right: 0.57rem;
     }
+    .exclu{
+      background:#f0f1f5;
+    }
   }
   
 </style>

+ 10 - 7
src/common/MultiLineInput.vue

@@ -34,16 +34,11 @@ export default {
       default:false,
       type:Boolean
     },
-    value:{ //回读的值
-      default:'',
-      type:String
-    }
   },
   data(){
     return {
       content:{},
       txt:this.part.value || '', //回读用
-      val:this.value
     }
   },
   mounted(){
@@ -51,14 +46,22 @@ export default {
   },
   methods:{
     changeVal(){
-      this.$emit('changeMultipVal',this.txt)
+      // this.$emit('changeMultipVal',this.txt)
     },
     blur(){
       const newData = Object.assign({},this.part,{value:this.txt,controlType:3});
       this.$emit("updata",newData);
       this.$emit('handleInp',this.txt);
     }
-  }
+  },
+  watch:{
+      part:{//清空时更新
+        handler(newVal,oldVal){
+          this.txt = newVal.value;
+        },
+        deep:true
+      }
+    },
 }
 </script>
 <style lang="less" scoped>

+ 4 - 8
src/common/Radio.vue

@@ -6,11 +6,9 @@
       <!-- <span :class="{'check':it.select==1}">{{it.name}}</span> -->
       <span v-if="(it.name.indexOf('${'))==-1" :class="{'check':it.select==1}">{{it.name}}</span>
       <MultiLineInput v-else 
-          @changeMultipVal="changeMultipVal($event,index)" 
           @handleInp="inpVal($event,index)"
           :msg="it.name" 
-          :part="it"
-          :value="it.value" 
+          :part="it" 
           :border="false" 
           :inline="true" 
           :select="it.select==1" 
@@ -55,18 +53,16 @@ import MultiLineInput from '../common/MultiLineInput.vue';
       inpVal(val,index){//输入框失焦处理
         let valueStr = this.datas.value;
         let patt = /\$\{[^\]]+\}/g;
-        let newVal = '{' + val + '}';//修改时替换值用
+        // let newVal = '{' + val + '}';//修改时替换值用
+        let newVal =  val;//修改时替换值用
         const str = valueStr.replace(patt,newVal);
         this.datas.value = str;
         // 输入框回读
         let detailList = this.datas.questionDetailList;
         let currItem = detailList[index];
-        currItem.value = val; //console.log('单选:',val,valueStr,str,this.datas)
+        currItem.value = val; 
         this.$emit("updata",this.datas);
       },
-      changeMultipVal(val){
-        // console.log('输入:',this.datas,val)
-      },
     },
     watch:{
       item:{

+ 1 - 7
src/components/AddContent.vue

@@ -21,7 +21,6 @@
           <Input v-if="item.controlType==6 || item.controlType==7"
             :item="item"
             :key="item.id"
-            :uFlag="uFlag"
             @updata="updataData"/>
           <template
             v-if="item.controlType == 3"
@@ -32,7 +31,6 @@
               :msg="part.name"
               :part="part"
               @updata="updataData($event,index,item)"
-              @changeMultipVal="changeMultipVal($event,idx)"
             ></MultiLineInput>
           </template>
         </li>
@@ -62,7 +60,6 @@ export default {
   data() {
     return {
       dataTrd: [],
-      uFlag:false,  //输入框触发更新
       val: ''
     }
   },
@@ -348,9 +345,6 @@ export default {
       // console.log(value,idx)
       this.val = value
     },
-    changeMultipVal(value, idx) {
-      // console.log(value, idx)
-    },
     next(){
       this.$store.commit('setText',{data:this.dataTrd,type:4});
       this.$emit('next','preview')
@@ -369,7 +363,7 @@ export default {
       if(data.controlType == 3){//多行输入,多了一层需单独处理
         let tmpLis = item.questionDetailList
         tmpLis.splice(idx,1,data)
-        console.log(this.dataTrd,7878)
+        // console.log(this.dataTrd,7878)
         // this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
         // this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:this.type,flag:true});
         return;

+ 15 - 13
src/components/Detail.vue

@@ -14,13 +14,11 @@
       <!-- 文本域 -->
       <ComTextArea v-if="item.controlType == 5"
             :item="item"
-            :uFlag="uFlag"
             @updata="updataData"/>
       <!-- 输入框 -->
       <Input v-if="item.controlType==6 || item.controlType==7"
             :item="item"
             :key="item.id"
-            :uFlag="uFlag"
             @updata="updataData"/>
     </div>
   </div>
@@ -36,7 +34,6 @@ import ComTextArea from '../common/ComTextArea.vue';
     data(){
       return{
         checkDatas:{},
-        uFlag:false,  //输入框触发更新
         finished:false
       }
     },
@@ -50,12 +47,6 @@ import ComTextArea from '../common/ComTextArea.vue';
       Input,
       ComTextArea
     },
-    /*beforeUpdate(){
-      console.log(3333,this.checkDatas)
-    },
-    updated(){
-      console.log(777)
-    },*/
     methods:{
       updataData(data){
         const origMapping = this.datas.questionMapping;
@@ -68,6 +59,7 @@ import ComTextArea from '../common/ComTextArea.vue';
       },
       saveData(){//存值
         this.finished = true;
+        this.checkDatas = Object.assign({},this.checkDatas,{select:1});
         const datas = this.checkDatas.questionMapping;
         let text = "";
         for(let i in datas){
@@ -75,10 +67,18 @@ import ComTextArea from '../common/ComTextArea.vue';
             text += datas[i].value+',';
           }
         }
-        // 替换占位符 {}
-        let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);
+        // let msg = this.checkDatas.name+ ',' + text.substring(0,text.length-1);
+        let msg = this.checkDatas.name+ ',' + text;
+        let newMsg = "";
+        if(msg[msg.length-1] == ','){
+          newMsg = msg.substring(0,msg.length-1);
+        }else{
+          newMsg = msg
+        }
+
         this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
-        this.$store.commit('setText',{text:msg.replace('{','').replace('}',''),pId:this.checkDatas.id,type:this.type,flag:true});
+        // flag是区分点开已选症状 未点完成
+        this.$store.commit('setText',{text:newMsg,pId:this.checkDatas.id,type:this.type,flag:true});
       },
       clearData(){//清空
         const datas = this.checkDatas.questionMapping;
@@ -88,6 +88,9 @@ import ComTextArea from '../common/ComTextArea.vue';
           if(detaiList.length>0){
             for(let k in detaiList){
               detaiList[k].select = 0;
+              if(detaiList[k].value){
+                detaiList[k].value = "";
+              }
             }
           }
         }
@@ -95,7 +98,6 @@ import ComTextArea from '../common/ComTextArea.vue';
         let msg = this.checkDatas.name;
         this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
         this.$store.commit('setText',{text:msg,pId:this.checkDatas.id,type:this.type,flag:true});
-        this.uFlag = !this.uFlag;
       }
     },
   }

+ 1 - 1
src/components/DetailBox.vue

@@ -123,6 +123,6 @@
   }
   @keyframes wave {
     0%   {height:0 ;}
-    100% {height: 95%;}
+    100% {height: 100%;}
   } 
 </style>

+ 6 - 23
src/components/DiagTreat.vue

@@ -10,8 +10,7 @@
               :indx="i" 
               :ppId="it.id" 
               :moduleType="datas.type" 
-              @setDetail="setDetail"
-              @updateOrig="updateOrig"/>
+              @setDetail="setDetail"/>
       <UploadImg v-if="it.controlType==4" 
             :item="it" 
             :moduleType="datas.type"
@@ -35,25 +34,21 @@
               v-if="labelDetail.questionMapping&&labelDetail.questionMapping.length>0"
               @pComplete="complete"/>
     </div>
-    <!-- <Toast :message="delText" 
-          :show="showToast"
-          @comfirn="comfirnDel" 
-          @cancel="cancelDel"/> -->
   </div>
 </template>
 <script type="text/javascript">
   import UploadImg from '../common/UploadImg.vue';
   import Label from '../common/Label.vue';
   import DetailBox from './DetailBox.vue';
-  import Toast from '../common/Toast.vue';
   export default {
     name:'DiagTreat',
     data(){
-      let {origin,text} = this.$store.state.diagnose;
+      let {origin,text,datas} = this.$store.state.diagnose;
       return{
         msg:"诊疗情况",
         imgs:this.$store.state.diagnose.imgSrc,
-        dtoList:origin, //模板数据
+        // dtoList:origin, //模板数据
+        dtoList:datas, //模板数据
         labelDetail:{}, //标签明细
         checkText:text, //选中的文字-Arr
         show:false,
@@ -61,19 +56,12 @@
       }
     },
     props:['datas','preName','nextName'],
-    created(){
-      /*let dataArr = this.datas&&this.datas.moduleDetailDTOList;
-      if(dataArr){
-        this.dtoList = JSON.parse(JSON.stringify(dataArr));
-      }*/
-    },
     methods:{
       beBack(){
         this.$emit('back');
       },
       toNext(){
         this.$emit('next');
-        // console.log("模板数据:",this.datas,"诊疗数据:",this.dtoList)
       },
       setDetail(obj){
         this.labelDetail = obj.detail;
@@ -91,10 +79,6 @@
         this.labelDetail = {};
         this.ppId = null;
       },
-      updateOrig(){
-        let origin = this.$store.state.diagnose.origin;
-        // this.dtoList = origin;console.log("更新:",origin)
-      },
       getText(){
         let textArr = this.checkText;
         let msg = "";
@@ -109,14 +93,13 @@
       Label,
       DetailBox
     },
-    watch:{
+    /*watch:{
       dtoList:{
         handler(newVal,oldVal){
-          // console.log("诊疗数据更新:",newVal,oldVal); 
         },
         deep:true
       }
-    },
+    },*/
   }
 </script>
 <style lang="less" scoped>

+ 16 - 19
src/components/Others.vue

@@ -9,14 +9,12 @@
               :item="it"
               :ppId="it.id" 
               :moduleType="datas.type" 
-              @setDetail="setDetail"
-              @updateOrig="updateOrig"/>
+              @setDetail="setDetail"/>
         <!-- 输入框 -->
         <Input v-if="it.controlType==6 || it.controlType==7"
             :item="it"
             :key="it.id"
-            :uFlag="uFlag"
-            @updata="updataData"/>
+            @updata="updataData($event,it.id)"/>
     </div>
     <div class="result" v-if="checkText.length>0">
       <p class="title">其他病史</p>
@@ -46,16 +44,16 @@
   export default {
     name:'Others',
     data(){
-      let {origin,text} = this.$store.state.others;
+      let {origin,datas,text} = this.$store.state.others;
       return{
         msg:"其他情况",
         // imgs:this.$store.state.others.imgSrc,
-        dtoList:origin, //模板数据
+        // dtoList:origin, //模板数据
+        dtoList:datas, //模板数据
         labelDetail:{}, //标签明细
         checkText:text, //选中的文字
         ppId:null,
         show:false,
-        uFlag:false
       }
     },
     props:['datas','preName','nextName'],
@@ -66,7 +64,6 @@
       },
       toNext(){
         this.$emit('next');
-        // console.log("模板数据:",this.datas,"诊疗数据:",this.dtoList)
       },
       setDetail(obj){
         this.labelDetail = obj.detail;
@@ -84,25 +81,25 @@
         this.labelDetail = {};
         this.ppId = null;
       },
-      updateOrig(){
-        let origin = this.$store.state.diagnose.origin;
-      },
-      updataData(data){//输入框存值
-        console.log("输入框的值:",data,this.dtoList)
+      updataData(data,id){//输入框存值
         let list = this.dtoList;
         for(let i in list){
           if(list[i].id==data.id){
             list.splice(i,1,data)
           }
         }
-        this.$store.commit('setOrigin',{type:'3',data:data,pId:data.id});
-        this.$store.commit('setText',{type:'3',text:data.value,pId:data.id}); 
+        
+        // this.$store.commit('setOrigin',{type:'3',data:data,pId:data.id});
+        this.$store.commit('setDatas',{type:'3',data:data,pId:data.id,ppId:id});
+        this.$store.commit('setText',{type:'3',text:data.value,pId:data.id,flag:true}); 
       },
       getText(){
         let textArr = this.checkText;
         let msg = "";
         for(let k in textArr){
-          msg += textArr[k].text + ';'
+          if(textArr[k].text){
+            msg += textArr[k].text + ';'
+          }          
         }
         return msg;
       }
@@ -113,14 +110,14 @@
       DetailBox,
       Input
     },
-    watch:{
+    /*watch:{
       dtoList:{
         handler(newVal,oldVal){
-          // console.log("诊疗数据更新:",newVal,oldVal); 
+          console.log("其他史数据更新:",newVal,this.$store.state.others.text)
         },
         deep:true
       }
-    },
+    },*/
   }
 </script>
 <style lang="less" scoped>

+ 1 - 1
src/components/PathInfo.vue

@@ -110,7 +110,7 @@
       recordCheck(){
         const param = {
           'doctorId':this.pathInfo.doctorId,
-          'hospitalDeptId':this.pathInfo.selfDeptId,
+          'hospitalDeptId':this.pathInfo.hospitalDeptId,
           'hospitalId':this.pathInfo.hospitalId,
           'inquiryCode':this.pathInfo.recordId,
           'patientId':this.pathInfo.patientId

+ 4 - 4
src/components/Preview.vue

@@ -20,22 +20,22 @@
         <li v-if="symptom.choose.length>0">
           <h4><i :style="{'background': '#FF9A9A'}"></i> 主诉:</h4>
           <p>
-            <span v-for="(item,idx) in symptom.choose" :key="item.name">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
+            <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
           </p>
         </li>
         <li v-if="diagnose.text.length>0">
           <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
           <p>
-            <span v-for="(item,idx) in symptom.text" :key="item.text">{{item.text+(idx == symptom.choose.length-1?'。':';')}}</span>
+            <span v-for="(item,idx) in symptom.text" :key="item.text+idx">{{item.text+(idx == symptom.choose.length-1?'。':';')}}</span>
           </p>
           <p>
-            <span v-for="(item,idx) in diagnose.text" :key="item.text">{{item.text+(idx == diagnose.text.length-1?'。':';')}}</span>
+            <span v-for="(item,idx) in diagnose.text" :key="item.text+idx">{{item.text+(idx == diagnose.text.length-1?'。':';')}}</span>
           </p>
         </li>
         <li v-if="others.text.length>0">
           <h4><i></i> 其他史:</h4>
           <p>
-            <span v-for="(item,idx) in others.text" :key="item.text">{{item.text+(idx == others.text.length-1?'。':';')}}</span>
+            <span v-for="(item,idx) in others.text" :key="item.text+idx">{{item.text+(idx == others.text.length-1?'。':';')}}</span>
           </p>
         </li>
         <li v-if="addContent.txt">

+ 0 - 1
src/components/Search.vue

@@ -83,7 +83,6 @@ export default {
       }
       api.getTagInfos(param).then((res) => {
         const result = res.data;
-        console.log(result)
         if (result.code == 0) {
           this.searchLis = result.data
         }

+ 1 - 3
src/components/Symptom.vue

@@ -84,8 +84,6 @@ export default {
       sexType: pathInfo.patientSex == '男' ? 1 : (pathInfo.patientSex == '女' ? 2 : 3),
       deptName: pathInfo.selfDeptName,
       hosCode: pathInfo.hospitalCode,
-      choose: false,
-      check: false,
       show: false, //显示明细
       chooseSymp: choose, //已选症状
       symp: [], //症状
@@ -95,7 +93,6 @@ export default {
       delText: "是否删除该信息?<br/> (已填内容将清除)",
       delIndex: null,
       showToast: false,
-      finished: false,//是否填写了明细
       searchShow: false,//显示搜索界面
       tmpItem:{},//检索的症状
       isSearch:false
@@ -239,6 +236,7 @@ export default {
         this.chooseSymp.push(this.tmpItem);
         this.searchShow = false
       }
+      this.isSearch = false; //重置,否则每次点开都会叠加
       this.checkText = this.$store.state.symptom.text;
       this.show = false;
       this.questId = null;

+ 15 - 20
src/store.js

@@ -8,11 +8,6 @@ const store = new Vuex.Store({
     pathInfo:{}, //患者信息-后续提交要用
     sysConfig:[], //系统配置项
     allMoudles:[], //模板
-    // originDatas:{},  //getById获取到的源数据
-    // datas:{},  //处理过的数据
-    updata:false,  //更新数据
-    // imgFile:[],   //上传图片信息file
-    // imgSrc:{},   //上传的图片信息src
     symptom:{ //症状情况
       choose:[],
       origin:{},
@@ -21,14 +16,14 @@ const store = new Vuex.Store({
     },
     diagnose:{ //诊疗
       origin:[], //模板数据
-      datas:{},
+      datas:[],
       text:[],
-      imgFile:[],
-      imgSrc:{},
+      imgFile:[],//上传图片信息file
+      imgSrc:{},//上传的图片信息src
     },
     others:{ //其他情况
       origin:[], //模板数据
-      datas:{},
+      datas:[],
       text:[],
       imgFile:[],
       imgSrc:{},
@@ -48,14 +43,14 @@ const store = new Vuex.Store({
       }
       state.diagnose={ //诊疗
         origin:[], //模板数据
-        datas:{},
+        datas:[],
         text:[],
         imgFile:[],
         imgSrc:{},
       }
       state.others={ //其他情况
         origin:[], //模板数据
-        datas:{},
+        datas:[],
         text:[],
         imgFile:[],
         imgSrc:{},
@@ -81,12 +76,14 @@ const store = new Vuex.Store({
       for(let k in param){
         if(param[k].type == 2){
           state.diagnose.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
+          state.diagnose.datas = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
         }else if(param[k].type == 3){
           state.others.origin = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
+          state.others.datas = JSON.parse(JSON.stringify(param[k].moduleDetailDTOList))
         }
       }
     },
-    setOrigin(state,param){
+    setOrigin(state,param){//取消选中时用
       const type = parseInt(param.type);
       const data = param.data;
       switch(type){
@@ -128,7 +125,7 @@ const store = new Vuex.Store({
     },
     setDatas(state,param){
       // ppId--每一道题的id;pId--每个选项的id
-      const type = parseInt(param.type);//console.log("存值:",param)
+      const type = parseInt(param.type);
       const data = param.data;
       const ppId = param.ppId;
       switch(type){
@@ -136,20 +133,21 @@ const store = new Vuex.Store({
           state.symptom.datas = Object.assign({},state.symptom.datas,{[param.pId]:data});
           break;
         case 2: //诊疗情况
-          let diagData = state.diagnose.origin;
+          let diagData = state.diagnose.datas;
           for(let i in diagData){
             if(diagData[i].id == ppId){
               let questionMapping = diagData[i].questionMapping;
               for(let k in questionMapping){
                 if(questionMapping[k].id == data.id){
-                  questionMapping[k].questionMapping = data.questionMapping;
+                  // questionMapping[k].questionMapping = data.questionMapping;
+                  questionMapping.splice(k,1,data);
                 }
               }
             }
           }
           break;
         case 3:
-          let otherData = state.others.origin;
+          let otherData = state.others.datas;
           for(let i in otherData){
             if(otherData[i].id == ppId){
               let questionMapping = otherData[i].questionMapping;
@@ -178,7 +176,7 @@ const store = new Vuex.Store({
           let text = state.symptom.text;
           if(text.length > 0){
             for(let i in text){
-              // 点完成时才覆盖,单纯点开再关闭不覆盖
+              // 点完成时才覆盖,单纯点开再关闭不覆盖flag
               if(text[i].pId==param.pId){
                 if(param.flag){
                   text.splice(i,1,param);
@@ -269,9 +267,6 @@ const store = new Vuex.Store({
     setChoose(state,param){ //症状情况-已选症状
       state.symptom.choose = param.choose;
     },
-    getUpdate(state){//更新数据
-      state.updata = !state.updata;
-    },
     setImgFile(state,param){//区别模块
       const type = parseInt(param.type);
       switch(type){