Browse Source

bug2669,2664,2625,2624

luolei 5 years ago
parent
commit
bb26b08a50
5 changed files with 46 additions and 36 deletions
  1. 2 2
      src/common/CheckBox.vue
  2. 1 7
      src/components/Department.vue
  3. 12 4
      src/components/Detail.vue
  4. 28 20
      src/components/Login.vue
  5. 3 3
      src/utils/tools.js

+ 2 - 2
src/common/CheckBox.vue

@@ -132,7 +132,7 @@ import OptionInp from '../common/OptionInp.vue';
             this.exclusion = filArr1[0].exclusion;
           }
         }
-        let temp = concatVal(data);
+        let temp = concatVal(data,false,this.datas.flag);
         const newData = Object.assign({},this.datas,{questionDetailList:data},{value:temp.value?temp.value:''},{valueP:temp.valueP?temp.valueP:''});
         this.$emit("updata",newData);
       },
@@ -142,7 +142,7 @@ import OptionInp from '../common/OptionInp.vue';
         let currItem = detailList[index];
         currItem.value = val;
         // 输入框失焦重新拼接父级的value
-        let temp = concatVal(detailList);
+        let temp = concatVal(detailList,false,this.datas.flag);
         this.datas.value = temp.value;
         this.datas.valueP = temp.valueP;
         this.$emit("updata",this.datas);

+ 1 - 7
src/components/Department.vue

