|
@@ -7,8 +7,19 @@
|
|
|
<h4>欢迎使用智能预问诊</h4>
|
|
|
</div>
|
|
|
<div class="main">
|
|
|
- <div class="iptWrap choose">
|
|
|
- <p @click="handleShow">
|
|
|
+ <div class="iptWrap choose" v-if="hospitalShow">
|
|
|
+ <p @click="handleShow(1)">
|
|
|
+ {{hospitalName}}
|
|
|
+ <img src="../images/down.png" />
|
|
|
+ </p>
|
|
|
+ <div class="slideType" v-if="showH">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,idx) in hospitalList" :key="idx" @click="handleCode(item,idx)" :style="{'border':(idx == (hospitalList.length-1))?'0 none':''}">{{item.hospitalName}}</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="iptWrap choose iptWrapS">
|
|
|
+ <p @click="handleShow(2)">
|
|
|
{{name}}
|
|
|
<img src="../images/down.png" />
|
|
|
</p>
|
|
@@ -28,7 +39,6 @@
|
|
|
: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'"
|
|
|
class="input"
|
|
|
type="text"
|
|
|
:placeholder="'请输入'+name"
|
|
@@ -46,10 +56,11 @@
|
|
|
placeholder="请输入姓名"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div :class="['btn',canClick&&allow?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
|
|
|
+ <div :class="['btn',canClick?'btnClick':'btnDis']" @click.stop.prevent="handleDepart">进入预问诊</div>
|
|
|
</div>
|
|
|
<!-- <div class="tip">注:建议您可先输入病情情况,方便医生提前了解情况</div> -->
|
|
|
<Submit v-if="submit" :showType="showType" :fail="failMsg" @showSubmit="showSubmit"></Submit>
|
|
|
+ <Loading v-if="this.$store.state.loadingShow"></Loading>
|
|
|
<Tiptoast
|
|
|
:show="showTip"
|
|
|
@close="close"
|
|
@@ -61,17 +72,20 @@ 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";
|
|
|
+import Loading from '../common/Loading';
|
|
|
import $ from "jquery";
|
|
|
// let iscanscrollpage = false
|
|
|
export default {
|
|
|
name: "Login",
|
|
|
data() {
|
|
|
return {
|
|
|
+ loadingShow: this.$store.state.loadingShow,
|
|
|
showTip: false,
|
|
|
showType: "fail",
|
|
|
failMsg: "",
|
|
|
submit: false,
|
|
|
show: false,
|
|
|
+ showH:false,
|
|
|
type: "102",
|
|
|
name: "病历号",
|
|
|
patName:'',
|
|
@@ -81,16 +95,39 @@ export default {
|
|
|
text: ""
|
|
|
},
|
|
|
code:'',
|
|
|
- allow:true,
|
|
|
+ allow:false,
|
|
|
canClick:false,
|
|
|
+ hospitalName:'',
|
|
|
+ hospitalNum:'',
|
|
|
+ hospitalList:[],
|
|
|
+ hospitalShow:false,
|
|
|
+ son:false,//有无子医院
|
|
|
+ clique:1
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
|
- this.code = this.$route.query.hospitalCode||''
|
|
|
+ let query = this.$route.query;
|
|
|
+ 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
|
|
|
+ this.name = type == 101?'身份证号':type == 102?'病历号':type == 104?'市民卡号':''
|
|
|
+ this.value = value
|
|
|
+ this.patName = name
|
|
|
+ if(sonHospitalCode&&sonHospitalName){
|
|
|
+ this.hospitalNum=sonHospitalCode
|
|
|
+ this.hospitalName=sonHospitalName
|
|
|
+ this.son = true
|
|
|
+ }else{
|
|
|
+ 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{
|
|
@@ -100,7 +137,7 @@ export default {
|
|
|
deep: true
|
|
|
},
|
|
|
patName:{
|
|
|
- handler: function (val, oldVal) {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
if(val&&this.value){
|
|
|
this.canClick = true
|
|
|
}else{
|
|
@@ -111,12 +148,56 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeRouteLeave(to, from, next){
|
|
|
- if(JSON.stringify(to.params) == '{}'){
|
|
|
+ const { value,patName,allow } = this;
|
|
|
+ if(!value||!patName){
|
|
|
return
|
|
|
}
|
|
|
next();
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
+ getHospitalList(code){
|
|
|
+ api.getHospitalDatas({'hospitalCode':code}).then(res => {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.code == 0) {
|
|
|
+ let tmpMain = result.data.superiorsInfo;
|
|
|
+ let tmpLis = result.data.juniorHospital;
|
|
|
+ if(this.clique == 1){
|
|
|
+ tmpLis.unshift(tmpMain)
|
|
|
+ }
|
|
|
+ this.hospitalList = tmpLis
|
|
|
+ if(!this.son){
|
|
|
+ this.hospitalName = tmpLis[0].hospitalName //默认第一个
|
|
|
+ this.hospitalNum = tmpLis[0].hospitalCode
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ // this.defaultWaring(res.data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSysConfig(code){
|
|
|
+ api.getSysConfig({'hospitalCode':code}).then((res)=>{
|
|
|
+ const result = res.data;
|
|
|
+ if(result.code==0){
|
|
|
+ const datas = result.data;
|
|
|
+ this.child = datas.filter((item)=>{return item.code == "constitution_show"})
|
|
|
+ this.$store.commit('saveSysConfig',datas)
|
|
|
+ for(let i = 0;i < datas.length;i++){
|
|
|
+ if(datas[i].code == 'junior_show'){
|
|
|
+ this.hospitalShow = +datas[i].value==1?true:false
|
|
|
+ if(datas[i].value==1){
|
|
|
+ this.hospitalShow = true
|
|
|
+ this.getHospitalList(code)
|
|
|
+ }else{
|
|
|
+ this.hospitalShow = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.defaultWaring(res.data.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
close() {
|
|
|
this.showTip = false;
|
|
|
},
|
|
@@ -129,9 +210,24 @@ export default {
|
|
|
}
|
|
|
this.show = false;
|
|
|
},
|
|
|
- handleShow() {
|
|
|
- const { show } = this;
|
|
|
- this.show = !show;
|
|
|
+ handleCode(item,idx) {
|
|
|
+ this.hospitalName = item.hospitalName
|
|
|
+ this.hospitalNum = item.hospitalCode
|
|
|
+ this.showH = false;
|
|
|
+ },
|
|
|
+ handleShow(flg) {
|
|
|
+ const { show,showH } = this;
|
|
|
+ if(flg == 1){
|
|
|
+ if(!showH){
|
|
|
+ this.show=false
|
|
|
+ }
|
|
|
+ this.showH = !showH;
|
|
|
+ }else{
|
|
|
+ if(!show){
|
|
|
+ this.showH=false
|
|
|
+ }
|
|
|
+ this.show = !show;
|
|
|
+ }
|
|
|
},
|
|
|
focus(){
|
|
|
// iscanscrollpage = false;
|
|
@@ -142,22 +238,18 @@ export default {
|
|
|
// document.activeElement.scrollIntoView({behavior: "smooth",block:'end'})
|
|
|
// }
|
|
|
},
|
|
|
- changeName() {
|
|
|
- // document.activeElement.scrollIntoViewIfNeeded(true);
|
|
|
- const { patName } = this;
|
|
|
- this.patName = patName.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
|
|
|
+ changeName(e) {
|
|
|
+ this.patName = e.target.value.replace(/[`~!@#$%^&)(*_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im,'')
|
|
|
},
|
|
|
changeVal() {
|
|
|
- // document.activeElement.scrollIntoViewIfNeeded(true);
|
|
|
const { type, value } = this;
|
|
|
- if (type == 102 || type == 103) {
|
|
|
+ if (type == 103) {
|
|
|
this.value = value.replace(/[^\d]/g, "");
|
|
|
- } else if (type == 101 || type == 104) {
|
|
|
+ } else if (type == 102 || type == 101 || type == 104) {
|
|
|
this.value = value.replace(/[^\w\.\/]/ig, "");
|
|
|
}
|
|
|
},
|
|
|
defaultWaring(msg) {
|
|
|
- this.$store.commit("handleToggleShow", false);
|
|
|
this.showType = "fail";
|
|
|
this.failMsg = msg;
|
|
|
this.submit = true;
|
|
@@ -170,43 +262,48 @@ export default {
|
|
|
this.submit = flg;
|
|
|
},
|
|
|
handleDepart(){
|
|
|
- const { type, value,patName,allow } = this;
|
|
|
- this.allow = false
|
|
|
- if (value&&patName&&allow) {
|
|
|
+ const { type, value,patName,allow,hospitalNum,hospitalName,code,hospitalList } = this;
|
|
|
+ if(allow){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (value&&patName) {
|
|
|
+ this.allow = true
|
|
|
let timer = setTimeout(() => {
|
|
|
if (type == 102) {
|
|
|
- if (!jgpattern.test(value)) {//验证不通过
|
|
|
+ if (!jgpattern.test(value) || value.length > 20) {//验证不通过
|
|
|
this.defaultWaring("请输入正确的病历号");
|
|
|
- this.allow = true
|
|
|
+ this.allow = false;
|
|
|
return;
|
|
|
}
|
|
|
} else if (type == 101) {//身份证
|
|
|
- if (!identify.test(value)) {//验证不通过
|
|
|
+ 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;
|
|
|
}
|
|
|
+ this.$store.commit('handleToggleShow', true);
|
|
|
const param = {
|
|
|
- patientInfo: this.value,
|
|
|
- patientInfoType: this.type,
|
|
|
- hospitalCode:this.code,
|
|
|
- patientName:patName
|
|
|
+ patientInfo: value,
|
|
|
+ patientInfoType: type,
|
|
|
+ hospitalCode:code,
|
|
|
+ hospitalName:hospitalList.length>0&&hospitalList[0].hospitalName||'',
|
|
|
+ patientName:patName,
|
|
|
+ sonHospitalCode: code==hospitalNum?'':hospitalNum||'',
|
|
|
+ sonHospitalName: code==hospitalNum?'':hospitalName||''
|
|
|
};
|
|
|
- api
|
|
|
- .signIn(param)
|
|
|
- .then(res => {
|
|
|
+ api.signIn(param).then(res => {
|
|
|
let result = res.data;
|
|
|
if (result.code == 0) {
|
|
|
// result.data.splice(0,1);//测试只有一条数据
|
|
@@ -216,21 +313,24 @@ export default {
|
|
|
name: "Department",
|
|
|
params: { result: result.data }
|
|
|
});
|
|
|
+ this.allow = false
|
|
|
} else if (result.data.length == 1) {
|
|
|
let msg = result.data[0];
|
|
|
let params = {
|
|
|
hospitalCode: msg.hospitalCode,
|
|
|
hospitalDeptCode: msg.hospitalDeptCode,
|
|
|
- doctorCode: msg.doctorCode,
|
|
|
- patientCode: msg.patientCode,
|
|
|
- recordId: msg.recordId,
|
|
|
- time:(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()
|
|
|
+ doctorCode: msg.doctorCode||'',
|
|
|
+ patientCode: msg.patientCode||'',
|
|
|
+ recordId: msg.recordId||'',
|
|
|
+ sonHospitalCode:msg.sonHospitalCode||'',
|
|
|
+ time:msg.recordTime&&(new Date((msg.recordTime).replace(/\-/g, "/"))).getTime()||''
|
|
|
};
|
|
|
localStorage.setItem('loginParam',JSON.stringify(params))//保存登陆信息,扫码进入删除该参数
|
|
|
this.$router.push({
|
|
|
path: "/home",
|
|
|
query: params
|
|
|
});
|
|
|
+ this.allow = false
|
|
|
} else {
|
|
|
this.message.title = '温馨提示'
|
|
|
this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
|
|
@@ -238,19 +338,22 @@ export default {
|
|
|
}
|
|
|
clearTimeout(timer)
|
|
|
} else {
|
|
|
- if(res.msg.indexOf('暂无今日挂号信息') != -1){
|
|
|
- this.message.title = '温馨提示'
|
|
|
- this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
|
|
|
- this.showTip = true
|
|
|
- }else{
|
|
|
- this.defaultWaring(res.msg);
|
|
|
- }
|
|
|
+ // if(res.msg.indexOf('暂无今日挂号信息') != -1){
|
|
|
+ // this.message.title = '温馨提示'
|
|
|
+ // this.message.text = '暂无今日挂号信息,可更换登录方式再次尝试。'
|
|
|
+ // this.showTip = true
|
|
|
+ // }else{
|
|
|
+ // this.defaultWaring(res.data.msg);
|
|
|
+ // }
|
|
|
+ this.allow = false
|
|
|
+ this.defaultWaring(res.data.msg||"网络异常请稍后重试");
|
|
|
clearTimeout(timer)
|
|
|
}
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.allow = true
|
|
|
+ this.$store.commit('handleToggleShow', false);
|
|
|
+ }).catch(() => {
|
|
|
+ this.allow = false
|
|
|
clearTimeout(timer)
|
|
|
+ this.$store.commit('handleToggleShow', false);
|
|
|
this.defaultWaring("网络异常请稍后重试");
|
|
|
});
|
|
|
}, 200);
|
|
@@ -259,7 +362,8 @@ export default {
|
|
|
},
|
|
|
components: {
|
|
|
Submit,
|
|
|
- Tiptoast
|
|
|
+ Tiptoast,
|
|
|
+ Loading
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -310,6 +414,10 @@ export default {
|
|
|
padding: 0.23rem 0.3rem;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
+
|
|
|
+ .iptWrapS{
|
|
|
+ margin-top: 0.3rem;
|
|
|
+ }
|
|
|
.choose {
|
|
|
position: relative;
|
|
|
p {
|