瀏覽代碼

merge dev

liucf 5 年之前
父節點
當前提交
6f435c72fb

+ 11 - 4
src/common/CheckBox.vue

@@ -17,6 +17,7 @@
           :item="it" 
           ref="inp"
           @handleInp="inpVal($event,index)" 
+          @handleSelec="handleClick(it,index,true)"
           :exclu="exclusion !==999 && it.exclusion !== exclusion" 
           />
     </p>
@@ -46,7 +47,7 @@ import OptionInp from '../common/OptionInp.vue';
       this.resetExc();
     },
     methods:{
-      handleClick(it,index){
+      handleClick(it,index,flag){
         const that = this;
         const list = this.datas;
         let data = list.questionDetailList&&list.questionDetailList.slice(0);
@@ -62,12 +63,18 @@ import OptionInp from '../common/OptionInp.vue';
           this.exclusion = it.exclusion;  
         }
         // 处理选中状态
-        if(data[index].select){
-          data[index].select = 0;
-        }else{
+        if(flag){//输入框反选
           data[index].select = 1;
           this.exclusion = it.exclusion;
+        }else{
+          if(data[index].select){
+            data[index].select = 0;
+          }else{
+            data[index].select = 1;
+            this.exclusion = it.exclusion;
+          }
         }
+        
         // 处理取消-互斥
         const filArr1 = data.filter(it=>it.select==1);
         if(excluArr.length>0){//有互斥

+ 21 - 10
src/common/OptionInp.vue

@@ -5,8 +5,8 @@
     <div class="inp" @click="preClick">
       <input :type="msg.type=='number'?'tel':'text'" 
               :placeholder="msg.placeholder"
-              :disabled="select!=1"
-              :class="{'exclu':exclu}"
+              
+              :class="[{'exclu':exclu},{'cancel':item.select==0}]"
               v-model="txt"
               @click="handleCli"
               @blur="handleBlur"
@@ -50,6 +50,10 @@ import { getExpStr,scrollToV,isIos} from '@utils/tools';
         e.stopPropagation();
       },
       handleCli(e){
+        // const select = this.item.select;
+        if(!this.select){//聚焦时自动选中该项
+          this.$emit('handleSelec');
+        }
         if(!isIos()){
           scrollToV(e)
         } 
@@ -73,25 +77,32 @@ import { getExpStr,scrollToV,isIos} from '@utils/tools';
     .inp{
       display: inline-block;
       vertical-align: top;
-      position: relative;
-      top:3px;
+      // position: relative;
+      // top:1px;
       input{
         color: #4F50FF;
-        font-size: .3rem;
+        font-size: .28rem;
         border-bottom: 1px solid #DFE0E4 !important;
         border-radius: 0;
         padding-left: .05rem;
       }
     }
-    .check{
+    .check{//选中
       color: #4F50FF;
     }
-    .exclu{
+    .inp .exclu{ //互斥
       color:#e6e7e9 !important;
     }
-    input:disabled, input[disabled]{ 
-      background:#EBEBE4;
-      // -webkit-text-fill-color:#8d9399;
+    .cancel{ //取消
+      color: #bbbbbb !important;
+    }
+    input:disabled, input[disabled]{
+      background:transparent;
+      border-bottom-color: #DEDEDE !important;
+    }
+    // input:disabled,input[disabled]::-webkit-input-placeholder{
+    .exclu::-webkit-input-placeholder{
+      color:#e6e7e9 !important;
     }
   }
 </style>

+ 5 - 1
src/common/Radio.vue

@@ -13,7 +13,7 @@
           :inline="true" 
           :select="it.select==1" 
           /> -->
-      <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" />
+      <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" @handleSelec="handleClick(it,index)"/>
     </p>
   </div>
 </template>
@@ -63,6 +63,10 @@ import OptionInp from '../common/OptionInp.vue';
         this.datas.valueP = temp.valueP;
         this.$emit("updata",this.datas);
       },
+      /*inpSele(index){//输入框反选
+        let detailList = this.datas.questionDetailList;console.log("单选:",index,detailList[index])
+        detailList[index].select = 1;
+      }*/
     },
     watch:{
       item:{

+ 24 - 3
src/common/Toast.vue

@@ -13,6 +13,7 @@
   </div>
 </template>
 <script type="text/javascript">
+import $ from 'jquery';
   export default {
     name:'Toast',
     data(){
@@ -20,15 +21,35 @@
         msg:"是否删除该信息?"
       }
     },
-    props:['message','show'],
+    props:['message','show','labShow'],
+    /*mounted(){
+      $('body').bind("touchmove",function(e){
+        e.preventDefault();
+      })
+    },
+    beforeDestroy(){
+      $('body').bind("touchmove",function(e){
+        e.next();
+      })
+    },*/
     methods:{
       comfirn(){
         this.$emit("comfirn")
       },
       cancel(){
         this.$emit("cancel")
-      },
-    }
+      }
+    },
+    /*watch:{
+      labShow(newVal,oldVal){
+        if(newVal){
+          const height = document.documentElement.clientHeight;
+          $('body').css({'height':height+'px','overflow-y':'hidden'})
+        }else{
+          $('body').css({'height':'100%','overflow-y':'auto'})
+        }
+      }
+    }*/
   }
 </script>
 <style lang="less" scoped>

+ 23 - 4
src/components/DiagTreat.vue

@@ -35,6 +35,17 @@
             :item="it"
             :key="it.id"
             @updata="updataData($event,it.id)"/>
+        <!-- 多行输入-->
+        <template
+            v-if="it.controlType == 3"
+            v-for="(part,index) in it.questionDetailList"
+          >
+            <MultiLineInput
+              :msg="part.name"
+              :part="part"
+              @updata="updataData($event,it.id,index)"
+            ></MultiLineInput>
+        </template>
     </div>
     <div class="result" v-if="checkText.length>0">
       <p class="title">{{datas.name}}</p>
@@ -69,6 +80,7 @@
   import {moduleCP,patt,imageUrlPrefix} from '@utils/tools';
   import Radio from '../common/Radio.vue';
   import CheckBox from '../common/CheckBox.vue';
+  import MultiLineInput from '../common/MultiLineInput.vue';
   export default {
     name:'DiagTreat',
     data(){
@@ -123,11 +135,17 @@
         }          
         return msg;
       },
-      updataData(data,id){//输入框存值
+      updataData(data,id,index){//输入框存值
         let list = this.dtoList;
         for(let i in list){
-          if(list[i].id==data.id){
-            list.splice(i,1,data)
+          // 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);
+            }else{
+              list.splice(i,1,data)
+            }
           }
         }
         this.$store.commit('setDatas',{type:moduleCP['diagT'],data:data,pId:data.id,ppId:id});
@@ -141,7 +159,8 @@
       Input,
       ComTextArea,
       Radio,
-      CheckBox
+      CheckBox,
+      MultiLineInput
     },
     /*watch:{
       dtoList:{

+ 13 - 8
src/components/Others.vue

@@ -29,18 +29,17 @@
             :item="it"
             :key="it.id"
             @updata="updataData($event,it.id)"/>
-        <!-- 多行输入 存值和回读事件未处理 -->
-        <!-- <template
+        <!-- 多行输入-->
+        <template
             v-if="it.controlType == 3"
             v-for="(part,index) in it.questionDetailList"
           >
             <MultiLineInput
-              v-if="it.controlType == 3"
               :msg="part.name"
               :part="part"
-              @updata="updataData($event,index,it)"
+              @updata="updataData($event,it.id,index)"
             ></MultiLineInput>
-        </template> -->
+        </template>
     </div>
     <div class="result" v-if="checkText.length>0">
       <p class="title">{{datas.name}}</p>
@@ -120,11 +119,17 @@
         this.labelDetail = {};
         this.ppId = null;
       },
-      updataData(data,id){//输入框存值
+      updataData(data,id,index){//输入框存值
         let list = this.dtoList;
         for(let i in list){
-          if(list[i].id==data.id){
-            list.splice(i,1,data)
+          // 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);
+            }else{
+              list.splice(i,1,data)
+            } 
           }
         }
         

+ 1 - 1
src/components/PathInfo.vue

@@ -178,7 +178,7 @@
           // this.$router.push({path:'/tab'})
           this.$router.replace({path:'/tab'})
         }else{
-          this.defaultWaring('请先维护症状模块')
+          this.defaultWaring('网络异常请稍后重试')
         }
       },
       defaultWaring(msg){

+ 3 - 0
src/components/TabPage.vue

@@ -67,6 +67,7 @@ import DiagTreat from './DiagTreat.vue';
 import Others from './Others.vue';
 import Preview from './Preview.vue';
 import {moduleConfig,moduleCP} from '../utils/tools.js';
+import $ from 'jquery';
 export default {
   name: 'TabPage',
   data() {
@@ -151,6 +152,7 @@ export default {
           }
         }
       }
+      $('body').scrollTop(0);
     },
     beBack(preview) {
       if(preview === 'preview'){
@@ -171,6 +173,7 @@ export default {
           this.flag = this.modlues[i-1].type
         }
       }
+      $('body').scrollTop(0);
     },
     toggleModule(flg){
       this.moduleShow = flg

+ 1 - 1
src/less/index.less

@@ -97,4 +97,4 @@ html{
     .main .mainBtm .Recommend .btn {
       padding: 0 10px !important;
     }
-} */ 
+} */