|
|
@ -22,6 +22,7 @@ import { NzFormatBeforeDropEvent } from 'ng-zorro-antd/tree'; |
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
import { delay } from 'rxjs/operators'; |
|
|
|
import { delay } from 'rxjs/operators'; |
|
|
|
import { CustomReuseStrategy } from 'src/app/CustomReuseStrategy'; |
|
|
|
import { CustomReuseStrategy } from 'src/app/CustomReuseStrategy'; |
|
|
|
|
|
|
|
import { ChangeOrComponent } from './change-or/change-or.component'; |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-organization', |
|
|
|
selector: 'app-organization', |
|
|
|
templateUrl: './organization.component.html', |
|
|
|
templateUrl: './organization.component.html', |
|
|
@ -84,10 +85,7 @@ export class OrganizationComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
allOrList: any; |
|
|
|
allOrList: any; |
|
|
|
getAllOrganization() { |
|
|
|
getAllOrganization() { |
|
|
|
let OrganizationUnitId = ''; |
|
|
|
|
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
// OrganizationUnitId: OrganizationUnitId,
|
|
|
|
|
|
|
|
// IsContainsChildren: "true"
|
|
|
|
|
|
|
|
ContainsChildren: true, |
|
|
|
ContainsChildren: true, |
|
|
|
pageSize: 9999, |
|
|
|
pageSize: 9999, |
|
|
|
}; |
|
|
|
}; |
|
|
@ -193,6 +191,48 @@ export class OrganizationComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changeOr(node) { |
|
|
|
|
|
|
|
console.log(node); |
|
|
|
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
|
|
|
nzTitle: '修改所属组织机构', |
|
|
|
|
|
|
|
nzContent: ChangeOrComponent, |
|
|
|
|
|
|
|
nzViewContainerRef: this.viewContainerRef, |
|
|
|
|
|
|
|
nzWidth: 500, |
|
|
|
|
|
|
|
nzComponentParams: { |
|
|
|
|
|
|
|
data: this.allOrList, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
|
|
|
let selectedNode = |
|
|
|
|
|
|
|
instance.nzTreeComponent.getSelectedNodeList()[0].key; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selectedNode) { |
|
|
|
|
|
|
|
await new Promise((resolve) => { |
|
|
|
|
|
|
|
let body = { |
|
|
|
|
|
|
|
parentId: selectedNode, |
|
|
|
|
|
|
|
isGasStation: node.origin.isGasStation, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.http |
|
|
|
|
|
|
|
.put(`/api/Organizations/${node.origin.id}`, body) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
resolve(data); |
|
|
|
|
|
|
|
this.message.create('success', '修改成功!'); |
|
|
|
|
|
|
|
this.nzTreeComponent.getExpandedNodeList().forEach((item) => { |
|
|
|
|
|
|
|
this.defaultExpandedKeys.push(item.key); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.getAllOrganization(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.create('warning', '请选择机构!'); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
deleteOr(item) { |
|
|
|
deleteOr(item) { |
|
|
|
console.log(item); |
|
|
|
console.log(item); |
|
|
|
if (item.origin.children && item.origin.children.length != 0) { |
|
|
|
if (item.origin.children && item.origin.children.length != 0) { |
|
|
|