机构或角色删除后影响用户的问题修复

This commit is contained in:
zhouyuejun
2019-05-09 11:01:03 +08:00
parent 6704dca7f8
commit 833108cd0d
7 changed files with 99 additions and 52 deletions
@@ -140,16 +140,23 @@ export class DepartmentManagementComponent implements OnInit {
nzTitle: '删除',
nzContent: '确定删除【' + this.orgDetail.organization + '】?',
nzOnOk: () => new Promise((resolve, reject) => {
this.http.delete('/sysapi/setting/organization/delOrgByid/' + this.orgDetail.id).subscribe((json) => {
if (json.is_success) {
resolve();
this.message.success(`删除成功!`);
this.initTree();
} else {
reject();
this.message.error(`删除失败!`);
}
})
if (this.userList && this.userList.length > 0) {
setTimeout(()=>{
this.message.error('删除失败,请删除此机构下的用户后再执行此操作!');
reject()
},500);
} else {
this.http.delete('/sysapi/setting/organization/delOrgByid/' + this.orgDetail.id).subscribe((json) => {
if (json.is_success) {
resolve();
this.message.success(`删除成功!`);
this.initTree();
} else {
reject();
this.message.error(`删除失败!`);
}
})
}
}).catch(() => console.log('Oops errors!'))
});
@@ -411,10 +418,10 @@ export class DepartmentManagementComponent implements OnInit {
this.orgDetail = treeNode;
this.oldLoginName = this.orgDetail.code;
this.queryUserById();
if(this.treeSelected.children&&this.treeSelected.children.length>0){
if (this.treeSelected.children && this.treeSelected.children.length > 0) {
this.canDel = false;
this.canEdit = true;
}else{
} else {
this.canDel = true;
this.canEdit = true;
}