|
@@ -25,7 +25,7 @@
|
|
|
<input
|
|
|
@focus="focus"
|
|
|
@blur="blur"
|
|
|
- :maxlength="type==103?11:type==101?18:type==102?7:type==104?9:30"
|
|
|
+ :maxlength="type==103?11:type==101?18:type==102?20:type==104?9:30"
|
|
|
v-model="value"
|
|
|
@input="changeVal"
|
|
|
:type="type==101||type==104?'text':'tel'"
|
|
@@ -46,7 +46,7 @@
|
|
|
placeholder="请输入姓名"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div :class="['btn',value&&patName&&allow?'btnClick':'btnDis']" @click="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>
|
|
@@ -82,28 +82,40 @@ export default {
|
|
|
},
|
|
|
code:'',
|
|
|
allow:true,
|
|
|
- he:'',
|
|
|
+ canClick:false,
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
|
this.code = this.$route.query.hospitalCode||''
|
|
|
},
|
|
|
- // mounted(){
|
|
|
-
|
|
|
- // (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
|
|
|
- // // 这里加了个类型判断,因为a等元素也会触发blur事件
|
|
|
- // if(['input', 'textarea'].includes(e.target.localName)) {
|
|
|
- // iscanscrollpage = true;
|
|
|
- // setTimeout(function() {
|
|
|
- // if(iscanscrollpage) {
|
|
|
- // // alert(document.scrollingElement.scrollTop)
|
|
|
- // document.scrollingElement.scrollTo(0, document.scrollingElement.scrollTop);
|
|
|
- // document.body && (document.body.scrollTop = document.body.scrollTop);
|
|
|
- // }
|
|
|
- // }, 200);
|
|
|
- // }
|
|
|
- // }, true)
|
|
|
- // },
|
|
|
+ watch:{
|
|
|
+ value:{
|
|
|
+ handler: function (val, oldVal) {
|
|
|
+ if(val&&this.patName){
|
|
|
+ this.canClick = true
|
|
|
+ }else{
|
|
|
+ this.canClick = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ patName:{
|
|
|
+ handler: function (val, oldVal) {
|
|
|
+ if(val&&this.value){
|
|
|
+ this.canClick = true
|
|
|
+ }else{
|
|
|
+ this.canClick = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteLeave(to, from, next){
|
|
|
+ if(JSON.stringify(to.params) == '{}'){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ next();
|
|
|
+ },
|
|
|
methods: {
|
|
|
close() {
|
|
|
this.showTip = false;
|
|
@@ -126,9 +138,9 @@ export default {
|
|
|
},
|
|
|
blur() {
|
|
|
// iscanscrollpage = true;
|
|
|
- if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
|
|
|
- document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
|
|
|
- }
|
|
|
+ // if(MobileDevice.getModels().join(' or ').indexOf('6') == -1){
|
|
|
+ // document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
|
|
|
+ // }
|
|
|
},
|
|
|
changeName() {
|
|
|
// document.activeElement.scrollIntoViewIfNeeded(true);
|
|
@@ -154,32 +166,36 @@ export default {
|
|
|
clearTimeout(timer);
|
|
|
}, 2000);
|
|
|
},
|
|
|
- showSubmit(flg) {
|
|
|
+ showSubmit(flg){
|
|
|
this.submit = flg;
|
|
|
},
|
|
|
- handleDepart() {
|
|
|
+ handleDepart(){
|
|
|
const { type, value,patName,allow } = this;
|
|
|
+ this.allow = false
|
|
|
if (value&&patName&&allow) {
|
|
|
- this.allow = false
|
|
|
let timer = setTimeout(() => {
|
|
|
- if (type == 103) {
|
|
|
- if (!phoneTest.test(value)) {//验证不通过
|
|
|
- this.defaultWaring("输入信息格式有误");
|
|
|
+ if (type == 102) {
|
|
|
+ if (!jgpattern.test(value)) {//验证不通过
|
|
|
+ this.defaultWaring("请输入正确的病历号");
|
|
|
+ this.allow = true
|
|
|
return;
|
|
|
}
|
|
|
} else if (type == 101) {//身份证
|
|
|
if (!identify.test(value)) {//验证不通过
|
|
|
- this.defaultWaring("输入信息格式有误");
|
|
|
+ this.defaultWaring("请输入正确的身份证号");
|
|
|
+ this.allow = true
|
|
|
return;
|
|
|
}
|
|
|
- } else if (type == 104) {//病历号只能输入数字字母
|
|
|
- if (!jgpattern.test(value)) {//验证不通过
|
|
|
- this.defaultWaring("输入信息格式有误");
|
|
|
+ } else if (type == 104) {//市民卡号只能输入数字字母
|
|
|
+ if (!jgpattern.test(value)||value.length!=9) {//验证不通过
|
|
|
+ this.defaultWaring("请输入正确的9位市民卡号");
|
|
|
+ this.allow = true
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if(!this.code){
|
|
|
this.defaultWaring("医院编码必填");
|
|
|
+ this.allow = true
|
|
|
return;
|
|
|
}
|
|
|
const param = {
|
|
@@ -248,15 +264,12 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
+@import "../less/index.less";
|
|
|
.login {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
- background: linear-gradient(
|
|
|
- 180deg,
|
|
|
- rgba(79, 79, 255, 1) 0%,
|
|
|
- rgba(79, 137, 255, 1) 100%
|
|
|
- );
|
|
|
+ background: #colors[btn];
|
|
|
padding: 0rem 0.6rem;
|
|
|
box-sizing: border-box;
|
|
|
.top {
|
|
@@ -351,12 +364,8 @@ export default {
|
|
|
height: 0.88rem;
|
|
|
line-height: 0.88rem;
|
|
|
text-align: center;
|
|
|
- background: linear-gradient(
|
|
|
- 270deg,
|
|
|
- rgba(79, 139, 255, 1) 0%,
|
|
|
- rgba(79, 79, 255, 1) 100%
|
|
|
- );
|
|
|
- border-radius: 0.44rem;
|
|
|
+ background: #colors[btn];
|
|
|
+ border-radius: 0.2rem;
|
|
|
color: #fff;
|
|
|
font-size: 0.32rem;
|
|
|
font-weight: 500;
|