浏览代码

Merge remote-tracking branch 'origin/new' into tempMaster

zhouna 5 年之前
父节点
当前提交
5ef2140b9e

+ 10 - 1
src/common/CheckBox.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="check-wrap" v-if="item">
-    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,'',true)">
+    <!-- <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,'',true)"> -->
+      <p v-for="(it,index) in datas.questionDetailList" :key="it.id" :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]" @click="handleClick(it,index,'',true)">
       <img :src="it.select==1?check:defaultPic">
       <span v-if="((it.description||it.name).indexOf('${'))==-1" :class="[{'check':it.select==1},{'exclu':exclusion !==999 && it.exclusion !== exclusion}]">{{it.description||it.name}}</span>
       <OptionInp v-else 
@@ -128,16 +129,24 @@ import OptionInp from '../common/OptionInp.vue';
     img{
       width:100%;
     }
+    .block{
+      width:100%;
+    }
     .list{
       color: #7C828E;
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
       white-space: nowrap;
+      overflow-x: hidden;
       img{
         width: .38rem;
         vertical-align: middle;
       }
+      >span{
+        white-space: normal;
+        vertical-align: middle;
+      }
     }
     .check{
       color: #4F50FF;

+ 26 - 7
src/common/OptionInp.vue

@@ -2,9 +2,10 @@
 <template>
   <div :class="['inpbox',{'check':item.select},{'exclu':exclu}]">
     <span class="prefix" v-if="msg.prefix">{{msg.prefix}}</span>
-    <div class="inp" @click="preClick">
+    <!-- <div class="inp" @click="preClick"> -->
       <input :type="msg.type=='number'?'tel':'text'" 
               :placeholder="msg.placeholder"
+              :style="{'width':!msg.prefix&&!msg.suffix?'90%':'33%'}"
               :disabled="exclu"
               :maxlength="msg.type=='number'?10:''"
               :class="[{'exclu':exclu},{'cancel':item.select==0}]"
@@ -12,7 +13,7 @@
               @click="handleCli"
               @blur="handleBlur"
               @input="changeVal">
-    </div>
+    <!-- </div> -->
     <span class="suffix" v-if="msg.suffix">{{msg.suffix}}</span>
   </div>
 </template>
@@ -24,7 +25,7 @@ import { getExpStr} from '@utils/tools';
       return{
         msg:{},
         txt:this.item.value || '',
-        select:0
+        select:0,
       }
     },
     props:['item','exclu'],
