|
|
|
@ -54,10 +54,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public attendedDays: number;
|
|
|
|
public attendedDays: number;
|
|
|
|
public futrueDays = 0;
|
|
|
|
public futrueDays = 0;
|
|
|
|
public totalAttendancePrecentage = 0;
|
|
|
|
public totalAttendancePrecentage = 0;
|
|
|
|
public arrDaysAttendance: any = [];
|
|
|
|
|
|
|
|
public arrDaysAbsent: any = [];
|
|
|
|
|
|
|
|
public arrDaysOff: any = [];
|
|
|
|
|
|
|
|
public normalDays: any = [];
|
|
|
|
|
|
|
|
public monthTitle: string = moment().format('MMMM');
|
|
|
|
public monthTitle: string = moment().format('MMMM');
|
|
|
|
public yearTitle: string;
|
|
|
|
public yearTitle: string;
|
|
|
|
public activeMonth: any;
|
|
|
|
public activeMonth: any;
|
|
|
|
@ -120,7 +116,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public segmentChanged(event: any) {
|
|
|
|
public segmentChanged(event: any) {
|
|
|
|
this.activeSegment = event.detail.value;
|
|
|
|
this.activeSegment = event.detail.value;
|
|
|
|
if (this.activeSegment === 'Attendance') {
|
|
|
|
if (this.activeSegment === 'Attendance') {
|
|
|
|
this.normalDays = [];
|
|
|
|
|
|
|
|
this.initAttendance();
|
|
|
|
this.initAttendance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -132,19 +127,11 @@ export class DetailsComponent implements OnInit {
|
|
|
|
this.currentDate = new Date();
|
|
|
|
this.currentDate = new Date();
|
|
|
|
this.showData = false;
|
|
|
|
this.showData = false;
|
|
|
|
this.nextMonth = new Date().getMonth() + 2;
|
|
|
|
this.nextMonth = new Date().getMonth() + 2;
|
|
|
|
this.preMonth = new Date().getMonth() - 2;
|
|
|
|
this.preMonth = new Date().getMonth();
|
|
|
|
if (this.preMonth < 0) {
|
|
|
|
|
|
|
|
this.preMonth = this.preMonth * - 1;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.preMonth = this.preMonth * - 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
|
|
|
|
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
calendarConfig(month?, year?) {
|
|
|
|
calendarConfig(month?, year?) {
|
|
|
|
this.arrDaysOff = [];
|
|
|
|
|
|
|
|
this.arrDaysAttendance = [];
|
|
|
|
|
|
|
|
this.arrDaysAbsent = [];
|
|
|
|
|
|
|
|
this.month = month;
|
|
|
|
this.month = month;
|
|
|
|
this.year = year;
|
|
|
|
this.year = year;
|
|
|
|
this.getTimeCardSummaryDetails(month, year);
|
|
|
|
this.getTimeCardSummaryDetails(month, year);
|
|
|
|
@ -174,14 +161,12 @@ export class DetailsComponent implements OnInit {
|
|
|
|
console.log(result.GetDayHoursTypeDetailsList);
|
|
|
|
console.log(result.GetDayHoursTypeDetailsList);
|
|
|
|
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
|
|
|
|
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
|
|
|
|
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
|
|
|
|
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
|
|
|
|
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nextSlide() {
|
|
|
|
nextSlide() {
|
|
|
|
this.normalDays = [];
|
|
|
|
|
|
|
|
if (this.currentMonthName !== this.month) {
|
|
|
|
if (this.currentMonthName !== this.month) {
|
|
|
|
this.showData = false;
|
|
|
|
this.showData = false;
|
|
|
|
if (this.nextMonth > 12) {
|
|
|
|
if (this.nextMonth > 12) {
|
|
|
|
@ -196,7 +181,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
previousSlide() {
|
|
|
|
previousSlide() {
|
|
|
|
this.normalDays = [];
|
|
|
|
|
|
|
|
this.showData = false;
|
|
|
|
this.showData = false;
|
|
|
|
if (this.preMonth === 0) {
|
|
|
|
if (this.preMonth === 0) {
|
|
|
|
this.currentYear = this.currentYear - 1;
|
|
|
|
this.currentYear = this.currentYear - 1;
|
|
|
|
@ -210,6 +194,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changeMonthTitle(title) {
|
|
|
|
changeMonthTitle(title) {
|
|
|
|
this.monthTitle = title;
|
|
|
|
this.monthTitle = title;
|
|
|
|
this.getTimeCardSummaryDetails();
|
|
|
|
this.getTimeCardSummaryDetails();
|
|
|
|
@ -223,48 +208,35 @@ export class DetailsComponent implements OnInit {
|
|
|
|
for (let i = 0; i < allDays.length; i++) {
|
|
|
|
for (let i = 0; i < allDays.length; i++) {
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
if (allDays[i].ATTENDED_FLAG == 'Y') {
|
|
|
|
if (allDays[i].ATTENDED_FLAG == 'Y') {
|
|
|
|
allDays[i].present = true;
|
|
|
|
allDays[i].customPresent = true;
|
|
|
|
allDays[i].absent = false;
|
|
|
|
allDays[i].customAbsent = false;
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
allDays[i].customDaysOff = false;
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
allDays[i].customSchedule = false;
|
|
|
|
this.arrDaysAttendance.push({
|
|
|
|
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
|
|
|
|
allDays[i].present = false;
|
|
|
|
allDays[i].customPresent = false;
|
|
|
|
allDays[i].absent = true;
|
|
|
|
allDays[i].customAbsent = true;
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
allDays[i].customDaysOff = false;
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
allDays[i].customSchedule = false;
|
|
|
|
this.arrDaysAbsent.push({
|
|
|
|
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
isoTime: '09:00:00',
|
|
|
|
|
|
|
|
allDay: false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
|
|
|
|
allDays[i].present = false;
|
|
|
|
allDays[i].customPresent = false;
|
|
|
|
allDays[i].absent = false;
|
|
|
|
allDays[i].customAbsent = false;
|
|
|
|
allDays[i].daysOff = true;
|
|
|
|
allDays[i].customDaysOff = true;
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
allDays[i].customSchedule = false;
|
|
|
|
this.arrDaysOff.push({
|
|
|
|
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
allDays[i].present = false;
|
|
|
|
allDays[i].customPresent = false;
|
|
|
|
allDays[i].absent = false;
|
|
|
|
allDays[i].customAbsent = false;
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
allDays[i].customDaysOff = false;
|
|
|
|
allDays[i].schedule = true;
|
|
|
|
allDays[i].customSchedule = true;
|
|
|
|
this.normalDays.push({
|
|
|
|
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.showData = true;
|
|
|
|
this.showData = true;
|
|
|
|
|
|
|
|
this.dayHoursTypeDetailsList = allDays;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public getTimeCardSummaryDetails(month?, year?) {
|
|
|
|
public getTimeCardSummaryDetails(month?, year?) {
|
|
|
|
|