|
|
|
@ -12,7 +12,8 @@ import * as moment from 'moment';
|
|
|
|
import { TimeCardService } from 'src/app/time-card/service/time-card.service';
|
|
|
|
import { TimeCardService } from 'src/app/time-card/service/time-card.service';
|
|
|
|
import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request';
|
|
|
|
import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request';
|
|
|
|
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
|
|
|
|
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
|
|
|
|
|
|
|
|
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
|
|
|
|
|
|
|
|
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-details',
|
|
|
|
selector: 'app-details',
|
|
|
|
templateUrl: './details.component.html',
|
|
|
|
templateUrl: './details.component.html',
|
|
|
|
@ -22,7 +23,7 @@ import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-
|
|
|
|
export class DetailsComponent implements OnInit {
|
|
|
|
export class DetailsComponent implements OnInit {
|
|
|
|
public static opendEmployeesARR = 'opend_employees_arr';
|
|
|
|
public static opendEmployeesARR = 'opend_employees_arr';
|
|
|
|
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
|
|
|
|
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
|
|
|
|
public activeSegment = 'About';
|
|
|
|
public activeSegment = 'Attendance';
|
|
|
|
pageNum = 1;
|
|
|
|
pageNum = 1;
|
|
|
|
pageLimit = 50;
|
|
|
|
pageLimit = 50;
|
|
|
|
empSubordinate: any;
|
|
|
|
empSubordinate: any;
|
|
|
|
@ -38,8 +39,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public opendEmployees: any = [];
|
|
|
|
public opendEmployees: any = [];
|
|
|
|
public headerTitle = '';
|
|
|
|
public headerTitle = '';
|
|
|
|
public userImage: any = '../assets/imgs/profile.png';
|
|
|
|
public userImage: any = '../assets/imgs/profile.png';
|
|
|
|
|
|
|
|
|
|
|
|
public showMore: any = true;
|
|
|
|
|
|
|
|
public menuType: any;
|
|
|
|
public menuType: any;
|
|
|
|
public selEmp: string;
|
|
|
|
public selEmp: string;
|
|
|
|
public dateFrom: any = new Date();
|
|
|
|
public dateFrom: any = new Date();
|
|
|
|
@ -48,13 +47,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public timeCardSummaryData: any = [];
|
|
|
|
public timeCardSummaryData: any = [];
|
|
|
|
public dayHoursData: any = [];
|
|
|
|
public dayHoursData: any = [];
|
|
|
|
public selectedShift: any;
|
|
|
|
public selectedShift: any;
|
|
|
|
public rightIconActive = false;
|
|
|
|
|
|
|
|
public leftIconActive = false;
|
|
|
|
|
|
|
|
public loadMore = false;
|
|
|
|
|
|
|
|
public dayAndHoursPageNumber = 1;
|
|
|
|
public dayAndHoursPageNumber = 1;
|
|
|
|
public selectedFilters: any = {};
|
|
|
|
|
|
|
|
public selectedShiftFilter: any;
|
|
|
|
|
|
|
|
public loadMoreDateHoursData = false;
|
|
|
|
|
|
|
|
public monthName: any;
|
|
|
|
public monthName: any;
|
|
|
|
public yearDate: any;
|
|
|
|
public yearDate: any;
|
|
|
|
public absentDays: number;
|
|
|
|
public absentDays: number;
|
|
|
|
@ -64,14 +57,16 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public arrDaysAttendance: any = [];
|
|
|
|
public arrDaysAttendance: any = [];
|
|
|
|
public arrDaysAbsent: any = [];
|
|
|
|
public arrDaysAbsent: any = [];
|
|
|
|
public arrDaysOff: 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 isChange = false;
|
|
|
|
|
|
|
|
public activeMonth: any;
|
|
|
|
public activeMonth: any;
|
|
|
|
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
|
|
|
|
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
|
|
|
|
public showData = false;
|
|
|
|
public showData = false;
|
|
|
|
public currentYear = new Date().getFullYear();
|
|
|
|
public currentYear = new Date().getFullYear();
|
|
|
|
|
|
|
|
public attendanceTrackingList: any = [];
|
|
|
|
|
|
|
|
public currentDate = new Date();
|
|
|
|
|
|
|
|
public dayHoursTypeDetailsList = [];
|
|
|
|
month: any;
|
|
|
|
month: any;
|
|
|
|
year: any;
|
|
|
|
year: any;
|
|
|
|
preMonth: number;
|
|
|
|
preMonth: number;
|
|
|
|
@ -83,44 +78,7 @@ export class DetailsComponent implements OnInit {
|
|
|
|
legend: { display: false }
|
|
|
|
legend: { display: false }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
public data = {
|
|
|
|
public data = {};
|
|
|
|
datasets: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
data: [120, 50],
|
|
|
|
|
|
|
|
backgroundColor: [
|
|
|
|
|
|
|
|
'#22c6b3',
|
|
|
|
|
|
|
|
'#094875',
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
borderWidth: 2
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public filters = [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
name: 'All',
|
|
|
|
|
|
|
|
active: true,
|
|
|
|
|
|
|
|
color: '#124375'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
name: 'Present',
|
|
|
|
|
|
|
|
active: false,
|
|
|
|
|
|
|
|
color: '#18a169'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
name: 'Absent',
|
|
|
|
|
|
|
|
active: false,
|
|
|
|
|
|
|
|
color: '#38c9b3'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
name: 'Late',
|
|
|
|
|
|
|
|
active: false,
|
|
|
|
|
|
|
|
color: '#114475'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slideOptsOne = {
|
|
|
|
public slideOptsOne = {
|
|
|
|
slidesPerView: 4,
|
|
|
|
slidesPerView: 4,
|
|
|
|
@ -143,15 +101,31 @@ export class DetailsComponent implements OnInit {
|
|
|
|
public modalController: ModalController,
|
|
|
|
public modalController: ModalController,
|
|
|
|
private location: Location,
|
|
|
|
private location: Location,
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
|
|
|
|
public dashboardService: DashboredService,
|
|
|
|
) { }
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.intializeMemberDetail();
|
|
|
|
this.intializeMemberDetail();
|
|
|
|
|
|
|
|
this.showAttendanceTracking();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showAttendanceTracking() {
|
|
|
|
|
|
|
|
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
|
|
|
|
|
|
|
|
const request = {
|
|
|
|
|
|
|
|
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
this.dashboardService.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
|
|
|
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
|
|
|
const key = 'GetAttendanceTrackingList';
|
|
|
|
|
|
|
|
this.attendanceTrackingList = result[key];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -188,59 +162,34 @@ export class DetailsComponent implements OnInit {
|
|
|
|
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
|
|
|
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
|
|
|
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
|
|
|
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
|
|
|
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
|
|
|
dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
|
|
|
|
dayAndHoursReqObj.P_MENU_TYPE = this.menuType;
|
|
|
|
dayAndHoursReqObj.P_MENU_TYPE = 'M';
|
|
|
|
dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
|
|
|
|
dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
|
|
|
|
dayAndHoursReqObj.SearchMonth = this.monthName;
|
|
|
|
dayAndHoursReqObj.SearchMonth = this.monthName;
|
|
|
|
dayAndHoursReqObj.SearchYear = this.yearDate;
|
|
|
|
dayAndHoursReqObj.SearchYear = this.yearDate;
|
|
|
|
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
|
|
|
|
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
|
|
|
|
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
|
|
|
|
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
|
|
|
|
|
|
|
|
|
|
|
|
if (Object.keys(this.selectedFilters).length !== 0) {
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_SHT_TYPE = this.selectedShiftFilter;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
dayAndHoursReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
|
|
|
|
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
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.loadMoreDateHoursData = false;
|
|
|
|
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
|
|
|
|
const daysDataLength = result.GetDayHoursTypeDetailsList.length;
|
|
|
|
|
|
|
|
this.loadMore = daysDataLength === 10 ? true : false;
|
|
|
|
|
|
|
|
if (this.dayAndHoursPageNumber > 1 && daysDataLength !== 0) {
|
|
|
|
|
|
|
|
this.rightIconActive = true;
|
|
|
|
|
|
|
|
this.dayHoursData = this.dayHoursData.concat(result.GetDayHoursTypeDetailsList);
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
this.nextSlide();
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
} else if (this.dayAndHoursPageNumber === 1 && daysDataLength <= 10 && daysDataLength !== 0) {
|
|
|
|
|
|
|
|
this.rightIconActive = true;
|
|
|
|
|
|
|
|
this.dayHoursData = 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) {
|
|
|
|
this.currentYear = this.currentYear + 1;
|
|
|
|
this.currentYear = this.currentYear + 1;
|
|
|
|
this.nextMonth = 1;
|
|
|
|
this.nextMonth = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
|
|
|
|
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
|
|
|
|
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
|
|
|
|
this.nextMonth = this.nextMonth + 1;
|
|
|
|
this.nextMonth = this.nextMonth + 1;
|
|
|
|
this.preMonth = this.nextMonth - 2;
|
|
|
|
this.preMonth = this.nextMonth - 2;
|
|
|
|
@ -248,11 +197,14 @@ 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;
|
|
|
|
this.preMonth = 12;
|
|
|
|
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.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
|
|
|
|
this.preMonth = this.preMonth - 1;
|
|
|
|
this.preMonth = this.preMonth - 1;
|
|
|
|
this.nextMonth = this.preMonth + 2;
|
|
|
|
this.nextMonth = this.preMonth + 2;
|
|
|
|
@ -260,74 +212,82 @@ export class DetailsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changeMonthTitle(title) {
|
|
|
|
changeMonthTitle(title) {
|
|
|
|
console.log('changeMonthTitle');
|
|
|
|
|
|
|
|
this.monthTitle = title;
|
|
|
|
this.monthTitle = title;
|
|
|
|
this.isChange = true;
|
|
|
|
|
|
|
|
this.getTimeCardSummaryDetails();
|
|
|
|
this.getTimeCardSummaryDetails();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
changeYear(year) {
|
|
|
|
changeYear(year) {
|
|
|
|
console.log('changeYear');
|
|
|
|
|
|
|
|
this.yearTitle = year;
|
|
|
|
this.yearTitle = year;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
countAllAttendDays(allDays) {
|
|
|
|
countAllAttendDays(allDays) {
|
|
|
|
// tslint:disable-next-line:prefer-for-of
|
|
|
|
// tslint:disable-next-line:prefer-for-of
|
|
|
|
for (let i = 0; i < allDays.length; i++) {
|
|
|
|
for (let i = 0; i < allDays.length; i++) {
|
|
|
|
if (allDays[i].DAY_TYPE === 'Off') {
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
this.arrDaysOff.push({startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
if (allDays[i].ATTENDED_FLAG == 'Y') {
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)});
|
|
|
|
allDays[i].present = true;
|
|
|
|
} else if (allDays[i].DAY_TYPE === 'SCHEDULED') {
|
|
|
|
allDays[i].absent = false;
|
|
|
|
this.arrDaysAttendance.push({startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)});
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
} else {
|
|
|
|
this.arrDaysAttendance.push({
|
|
|
|
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
|
|
|
|
|
|
|
|
allDays[i].present = false;
|
|
|
|
|
|
|
|
allDays[i].absent = true;
|
|
|
|
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
this.arrDaysAbsent.push({
|
|
|
|
this.arrDaysAbsent.push({
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
isoTime: '09:00:00',
|
|
|
|
isoTime: '09:00:00',
|
|
|
|
allDay: false
|
|
|
|
allDay: false
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// tslint:disable-next-line: triple-equals
|
|
|
|
|
|
|
|
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
|
|
|
|
|
|
|
|
allDays[i].present = false;
|
|
|
|
|
|
|
|
allDays[i].absent = false;
|
|
|
|
|
|
|
|
allDays[i].daysOff = true;
|
|
|
|
|
|
|
|
allDays[i].schedule = false;
|
|
|
|
|
|
|
|
this.arrDaysOff.push({
|
|
|
|
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
allDays[i].present = false;
|
|
|
|
|
|
|
|
allDays[i].absent = false;
|
|
|
|
|
|
|
|
allDays[i].daysOff = false;
|
|
|
|
|
|
|
|
allDays[i].schedule = true;
|
|
|
|
|
|
|
|
this.normalDays.push({
|
|
|
|
|
|
|
|
startTime: new Date(allDays[i].SCHEDULE_DATE),
|
|
|
|
|
|
|
|
endTime: new Date(allDays[i].SCHEDULE_DATE)
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.showData = true;
|
|
|
|
this.showData = true;
|
|
|
|
|
|
|
|
console.log(this.arrDaysOff);
|
|
|
|
|
|
|
|
console.log(this.arrDaysAttendance);
|
|
|
|
|
|
|
|
console.log(this.arrDaysAbsent);
|
|
|
|
|
|
|
|
console.log(this.normalDays);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public getTimeCardSummaryDetails(month?, year?) {
|
|
|
|
public getTimeCardSummaryDetails(month?, year?) {
|
|
|
|
const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
|
|
|
|
const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
|
|
|
|
if (this.isChange) {
|
|
|
|
|
|
|
|
this.monthName = month;
|
|
|
|
|
|
|
|
this.yearDate = year;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.monthName = month;
|
|
|
|
this.monthName = month;
|
|
|
|
this.yearDate = year;
|
|
|
|
this.yearDate = year;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
|
|
|
this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
|
|
|
this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
|
|
|
this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
|
|
|
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
|
|
|
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
|
|
|
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
|
|
|
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
|
|
|
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
|
|
|
timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
|
|
|
|
timeCardSummaryReqObj.P_MENU_TYPE = this.menuType;
|
|
|
|
timeCardSummaryReqObj.P_MENU_TYPE = 'M';
|
|
|
|
timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
|
|
|
|
timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
|
|
|
|
timeCardSummaryReqObj.SearchMonth = this.monthName;
|
|
|
|
timeCardSummaryReqObj.SearchMonth = this.monthName;
|
|
|
|
timeCardSummaryReqObj.SearchYear = this.yearDate;
|
|
|
|
timeCardSummaryReqObj.SearchYear = this.yearDate;
|
|
|
|
|
|
|
|
|
|
|
|
if (Object.keys(this.selectedFilters).length !== 0) {
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_SHT_TYPE = this.selectedShiftFilter;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
timeCardSummaryReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
|
|
|
|
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -335,28 +295,25 @@ export class DetailsComponent implements OnInit {
|
|
|
|
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
|
|
|
|
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
|
|
|
|
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
|
|
|
|
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
|
|
|
|
|
|
|
|
|
|
|
|
this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
|
|
|
|
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
|
|
|
|
this.options = {
|
|
|
|
// if (this.absentDays === 0 && this.attendedDays === 0) {
|
|
|
|
cutoutPercentage: 80,
|
|
|
|
// this.futrueDays = this.totalAttendancePrecentage;
|
|
|
|
tooltips: { enabled: false },
|
|
|
|
// }
|
|
|
|
legend: { display: false }
|
|
|
|
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
|
|
|
|
};
|
|
|
|
if (this.totalAttendancePrecentage > 0) {
|
|
|
|
if (this.absentDays === 0 && this.attendedDays === 0) {
|
|
|
|
|
|
|
|
this.futrueDays = this.totalAttendancePrecentage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.data = {
|
|
|
|
this.data = {
|
|
|
|
datasets: [
|
|
|
|
datasets: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
data: [this.absentDays, this.attendedDays, this.futrueDays],
|
|
|
|
data: [this.absentDays, this.attendedDays],
|
|
|
|
backgroundColor: [
|
|
|
|
backgroundColor: [
|
|
|
|
'#094875',
|
|
|
|
'#094875',
|
|
|
|
'#22c6b3',
|
|
|
|
'#22c6b3'
|
|
|
|
'#9e9e9e'
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
borderWidth: 2
|
|
|
|
borderWidth: 2
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -431,7 +388,6 @@ export class DetailsComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
searchEmployeeTwo() {
|
|
|
|
searchEmployeeTwo() {
|
|
|
|
console.log('umar 1999');
|
|
|
|
|
|
|
|
this.isSearch = true;
|
|
|
|
this.isSearch = true;
|
|
|
|
this.empSubordinate = [];
|
|
|
|
this.empSubordinate = [];
|
|
|
|
this.getEmpSubordinate('');
|
|
|
|
this.getEmpSubordinate('');
|
|
|
|
|