@@ -90,13 +90,7 @@
                             this.showTip = true
                         }
                     } else {
-                        if(res.msg.indexOf('暂无今日挂号信息') != -1){
-                            this.message.title = '温馨提示'
-                            this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
-                            this.showTip = true
-                        }else{
-                            this.defaultWaring(res.msg);
-                        }
+                        this.defaultWaring(res.data.msg);
                     }
                 }).catch(() => {
                     this.defaultWaring("网络异常请稍后重试");

+ 12 - 4
src/components/Detail.vue

@@ -244,7 +244,7 @@ import $ from 'jquery';
         let textP = "";//患者
         let special = ""; //拼到主诉
         let specialP = "";
-        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="",signNum1=1,signNum2=1;
+        let bj1 = "",bjP1 = "",bj2 = "",bjP2 = "",bj3="",bjP3="",signNum1=1,signNum2=1,signNum3=1;
         for(let i in datas){
           // 校验必填项
          /* if(datas[i].required==1 && !datas[i].value){
@@ -252,9 +252,17 @@ import $ from 'jquery';
             return
           }*/
           // 拼到主诉
-          if(datas[i].specFlag==1 && datas[i].value){
-            special += datas[i].value;
-            specialP += datas[i].valueP;
+          // if(datas[i].specFlag==1 && datas[i].value){
+          //   special += datas[i].value;
+          //   specialP += datas[i].valueP;
+          // }
+          if(datas[i].flag==1 && datas[i].value){
+            if(signNum3 == 1){
+              special += datas[i].value;
+              specialP += datas[i].valueP;
+            }else{
+
+            }
           }
           if(datas[i].value){
             if(datas[i].flag == 1){

+ 28 - 20
src/components/Login.vue

@@ -57,7 +57,7 @@
           placeholder="请输入姓名"
         />
       </div>
-      <div :class="['btn',canClick&&allow?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
+      <div :class="['btn',canClick&&!allow?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
     </div>
     <!-- <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div> -->
     <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
@@ -93,18 +93,19 @@ export default {
         text: ""
       },
       code:'',
-      allow:true,
+      allow:false,
       canClick:false,
       hospitalName:'',
       hospitalNum:'',
       hospitalList:[],
       hospitalShow:false,
-      son:false//有无子医院
+      son:false,//有无子医院
+      clique:1
     };
   },
   created(){
     let query = this.$route.query;
-    let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode,sonHospitalCode=query.sonHospitalCode,sonHospitalName=query.sonHospitalName;
+    let type = query.patientInfoType,name = query.patientName,value = query.patientInfo,code=query.hospitalCode,sonHospitalCode=query.sonHospitalCode,sonHospitalName=query.sonHospitalName,clique=(query.clique!=2?1:query.clique);
     this.code = code||'';
     if(value&&name&&type&&code){
       this.type = type
@@ -119,11 +120,12 @@ export default {
         this.son = false
       }
     }
+    this.clique = clique
     this.getSysConfig(code)
   },
   watch:{
     value:{
-      handler: function (val, oldVal) {
+      handler: function(val, oldVal) {
         if(val&&this.patName){
           this.canClick = true
         }else{
@@ -133,7 +135,7 @@ export default {
       deep: true
     },
     patName:{
-      handler: function (val, oldVal) {
+      handler: function(val, oldVal) {
         if(val&&this.value){
           this.canClick = true
         }else{
@@ -144,8 +146,8 @@ export default {
     }
   },
   beforeRouteLeave(to, from, next){
-    // console.log(to)
-    if(JSON.stringify(to.params) == '{}'&&JSON.stringify(to.query) == '{}'){
+    const { value,patName,allow } = this;
+    if(!value||!patName){
       return
     }
     next();
@@ -158,7 +160,9 @@ export default {
         if (result.code == 0) {
           let tmpMain = result.data.superiorsInfo;
           let tmpLis = result.data.juniorHospital;
-          tmpLis.unshift(tmpMain)
+          if(this.clique == 1){
+            tmpLis.unshift(tmpMain)
+          }
           this.hospitalList = tmpLis
           if(!this.son){
             this.hospitalName = tmpLis[0].hospitalName  //默认第一个
@@ -232,10 +236,9 @@ export default {
       //   document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
       // }
     },
-    changeName() {
+    changeName(e) {
       // document.activeElement.scrollIntoViewIfNeeded(true);
-      const { patName } = this;
-      this.patName = patName.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
+      this.patName = e.target.value.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
     },
     changeVal() {
       // document.activeElement.scrollIntoViewIfNeeded(true);
@@ -261,31 +264,34 @@ export default {
     },
     handleDepart(){
       const { type, value,patName,allow,hospitalNum,hospitalName,code,hospitalList } = this;
-      this.allow = false
-      if (value&&patName&&allow) {
+      if(allow){
+        return
+      }
+      if (value&&patName) {
+        this.allow = true
         let timer = setTimeout(() => {
           if (type == 102) {
             if (!jgpattern.test(value) || value.length > 20) {//验证不通过
               this.defaultWaring("请输入正确的病历号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           } else if (type == 101) {//身份证
             if (!identify.test(value) || value.length > 18) {//验证不通过
               this.defaultWaring("请输入正确的身份证号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           } else if (type == 104) {//市民卡号只能输入数字字母
             if (!jgpattern.test(value)||value.length!=9) {//验证不通过
               this.defaultWaring("请输入正确的9位市民卡号");
-              this.allow = true
+              this.allow = false;
               return;
             }
           }
           if(!this.code){
             this.defaultWaring("医院编码必填");
-            this.allow = true
+            this.allow = false;
             return;
           }
           const param = {
@@ -307,6 +313,7 @@ export default {
                   name: "Department",
                   params: { result: result.data }
                 });
+                this.allow = false
               } else if (result.data.length == 1) {
                 let msg = result.data[0];
                 let params = {
@@ -323,6 +330,7 @@ export default {
                   path: "/home",
                   query: params
                 });
+                this.allow = false
               } else {
                 this.message.title = '温馨提示'
                 this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
@@ -337,12 +345,12 @@ export default {
               // }else{
               //   this.defaultWaring(res.data.msg);
               // }
-              this.allow = true
+              this.allow = false
               this.defaultWaring(res.data.msg||"网络异常请稍后重试");
               clearTimeout(timer)
             }
           }).catch(() => {
-            this.allow = true
+            this.allow = false
             clearTimeout(timer)
             this.defaultWaring("网络异常请稍后重试");
           });

+ 3 - 3
src/utils/tools.js

@@ -283,7 +283,7 @@ function trimDots(str){
 }
 
 // 拼值,并去掉占位符
-function concatVal(data,flg){
+function concatVal(data,flg,flag){
   let value = ""; //医生
   let valueP = ""; //患者
   let tmpStrHas = [],tmpStrNo = [],tmpAll=[];
@@ -312,8 +312,8 @@ function concatVal(data,flg){
           value += str + ',';
           valueP += strP + ',';
         }else{
-          value += data[k].name.replace(patt,'') + ',';
-          valueP += (data[k].description || data[k].name).replace(patt,'') + ',';
+          value += data[k].name.replace(patt,'') +( flag == 2?'、':',');
+          valueP += (data[k].description || data[k].name).replace(patt,'') + (flag == 2?'、':',');
         }
       }
     }