@@ -59,6 +60,7 @@ import { getExpStr} from '@utils/tools';
         e.stopPropagation();
       },
       handleCli(e){
+        e.stopPropagation();
         // const select = this.item.select;
         if(!this.select){//聚焦时自动选中该项
           this.$emit('handleSelec');
@@ -80,11 +82,15 @@ import { getExpStr} from '@utils/tools';
   .inpbox{
     color:#7C828E;
     display: inline-block;
-    .inp{
+    width: 100%;
+    white-space: normal;
+    vertical-align: middle;
+    // padding-right: .3rem;
+    /* height: .42rem;
+    line-height: .42rem; */
+    /* .inp{
       display: inline-block;
       vertical-align: top;
-      // position: relative;
-      // top:1px;
       input{
         color: #4F50FF;
         font-size: .28rem;
@@ -92,11 +98,24 @@ import { getExpStr} from '@utils/tools';
         border-radius: 0;
         padding-left: .05rem;
       }
+    } */
+    .prefix,.suffix{
+      display: inline-block;
+      vertical-align: middle;
+    }
+    input{
+      height: .42rem;
+      color: #4F50FF;
+      font-size: .28rem;
+      border-bottom: 1px solid #DFE0E4 !important;
+      border-radius: 0;
+      padding-left: .05rem;
     }
     .check{//选中
       color: #4F50FF;
     }
-    .inp .exclu{ //互斥
+    // .inp .exclu{ //互斥
+    .exclu{ //互斥
       color:#e6e7e9 !important;
     }
     .cancel{ //取消

+ 11 - 2
src/common/Radio.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="radio-wrap" v-if="item">
-    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,true)">
+    <!-- <p v-for="(it,index) in datas.questionDetailList" :key="it.id" class="list" @click="handleClick(it,index,true)"> -->
+    <p v-for="(it,index) in datas.questionDetailList" :key="it.id" :class="['list',{'block':((it.description||it.name).indexOf('${'))!=-1}]" @click="handleClick(it,index,true)">
       <img :src="it.select==1?check:defaultPic">
       <span v-if="((it.description||it.name).indexOf('${'))==-1" :class="{'check':it.select==1}">{{it.description||it.name}}</span>
       <OptionInp v-else :item="it" @handleInp="inpVal($event,index)" @handleSelec="handleClick(it,index)"/>
@@ -80,18 +81,26 @@ import OptionInp from '../common/OptionInp.vue';
     img{
       width:100%;
     }
+    .block{
+      width:100%;
+    }
     .list{
       color: #7C828E;
       margin:0 .1rem .1rem 0;
       padding: .12rem .1rem;
       display: inline-block;
       white-space: nowrap;
-      -webkit-white-space: nowrap;
+      overflow-x: hidden;
+      // -webkit-white-space: nowrap;
       // -webkit-box-orient: vertical;
       img{
         width: .38rem;
         vertical-align: middle;
       }
+      >span{
+        white-space: normal;
+        vertical-align: middle;
+      }
       .check{
         color: #4F50FF;
       }

+ 1 - 1
src/common/Toast.vue

@@ -10,7 +10,7 @@
                 <span @click="cancel" class="canc">取消</span>
               </div>
             </div>
-            <div class="mask"></div>
+            <div class="mask" @click="cancel"></div>
       </div>
     </portal>
 </template>

+ 2 - 1
src/components/AddContent.vue

@@ -86,7 +86,8 @@ export default {
     })
   },
   methods: {
-    onScroll() {
+    onScroll(data) {
+      this.$store.commit('setScroll', data)
       document.activeElement.scrollIntoViewIfNeeded(true);        
     },
     back() {

+ 0 - 1
src/components/Department.vue

@@ -86,7 +86,6 @@
                 padding-bottom: 1rem;
             }
             .list {
-                height:3.5rem;
                 background:rgba(255,255,255,1);
                 box-shadow:0px 3px 15px 0px rgba(217,217,217,0.5);
                 border-radius:.1rem;

+ 3 - 2
src/components/Detail.vue

@@ -172,7 +172,8 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         this.$store.commit('setDetail',{detail:{}})
       },
       clearData(){//清空
-        const datas = this.checkDatas.questionMapping;
+        // const datas = this.checkDatas.questionMapping;
+        const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
         let reqFlag = false;//必填项标识
         for(let i in datas){
           datas[i].value = "";
@@ -243,7 +244,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
 <style lang="less" scoped>
   .detail-wrap{
     // padding: .3rem .5rem 1.2rem .6rem;
-    padding: .3rem .5rem 1rem .6rem;
+    padding: .3rem .4rem 1rem ;
     font-size: .3rem;
     .quest{
       color:#000;

+ 2 - 1
src/components/DetailBox.vue

@@ -72,7 +72,8 @@
       })
     },
     methods:{
-      onScroll() {
+      onScroll(data) {
+        this.$store.commit('setScroll', data)
         document.activeElement.scrollIntoViewIfNeeded(true);        
       },
       close(){

+ 3 - 2
src/components/DiagTreat.vue

@@ -99,8 +99,9 @@
       })
     },
     methods:{
-      onScroll() {
-        document.activeElement.scrollIntoViewIfNeeded(true);        
+      onScroll(data) {
+        this.$store.commit('setScroll', data);
+        document.activeElement.scrollIntoViewIfNeeded(true);
       },
       beBack(){
         this.$emit('back');

+ 68 - 43
src/components/Login.vue

@@ -14,14 +14,14 @@
         </p>
         <div class="slideType" v-if="show">
           <ul>
-            <li @click="handleType('手机号',103)">手机号</li>
+            <!-- <li @click="handleType('手机号',103)">手机号</li> -->
             <li @click="handleType('身份证号',101)">身份证号</li>
             <li @click="handleType('病历号',102)">病历号</li>
             <li @click="handleType('市民卡号',104)" style="border:0 none">市民卡号</li>
           </ul>
         </div>
       </div>
-      <div class="iptWrap number">
+      <div class="iptWrap number numberIpt">
         <input
           @blur="blur"
           :maxlength="type==103?11:type==101?18:type==102?7:type==104?9:30"
@@ -33,7 +33,18 @@
           :placeholder="'请输入'+name"
         />
       </div>
-      <div :class="['btn',value?'btnClick':'btnDis']" @click="handleDepart">进入预问诊</div>
+      <div class="iptWrap number">
+        <input
+          @blur="blur"
+          :maxlength="30"
+          v-model="patName"
+          @input="changeName"
+          class="input"
+          type="text"
+          placeholder="请输入姓名"
+        />
+      </div>
+      <div :class="['btn',value&&patName?'btnClick':'btnDis']" @click="handleDepart">进入预问诊</div>
     </div>
     <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div>
     <Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
@@ -44,7 +55,7 @@
   </div>
 </template>
 <script>
-import { phoneTest, identify, jgpattern } from "@utils/tools.js";
+import { phoneTest, identify, jgpattern,name } from "@utils/tools.js";
 import Submit from "../common/Submit";
 import Tiptoast from "../common/Tiptoast";
 import api from "@utils/api.js";
@@ -57,8 +68,9 @@ export default {
       failMsg: "",
       submit: false,
       show: false,
-      type: "103",
-      name: "手机号",
+      type: "101",
+      name: "身份证",
+      patName:'',
       value: "",
       message:{
         title: "",
@@ -93,6 +105,11 @@ export default {
         document.activeElement.scrollIntoViewIfNeeded(true);
       }, 300);
     },
+    changeName() {
+      document.activeElement.scrollIntoViewIfNeeded(true);
+      const { patName } = this;
+      this.patName = patName.replace(/[0-9]*$/,'').replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
+    },
     changeVal() {
       document.activeElement.scrollIntoViewIfNeeded(true);
       const { type, value } = this;
@@ -116,39 +133,41 @@ export default {
       this.submit = flg;
     },
     handleDepart() {
-      const { type, value } = this;
-      if (value) {
-        if (type == 103) {
-          if (!phoneTest.test(value)) {
-            //验证不通过
-            this.defaultWaring("输入信息格式有误");
-            return;
-          }
-        } else if (type == 101) {
-          //身份证
-          if (!identify.test(value)) {
-            //验证不通过
-            this.defaultWaring("输入信息格式有误");
-            return;
+      const { type, value,patName } = this;
+      if (value&&patName) {
+        let timer = setTimeout(() => {
+          if (type == 103) {
+            if (!phoneTest.test(value)) {
+              //验证不通过
+              this.defaultWaring("输入信息格式有误");
+              return;
+            }
+          } else if (type == 101) {
+            //身份证
+            if (!identify.test(value)) {
+              //验证不通过
+              this.defaultWaring("输入信息格式有误");
+              return;
+            }
+          } else if (type == 104) {
+            //病历号只能输入数字字母
+            if (!jgpattern.test(value)) {
+              //验证不通过
+              this.defaultWaring("输入信息格式有误");
+              return;
+            }
           }
-        } else if (type == 104) {
-          //病历号只能输入数字字母
-          if (!jgpattern.test(value)) {
-            //验证不通过
-            this.defaultWaring("输入信息格式有误");
+          if(!this.code){
+            this.defaultWaring("医院编码必填");
             return;
           }
-        }
-        if(!this.code){
-          this.defaultWaring("医院编码必填");
-          return;
-        }
-        const param = {
-          patientInfo: this.value,
-          patientInfoType: this.type,
-          hospitalCode:this.code
-        };
-        api
+          const param = {
+            patientInfo: this.value,
+            patientInfoType: this.type,
+            hospitalCode:this.code,
+            patientName:patName
+          };
+          api
           .signIn(param)
           .then(res => {
             let result = res.data;
@@ -180,6 +199,7 @@ export default {
                 this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
                 this.showTip = true
               }
+              clearTimeout(timer)
             } else {
               if(res.msg.indexOf('暂无今日挂号信息') != -1){
                 this.message.title = '温馨提示'
@@ -188,11 +208,14 @@ export default {
               }else{
                 this.defaultWaring(res.msg);
               }
+              clearTimeout(timer)
             }
           })
           .catch(() => {
+            clearTimeout(timer)
             this.defaultWaring("网络异常请稍后重试");
           });
+        }, 300);
       }
     }
   },
@@ -212,14 +235,14 @@ export default {
     rgba(79, 79, 255, 1) 0%,
     rgba(79, 137, 255, 1) 100%
   );
-  padding: 0.1rem 0.6rem;
+  padding: 0rem 0.6rem;
   box-sizing: border-box;
   .top {
     .img {
       width: 1.6rem;
       height: 1.6rem;
       background-color: #fff;
-      margin: 1rem auto 0 auto;
+      margin: .8rem auto 0 auto;
       border-radius: 50%;
       overflow: hidden;
       padding:6px;
@@ -232,16 +255,16 @@ export default {
       text-align: center;
       color: #fff;
       margin-top: 0.4rem;
-      margin-bottom: 0.7rem;
+      margin-bottom: 0.5rem;
       font-weight: normal;
     }
   }
   .main {
     width: 100%;
-    height: 5.34rem;
+    // height: 5.34rem;
     background: #fff;
     border-radius: 0.2rem;
-    padding: 0.8rem 0.6rem;
+    padding: 0.6rem 0.6rem;
     box-sizing: border-box;
     font-size: 0.3rem;
     .iptWrap {
@@ -286,9 +309,8 @@ export default {
         }
       }
     }
-
     .number {
-      margin: 0.3rem 0 0.8rem 0;
+      margin: 0.3rem 0 0.6rem 0;
       .input {
         float: left;
         color: rgba(51, 51, 51, 1);
@@ -299,6 +321,9 @@ export default {
         background-color: transparent;
       }
     }
+    .numberIpt {
+      margin: 0.3rem 0 0.3rem 0;
+    }
     .btn {
       width: 100%;
       height: 0.88rem;

+ 2 - 1
src/components/Others.vue

@@ -93,7 +93,8 @@
       })
     },
     methods:{
-      onScroll() {
+      onScroll(data) {
+        this.$store.commit('setScroll', data)
         document.activeElement.scrollIntoViewIfNeeded(true);
       },
       beBack(){

+ 4 - 2
src/components/Symptom.vue

@@ -38,6 +38,7 @@
           @touchstart.stop.prevent="touchstart(it)"
           @touchend.stop.prevent="touchend(it)"
         >{{it.description || it.name}}</span>
+        <p class="tip" v-show="chooseSymp.length==0">长按症状按钮可显示症状解释说明</p>
       </div>
       <div
         class="result"
@@ -152,8 +153,9 @@ export default {
       this.message.title = '';
       this.message.text = '';
     },
-    onScroll() {
-      document.activeElement.scrollIntoViewIfNeeded(true);        
+    onScroll(data) {
+      this.$store.commit('setScroll', data);
+      document.activeElement.scrollIntoViewIfNeeded(true);
     },
     search(flg) {
       this.$store.commit('setSearchShow', flg);

+ 5 - 0
src/less/base.less

@@ -70,6 +70,11 @@
   /* .symp:nth-child(3n+2){
     margin-left: 0;
   } */
+  .tip{
+    color: #AAAAAA;
+    margin-top: .2rem;
+    font-size: .24rem;
+  }
   .over{
     font-size: .24rem !important;
   }

+ 4 - 0
src/store.js

@@ -9,6 +9,7 @@ const store = new Vuex.Store({
     pathInfo:{}, //患者信息-后续提交要用
     sysConfig:[], //系统配置项
     allMoudles:[], //模板
+    scroll:{},
     symptom:{ //症状情况
       choose:[],
       origin:{},
@@ -313,6 +314,9 @@ const store = new Vuex.Store({
     setChoose(state,param){ //症状情况-已选症状
       state.symptom.choose = param.choose;
     },
+    setScroll(state,data){ //症状情况-已选症状
+      state.scroll = data;
+    },
     delChoose(state,param){ //详情有必填项未填--移除症状
       const id = param.id;
       let symp = state.symptom.choose;

+ 4 - 1
src/utils/tools.js

@@ -129,6 +129,8 @@ const phoneTest = /^[1]([3-9])[0-9]{9}$/;
 const identify = /(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)|(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/;
 //只能是数字和字母
 const jgpattern = /^[A-Za-z0-9]+$/;
+//名字汉字字母
+const name = /^[0-9\u4e00-\u9fa5]+$/;
 
 const getAllStr = (allData) =>{//获取界面数据,拼接字符串
   // console.log(allData,777777)
@@ -358,7 +360,8 @@ module.exports =  {
   identify,
   jgpattern,
   compare,
-  dateParser
+  dateParser,
+  name
 }