added employee hierarchy

MOE-PHASE-2-SPRINT-1
umasoodch 3 years ago
parent 874b9951be
commit 124eb3cc92

@ -52,14 +52,14 @@
</ion-label>
</ion-item>
<!-- <ion-item lines="none" (click)="openEmployeeHierarchy()">
<ion-item lines="none" (click)="openEmployeeHierarchy()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','employee-hierarchy')}}
</ion-label>
</ion-item> -->
</ion-item>
<!-- <ion-item (click)="openMyRequestPage()">
<ion-thumbnail slot="start" class="menu-thumb">
@ -198,14 +198,14 @@
</ion-label>
</ion-item>
<!-- <ion-item lines="none" (click)="openEmployeeHierarchy()">
<ion-item lines="none" (click)="openEmployeeHierarchy()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','employee-hierarchy')}}
</ion-label>
</ion-item> -->
</ion-item>
<!-- <ion-item (click)="openMyRequestPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>

@ -9,19 +9,15 @@
</ion-col>
<ion-col [size]="9" style="padding: 8px 5px 0px;margin-top: 14px;">
<div>
<div [ngClass]="direction == 'en' ? 'numberEmp':'numberEmp-ar' ">39</div>
<span [ngClass]=" direction == 'en'? 'employee-name' : 'employee-name-ar'" (click)="getDetails()">
<h2 class="name">{{name}}</h2>
<span class="title">{{title}}</span>
</span>
<a [ngClass]="employeePhoneNumber == '' ? 'disable-phone image-container' : 'image-container'" href="tel:{{employeePhoneNumber}}">
<!-- <img src="../assets/imgs/green_call_icon.png" > -->
<img src="../assets/imgs/call.svg" >
</a>
</div>
<!-- <div class="swipe-information">
<span class="check-in"><strong>Check-In:</strong> {{checkIn}}</span>
<span><strong>Check-Out:</strong> {{checkOut}}</span>
</div> -->
</ion-col>
</ion-row>
</div>

@ -119,4 +119,32 @@
font-size: 12px;
margin-right: 15px;
}
}
}
.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;
}

@ -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;
}

@ -7,15 +7,37 @@
<ion-content>
<div class="contentBg">
<!-- <ng-container *ngFor="let subordinate of empSubordinate;let i=index">
<app-employee-information
<ng-container *ngFor="let subordinate of supervisorHierarchyList;let i=index">
<app-employee-hierarchy-card
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(onGetDetails)="getDetails(i)">
</app-employee-hierarchy-card>
</ng-container>
</div>
<div *ngIf="personalInfo" class="current-employee">
<app-employee-hierarchy-card
[name]="personalInfo.EMPLOYEE_NAME"
[title]="personalInfo.POSITION_NAME"
[employeeImage]="personalInfo.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+personalInfo.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="personalInfo.EMPLOYEE_MOBILE_NUMBER"
(onGetDetails)="getDetails('personal')">
</app-employee-hierarchy-card>
</div>
<div class="contentBg">
<ng-container *ngFor="let subordinate of subordinateHierarchyList;let i=index">
<app-employee-hierarchy-card
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(onGetDetails)="getDetails(i)">
</app-employee-information>
</ng-container> -->
</app-employee-hierarchy-card>
</ng-container>
</div>
</ion-content>

@ -0,0 +1,9 @@
.contentBg {
padding: 0px 20px;
margin-top: 20px;
}
.current-employee {
padding: 0px 20px;
}

@ -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();
}
});
}
}

@ -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);

@ -211,7 +211,7 @@
</ion-card-content>
</ion-card>
<!-- <ion-card *ngIf="basicDetailsSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<ion-card *ngIf="basicDetailsSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<ion-card-content *ngIf="!editBasic && employeeQualifications">
<ion-grid>
<ion-row >
@ -249,7 +249,7 @@
<h3 [ngClass]="direction === 'ltr'? 'result-label-text-form': 'result-label-text-form-ar' ">{{employeeQualifications.STATUS}}</h3>
<br>
</ion-card-content>
</ion-card> -->
</ion-card>
<ion-card *ngIf="contactSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<ion-card-content *ngIf="!editAddress && employeeAdress">

@ -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 = {

Loading…
Cancel
Save