edit monthly attendance

new-time-card
Fatimah.Alshammari 6 years ago
parent 32e33e655b
commit 573941941f

@ -91,6 +91,7 @@ export class CircleCalendarComponent implements OnInit {
ngOnInit() {
this.isFirst = false;
this.reRenderCalendar();
console.log("1")
}
@ -98,8 +99,12 @@ export class CircleCalendarComponent implements OnInit {
setTimeout(() => {
this.reRenderCalendar();
}, 1000);
console.log("2")
}
// ngOnChanges(){
// console.log("3")
// }
getHeaderDay(date: any) {
return this.weekDaysEnSort[date.getDay()];

@ -173,4 +173,8 @@
</ion-col>
</ion-row> -->
</ion-grid>
<!-- <div style="border-bottom: rgb(190, 187, 187) solid 1px;" >
<button class="more" ion-button (click)="hide()" >{{ts.trPK('attendance-tracking','less')}}</button>
</div>
<div *ngIf="hideMe"> </div> -->
</div>

@ -160,4 +160,19 @@ height: 360px !important;
padding-bottom: 21px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
}
// .less{ background-color: #22C6B3;
// background-color: #22C6B3;
// border: none;
// color: white;
// text-align: center;
// text-decoration: none;
// display: inline-block;
// font-size: 12px;
// border-radius: 30px;
// height: 26px;
// padding: 6px 24px;
// margin-left: 123px;
// /* margin-top: -19px; */
// margin-bottom: 17px;
// }

@ -195,6 +195,10 @@ export class DateInfoModalComponent implements OnInit {
return this.weekDaysEn[date.getDay()];
}
// hide(){
// this.hideMe = true;
// }
// @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
// public options = {
// cutoutPercentage: 80,

@ -412,11 +412,9 @@
<p style="position: absolute; left: 25%; bottom: 0%; font-family: WorkSans-Bold;">{{year}}</p>
</ion-col>
<ion-col>
<button ion-button icon-end class="slidNext" (click)="nextSlide(sliderOne,slideWithNav)">
<ion-icon class="disabledArrow" ios="ios-arrow-dropright-circle" md="md-arrow-dropright-circle">
</ion-icon>
</button>
<button ion-button icon-end class="slidNext" (click)="nextSlide()">
<ion-icon [ngClass]=" currentMonthName === month ? 'disabledArrow' : 'activeArrow'" ios="ios-arrow-dropright-circle" md="md-arrow-dropright-circle"></ion-icon>
</button>
</ion-col>
</ion-row>
</div>
@ -474,7 +472,7 @@
</div> -->
<div style="position: relative;
left: 77%;
left: 74%;
bottom: 117px;
color: black;
background-color: #22c6b3;
@ -489,7 +487,7 @@
</ion-col>
</div>
<div style="position: relative;
left: 77%;
left: 74%;
bottom: 67px;
color: black;
background-color: #094875;
@ -561,7 +559,7 @@
</ion-grid>
</div>
<div >
<ion-grid class="bodyGrid">
<ion-grid class="bodyGrid" *ngIf="showData">
<p style="font-weight: bold; font-size: 17px;"> {{ts.trPK('attendance','monthly-attendance-calendar')}}</p>
<app-circle-calendar [eventsdateAttend]='arrDaysAttendance' [eventsdateAbsent]='arrDaysAbsent' [eventsdateDayOff]='arrDaysOff' (monthTitle)='changeMonthTitle($event)' (currentYear)=changeYear($event)></app-circle-calendar>
</ion-grid>

@ -73,37 +73,27 @@ export class TimeCardDetailsComponent implements OnInit {
public yearTitle: string;
public isChange = false;
public activeMonth: any;
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
public showData = false;
public currentYear = new Date().getFullYear();
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [120, 50],
backgroundColor: [
'#22c6b3',
'#094875',
],
borderWidth: 2
}]
};
ngOnInit() {
@ -117,17 +107,15 @@ export class TimeCardDetailsComponent implements OnInit {
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
}
calendarConfig(month?, year?) {
console.log('ngOnInit');
this.arrDaysOff = [];
this.arrDaysAttendance = [];
this.arrDaysAbsent = [];
this.month = month;
this.year = year;
this.arrDaysOff = this.common.sharedService.getSharedData('calendarDayOffDateValue', false);
this.arrDaysAttendance = this.common.sharedService.getSharedData('calendarAttendanceDateValue', false);
this.arrDaysAbsent = this.common.sharedService.getSharedData('calendarDaysAbsentDateValue', false);
// this.arrDaysOff = this.common.sharedService.getSharedData('calendarDayOffDateValue', false);
// this.arrDaysAttendance = this.common.sharedService.getSharedData('calendarAttendanceDateValue', false);
// this.arrDaysAbsent = this.common.sharedService.getSharedData('calendarDaysAbsentDateValue', false);
this.getTimeCardSummaryDetails(month, year);
this.getDayHoursTypeDetails(month, year);
}
@ -214,13 +202,10 @@ export class TimeCardDetailsComponent implements OnInit {
}
// startTime:new Date(new Date().getTime() +( 60000*60 * 24)),
// endTime: new Date(new Date().getTime() +( 60000*60 * 24)),
// isoTime:"09:00:00",
// allDay: false
countAllAttendDays(allDays) {
console.log('countAllAttendDays');
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < allDays.length; i++) {
if (allDays[i].DAY_TYPE === 'Off') {
// offDay
@ -242,22 +227,21 @@ export class TimeCardDetailsComponent implements OnInit {
);
}
}
this.showData = true;
}
public getTimeCardSummaryDetails(month?, year?) {
console.log('getTimeCardSummaryDetails');
const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
if (this.isChange) {
// this.monthName = this.monthTitle;
// this.yearDate = this.yearTitle;
this.monthName = month;
console.log('' + this.monthName);
this.yearDate = year;
console.log('' + this.yearDate);
} else {
this.monthName = month; // moment().format('MMMM');
this.yearDate = year; // moment().format('YYYY');
this.monthName = month;
this.yearDate = year;
}
this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
@ -268,8 +252,6 @@ export class TimeCardDetailsComponent implements OnInit {
timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
timeCardSummaryReqObj.P_MENU_TYPE = this.menuType;
timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
// timeCardSummaryReqObj.P_SCHEDULE_DATE_FROM = this.common.convertISODateToJsonDate(this.dateFrom);
// timeCardSummaryReqObj.P_SCHEDULE_DATE_TO = this.common.convertISODateToJsonDate(this.dateTo);
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
@ -289,6 +271,7 @@ export class TimeCardDetailsComponent implements OnInit {
}
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
// console.log("absent: "+ this.absentDays);
@ -305,13 +288,6 @@ export class TimeCardDetailsComponent implements OnInit {
if (this.absentDays === 0 && this.attendedDays === 0) {
this.futrueDays = this.totalAttendancePrecentage;
}
//////////////////////////////////////////////
// console.log("absent: "+ this.absentDays);
// console.log("attend: "+ this.attendedDays);
// console.log("future"+ this.futrueDays);
// in chart "this.futrueDays"
// in calender "this.futrueDays == white"
// timecard sumery return not match data with GET_DAY_HOURS_TYPE_DETAILS
this.data = {
datasets: [
{
@ -375,8 +351,6 @@ export class TimeCardDetailsComponent implements OnInit {
}
showShiftDetails(origin: string) {
console.log('showShiftDetails');
this.sliderRef.getActiveIndex().then((index: number) => {
this.selectedShift = this.dayHoursData[index];
this.selectedShift.origin = origin;
@ -385,47 +359,32 @@ export class TimeCardDetailsComponent implements OnInit {
});
}
/////////////////////////////////////////////////// here
// slideNext(object, slideView) {
// if (this.loadMoreDateHoursData && this.loadMore) {
// this.dayAndHoursPageNumber++;
// this.getDayHoursTypeDetails();
// }
// this.sliderRef.slideNext();
// this.sliderRef.getActiveIndex().then((index: number) => {
// if (index === (this.dayHoursData.length - 1)) {
// this.loadMoreDateHoursData = true;
// }
// });
// }
// slidePrev(object, slideView) {
// this.sliderRef.slidePrev();
// }
/////////////////////////////////
nextSlide() {
let currentYear = new Date().getFullYear();
if (this.nextMonth > 12) {
currentYear = currentYear + 1;
this.nextMonth = 1;
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
this.currentYear = this.currentYear + 1;
this.nextMonth = 1;
}
console.log('preMonth: ' + this.nextMonth);
console.log('currentYear: ' + this.currentYear);
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
this.nextMonth = this.nextMonth + 1;
this.preMonth = this.nextMonth - 2;
}
this.calendarConfig(this.getMonthName(this.nextMonth) , currentYear);
this.nextMonth = this.nextMonth + 1;
this.preMonth = this.preMonth + 1;
}
previousSlide() {
let currentYear = new Date().getFullYear();
this.showData = false;
if (this.preMonth === 0) {
currentYear = currentYear - 1;
this.currentYear = this.currentYear - 1;
this.preMonth = 12;
}
this.calendarConfig(this.getMonthName(this.preMonth) , currentYear);
console.log('preMonth: ' + this.preMonth);
console.log('currentYear: ' + this.currentYear);
this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
this.preMonth = this.preMonth - 1;
this.nextMonth = this.nextMonth - 1;
this.nextMonth = this.preMonth + 2;
}
changeMonthTitle(title) {

@ -2204,6 +2204,14 @@
"en": "Attendance Statistics",
"ar":""
},
"more":{
"en": "MORE",
"ar":""
},
"less":{
"en": "LESS",
"ar":""
},
"confirm-alert1":{
"en": "Are you sure, you want to",
"ar":"Are you sure, you want to"

Loading…
Cancel
Save