浏览代码

成文顺序按题号;症状显示患者信息

liucf 5 年之前
父节点
当前提交
83216fcf58

+ 2 - 2
config/index.js

@@ -4,8 +4,8 @@
 
 const path = require('path')
 // const proxy_path = 'http://192.168.2.236:80';
-// const proxy_path = 'http://192.168.2.236:5050';
-const proxy_path = 'http://192.168.2.241:5050';
+const proxy_path = 'http://192.168.2.236:5050';
+// const proxy_path = 'http://192.168.2.241:5050';
 
 module.exports = {
   dev: {

+ 11 - 7
src/common/Label.vue

@@ -23,10 +23,11 @@ import {moduleCP} from '@utils/tools';
         showToast:false,
         delText:"是否取消当前选中内容?",
         tempItem:{},
-        exclusion:999 //互斥
+        exclusion:999, //互斥
+        delIndx:null
       }
     },
-    props:['item','moduleType','ppId'],
+    props:['item','moduleType','ppId','order'],
     created(){
       this.datas = this.item;
       // 回读互斥项标识
@@ -67,17 +68,18 @@ import {moduleCP} from '@utils/tools';
             mapping.splice(i,1,newItem)
           }
         }
-        // 存值到store
+        // 存值到store  arrFlag:true说明要区分pId
         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,textP:(it.description||it.name),pId:it.id});
+        this.$store.commit('setText',{type:this.moduleType,text:it.name,textP:(it.description||it.name),pId:it.id,order:this.order,index:index,arrFlag:true});
         if(it.questionMapping&&it.questionMapping.length>0){//有明细
-          this.$emit("setDetail",{detail:it,ppId:this.ppId})
-          this.$store.commit('setDetail',{detail:it,ppId:this.ppId,moduleType:this.moduleType})
+          // this.$emit("setDetail",{detail:it,ppId:this.ppId})
+          this.$store.commit('setDetail',{detail:it,ppId:this.ppId,moduleType:this.moduleType,order:this.order,index:index})
         }
       },
       deletSymp(e,it,index){
         e.stopPropagation();
         // 删除互斥项(无)不弹窗提醒 7-18
+        this.delIndx = index;
         this.tempItem = it;
         if(it.exclusionType == 1){
           this.comfirnDel();
@@ -123,12 +125,14 @@ import {moduleCP} from '@utils/tools';
         }
         //存值
         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.$store.commit('delText',{type:this.moduleType,pId:temp.id,order:this.order,index:this.delIndx});
+        // this.$store.commit('setText',{type:this.moduleType,text:it.name,textP:(it.description||it.name),pId:it.id,order:this.order,index:index,arrFlag:true});
         this.cancelDel();
       },
       cancelDel(){
         this.showToast = false;
         this.tempItem = {};
+        this.delIndx = null;
       }
     }
   }

+ 5 - 5
src/components/Detail.vue

@@ -52,7 +52,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         imgUrl:imageUrlPrefix,
       }
     },
-    props:['datas','type','ppId'],
+    props:['datas','data'],
     created(){
       this.checkDatas = JSON.parse(JSON.stringify(this.datas));
     },
@@ -131,9 +131,9 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
           newMsg = msg;
           newMsgP = msgP;
         }
-        this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.type,ppId:this.ppId});
+        this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
         // flag是区分点开已选症状 未点完成
