|
|
|
@ -232,7 +232,8 @@ export default { |
|
|
|
|
listLoading:false,// 列表加载 |
|
|
|
|
submiting: false, // 新增编辑员工防抖标识 |
|
|
|
|
updateTime: 0, |
|
|
|
|
next: null |
|
|
|
|
next: null, |
|
|
|
|
backType: false |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -275,6 +276,7 @@ export default { |
|
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
|
console.log(44, this.updateTime) |
|
|
|
|
if(this.updateTime){ |
|
|
|
|
if(!this.backType) { |
|
|
|
|
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
@ -283,6 +285,10 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
next() |
|
|
|
|
}) |
|
|
|
|
}else { |
|
|
|
|
next() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
next() |
|
|
|
|
} |
|
|
|
@ -697,6 +703,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 返回 |
|
|
|
|
back() { |
|
|
|
|
this.backType = true |
|
|
|
|
// 更改了信息才需要提示 |
|
|
|
|
if(this.updateTime){ |
|
|
|
|
this.$confirm('编辑的内容未保存,是否保存?', "提示", { |
|
|
|
@ -704,10 +711,10 @@ export default { |
|
|
|
|
}).then(() => { |
|
|
|
|
this.save(this.projectManage.state) |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$router.back() |
|
|
|
|
this.$router.push('/project/list') |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$router.back() |
|
|
|
|
this.$router.push('/project/list') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|