Jelajahi Sumber

必填项验证去掉

zhouna 5 tahun lalu
induk
melakukan
192689700a
3 mengubah file dengan 35 tambahan dan 36 penghapusan
  1. 1 1
      config/index.js
  2. 14 14
      src/components/Detail.vue
  3. 20 21
      src/components/DetailBox.vue

+ 1 - 1
config/index.js

@@ -4,7 +4,7 @@
 
 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.121:5050';
 // const proxy_path = 'http://192.168.2.241:5050';
 
 module.exports = {

+ 14 - 14
src/components/Detail.vue

@@ -4,15 +4,15 @@
     <div v-for="(item,index) in checkDatas.questionMapping">
       <p class="quest"><span v-show="item.required==1" style="color: red;">*</span>{{index + 1 +'.' + (item.description || item.name)}}</p>
       <img class="questionImg" :src="item.url.replace('{imageUrlPrefix}',imgUrl)" v-if="item.url">
-      <Radio v-if="item.controlType==1" 
+      <Radio v-if="item.controlType==1"
             :item="item"
             :key="item.id"
             @updata="updataData"/>
-      <RadioSelect v-if="item.controlType==8" 
+      <RadioSelect v-if="item.controlType==8"
             :item="item"
             :key="item.id"
             @updata="updataData"/>
-      <CheckBox v-if="item.controlType==2" 
+      <CheckBox v-if="item.controlType==2"
             :item="item"
             :key="item.id"
             @updata="updataData"/>
@@ -36,7 +36,7 @@
           @updata="updataData($event,item)"
         ></MultiLineInput>
       </template>
-      <PickTime v-if="item.controlType == 9" 
+      <PickTime v-if="item.controlType == 9"
               @updata="updataData"
               :item="item"/>
     </div>
@@ -87,7 +87,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
                 if(detList[k].id==data.id){
                   detList.splice(k,1,data)
                 }
-              } 
+              }
               for(let n in detList){//给父级赋值
                 if(detList[n].value){
                   tempVal += detList[n].name.replace(patt,detList[n].value)+',';
@@ -103,7 +103,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
               mapping.splice(i,1,data)
             }
           }
-          
+
         }
         // 实时更新清空样式
         if(data.value){
@@ -117,19 +117,19 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
           }
         }
         // 更新完成样式
-        let checkReq = this.checkReq();
+        /*let checkReq = this.checkReq();
         if(checkReq){
           this.$emit('checkReq',true)
         }else{
           this.$emit('checkReq',false)
-        }
+        }*/
       },
       saveData(){//存值
         this.checkDatas = Object.assign({},this.checkDatas,{select:1});
         const datas = this.checkDatas.questionMapping;
         const id = this.checkDatas.id;
         let chooseSymp = this.$store.state.symptom.choose;
-        
+
         let text = ""; //医生
         let textP = "";//患者
         let special = ""; //拼到主诉
@@ -158,7 +158,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
             }
           }
         }
-        
+
         let msg = this.checkDatas.name+ ',' + text;
         let msgP = (this.checkDatas.description || this.checkDatas.name)+ ',' + textP;
         let newMsg = "";
@@ -185,7 +185,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
           if(datas[i].controlType ==9){
             if(datas[i].pickIndex){
               datas[i].pickIndex = [];
-            } 
+            }
           }
           datas[i].value = "";
           datas[i].valueP = "";
