|
@@ -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("网络异常请稍后重试");
|
|
|
});
|