-        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:this.checkDatas.id,type:this.type,flag:true});
+        this.$store.commit('setText',{text:trimDots(newMsg),textP:trimDots(newMsgP),pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
       },
       clearData(){//清空
         const datas = this.checkDatas.questionMapping;
@@ -154,8 +154,8 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
         let msg = this.checkDatas.name;
         let msgP = (this.checkDatas.description||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,textP:msgP,pId:this.checkDatas.id,type:this.type,flag:true});
+        this.$store.commit('setDatas',{data:this.checkDatas,pId:this.checkDatas.id,type:this.data.moduleType,ppId:this.data.ppId});
+        this.$store.commit('setText',{text:msg,textP:msgP,pId:this.checkDatas.id,type:this.data.moduleType,flag:true,order:this.data.order,arrFlag:true,index:this.data.index});
       },
       check(){// 校验是否有已填项
         const datas = this.checkDatas.questionMapping;

+ 1 - 2
src/components/DetailBox.vue

@@ -7,8 +7,7 @@
         <div class="main">
           <Detail :datas="privateData" 
                   ref="detail"
-                  :type="data.moduleType" 
-                  :ppId="data.ppId"
+                  :data="data"
                   @check="changeCheck($event)"/>
         </div>
         <!-- <div class="foot" @click="complete">完成</div> -->

+ 42 - 16
src/components/DiagTreat.vue

@@ -10,6 +10,7 @@
         <Label v-if="it.controlType==0" 
               :item="it" 
               :ppId="it.id"
+              :order="i"
               :moduleType="datas.type"/>
         <!-- 上传图片 -->
         <UploadImg v-if="it.controlType==4" 
@@ -20,19 +21,19 @@
         <Input v-if="it.controlType==6 || it.controlType==7"
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <!-- 文本域 -->
         <ComTextArea v-if="it.controlType == 5"
             :item="it"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <Radio v-if="it.controlType==1" 
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <CheckBox v-if="it.controlType==2" 
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <!-- 多行输入-->
         <template
             v-if="it.controlType == 3"
@@ -41,11 +42,12 @@
             <MultiLineInput
               :msg="part.name"
               :part="part"
-              @updata="updataData($event,it.id,index)"
+              @updata="updataData($event,it.id,i,index)"
             ></MultiLineInput>
         </template>
       </div>
-      <div class="result" v-if="checkText.length>0">
+      <!-- <div class="result" v-if="checkText.length>0"> -->
+      <div class="result" v-if="getText()">
         <p class="title">{{datas.name}}</p>
         <!-- <p v-for="(v,i) in checkText">{{v.text}}</p> -->
         <p>{{getText()}}</p>
@@ -116,27 +118,45 @@
         let textArr = this.checkText;
         let msg = "";
         for(let k in textArr){
-          if(textArr[k].textP){
+          if(textArr[k] && Array.isArray(textArr[k])){
+            let temp = textArr[k];
+            for(let j in temp){
+              if(temp[j] && temp[j].textP){
+                msg += temp[j].textP + ';'
+              }
+            }
+          }else if(textArr[k]&&textArr[k].textP){
             msg += textArr[k].textP + ';'
           }
-        }          
-        return trimDots(msg);;
+        }    
+        return trimDots(msg);
       },
-      updataData(data,id,index){//输入框存值
+      updataData(data,id,order,index){//输入框存值
         let list = this.dtoList;
+        let value = "";
+        let valueP = "";
         for(let i in list){
           // if(list[i].id==data.id){
           if(list[i].id==id){
             if(list[i].controlType == 3){//多行输入
               let detailList = list[i].questionDetailList;
               detailList.splice(index,1,data);
+              let temVal = "";
+              for(let k in detailList){
+                if(detailList[k].value){
+                  temVal += detailList[k].value + ','
+                }
+              }
+              value = valueP = temVal?temVal.substring(0,temVal.length-1):'';
             }else{
-              list.splice(i,1,data)
+              list.splice(i,1,data);
+              value = data.value;
+              valueP = data.valueP;
             }
           }
         }
         this.$store.commit('setDatas',{type:moduleCP['diagT'],data:data,pId:data.id,ppId:id});
-        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}); 
+        this.$store.commit('setText',{type:moduleCP['diagT'],text:value.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),textP:valueP.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:data.id,flag:true,order:order}); 
         this.$nextTick(()=>{
           this.scroll.refresh()
         })
@@ -152,13 +172,19 @@
       CheckBox,
       MultiLineInput
     },
-    /*watch:{
-      dtoList:{
-        handler(newVal,oldVal){
+    computed:{
+      getItem(){
+        return this.$store.state.diagnose.text;
+      }
+    },
+    watch:{
+      getItem:{
+        handler(value){
+          this.checkText = value;
         },
         deep:true
       }
-    },*/
+    }
   }
 </script>
 <style lang="less" scoped>

+ 43 - 18
src/components/Others.vue

@@ -11,24 +11,25 @@
         <Label v-if="it.controlType==0"
               :item="it"
               :ppId="it.id" 
