import { Component, OnInit } from '@angular/core';
import { MyService } from '../my.service';

@Component({
  selector: 'ydlife-team-area-panel',
  templateUrl: './team-area-panel.component.html',
  styleUrls: ['./team-area-panel.component.scss']
})
export class TeamAreaPanelComponent implements OnInit {
  practitionerId: any;
  branchDataInfos:Array<any>;
  constructor(private myService: MyService) { }

  ngOnInit() {
    this.practitionerId = JSON.parse(localStorage.getItem('lifeCustomerInfo'))['practitionerId'];
    this.queryPEPScore();
  }

  //获取区域管理人所有团队
  queryPEPScore(){
    // this.myService.employeePerformanceForAreaManagerQuery({ areaManagerPractitionerId: this.practitionerId }).subscribe((res)=>{
    //   if(res['success']){ 
    //    this.branchDataInfos = res['data']['insurerDataInfos'][0]['branchDataInfos'];
      
    //   }
    // })

    this.branchDataInfos = [
        {
            "branchId": 97,
            "branchName": "北京分公司",
            "statisticInfo": {
                "fyc": 0.0,
                "fyp": 0.0,
                "count": 0
            },
            "deptDataInfos": [
                {
                    "deptId": 38,
                    "deptName": "北京营业部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 35,
                            "subordinateSystemName": "冠军",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 105,
                                    "name": "梁朝霞",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "branchId": 86,
            "branchName": "测试分公司",
            "statisticInfo": {
                "fyc": 0.0,
                "fyp": 0.0,
                "count": 0
            },
            "deptDataInfos": [
                {
                    "deptId": 30,
                    "deptName": "张江营业二部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 38,
                            "subordinateSystemName": "柠檬精体系",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 72,
                                    "name": "玛丽酱",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                },
                {
                    "deptId": 37,
                    "deptName": "长江产险营业部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 34,
                            "subordinateSystemName": "产险一体系",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 25,
                                    "name": "李慧敏",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "branchId": 64,
            "branchName": "银盾北京分公司",
            "statisticInfo": {
                "fyc": 0.0,
                "fyp": 0.0,
                "count": 0
            },
            "deptDataInfos": [
                {
                    "deptId": 3,
                    "deptName": "北京water营业一部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 4,
                            "subordinateSystemName": "water体系2",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 69,
                                    "name": "毛利",
                                    "levelCode": "S1-B",
                                    "levelName": "营销高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        },
                        {
                            "subordinateSystemId": 3,
                            "subordinateSystemName": "water体系1",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 21,
                                    "name": "肖晓耀",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "branchId": 67,
            "branchName": "上海分公司",
            "statisticInfo": {
                "fyc": 0.0,
                "fyp": 0.0,
                "count": 0
            },
            "deptDataInfos": [
                {
                    "deptId": 11,
                    "deptName": "测试新增上海营业部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 40,
                            "subordinateSystemName": "乘风破浪",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 113,
                                    "name": "李春霞",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 114,
                                    "name": "孙葵",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                },
                {
                    "deptId": 2,
                    "deptName": "金港路寿险部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 2,
                            "subordinateSystemName": "双莲",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 97,
                                    "name": "金毛",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 79,
                                    "name": "张九九",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 18,
                                    "name": "汪鹏",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 91,
                                    "name": "十二不傻",
                                    "levelCode": "S1-B",
                                    "levelName": "营销高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 10,
                                    "name": "万双莲",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 90,
                                    "name": "六四",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 11,
                                    "name": "余侑蓁",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 78,
                                    "name": "张嘉欣",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                },
                {
                    "deptId": 1,
                    "deptName": "张扬路寿险部",
                    "statisticInfo": {
                        "fyc": 0.0,
                        "fyp": 0.0,
                        "count": 0
                    },
                    "subordinateSystemDataInfos": [
                        {
                            "subordinateSystemId": 36,
                            "subordinateSystemName": "如乔体系",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 4,
                                    "name": "林如乔",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        },
                        {
                            "subordinateSystemId": 1,
                            "subordinateSystemName": "菁英",
                            "statisticInfo": {
                                "fyc": 0.0,
                                "fyp": 0.0,
                                "count": 0,
                                "completionRate": null
                            },
                            "memberInfoList": [
                                {
                                    "practitionerId": 118,
                                    "name": "傻逼",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 119,
                                    "name": "傻逼吗",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 126,
                                    "name": "复现",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 2,
                                    "name": "吕子苹",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 122,
                                    "name": "新增增员",
                                    "levelCode": "A1",
                                    "levelName": "业务主任",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 117,
                                    "name": "喵喵",
                                    "levelCode": "S1-A",
                                    "levelName": "业务高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 77,
                                    "name": "张嘉欣",
                                    "levelCode": null,
                                    "levelName": null,
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 123,
                                    "name": "张佳南",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 1,
                                    "name": "郑志弘",
                                    "levelCode": "A1",
                                    "levelName": "业务主任",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 82,
                                    "name": "瓦特",
                                    "levelCode": "A1",
                                    "levelName": "业务主任",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 5,
                                    "name": "宁琳",
                                    "levelCode": "A3",
                                    "levelName": "业务总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 80,
                                    "name": "Sweet",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 121,
                                    "name": "孙孙",
                                    "levelCode": "A2",
                                    "levelName": "业务经理",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 63,
                                    "name": "唐纳德",
                                    "levelCode": "S1-A",
                                    "levelName": "业务高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 120,
                                    "name": "傻逼是",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 115,
                                    "name": "测试一下",
                                    "levelCode": "S2",
                                    "levelName": "业务合伙人",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 8,
                                    "name": "徐昳雯",
                                    "levelCode": "S1-B",
                                    "levelName": "营销高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 87,
                                    "name": "丝丝",
                                    "levelCode": "S1-A",
                                    "levelName": "业务高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 76,
                                    "name": "二二",
                                    "levelCode": "S1-B",
                                    "levelName": "营销高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                },
                                {
                                    "practitionerId": 75,
                                    "name": "一一",
                                    "levelCode": "S1-B",
                                    "levelName": "营销高级总监",
                                    "fyp": 0.0,
                                    "fyc": 0.0,
                                    "count": 0
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
     console.log(this.branchDataInfos)
  }
}
