父传子
父亲:
点击登录打开完善信息页面
孩子: <wszjxx ref="wszjxx"></wszjxx>//完善信息页面
父亲: <el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
>
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
完善信息方法
//获取当前登陆用户单位-专家信息 审批状态(0待审核,1未提交,2审核不通过,3审核通过)
getLoginUserInfo(){
getLoginUserInfo().then((response) => {
// this.loading = false;
if(!response.data){
var zgObj=JSON.stringify({userType:'-1'})
sessionStorage.setItem('zgObj',zgObj)
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}
else if(response.data.userType==3){
sessionStorage.setItem('userType',response.data.userType)
if(response.data.status==1||response.data.status==2){
this.$refs.wszjxx.zjxx(response.data)//把response.data传给孩子的页面
}else if(response.data.status==3){
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
} else if(response.data.status==0){
this.$store.dispatch('LogOut').then(() => {
sessionStorage.clear();
})
this.$alert("主管审核中!", "提示", {
confirmButtonText: "确定",
});
this.loading = false;
}
}else if(response.data.userType==2){
sessionStorage.setItem('userType',response.data.userType)
if(response.data.status==1||response.data.status==2){
this.$refs.wsqyxx.openDia(response.data)
}else if(response.data.status==3){
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}
else if(response.data.status==0){
this.$store.dispatch('LogOut').then(() => {
sessionStorage.clear();
})
this.$alert("主管审核中!", "提示", {
confirmButtonText: "确定",
});
this.loading = false;
}
}else if(response.data.userType==0){
var zgObj=JSON.stringify(response.data)
sessionStorage.setItem('zgObj',zgObj)
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}
}).catch((response) => {
this.$store.dispatch('LogOut').then(() => {
sessionStorage.clear();
location.href = '/index';
})
this.$message.error(response.msg);
});
},
孩子接收父亲页面的方法zjxx
zjxx(val){
this.wszjxxopen = true
this.getArea()
this.form = val//(父亲传过来的res.response)
this.flag=val.status
this.form.id = val.id
this.title="完善专家信息"
},