|
|
|
@ -155,28 +155,33 @@ export class OrganizationComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
deleteOr(item) { |
|
|
|
|
console.log(item) |
|
|
|
|
this.modal.confirm({ |
|
|
|
|
nzTitle: `确定要删除${item.title}这个机构吗?`, |
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'danger', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
this.http.delete('/api/services/app/Organization/Delete', { |
|
|
|
|
params: { |
|
|
|
|
Id: item.origin.id |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { |
|
|
|
|
this.defaultExpandedKeys.push(item.key) |
|
|
|
|
if (item.origin.children && item.origin.children.length != 0) { |
|
|
|
|
this.message.create('warning', '请先删除所有子节点'); |
|
|
|
|
} else { |
|
|
|
|
this.modal.confirm({ |
|
|
|
|
nzTitle: `确定要删除${item.title}这个机构吗?`, |
|
|
|
|
nzOkText: '确定', |
|
|
|
|
nzOkType: 'danger', |
|
|
|
|
nzOnOk: () => { |
|
|
|
|
this.http.delete('/api/services/app/Organization/Delete', { |
|
|
|
|
params: { |
|
|
|
|
Id: item.origin.id |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { |
|
|
|
|
this.defaultExpandedKeys.push(item.key) |
|
|
|
|
}) |
|
|
|
|
this.getAllOrganization() |
|
|
|
|
this.message.create('success', '删除成功!'); |
|
|
|
|
}) |
|
|
|
|
this.getAllOrganization() |
|
|
|
|
this.message.create('success', '删除成功!'); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
nzCancelText: '取消', |
|
|
|
|
nzOnCancel: () => { |
|
|
|
|
}, |
|
|
|
|
nzCancelText: '取消', |
|
|
|
|
nzOnCancel: () => { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|