|
|
|
@ -79,10 +79,7 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
organization: any; |
|
|
|
|
getAllOrganization() { |
|
|
|
|
this.orSpin = true; |
|
|
|
|
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata")) |
|
|
|
|
.organization.id; |
|
|
|
|
let params = { |
|
|
|
|
// OrganizationUnitId: OrganizationUnitId,
|
|
|
|
|
IsContainsChildren: "true", |
|
|
|
|
}; |
|
|
|
|
this.http |
|
|
|
@ -90,9 +87,6 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
params: params, |
|
|
|
|
}) |
|
|
|
|
.subscribe((data: any) => { |
|
|
|
|
data.result.items = data.result.items.filter((item, i) => { |
|
|
|
|
return !item.isGasStation; |
|
|
|
|
}); |
|
|
|
|
this.organization = data.result.items; |
|
|
|
|
this.getStationsNum(data.result.items); |
|
|
|
|
}); |
|
|
|
@ -100,7 +94,8 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//获得组织机构下有多少油站
|
|
|
|
|
stationsList; |
|
|
|
|
getStationsNum(e) { |
|
|
|
|
getStationsNum(currentOrList) { |
|
|
|
|
console.log("e", currentOrList); |
|
|
|
|
let OrganizationUnitId = JSON.parse(sessionStorage.getItem("userdata")) |
|
|
|
|
.organization.id; |
|
|
|
|
let OrganizationUnitIds = JSON.parse( |
|
|
|
@ -112,7 +107,7 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
) |
|
|
|
|
.subscribe((data: any) => { |
|
|
|
|
this.stationsList = data.result; |
|
|
|
|
const arrs = e.map((item) => { |
|
|
|
|
const arrs = currentOrList.map((item) => { |
|
|
|
|
const data = this.stationsList.find( |
|
|
|
|
(i) => item.id == i.organizationId |
|
|
|
|
); |
|
|
|
@ -121,6 +116,7 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
products: data ? data : false, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (let index = 0; index < arrs.length; index++) { |
|
|
|
|
if (OrganizationUnitIds && OrganizationUnitIds.length !== 0) { |
|
|
|
|
if (OrganizationUnitIds.includes(arrs[index].id)) { |
|
|
|
@ -136,11 +132,9 @@ export class PlanAdminComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
this.orSpin = false; |
|
|
|
|
this.nodes = [...this.toTree.toTree(arrs)]; |
|
|
|
|
|
|
|
|
|
console.log("树形结构", this.nodes); |
|
|
|
|
this.nzExpandedKeys = [OrganizationUnitId]; |
|
|
|
|
this.nzSelectedKeys = [OrganizationUnitId]; |
|
|
|
|
sessionStorage.setItem("planAdminOrid", OrganizationUnitId); |
|
|
|
|
this.nzExpandedKeys = [this.nodes[0].id]; |
|
|
|
|
this.nzSelectedKeys = [this.nodes[0].id]; |
|
|
|
|
sessionStorage.setItem("planAdminOrid", this.nodes[0].id); |
|
|
|
|
this.oilStationListComponent.onChildMethod(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|