fixed issue MM-46

master
umasoodch 6 years ago
parent fcbeae462e
commit 6db87b6930

@ -69,8 +69,7 @@ export class CircleCalendarComponent implements OnInit {
@ViewChild('slider') slides: ElementRef;
ngOnInit() {
this.reRenderCalendar();
console.log(this.currentDateParent);
// this.reRenderCalendar();
}
// tslint:disable-next-line: use-life-cycle-interface
@ -118,6 +117,7 @@ export class CircleCalendarComponent implements OnInit {
}
});
});
this.common.stopLoading();
}
onDayClicked(event) {

@ -75,7 +75,7 @@ export class DetailsComponent implements OnInit {
};
public data = {};
public isPostNoLoad = true;
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
@ -96,11 +96,13 @@ export class DetailsComponent implements OnInit {
) { }
ngOnInit() {
this.common.startLoading();
this.intializeMemberDetail();
this.showAttendanceTracking();
}
showAttendanceTracking() {
this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
@ -116,6 +118,7 @@ export class DetailsComponent implements OnInit {
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if (this.activeSegment === 'Attendance') {
this.common.startLoading();
this.initAttendance();
}
}
@ -139,7 +142,6 @@ export class DetailsComponent implements OnInit {
}
public getDayHoursTypeDetails(month?, year?) {
console.log('getDayHoursTypeDetails');
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
this.monthName = month;
this.yearDate = year;
@ -156,17 +158,17 @@ export class DetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
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);
}
});
}
nextSlide() {
this.common.startLoading();
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
@ -181,6 +183,7 @@ export class DetailsComponent implements OnInit {
}
previousSlide() {
this.common.startLoading();
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
@ -255,17 +258,11 @@ export class DetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
// if (this.absentDays === 0 && this.attendedDays === 0) {
// this.futrueDays = this.totalAttendancePrecentage;
// }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) {
this.data = {

@ -45,31 +45,51 @@ export class TimeCardService {
public getTimeCardSummary(
timeCardSummaryReq,
onError?: any,
errorLabel?: string
errorLabel?: string,
isPostNoLoad = false
): Observable<GetTimeCardSummaryResponse> {
const request = timeCardSummaryReq;
this.authService.authenticateRequest(request);
if (isPostNoLoad) {
return this.con.postNoLoad(
TimeCardService.getTimeCardSummaryUrl,
request,
onError,
errorLabel
);
} else {
return this.con.post(
TimeCardService.getTimeCardSummaryUrl,
request,
onError,
errorLabel
);
}
}
public getDayHoursTypeDetails(
dayHoursDetailsReq,
onError?: any,
errorLabel?: string
errorLabel?: string,
isPostNoLoad = false
): Observable<GetDayAndHoursDetailsResponse> {
const request = dayHoursDetailsReq;
this.authService.authenticateRequest(request);
return this.con.post(
TimeCardService.getDayHourDetailsUrl,
request,
onError,
errorLabel
);
if (isPostNoLoad) {
return this.con.postNoLoad(
TimeCardService.getDayHourDetailsUrl,
request,
onError,
errorLabel
);
} else {
return this.con.post(
TimeCardService.getDayHourDetailsUrl,
request,
onError,
errorLabel
);
}
}
public getShiftDetail(

@ -3,7 +3,6 @@ import { TimeCardService } from 'src/app/time-card/service/time-card.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { ModalController, IonSlides } from '@ionic/angular';
import { SelectPeriodComponent } from '../select-period/select-period.component';
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 { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
@ -62,6 +61,7 @@ export class TimeCardDetailsComponent implements OnInit {
public currentYear = new Date().getFullYear();
public dayHoursTypeDetailsList = [];
public currentDate = new Date();
public isPostNoLoad = true;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
@ -70,6 +70,7 @@ export class TimeCardDetailsComponent implements OnInit {
public data = {};
ngOnInit() {
this.common.startLoading();
this.showData = false;
this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth();
@ -101,7 +102,7 @@ export class TimeCardDetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
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');
@ -163,17 +164,11 @@ export class TimeCardDetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
// if (this.absentDays === 0 && this.attendedDays === 0) {
// this.futrueDays = this.totalAttendancePrecentage;
// }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) {
this.data = {
@ -193,6 +188,7 @@ export class TimeCardDetailsComponent implements OnInit {
}
nextSlide() {
this.common.startLoading();
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
@ -207,6 +203,7 @@ export class TimeCardDetailsComponent implements OnInit {
}
previousSlide() {
this.common.startLoading();
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;

Loading…
Cancel
Save