From 124eb3cc92d7b643de49eceb2d9a765745fcc565 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Tue, 28 Feb 2023 16:22:28 +0300 Subject: [PATCH] added employee hierarchy --- Mohem/src/app/app.component.html | 8 ++-- .../employee-hierarchy-card.component.html | 6 +-- .../employee-hierarchy-card.component.scss | 30 ++++++++++++++- .../my-team/details/details.component.scss | 6 --- .../employee-hierarchy.component.html | 30 +++++++++++++-- .../employee-hierarchy.component.scss | 9 +++++ .../employee-hierarchy.component.ts | 38 ++++++++++++++++++- .../app/my-team/service/my-team.service.ts | 7 ++++ .../src/app/profile/home/home.component.html | 4 +- Mohem/src/app/profile/home/home.component.ts | 15 -------- 10 files changed, 114 insertions(+), 39 deletions(-) diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index 1127ed78..ac81978c 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -52,14 +52,14 @@ - + + - \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/employee-hierarchy-card/employee-hierarchy-card.component.scss b/Mohem/src/app/hmg-common/ui/employee-hierarchy-card/employee-hierarchy-card.component.scss index cf3ba641..abf864a4 100644 --- a/Mohem/src/app/hmg-common/ui/employee-hierarchy-card/employee-hierarchy-card.component.scss +++ b/Mohem/src/app/hmg-common/ui/employee-hierarchy-card/employee-hierarchy-card.component.scss @@ -119,4 +119,32 @@ font-size: 12px; margin-right: 15px; } -} \ No newline at end of file +} + +.numberEmp { + color: white; + font-size: 12px; + font-weight: bolder; + margin-left: 13px; + width: 23px; + height: 23px; + border-radius: 100%; + background-color: #024d71; + z-index: 9; + text-align: center; + padding-top: 3px; +} + +.numberEmp-ar { + color: white; + font-size: 12px; + font-weight: bolder; + margin-right: 13px; + width: 23px; + height: 23px; + border-radius: 100%; + background-color: #024d71; + z-index: 9; + text-align: center; + padding-top: 3px; +} diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss index fbcf72b5..609751a1 100644 --- a/Mohem/src/app/my-team/details/details.component.scss +++ b/Mohem/src/app/my-team/details/details.component.scss @@ -1071,8 +1071,6 @@ $actionBtnSize : 36px; color: white; font-size: 12px; font-weight: bolder; - /* padding-top: 5px; */ - /* padding-right: 20px; */ margin-left: 13px; width: 23px; height: 23px; @@ -1080,7 +1078,6 @@ $actionBtnSize : 36px; background-color: #024d71; z-index: 9; margin-top: 25px; - /* padding-left: 4px; */ text-align: center; padding-top: 3px; } @@ -1089,8 +1086,6 @@ $actionBtnSize : 36px; color: white; font-size: 12px; font-weight: bolder; - /* padding-top: 5px; */ - /* padding-right: 20px; */ margin-right: 13px; width: 23px; height: 23px; @@ -1098,7 +1093,6 @@ $actionBtnSize : 36px; background-color: #024d71; z-index: 9; margin-top: 25px; - /* padding-left: 4px; */ text-align: center; padding-top: 3px; } diff --git a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.html b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.html index c127c302..e343afa3 100644 --- a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.html +++ b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.html @@ -7,15 +7,37 @@
- + +
diff --git a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.scss b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.scss index e69de29b..30e4390b 100644 --- a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.scss +++ b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.scss @@ -0,0 +1,9 @@ +.contentBg { + padding: 0px 20px; + margin-top: 20px; +} + + +.current-employee { + padding: 0px 20px; +} \ No newline at end of file diff --git a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.ts b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.ts index 9a99b95d..b3200645 100644 --- a/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.ts +++ b/Mohem/src/app/my-team/employee-hierarchy/employee-hierarchy.component.ts @@ -4,6 +4,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; import { MyTeamService } from '../service/my-team.service'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; @Component({ selector: 'app-employee-hierarchy', @@ -11,14 +12,47 @@ import { MyTeamService } from '../service/my-team.service'; styleUrls: ['./employee-hierarchy.component.scss'], }) export class EmployeeHierarchyComponent implements OnInit { + public personalInfo: any; + public hierarchyData: any; + public subordinateHierarchyList: any; + public supervisorHierarchyList: any; constructor( public ts: TranslatorService, public authService: AuthenticationService, public common: CommonService, - public myTeamService: MyTeamService + public myTeamService: MyTeamService, + public cs: CommonService ) { } - ngOnInit() {} + ngOnInit() { + this.getProfile(); + } + + public getProfile() { + this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { + if (user) { + this.personalInfo = user; + this.getEmployeeHierachy(); + } + }); + } + + public getEmployeeHierachy() { + const body = { + P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER, + P_MENU_TYPE: "E", + P_SELECTED_RESP_ID: -999 + }; + this.myTeamService.getEmployeeHierachy(body).subscribe((result: any) => { + if (this.cs.validResponse(result)) { + this.hierarchyData = result.SupervisorHierarchyLists; + this.subordinateHierarchyList = this.hierarchyData.SubordinateHierarchyList; + let rawSupervisorHierarchyList = this.hierarchyData.SupervisorHierarchyList; + this.supervisorHierarchyList = rawSupervisorHierarchyList.reverse(); + } + }); + + } } diff --git a/Mohem/src/app/my-team/service/my-team.service.ts b/Mohem/src/app/my-team/service/my-team.service.ts index 81149b41..27b71d9b 100644 --- a/Mohem/src/app/my-team/service/my-team.service.ts +++ b/Mohem/src/app/my-team/service/my-team.service.ts @@ -8,6 +8,7 @@ export class MyTeamService { public static EMPLOYEE_SHARED_DATA = 'employee'; public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES'; public static getSubordintesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES_TOTAL_VACATIONS'; + public static getEmployeeHierachy = "Services/ERP.svc/REST/GET_SUPERVISOR_HIERARCHY"; // public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS'; @@ -28,6 +29,12 @@ export class MyTeamService { return this.con.post(MyTeamService.getSubordintesLeaves, request, onError, errorLabel); } + public getEmployeeHierachy(employeeQualificationRequest: any, onError?: any, errorLabel?: string) { + const request = employeeQualificationRequest; + this.authService.authenticateRequest(request); + return this.con.post(MyTeamService.getEmployeeHierachy, request, onError, errorLabel); + } + // public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){ // const request = absence; // this.authService.authenticateRequest(request); diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html index 5eb3c359..da029dec 100644 --- a/Mohem/src/app/profile/home/home.component.html +++ b/Mohem/src/app/profile/home/home.component.html @@ -211,7 +211,7 @@ - + diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts index 831f61b9..590b2d47 100644 --- a/Mohem/src/app/profile/home/home.component.ts +++ b/Mohem/src/app/profile/home/home.component.ts @@ -182,27 +182,12 @@ export class HomeComponent implements OnInit { } this.getBasicDetails(); this.getEmployeeQualifications(); - this.getEmployeeHierachy(); this.getAddress(); } }); } - public getEmployeeHierachy() { - const body = { - P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER, - P_MENU_TYPE: "E", - P_SELECTED_RESP_ID: -999 - }; - this.profileService.getEmployeeHierachy(body).subscribe((result: any) => { - if (this.cs.validResponse(result)) { - // this.employeeQualifications = result.EmployeeQualificationsList[0]; - // this.cs.sharedService.setSharedData(this.employeeQualifications, 'employeeQualifications'); - // console.log(this.employeeQualifications); - } - }); - } public getEmployeeQualifications() { const body = {