|
|
|
|
@ -92,7 +92,10 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
public selectedFilter = '';
|
|
|
|
|
public itemType = '';
|
|
|
|
|
public monthNo: any;
|
|
|
|
|
isFavorite: boolean = false;
|
|
|
|
|
isFavorite = false;
|
|
|
|
|
public EmpNumer:any;
|
|
|
|
|
public isFavor:any;
|
|
|
|
|
public EmployeeTotal:any;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -231,7 +234,9 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
this.showAttendanceTracking();
|
|
|
|
|
// tslint:disable-next-line: max-line-length
|
|
|
|
|
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
|
|
|
|
|
this.getSuborinatesAttStatus();
|
|
|
|
|
// this.getSuborinatesAttStatus();
|
|
|
|
|
// this.getFavorit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -300,7 +305,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
console.log(result.GetDayHoursTypeDetailsList);
|
|
|
|
|
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
|
|
|
|
|
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
|
|
|
|
|
}
|
|
|
|
|
@ -308,7 +312,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
monthCardSliders(monthNo) {
|
|
|
|
|
console.log(monthNo + "__________________")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* change
|
|
|
|
|
*/
|
|
|
|
|
@ -321,8 +325,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//end
|
|
|
|
|
this.calendarConfig(this.getMonthName(monthNo), this.currentYear);
|
|
|
|
|
console.log("next month =" + this.nextMonth);
|
|
|
|
|
console.log(" Month Name =" + this.currentMonthName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -350,7 +353,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
this.preMonth = 12;
|
|
|
|
|
}
|
|
|
|
|
this.currentDate = new Date(this.currentYear, (this.preMonth - 1), 1);
|
|
|
|
|
console.log(this.currentDate);
|
|
|
|
|
|
|
|
|
|
this.calendarConfig(this.getMonthName(this.preMonth), this.currentYear);
|
|
|
|
|
this.preMonth = this.preMonth - 1;
|
|
|
|
|
this.nextMonth = this.preMonth + 2;
|
|
|
|
|
@ -525,6 +528,8 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false;
|
|
|
|
|
if (this.employee) {
|
|
|
|
|
this.getEmpSubordinate(userID);
|
|
|
|
|
this.isFavorite = false;
|
|
|
|
|
this.getFavorit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -587,7 +592,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
};
|
|
|
|
|
this.getEmployeeSubordinatesRequestObject = body;
|
|
|
|
|
this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
|
|
|
|
|
console.log('one');
|
|
|
|
|
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleEmpResult(result.GetEmployeeSubordinatesList);
|
|
|
|
|
}
|
|
|
|
|
@ -595,6 +600,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleEmpResult(result) {
|
|
|
|
|
this.EmployeeTotal = result.length;
|
|
|
|
|
const lastItemIndex = result.length - 1;
|
|
|
|
|
const lastItem = result[lastItemIndex];
|
|
|
|
|
if (lastItem) {
|
|
|
|
|
@ -625,7 +631,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
doInfinite(infiniteScroll) {
|
|
|
|
|
if (!this.isReachEnd) {
|
|
|
|
|
this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
|
|
|
|
|
console.log('two');
|
|
|
|
|
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.handleEmpResult(result.GetEmployeeSubordinatesList);
|
|
|
|
|
}
|
|
|
|
|
@ -715,37 +721,29 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getSuborinatesAttStatus() {
|
|
|
|
|
const request = {
|
|
|
|
|
// VersionID:2.8,
|
|
|
|
|
// Channel:37,
|
|
|
|
|
// LanguageID:2,
|
|
|
|
|
// MobileType:"android",
|
|
|
|
|
// P_SESSION_ID:1142449920,
|
|
|
|
|
// MobileNumber:"0508079569",
|
|
|
|
|
// TokenID:"VHR_Token",
|
|
|
|
|
// P_USER_NAME:"111209",
|
|
|
|
|
// UserName:"111209",
|
|
|
|
|
// P_EMAIL_ADDRESS:"Faisal.AlQurashi@cloudsolutions.com.sa",
|
|
|
|
|
SearchMonth: "January",
|
|
|
|
|
SearchYear: 2021
|
|
|
|
|
// getSuborinatesAttStatus() {
|
|
|
|
|
// const request = {
|
|
|
|
|
// // SearchMonth: "January",
|
|
|
|
|
// // SearchYear: 2021
|
|
|
|
|
// SearchMonth: "",
|
|
|
|
|
// SearchYear: Number
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
// this.myTeamService.getSuborinatesAttStatus().subscribe((result: any) =>
|
|
|
|
|
this.myTeamService.getSuborinatesAttStatus(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
this.handleRespondSuborinatesAttStatusResult(result);
|
|
|
|
|
// };
|
|
|
|
|
// // this.myTeamService.getSuborinatesAttStatus().subscribe((result: any) =>
|
|
|
|
|
// this.myTeamService.getSuborinatesAttStatus(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
|
|
|
|
|
// this.handleRespondSuborinatesAttStatusResult(result);
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
handleRespondSuborinatesAttStatusResult(result) {
|
|
|
|
|
// this.EmpTotal = result.GetSubordinatesAttdStatusList.length;
|
|
|
|
|
this.EmpTotal = result.GetSubordinatesAttdStatusList[0].NUMBER_OF_EMPLOYEES;
|
|
|
|
|
console.log("total no " + this.EmpTotal)
|
|
|
|
|
}
|
|
|
|
|
// handleRespondSuborinatesAttStatusResult(result) {
|
|
|
|
|
// // this.EmpTotal = result.GetSubordinatesAttdStatusList.length;
|
|
|
|
|
// this.EmpTotal = result.GetSubordinatesAttdStatusList[0].NUMBER_OF_EMPLOYEES;
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
activeFilter(index: number) {
|
|
|
|
|
console.log(this.filters);
|
|
|
|
|
|
|
|
|
|
if (this.currentActiveIndex !== index) {
|
|
|
|
|
this.previousActiveIndex = this.currentActiveIndex;
|
|
|
|
|
this.currentActiveIndex = index;
|
|
|
|
|
@ -804,8 +802,9 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
this.common.presentConfirmDialog(
|
|
|
|
|
confirmBoxhtml
|
|
|
|
|
, () => {
|
|
|
|
|
|
|
|
|
|
var request =
|
|
|
|
|
{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true };
|
|
|
|
|
[ { "USER_NAME": this.employee.EMPLOYEE_NUMBER, "EMPLOYEE_DISPLAY_NAME": this.employee.EMPLOYEE_DISPLAY_NAME, "EMAIL_ADDRESS": this.employee.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": this.employee.EMPLOYEE_IMAGE, "IsFavorite": !this.isFavorite}];
|
|
|
|
|
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
// this.isFavorite = false;
|
|
|
|
|
@ -813,7 +812,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
}, () => {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
this.isFavorite = false;
|
|
|
|
|
|
|
|
|
|
// if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
|
|
|
|
|
// this.isSelect = true;
|
|
|
|
|
// }
|
|
|
|
|
@ -832,6 +831,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -842,10 +842,27 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.common.toastPK("replacementRoll", "favorite-saved");
|
|
|
|
|
this.isFavorite = true;
|
|
|
|
|
this.isFavorite = !this.isFavorite;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getFavorit(){
|
|
|
|
|
this.worklistService.getFavoriteMyTeam({}, () => {
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
this.EmpNumer = result.Mohemm_GetFavoriteReplacementsList;
|
|
|
|
|
|
|
|
|
|
this.EmpNumer.forEach(element => {
|
|
|
|
|
if(element.USER_NAME === this.employee.EMPLOYEE_NUMBER){
|
|
|
|
|
|
|
|
|
|
this.isFavorite = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|