Browse Source

[完善]组织机构新增bug

develop
邵佳豪 2 years ago
parent
commit
fbfe6e1c80
  1. 8
      src/app/system-management/organization/organization.component.ts

8
src/app/system-management/organization/organization.component.ts

@ -66,8 +66,8 @@ export class OrganizationComponent implements OnInit {
}); });
this.allOrList = data.items this.allOrList = data.items
this.nodes = [...this.toTree.toTree(data.items)] this.nodes = [...this.toTree.toTree(data.items)]
this.defaultExpandedKeys = [this.nodes[0].id] this.defaultExpandedKeys.length == 0 ? this.defaultExpandedKeys = [this.nodes[0].id] : this.defaultExpandedKeys = [...this.defaultExpandedKeys]
this.defaultExpandedKeys = [...this.defaultExpandedKeys]
}) })
} }
@ -80,7 +80,7 @@ export class OrganizationComponent implements OnInit {
addOr(node?: any) { addOr(node?: any) {
console.log(node) // console.log(node.key)
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: node ? '新增组织机构' : '新增一级组织机构', nzTitle: node ? '新增组织机构' : '新增一级组织机构',
nzContent: AddorComponent, nzContent: AddorComponent,
@ -92,7 +92,7 @@ export class OrganizationComponent implements OnInit {
await new Promise(resolve => { await new Promise(resolve => {
let body = { let body = {
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
parentId: node ? Number(node.key) : null, parentId: node ? node.key : null,
isGasStation: instance.validateForm.value.isGasStation isGasStation: instance.validateForm.value.isGasStation
} }
this.http.post('/api/Organizations', body).subscribe(data => { this.http.post('/api/Organizations', body).subscribe(data => {

Loading…
Cancel
Save