浏览代码

既往史修改

Luolei 6 年之前
父节点
当前提交
95b977da11

+ 9 - 4
src/api/utils.js

@@ -87,6 +87,7 @@ export default {
     // console.log(dataArr,type)
     let tmpArr = [];
     for(let i = 0;i < dataArr.length;i++){
+      let tmpData = dataArr[i];
       let mapping = {
         "sonQuestion": "",
         "position": 0,               //默认值,传0
@@ -99,7 +100,6 @@ export default {
           "id": "",
           "questionMappings": []
       }
-      let tmpData = dataArr[i];
   
       if(type == 6 && tmpData.length > 0){//既往史
         let sonMappingArr=[]; 
@@ -108,15 +108,20 @@ export default {
           if(i == 0){
             mapping.formPosition = 1;
             mapping.exclusionType = 1;
+            mapping.sonQuestion = tmpData[j];
+          }else if(i == 1){
+            mapping.formPosition = 0;
+            mapping.exclusionType = 0;
+            mapping.sonQuestion = tmpData[j];
           }else{
             mapping.formPosition = 0;
             mapping.exclusionType = 0;
+            sonMappingObj.sonQuestion = tmpData[j];    //{sonQuestion:18}
+            sonQuestionMap.questionMappings = sonMappingArr;    //{id:"",[{sonQuestion:18},{sonQuestion:18}]}
+            mapping.questionMappingSon = sonQuestionMap;
           }
-          sonMappingObj.sonQuestion = tmpData[j];    //{sonQuestion:18}
           sonMappingArr.push(sonMappingObj);         //[{sonQuestion:18},{sonQuestion:19}]
           
-          sonQuestionMap.questionMappings = sonMappingArr;    //{id:"",[{sonQuestion:18},{sonQuestion:18}]}
-          mapping.questionMappingSon = sonQuestionMap;
         }
         tmpArr.push(mapping)
       }else if(type == 2 && tmpData.length > 0){//杂音

+ 0 - 1
src/components/icss/NoiseTemplate.vue

@@ -160,7 +160,6 @@ export default {
       // console.log(type)
     },
     changeActionData(arr) {          //标签明细右侧数据id
-    console.log(44254165456)
       this.sendIds = arr
     },
     submitForm() {       // 调用子组件的方法验证公用部分

+ 89 - 35
src/components/icss/PubTagPartDetail.vue

@@ -46,7 +46,7 @@
           @click="selectPart(0)"
           v-else
         >
-          <span class="hzx ellipsis" v-for="item in poolDetailList[0]" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span>
+          <span class="hzx ellipsis" v-for="item in poolDetailList[0][0].questionDetailList" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span>
         </div>
         <div class="onlyBottom pubList">
           <ul class="clearfix">
@@ -65,11 +65,16 @@
                 </template>
               </ul>
               <ul v-else>
-                <template>
-                  <li class="partDetail ellipsis" v-for="item in poolDetailList[n]" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.name+' ]'" :key="item.id" @click="selectTagOne($event,item.id,n)">
+                <template v-if="n == 1">
+                  <li class="partDetail ellipsis" v-for="item in poolDetailList[n][0].questionDetailList" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.name+' ]'" :key="item.name">
                     [ {{item.name}} ]
                   </li>
                 </template>
+                <template  v-if="n == 2 || n == 3 || n == 4 || n == 5">
+                  <li class="partDetail ellipsis" v-for="item in poolDetailList[n]" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.tagName+' ]'" :key="item.tagName" @click="selectTagOne($event,item.id,n)">
+                    [ {{item.tagName}} ]
+                  </li>
+                </template>
               </ul>
             </li>
           </ul>
@@ -78,13 +83,14 @@
       <div class="partWaring">
         <ul>
           <li v-for="i in 5" :key="i">
-            <template v-for="item in poolDetailListTips[i]" v-show="poolDetailListTips[i].length > 0">
-              <p class="partDetail tipsWrap" :key="item.type" >
+            <template v-for="item in poolDetailListTips[i]" v-if="poolDetailListTips[i].length > 0">
+              <p class="partDetail tipsWrap" :key="item.type" v-if="currentTipLis.length>0">
                 <template v-for="section in currentTipLis">
                   <span v-if="item.type == section.val" :title="section.name" :key="section.val">{{section.name}}</span>         
                 </template>
               </p>        
-              <p class="partDetail tipsWrap" :title="item.name" :key="item.type+'--'">{{item.name}}</p> 
+              <p class="partDetail tipsWrap" :title="item.join" :key="item.join+'--'" v-if="!!item.join">标签之间链接{{item.join}}</p> 
+              <p class="partDetail tipsWrap" :title="item.name" :key="item.type+'--'" v-if="!!item.name">{{item.name}}</p> 
             </template>
           </li>
         </ul> 
@@ -134,7 +140,7 @@ export default {
   },
   data() {
     return {
-      poolDetailList: [[],[],[],[],[],[]],     //默认6个部分
+      poolDetailList: [[{questionDetailList:[]}],[{questionDetailList:[]}],[],[],[],[]],     //默认6个部分
       poolDetailListTips: [[],[],[],[],[],[]],     //6个部分对应的提示
       poolDetailListIds: [[],[],[],[],[],[]],     //6个部分对应的id
       poolDetailListAll:[],    //默认6个部分转化为一维数组
@@ -156,27 +162,70 @@ export default {
   mounted(){
     this.$nextTick(()=>{
       let tagList = this.options;
+      this.currentTipLis = this.tipLis
       if(tagList.length > 0){
         let tmpArr = [[],[],[],[],[],[]];
         this.tmpNum = 1
-        if(tagList[0].formPosition == 1){
-          tagList.map((val,idx)=>{
-            if(this.sign == 2) {     //杂音修改
-                tmpArr[idx].push(val)
-            }else{       //既往史修改
-              tmpArr[idx] = val.questionMapping
-            }
-          })
-        }else{
-          tagList.map((val,idx)=>{
-            if(this.sign == 2) {     //杂音修改
-                tmpArr[idx+1].push(val)
-            }else{       //既往史修改
-              tmpArr[idx+1] = val.questionMapping
+        if(this.sign == 2){//杂音修改
+          if(tagList[0].formPosition == 1){
+            tagList.map((val,idx)=>{
+              tmpArr[idx].push(val)
+            })
+          }else{
+            tagList.map((val,idx)=>{
+              tmpArr[idx+1].push(val)
+            })
+          }
+        }else{       //既往史修改
+            let sticArr = [{questionDetailList:[]}];
+            if(tagList.length > 1){     //至少两条数据
+              if(tagList[0].formPosition == 1 && tagList[1].tagType != 1){  //第一条为互斥项,第二条不是伴无  13...
+                tagList.map((val,idx)=>{
+                  if(idx == 0){
+                    tmpArr[idx].push(val)
+                  }else {
+                    tmpArr[1].push(sticArr)
+                    tmpArr[idx+1] = val.questionMapping
+                  }
+                })
+              }else if(tagList[0].formPosition == 1 && tagList[1].tagType == 1){   //第一条为互斥项,第二条是伴无  12...
+                tagList.map((val,idx)=>{
+                    if(idx < 2){
+                      tmpArr[idx].push(val)
+                    }else{
+                      tmpArr[idx] = val.questionMapping
+                    }
+                })
+              }else if(tagList[0].formPosition != 1 && tagList[0].tagType == 1){   //第一条是伴无  2...
+                tagList.map((val,idx)=>{
+                    if(idx == 0){
+                      tmpArr[0].push(sticArr)
+                      tmpArr[1].push(val)
+                    }else if(idx > 0){
+                      tmpArr[idx+1] = val.questionMapping
+                    }
+                })
+              }else{  //第一条不是互斥项,第二条不是伴无  3...
+                tagList.map((val,idx)=>{
+                  if(idx > 1){
+                    tmpArr[idx] = val.questionMapping
+                  }
+                })
+              }
+            }else{       //有且只有一条
+              if(tagList[0].formPosition == 1){  //第一条为互斥项
+                tmpArr[0].push(tagList[0])
+                tmpArr[1].push(sticArr)
+              }else if(tagList[0].formPosition != 1 && tagList[0].tagType == 1){   //第一条是伴无 
+                tmpArr[0].push(sticArr)
+                tmpArr[1].push(tagList[0])
+              }else{     //既不是互斥也不是伴无
+                tmpArr[0].push(sticArr)
+                tmpArr[1].push(sticArr)
+                tmpArr[2] = tagList[0].questionMapping
+              }
             }
-          })
-        }
-        
+          }
         this.poolDetailList = tmpArr
         this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
         this.searchTagList()
@@ -188,11 +237,6 @@ export default {
     pool(newVal, preVal) {
       this.currentPool = newVal
     },
-    tipLis(newVal, preVal) {
-      if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
-        this.currentTipLis = newVal
-      }
-    },
     sexType(newVal, preVal) {
       if (newVal != preVal) {
         if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
@@ -310,9 +354,14 @@ export default {
             if(!utils.filterArr(poolDetailListTips[i],tmpLi.controlType,2)){
               objTmp.type = tmpLi.controlType
               objTmp.name = tmpLi.name
-              poolDetailListTips[i].push(objTmp)
+              objTmp.join = tmpLi.joint
+              if(tmpLi.controlType){
+                poolDetailListTips[i].push(objTmp)
+              }
+            }
+            if(tmpLi.id){
+              poolDetailListIds[i].push(tmpLi.id)
             }
-            poolDetailListIds[i].push(tmpLi.id)
           }
         }
       }
@@ -334,7 +383,7 @@ export default {
       let ids = [];
       this.currentLis = []
       this.poolDetailListAll.map((value)=>{
-        ids.push(value.id)
+        if(value.id){ids.push(value.id)}
       })
       this.notIds = ids;
       
@@ -448,7 +497,7 @@ export default {
                 if(num == 6){
                   for(let i = 1;i < this.poolDetailList.length;i++){
                     let ids = [];
-                    if(this.poolDetailList[i].length == 0){      //判断part里面是不是有数据,没有直接添加
+                    if(this.poolDetailList[i].length == 0 || (this.poolDetailList[i].length > 0 && !this.poolDetailList[i].id)){      //判断part里面是不是有数据,没有直接添加
                       this.poolDetailList[i] = tmpArr;
                       this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);
                       this.searchTagList();
@@ -466,16 +515,21 @@ export default {
             this.currentLis.map((id)=>{
               tmpArr.push(res.data.data[id]);
             })
+            console.log(tmpArr,'多选既往史')
             this.selectArr.map((flg,idx)=>{         //判断右侧有没有选中
               if(flg){    //有选中
-                this.poolDetailList[idx] = (this.poolDetailList[idx]).concat(tmpArr);
+                if(idx == 0 || idx == 1){
+                  this.poolDetailList[idx] = tmpArr;
+                }else{
+                  this.poolDetailList[idx] = (this.poolDetailList[idx]).concat(tmpArr);
+                }
                 this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
                 this.searchTagList();
                 this.getPoolDetailListTips();
               }else{
                 ++num;
                 if(num == 6){
-                  for(let i = 1;i < this.poolDetailList.length;i++){
+                  for(let i = 2;i < this.poolDetailList.length;i++){
                     let ids = [];
                     if(this.poolDetailList[i].length == 0){      //判断part里面是不是有数据,没有直接添加
                       this.poolDetailList[i] = tmpArr;

+ 1 - 1
src/components/icss/SymptomTagGroup.vue

@@ -54,7 +54,7 @@
             </li>
         </ul>
     </div>
-    <div class="buttonBox">
+    <div class="buttonBox"  v-if="type == 1">     
         <div class="mainButton">
             <el-button type="primary" @click="mainSymptom">跟主症状</el-button>
         </div>