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