Skip to content

Commit

Permalink
fix #5 部门管理修改功能提交失败
Browse files Browse the repository at this point in the history
  • Loading branch information
enilu committed Jun 11, 2019
1 parent c195eef commit 59bec11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ public Object save(@ModelAttribute Dept dept){
if (ToolUtil.isOneEmpty(dept, dept.getSimplename())) {
throw new GunsException(BizExceptionEnum.REQUEST_NULL);
}

//完善pids,根据pid拿到pid的pids
deptService.deptSetPids(dept);
deptRepository.save(dept);
if(dept.getId()!=null){
Dept old = deptRepository.findById(dept.getId()).get();
old.setPid(dept.getPid());
old.setSimplename(dept.getSimplename());
old.setFullname(dept.getFullname());
old.setNum(dept.getNum());
old.setTips(dept.getTips());
deptService.deptSetPids(old);
deptRepository.save(old);
}else {
deptService.deptSetPids(dept);
deptRepository.save(dept);
}
return Rets.success();
}
@RequestMapping(method = RequestMethod.DELETE)
Expand Down
2 changes: 1 addition & 1 deletion flash-vue-admin/src/views/system/dept/dept.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default {
this.$refs['form'].validate((valid) => {
if (valid) {
console.log('form', self.form)
const menuData = self.form
const menuData = {id:self.form.id,simplename:self.form.simplename,fullname:self.form.fullname,num:self.form.num,pid:self.form.pid,tips:self.form.tips}//self.form
menuData.parent = null
save(menuData).then(response => {
console.log(response)
Expand Down

0 comments on commit 59bec11

Please sign in to comment.