+              :order="i"
               :moduleType="datas.type"/>
         <!-- 输入框 -->
         <Input v-if="it.controlType==6 || it.controlType==7"
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <!-- 文本域 -->
         <ComTextArea v-if="it.controlType == 5"
             :item="it"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <Radio v-if="it.controlType==1" 
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <CheckBox v-if="it.controlType==2" 
             :item="it"
             :key="it.id"
-            @updata="updataData($event,it.id)"/>
+            @updata="updataData($event,it.id,i)"/>
         <!-- 多行输入-->
         <template
             v-if="it.controlType == 3"
@@ -37,11 +38,12 @@
             <MultiLineInput
               :msg="part.name"
               :part="part"
-              @updata="updataData($event,it.id,index)"
+              @updata="updataData($event,it.id,i,index)"
             ></MultiLineInput>
         </template>
       </div>
-      <div class="result" v-if="checkText.length>0">
+      <!-- <div class="result" v-if="checkText.length>0"> -->
+      <div class="result" v-if="getText()">
         <p class="title">{{datas.name}}</p>
         <p>{{getText()}}</p>
       </div>
@@ -108,23 +110,34 @@
           this.$emit('next');
         }
       },
-      updataData(data,id,index){//输入框存值
+      updataData(data,id,order,index){//输入框存值
         let list = this.dtoList;
+        let value = "";
+        let valueP = "";
         for(let i in list){
           // if(list[i].id==data.id){
           if(list[i].id==id){
             if(list[i].controlType == 3){//多行输入
               let detailList = list[i].questionDetailList;
               detailList.splice(index,1,data);
+              let temVal = "";
+              for(let k in detailList){
+                if(detailList[k].value){
+                  temVal += detailList[k].value + ','
+                }
+              }
+              value = valueP = temVal?temVal.substring(0,temVal.length-1):'';
             }else{
-              list.splice(i,1,data)
-            } 
+              list.splice(i,1,data);
+              value = data.value;
+              valueP = data.valueP;
+            }
           }
         }
         
         // this.$store.commit('setOrigin',{type:'3',data:data,pId:data.id});
         this.$store.commit('setDatas',{type:moduleCP['other'],data:data,pId:data.id,ppId:id});
-        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}); 
+        this.$store.commit('setText',{type:moduleCP['other'],text:value.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),textP:valueP.replace(patt,'').replace(/\#\{/g,'').replace(/\}/g,''),pId:data.id,flag:true,order:order}); 
         
         this.$nextTick(()=>{
           this.scroll.refresh()
@@ -134,10 +147,17 @@
         let textArr = this.checkText;
         let msg = "";
         for(let k in textArr){
-          if(textArr[k].textP){
+          if(textArr[k] && Array.isArray(textArr[k])){
+            let temp = textArr[k];
+            for(let j in temp){
+              if(temp[j] && temp[j].textP){
+                msg += temp[j].textP + ';'
+              }
+            }
+          }else if(textArr[k]&&textArr[k].textP){
             msg += textArr[k].textP + ';'
-          }          
-        }
+          }
+        }    
         return trimDots(msg);
       }
     },
@@ -151,14 +171,19 @@
       CheckBox,
       MultiLineInput
     },
-    /*watch:{
-      dtoList:{
-        handler(newVal,oldVal){
-          console.log("其他史数据更新:",newVal,this.$store.state.others.text)
+    computed:{
+      getItem(){
+        return this.$store.state.others.text;
+      }
+    },
+    watch:{
+      getItem:{
+        handler(value){
+          this.checkText = value;
         },
         deep:true
       }
-    },*/
+    }
   }
 </script>
 <style lang="less" scoped>

+ 32 - 8
src/components/Preview.vue

@@ -26,23 +26,23 @@
             <li>
               <h4><i :style="{'background': '#FF9A9A'}"></i> 主诉:</h4>
               <p>
-                <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
+                <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{(item.description||item.name)+(idx == symptom.choose.length-1?'':'、')}}</span>
               </p>
             </li>
             <!-- <li v-if="diagnose.text.length>0||symptom.choose.length>0"> -->
             <li>
               <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
               <p>
-                <span v-for="(item,idx) in symptom.text" :key="item.text+idx">{{trimDots&&trimDots(item.text+(idx == symptom.choose.length-1?'。':';'))}}</span>
+                <span>{{getText(symptom.text,false)}}</span>
               </p>
               <p>
