//父组件的点击事件 @goback()
子组件
goback(){
// 判断fatherDeptId也就是存储的code的长度
if(this.fatherDeptId.length>1){
console.log(this.fatherDeptId[parseInt(this.fatherDeptId.length)-2],"上一级")
var deptCode=this.fatherDeptId[parseInt(this.fatherDeptId.length)-2]
if(deptCode==0){
this.fatherDeptId.pop()
console.log("返回最后一级")
this.deptLevel=0
this.back.isZhidui=0
this.hechartse()
}else {
this.deptLevel=1
this.childrenDeptId=deptCode
// this.activeName="second"
var data ={
"date": this.dateTime,
"deptId": this.childrenDeptId
}
this.page.current=1
this.page.size=5
if( this.deptLevel==1){
const loading = this.$loading({
lock: true,
text: '加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
dataZhiAttendance(data,this.page).then(res=>{
this.fatherDeptId.pop()
}
}
}