|
|
|
|
@ -11,6 +11,7 @@ import { Geolocation } from '@ionic-native/geolocation/ngx';
|
|
|
|
|
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
|
|
|
|
|
import { Device } from '@ionic-native/device/ngx';
|
|
|
|
|
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
|
|
|
|
|
import { COCRequest } from 'src/app/notification/models/COCRequest';
|
|
|
|
|
import { Response } from 'src/app/hmg-common/services/models/response';
|
|
|
|
|
import { AttendanceService } from './services/attendance.services';
|
|
|
|
|
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
|
|
|
|
|
@ -41,7 +42,9 @@ import { NFC, Ndef } from "@ionic-native/nfc/ngx"
|
|
|
|
|
import { DigitalIdComponent } from '../authentication/digital-id/digital-id.component';
|
|
|
|
|
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
|
|
|
|
|
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
|
|
|
|
|
|
|
|
|
|
import * as moment from "moment";
|
|
|
|
|
import { count } from 'console';
|
|
|
|
|
import { HomeComponent } from "src/app/notification/home/home.component";
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-home',
|
|
|
|
|
templateUrl: './home.page.html',
|
|
|
|
|
@ -68,6 +71,7 @@ export class HomePage implements OnInit {
|
|
|
|
|
public showVcationRule = false;
|
|
|
|
|
public isFakeLocationUsed = false;
|
|
|
|
|
public intervalCountdown: any;
|
|
|
|
|
public showLoader = true;
|
|
|
|
|
public statsButtons = [
|
|
|
|
|
{
|
|
|
|
|
title: this.ts.trPK('attendance-tracking', 'title'),
|
|
|
|
|
@ -371,6 +375,7 @@ export class HomePage implements OnInit {
|
|
|
|
|
this.setServicesPrivilage();
|
|
|
|
|
if (this.common.getTotalNumberOfWorklistRequest()) {
|
|
|
|
|
this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest();
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.openNotificationsDashbored();
|
|
|
|
|
}
|
|
|
|
|
@ -666,17 +671,63 @@ export class HomePage implements OnInit {
|
|
|
|
|
'worklistNotifications'
|
|
|
|
|
);
|
|
|
|
|
this.common.setFilterValues(result['GetOpenNotificationsList']);
|
|
|
|
|
} else {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
}, (error) => {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ITGCountAllNotification() {
|
|
|
|
|
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
|
|
|
|
|
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
|
|
|
|
|
this.common.filterKeys['ITG'] = result.TotalCount;
|
|
|
|
|
this.statsButtons[1].statsValue =
|
|
|
|
|
Math.floor(this.countAllNotification + result.TotalCount);
|
|
|
|
|
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
|
|
|
|
|
this.common.filterKeys['ITG'] = result.TotalCount;
|
|
|
|
|
this.statsButtons[1].statsValue = Math.floor(this.countAllNotification + result.TotalCount);
|
|
|
|
|
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
|
|
|
|
|
this.getCOCNotificationCount();
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
} else {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
}, (error) => {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getCOCNotificationCount() {
|
|
|
|
|
const request = new COCRequest();
|
|
|
|
|
request.ItgPageSize = 1;
|
|
|
|
|
request.ItgPageNo = 1;
|
|
|
|
|
request.Date = moment(new Date()).format("YYYY-MM-DD");
|
|
|
|
|
|
|
|
|
|
this.workListService.getCOCCount(request, '', '', this.isPostNoLoad).subscribe((result: any) => {
|
|
|
|
|
console.log(result);
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
const countResult = result.Mohemm_ITG_Pending_Task_ResponseItem;
|
|
|
|
|
const totalCount = countResult.escalation + countResult.waitingToClose + countResult.waitingForAcceptance + countResult.extendTATRequest;
|
|
|
|
|
this.common.filterKeys['COC'] = totalCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.statsButtons[1].statsValue = Math.floor(this.statsButtons[1].statsValue + totalCount);
|
|
|
|
|
|
|
|
|
|
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
|
|
|
|
|
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
} else {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, (error) => {
|
|
|
|
|
this.showLoader = false;
|
|
|
|
|
this.common.stopLoading();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|