Explorar o código

bug2642,2643,2645,2647

luolei %!s(int64=5) %!d(string=hai) anos
pai
achega
5c540f5e7d
Modificáronse 3 ficheiros con 28 adicións e 12 borrados
  1. 3 1
      src/components/Search.vue
  2. 24 8
      src/components/Symptom.vue
  3. 1 3
      src/store.js

+ 3 - 1
src/components/Search.vue

@@ -90,7 +90,9 @@ export default {
     searchList() {
       let tmpArr = [], chooseSymp = this.chooseSymp;
       for (let i = 0; i < chooseSymp.length; i++) {
-        tmpArr.push(chooseSymp[i].conceptId)
+        if(chooseSymp[i].conceptId){
+          tmpArr.push(chooseSymp[i].conceptId)
+        }
       }
       const param = {
         "age": this.age,

+ 24 - 8
src/components/Symptom.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="symp-wrap symper btscroll">
     <div class="content">
+      <p class="quest" v-if="chooseSymp.length>0">已选症状</p>
       <div
         class="choose"
         v-if="chooseSymp.length>0"
       >
-        <p class="quest">已选症状</p>
         <p
           class="choo-symp"
           v-for="(v,i) in chooseSymp"
@@ -243,7 +243,7 @@ export default {
         this.$emit('next');
       }
     },
-    common(item,flg){
+    common(item,flg,sign){
       if(this.chooseSymp.length>12){
         this.$store.commit('setSearchShow', false);
         return
@@ -270,17 +270,30 @@ export default {
             }
             this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
             if (mapping && mapping.length > 0) {
+              let numPlus = 0;
               for(let i = 0;i < mapping.length;i++){
-                if(mapping[i].flag == 3){
-                  localStorage.setItem("staticSymp",JSON.stringify(mapping[i].questionDetailList))
+                let tmpMap = mapping[i]
+                if(tmpMap.flag == 3){
+                  for(let j = 0;j < tmpMap.questionDetailList.length;j++){
+                    tmpMap.questionDetailList[j].questionId = tmpMap.questionDetailList[j].name
+                  }
+                  localStorage.setItem("staticSymp",JSON.stringify(tmpMap.questionDetailList))
+                }else{
+                  ++numPlus
                 }
               }
+              if(numPlus == mapping.length){
+                localStorage.setItem("staticSymp",JSON.stringify([]))
+              }
               this.$store.commit('setDetail',{detail:result.data,ppId:null,moduleType:moduleCP['symp'],sign:1,idx:this.chooseSymp.length})
+              if(sign){
+                return
+              }
               this.$store.commit('setSearchShow', false);
               this.chooseSymp.push(item);
             } else { 
-              this.chooseSymp.push(item);
               this.$store.commit('setSearchShow', false);
+              this.chooseSymp.push(item);
             }
             const sympText = this.getSympText();
             this.getPush(sympText);
@@ -298,6 +311,7 @@ export default {
         }else{
           this.$store.commit('setText', { type: moduleCP['symp'], text: item.name,textP: item.description||item.name, pId: this.questId,idx:flg });
         }
+        this.$store.commit('setSearchShow', false);
         this.chooseSymp.push(item);
         const sympText = this.getSympText();
         this.getPush(sympText);
@@ -307,7 +321,8 @@ export default {
     showDetil(item,flg) {//搜索点开的详情
       this.tmpItem=item
       this.isSearch=flg||false
-      this.common(item,flg,this.chooseSymp);
+      let num = this.chooseSymp.length+1;
+      this.common(item,num,flg);
     },
     getSympText() {//推送使用医生端信息
       const text = this.$store.state.symptom.text;
@@ -329,7 +344,7 @@ export default {
       api.getPush(param).then((res) => {
         const result = res.data;
         if (result.code == 0) {
-          let symp = result.data.symptom;
+          let symp = result.data.symptom||[];
           let symped = JSON.parse(JSON.stringify(this.chooseSymp));//已选症状
           let sympStic = JSON.parse(localStorage.getItem('staticSymp'));//首次有无症状
           let sympAll = sympStic.concat(symp);
@@ -345,6 +360,7 @@ export default {
               }
             }
           }
+          console.log(sympStic)
           this.symp = sympAll.slice(0,12);
           this.$refs.showHide.style.height = 'auto'
         }
@@ -457,7 +473,7 @@ export default {
         height: .74rem;
       }
     }
-    .choo-symp:last-child{
+    .choo-symp:nth-child(3n+3){
       margin-right: 0;
     }
   .label{

+ 1 - 3
src/store.js

@@ -218,10 +218,8 @@ const store = new Vuex.Store({
                 return
               }
             }
-            text.push(param);
-          }else{
-            text.push(param);
           }
+          text.push(param);
           break;
         case moduleCP['diagT']: //诊疗情况
           let diaText = JSON.parse(JSON.stringify(state.diagnose.text));