-                <span v-for="(item,idx) in diagnose.text" :key="item.text+idx">{{trimDots&&trimDots(item.text+(idx == diagnose.text.length-1?'。':';'))}}</span>
+                <span>{{getText(diagnose.text,false)}}</span>
               </p>
             </li>
             <li v-if="showLis[moduleCP['other']]==1">
               <h4><i></i> 其他史:</h4>
               <p>
-                <span v-for="(item,idx) in others.text" :key="item.text+idx">{{trimDots&&trimDots(item.text+(idx == others.text.length-1?'。':';'))}}</span>
+                <span>{{getText(others.text,false)}}</span>
               </p>
             </li>
             <li v-if="showLis[moduleCP['suplement']]==1">
@@ -93,16 +93,16 @@
               <li>
                 <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
                 <p>
-                  <span v-for="(item,idx) in symptom.text" :key="item.text+idx">{{item.text+(idx == symptom.choose.length-1?'。':';')}}</span>
+                  <span>{{getText(symptom.text,true)}}</span>
                 </p>
                 <p>
-                  <span v-for="(item,idx) in diagnose.text" :key="item.text+idx">{{item.text+(idx == diagnose.text.length-1?'。':';')}}</span>
+                  <span>{{getText(diagnose.text,true)}}</span>
                 </p>
               </li>
               <li v-if="showLis[moduleCP['other']]==1">
                 <h4><i></i> 其他史:</h4>
                 <p>
-                  <span v-for="(item,idx) in others.text" :key="item.text+idx">{{item.text+(idx == others.text.length-1?'。':';')}}</span>
+                  <span>{{getText(others.text,true)}}</span>
                 </p>
               </li>
               <li v-if="showLis[moduleCP['suplement']]==1">
