|
|
|
@ -25,7 +25,13 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
private http: HttpClient, |
|
|
|
|
private toTree: TreeService |
|
|
|
|
) {} |
|
|
|
|
levelList = ["无", "销售公司", "省公司", "区域", "油站"]; |
|
|
|
|
levelList=[ |
|
|
|
|
{level:0,name:'无'}, |
|
|
|
|
{level:1,name:'销售公司'}, |
|
|
|
|
{level:2,name:'省公司'}, |
|
|
|
|
{level:3,name:'区域'}, |
|
|
|
|
{level:4,name:'油站'}, |
|
|
|
|
] |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getAllRoles(); |
|
|
|
|
|
|
|
|
@ -49,15 +55,7 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
.subscribe((data: any) => { |
|
|
|
|
console.log("角色列表", data.result.items); |
|
|
|
|
let level = JSON.parse(sessionStorage.getItem("userdata")).organization |
|
|
|
|
.level; |
|
|
|
|
this.listOfData = []; |
|
|
|
|
data.result.items.forEach((ele) => { |
|
|
|
|
if (ele.organizationsLevel >= level || ele.organizationsLevel == 0) { |
|
|
|
|
this.listOfData.push(ele); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.listOfData = [...this.listOfData]; |
|
|
|
|
this.listOfData = data.result.items; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -96,7 +94,7 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
nzMaskClosable: false, |
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise((resolve,reject) => { |
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
|
console.log("表单信息", instance.validateForm); |
|
|
|
|
let body = { |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
@ -159,7 +157,7 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
nzMaskClosable: false, |
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
if (instance.validateForm.valid) { |
|
|
|
|
await new Promise((resolve,reject) => { |
|
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
|
console.log("表单信息", instance.validateForm); |
|
|
|
|
let body = { |
|
|
|
|
id: item.id, |
|
|
|
|