@@ -215,7 +215,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         }else{
           this.$store.commit('setDatas',{data:Object.assign({},this.checkDatas,{select:1}),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(){// 校验是否有已填项
@@ -240,7 +240,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         }
         return false;
       },
-      checkReq(){// 校验必填项
+      /*checkReq(){// 校验必填项
         const datas = this.checkDatas.questionMapping;
         for(let k in datas){
           if(datas[k].required==1 && !datas[k].value){
@@ -248,7 +248,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
           }
         }
         return true;
-      }
+      }*/
     },
   }
 </script>

+ 20 - 21
src/components/DetailBox.vue

@@ -5,11 +5,10 @@
       <div class="content detailBoxMain" ref="detailBox">
         <div class="tmpDom"></div>
         <div class="main">
-          <Detail :datas="privateData" 
+          <Detail :datas="privateData"
                   ref="detail"
                   :data="data"
-                  @check="changeCheck($event)"
-                  @checkReq="changeFins($event)"/>
+                  @check="changeCheck($event)"/>
         </div>
         <!-- <div class="foot" @click="complete">完成</div> -->
       </div>
@@ -23,10 +22,10 @@
       </div>
     </div>
     <!-- <div :class="['foot',{'noCheck':!checkF}]" @click="complete">完成</div> -->
-    <div style="position:absolute" :class="['foot',{'noCheck':!checkF || !reqFinish}]" @click="complete">完成</div>
-    <Toast :message="clearTxt" 
+    <div style="position:absolute" :class="['foot']" @click="complete">完成</div>
+    <Toast :message="clearTxt"
           :show="showToast"
-          @comfirn="comfirnDel" 
+          @comfirn="comfirnDel"
           @cancel="cancelDel"/>
   </portal>
 </template>
@@ -51,7 +50,7 @@
         tips:"(请完成病情预问诊可让医生提前了解病情)",
         checkF:false, //详情页有无已选项标识
         show:detailShow,
-        reqFinish:false,
+        //reqFinish:false,
         showPic:false
       }
     },
@@ -59,13 +58,13 @@
       this.$nextTick(()=>{
         // 校验是否有已填项,有--弹窗;无--return
         let hasCheck = this.$refs.detail.check();
-        let checkReq = this.$refs.detail.checkReq();
+        //let checkReq = this.$refs.detail.checkReq();
         if(hasCheck){
           this.checkF = true;
         }
-        if(checkReq && hasCheck){
+        /*if(checkReq && hasCheck){
           this.reqFinish = true;
-        }
+        }*/
         setTimeout(() => {
           let scroll = setScroll(BScroll,true,'.viewPrew')
           this.scroll = scroll
@@ -76,7 +75,7 @@
     methods:{
       onScroll(data) {
         this.$store.commit('setScroll', data)
-        document.activeElement.scrollIntoViewIfNeeded(true);        
+        document.activeElement.scrollIntoViewIfNeeded(true);
       },
       close(){
         // 有必填项但没值则将choose移除 8-19
@@ -96,31 +95,31 @@
             }
           }
         }
-        
+
         this.$store.commit('setDetail',{detail:{}})
       },
       complete(){
       //有选中内容才可以点完成#1919
         // if(this.checkF){
       //必填项都填完了才可以点完成
-        if(this.reqFinish && this.checkF){
+        //if(this.checkF){
           this.$refs.detail.saveData();
           this.$store.commit('setSearchShow', false);
-        }
+       // }
       },
       changeCheck(flag){//是否有选中项
         this.checkF = flag;
       },
-      changeFins(flag){//必填项是否都填了
+      /*changeFins(flag){//必填项是否都填了
         this.reqFinish = flag;
-      },
+      },*/
       handleClear(){//清空
         // 校验是否有已填项,有--弹窗;无--return
         if(this.checkF){
           this.showToast = true;
           $(".btscroll").css({'position':'fixed'})
           $(".foot").css({'position':'fixed'})
-        }  
+        }
       },
       cancelDel(){
         $(".btscroll").css({'position':'absolute'})
@@ -131,7 +130,7 @@
         this.$refs.detail.clearData();
         this.showToast = false;
         this.checkF = false;
-        this.reqFinish = false;
+        //this.reqFinish = false;
         // 让detail组件更新
         const type = this.data.moduleType;
         if(type == moduleCP['symp']){ //症状情况单独处理
@@ -140,7 +139,7 @@
           const data = read[id];
           this.$store.commit('setDetail',{detail:data,ppId:null,moduleType:moduleCP['symp']})
         }
-        
+
       },
     },
     components:{
@@ -256,9 +255,9 @@
     50% {top: 50%;}
     75% {top: 25%;}
     100% {top: 45px;}
-  } 
+  }
   @keyframes foo {
     0% {bottom:-1rem;}
     100% {bottom:0;}
   }
-</style>
+</style>