@@ -159,8 +159,32 @@ export default {
     })
   },
   methods: {
+    getText(textArr,flag){//拼接文本,flag=true为医生
+      let msg = "";
+      for(let k in textArr){
+        if(textArr[k] && Array.isArray(textArr[k])){
+          let temp = textArr[k];
+          for(let j in temp){
+            if(temp[j]){
+              if(flag){//医生
+                msg += temp[j].text + ';'
+              }else if(temp[j].textP){
+                msg += temp[j].textP + ';'
+              } 
+            }
+          }
+        }else if(textArr[k]){
+          if(flag){
+            msg += textArr[k].text + ';'
+          }else if(textArr[k].textP){
+            msg += textArr[k].textP + ';'
+          }
+          
+        }
+      }    
+      return trimDots(msg);
+    },
     handleClick(flg){
-      console.log(flg)
       this.showDoc = flg
       // this.scroll = setScroll(BScroll,!flg,'.previewper')
     },

+ 8 - 6
src/components/Symptom.vue

@@ -10,7 +10,7 @@
           class="choo-symp"
           v-for="(v,i) in chooseSymp"
         >
-          <span @click="showChecked(v)">{{v.name}}</span>
+          <span @click="showChecked(v)">{{v.description || v.name}}</span>
           <span @click="deletSymp(v,i)"><img
               src="../images/del.png"
               alt=""
@@ -29,7 +29,7 @@
           v-for="(it,ind) in symp"
           :key="it.conceptId"
           @click="showDetil(it)"
-        >{{it.name}}</span>
+        >{{it.description || it.name}}</span>
       </div>
       <div
         class="result"
@@ -68,7 +68,7 @@ import api from '@utils/api.js';
 import DetailBox from './DetailBox.vue';
 import Toast from '../common/Toast.vue';
 import Search from './Search.vue';
-import {moduleCP,setScroll} from '@utils/tools'
+import {moduleCP,setScroll,trimDots} from '@utils/tools'
 import BScroll from 'better-scroll';
 export default {
   name: 'Symptom',
@@ -156,7 +156,7 @@ export default {
       this.questId = item.questionId || item.id || item.conceptId;
       const id = item.questionId || item.id; //常见症状questionId,推送id,两者均有可能没有
       //将选中的name存到store中的text
-      this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.name, pId: this.questId });
+      this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId });
       this.quesText = "请问您还有其他不适吗?";
       if (id) {
         const param = {
@@ -192,9 +192,11 @@ export default {
       const text = this.$store.state.symptom.text;
       let msg = "";
       for (let i in text) {
-        msg += text[i].text;
+        if(text[i] && text[i].textP){
+          msg += text[i].textP;
+        }
       }
-      return msg;
+      return trimDots(msg);
     },
     getPush(symptoms) {//推理
       const param = {

+ 76 - 11
src/store.js

@@ -208,8 +208,37 @@ const store = new Vuex.Store({
           }
           break;
         case moduleCP['diagT']: //诊疗情况
-          let diaText = state.diagnose.text;
-          if(diaText.length > 0){
+          let diaText = JSON.parse(JSON.stringify(state.diagnose.text)); 
+          // 先判断order,然后判断index
+          let item = diaText[param.order];
+          if(item){
+            // 判断是对象还是数组--数组则区分index
+            if(Array.isArray(item)){
+              if(param.flag){//详情完成-覆盖
+                item[param.index] = param;
+              }else{ //直接点label--无则覆盖
+                if(!item[param.index]){
+                  item[param.index] = param;
+                }
+              }
+            }else{
+              if(param.flag){
+                diaText[param.order] = param;
+              }
+            }
+          }else{
+            if(param.arrFlag){
+              let temp = [];
+              temp[param.index] = param;
+              diaText[param.order] = temp;
+            }else{
+              diaText[param.order] = param;
+            }
+          }
+          state.diagnose.text = diaText;
+
+
+          /*if(diaText.length > 0){
             for(let i in diaText){
               if(diaText[i].pId==param.pId){
                 if(param.flag){
@@ -221,11 +250,38 @@ const store = new Vuex.Store({
             diaText.push(param);
           }else{
             diaText.push(param);
-          }
+          }*/
           break;
         case moduleCP['other']: //其他情况
-          let otherText = state.others.text;
-          if(otherText.length > 0){
+          let otherText = JSON.parse(JSON.stringify(state.others.text));
+          let oitem = otherText[param.order];
+          if(oitem){
+            // 判断是对象还是数组--数组则区分index
+            if(Array.isArray(oitem)){
+              if(param.flag){//详情完成-覆盖
+                oitem[param.index] = param;
+              }else{ //直接点label--无则覆盖
+                if(!oitem[param.index]){
+                  oitem[param.index] = param;
+                }
+              }
+            }else{
+              if(param.flag){
+                otherText[param.order] = param;
+              }
+            }
+          }else{
+            if(param.arrFlag){
+              let temp = [];
+              temp[param.index] = param;
+              otherText[param.order] = temp;
+            }else{
+              otherText[param.order] = param;
+            }
+          }
+          state.others.text = otherText;
+
+          /*if(otherText.length > 0){
             for(let i in otherText){
               if(otherText[i].pId==param.pId){
                 if(param.flag){
@@ -237,7 +293,7 @@ const store = new Vuex.Store({
             otherText.push(param);
           }else{
             otherText.push(param);
-          }
+          }*/
           break;
         case moduleCP['suplement']:
           let addText = state.addContent.txt
@@ -261,20 +317,29 @@ const store = new Vuex.Store({
           }
           break;
         case moduleCP['diagT']: //诊疗情况
-          let diaText = state.diagnose.text;
-          for(let i in diaText){
+          let diaText = JSON.parse(JSON.stringify(state.diagnose.text));
+          let temp = diaText[param.order];
+          temp[param.index] = null;
+          state.diagnose.text = diaText;
+
+          // let diaText = state.diagnose.text;
+          /*for(let i in diaText){
             if(diaText[i].pId==param.pId){
               diaText.splice(i,1)
             }
-          }
+          }*/
           break;
         case moduleCP['other']:
-          let otherText = state.others.text;
+          let otherText = JSON.parse(JSON.stringify(state.others.text));
+          let otemp = otherText[param.order];
+          otemp[param.index] = null;
+          state.others.text = otherText;
+          /*let otherText = state.others.text;
           for(let i in otherText){
             if(otherText[i].pId==param.pId){
               otherText.splice(i,1)
             }
-          }
+          }*/
           break;
         case moduleCP['suplement']: