Browse Source

bug2668,2667,2665,2656,2649,2648,

luolei 5 years ago
parent
commit
9be14b0871

+ 1 - 0
src/common/Submit.vue

@@ -140,6 +140,7 @@ export default {
   box-sizing: border-box;
   border-radius: 0.2rem;
   text-align: center;
+  padding: 0 .1rem;
   background-color: #fff;
 }
 </style>

+ 20 - 9
src/components/Detail.vue

@@ -11,7 +11,7 @@
     </div>
     <div class="viewPrew">
       <div class="content">
-        <div class="preQuestion" v-for="(item,index) in showCheckDatas">
+        <div class="preQuestion" v-for="(item,index) in checkDatas.questionMapping">
           <div class="quest" @click="slideToggle($event,index)">
             <img class="sign" v-if="item.required==1" src="../images/important.svg" alt="">
             <p class="title clearfix">{{index + 1 +'.'+(item.description || item.name)}}{{item.controlType==1?'(单选)':item.controlType==2?'(多选)':''}}</p>
@@ -100,9 +100,8 @@ import $ from 'jquery';
     },
     props:['datas','data','checkF','tips','sex','flags'],
     created(){
-      this.checkDatas = JSON.parse(JSON.stringify(this.datas));
-      let tmpD = this.checkDatas.questionMapping||[]
-      this.showCheckDatas = tmpD.filter(item=>item.flag!=3)
+      let tmpData = JSON.parse(JSON.stringify(this.datas));
+      this.checkDatas = tmpData
     },
     mounted(){
       this.$nextTick(()=>{
@@ -245,7 +244,7 @@ import $ from 'jquery';
         let textP = "";//患者
         let special = ""; //拼到主诉
         let specialP = "";
-        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="";
+        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="",signNum1=1,signNum2=1;
         for(let i in datas){
           // 校验必填项
          /* if(datas[i].required==1 && !datas[i].value){
@@ -259,11 +258,23 @@ import $ from 'jquery';
           }
           if(datas[i].value){
             if(datas[i].flag == 1){
-              bj1 += '于'+datas[i].value+'前';
-              bjP1 += '于'+datas[i].valueP+'前';
+              if(signNum1 == 1){
+                ++signNum1
+                bj1 += '于'+datas[i].value+'前';
+                bjP1 += '于'+datas[i].valueP+'前';
+              }else{
+                bj3 += datas[i].value+',';
+                bjP3 += datas[i].valueP+',';
+              }
             }else if(datas[i].flag == 2){
-              bj2 += datas[i].value;
-              bjP2 += datas[i].valueP;
+              if(signNum2 == 1){
+                ++signNum2
+                bj2 += datas[i].value;
+                bjP2 += datas[i].valueP;
+              }else{
+                bj3 += datas[i].value+',';
+                bjP3 += datas[i].valueP+',';
+              }
             }else{
               bj3 += datas[i].value+',';
               bjP3 += datas[i].valueP+',';

+ 18 - 1
src/components/DetailBox.vue

@@ -39,10 +39,27 @@
     props:['flags'],
     data(){
       const {detailInfo,detailShow} = this.$store.state;
+      const {detail} = this.$store.state.detailInfo;
+      let signNum = 1,tmpData = this.$store.state.detailInfo.detail,tmpArr=[];
+      if(tmpData.checkedAll != 1){
+        for(let i = 0;i < tmpData.questionMapping.length;i++){
+          if(tmpData.questionMapping[i].flag != 3){
+              tmpArr.push(tmpData.questionMapping[i])
+          }else{
+            if(signNum != 1){
+              tmpArr.push(tmpData.questionMapping[i])
+            }else{
+              ++signNum
+            }
+          }
+        }
+        tmpData.questionMapping = tmpArr
+        tmpData.checkedAll = 1
+      }
       return{
         msg:"胸痛详情",
         data:detailInfo,
-        privateData:this.$store.state.detailInfo.detail||{},
+        privateData:tmpData||{},
         compFlag:false,
         clearTxt:"是否清空当前已选内容?",
         showToast:false,

+ 0 - 1
src/components/Login.vue

@@ -120,7 +120,6 @@ export default {
       }
     }
     this.getSysConfig(code)
-    
   },
   watch:{
     value:{

+ 17 - 3
src/components/Symptom.vue

@@ -68,6 +68,7 @@
       @comfirn="comfirnDel"
       @cancel="cancelDel"
     />
+    <Submit v-if="submit" showType="fail" :fail="failMsg" @showSubmit="showSubmit"></Submit>
     <Search
       v-if="this.$store.state.searchShow"
       @search="search"
@@ -85,6 +86,7 @@ import Toast from '../common/Toast.vue';
 import Tiptoast from '../common/Tiptoast.vue';
 import Search from './Search.vue';
 import {moduleCP,setScroll,trimDots} from '@utils/tools'
+import Submit from "../common/Submit";
 import BScroll from 'better-scroll';
 import $ from 'jquery';
 export default {
@@ -118,10 +120,12 @@ export default {
         title:'',
         text:''
       },
+      submit:false,
       start:{},
       end:{},
       slide:false,
-      slideTxt:'展开'
+      slideTxt:'展开',
+      failMsg: "无法选择症状,已超过最高选择症状最高个数",
     }
   },
   created() {
@@ -159,6 +163,9 @@ export default {
     }
   },
   methods: {
+    showSubmit(flg){
+      this.submit = flg;
+    },
     slideToggle(){
       let flg = this.slideTxt;
       if(flg == '展开'){
@@ -246,6 +253,11 @@ export default {
     common(item,flg,sign){
       if(this.chooseSymp.length>12){
         this.$store.commit('setSearchShow', false);
+        this.submit = true
+        let timer = setTimeout(() => {
+          this.submit = false;
+          clearTimeout(timer);
+        }, 2000);
         return
       }
       this.questId = item.questionId || item.id || item.conceptId;
@@ -269,9 +281,10 @@ export default {
             this.$store.commit('setOrigin', { type: moduleCP['symp'], data: result.data });
             if (mapping && mapping.length > 0) {
               let numPlus = 0;
+              let signNUm = 1;//第一个打标的,保存为伴随
               for(let i = 0;i < mapping.length;i++){
                 let tmpMap = mapping[i]
-                if(tmpMap.flag == 3){
+                if(tmpMap.flag == 3 && signNUm == 1){
                   for(let j = 0;j < tmpMap.questionDetailList.length;j++){
                     tmpMap.questionDetailList[j].questionId = tmpMap.questionDetailList[j].name
                   }
@@ -414,7 +427,8 @@ export default {
   components: {
     Toast,
     Search,
-    Tiptoast
+    Tiptoast,
+    Submit
   }
 }
 </script>