Time Left Today
diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts
index 2fcd7a22..9c086dd5 100644
--- a/Mohem/src/app/home/home.page.ts
+++ b/Mohem/src/app/home/home.page.ts
@@ -1,48 +1,51 @@
-import { EitService } from "./../eit/services/eit.service";
-import { Component, OnInit } from "@angular/core";
-import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
-import { MenuController, Events, ActionSheetController } from "@ionic/angular";
-import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
-import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
-import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
-import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
-import { CommonService } from "src/app/hmg-common/services/common/common.service";
-import { Geolocation } from "@ionic-native/geolocation/ngx";
-import { ZBar, ZBarOptions } from "@ionic-native/zbar/ngx";
-import { BarcodeScanner } from "@ionic-native/barcode-scanner/ngx";
-import { Device } from "@ionic-native/device/ngx";
-import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request";
-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";
-import { FileUploaderComponent } from "../hmg-common/ui/file-uploader/file-uploader.component";
-import { Camera } from "@ionic-native/Camera/ngx";
-import { File } from "@ionic-native/file/ngx";
-import { DomSanitizer } from "@angular/platform-browser";
-import { SharedDataService } from "../hmg-common/services/shared-data-service/shared-data.service";
-import { DevicePermissionsService } from "../hmg-common/services/device-permissions/device-permissions.service";
-import { DashboredService } from "../hmg-common/services/dashbored/dashbored.service";
-import { OrganizationSalariesResponse } from "../hmg-common/services/dashbored/organization-salaries.response";
-import { OpenMissingSwipesResponse } from "../hmg-common/services/dashbored/open-missing-swipes.response";
-import { PerformanceAppraisalResponse } from "../hmg-common/services/dashbored/performance-appraisal.response";
-import { AttendanceTrackingResponse } from "../hmg-common/services/dashbored/attendance-tracking.response";
-import { OpenPeriodDatesResponse } from "../hmg-common/services/dashbored/models/openPeriodDatesResponse";
-import { GetSubordinatesAttdStatusRequest } from "../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest";
-import { GetSubordinatesLeavesRequest } from "../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest";
-import { GetOpenNotificationsResponse } from "../hmg-common/services/dashbored/models/GetOpenNotificationsResponse";
-import { GetSubordinatesAttdStatusResponse } from "../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse";
-import { GetSubordinatesLeavesResponse } from "../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse";
-import { AccrualService } from "../accrual-balances/services/accrual.service";
-import { WorklistMainService } from "../notification/service/work-list.main.service";
+import { EitService } from './../eit/services/eit.service';
+import { Component, OnInit } from '@angular/core';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { MenuController, Events, ActionSheetController } from '@ionic/angular';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
+import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { Geolocation } from '@ionic-native/geolocation/ngx';
+import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
+import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
+import { Device } from '@ionic-native/device/ngx';
+import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
+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';
+import { FileUploaderComponent } from '../hmg-common/ui/file-uploader/file-uploader.component';
+import { Camera } from '@ionic-native/Camera/ngx';
+import { File } from '@ionic-native/file/ngx';
+import { DomSanitizer } from '@angular/platform-browser';
+import { SharedDataService } from '../hmg-common/services/shared-data-service/shared-data.service';
+import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service';
+import { DashboredService } from '../hmg-common/services/dashbored/dashbored.service';
+import { OrganizationSalariesResponse } from '../hmg-common/services/dashbored/organization-salaries.response';
+import { OpenMissingSwipesResponse } from '../hmg-common/services/dashbored/open-missing-swipes.response';
+import { PerformanceAppraisalResponse } from '../hmg-common/services/dashbored/performance-appraisal.response';
+import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response';
+import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse';
+import { GetSubordinatesAttdStatusRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
+import { GetSubordinatesLeavesRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest';
+import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
+import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
+import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse';
+import { AccrualService } from '../accrual-balances/services/accrual.service';
+import { GetDayAndHoursDetailsRequest } from '../time-card/service/models/get-day-hours-type-details.request';
+import * as moment from 'moment';
+import { TimeCardService } from '../time-card/service/time-card.service';
+import { WorklistMainService } from '../notification/service/work-list.main.service';
@Component({
- selector: "app-home",
- templateUrl: "./home.page.html",
- styleUrls: ["./home.page.scss"]
+ selector: 'app-home',
+ templateUrl: './home.page.html',
+ styleUrls: ['./home.page.scss']
})
export class HomePage implements OnInit {
userData: any = {};
- userImage: any = "../assets/imgs/profile.png";
+ userImage: any = '../assets/imgs/profile.png';
menuList: any = [];
zbarOptions: any;
scannedResult: any;
@@ -59,10 +62,10 @@ export class HomePage implements OnInit {
missingSwipeRequestObject : any;
public statsButtons = [
{
- title: "Work List",
+ title: 'Work List',
statsValue: 0,
- icon: "assets/icon/new-design/work_list.png",
- link: "1"
+ icon: 'assets/icon/new-design/work_list.png',
+ link: '1'
},
// {
// title: 'Pending Request',
@@ -71,22 +74,22 @@ export class HomePage implements OnInit {
// link: ''
// },
{
- title: "Missing Swipes",
+ title: 'Missing Swipes',
statsValue: 0,
- icon: "assets/icon/new-design/missing_swipe.png",
- link: "2"
+ icon: 'assets/icon/new-design/missing_swipe.png',
+ link: '2'
},
{
- title: "Leave Balance",
+ title: 'Leave Balance',
statsValue: 0,
- icon: "assets/icon/new-design/leave_balance.png",
- link: "3"
+ icon: 'assets/icon/new-design/leave_balance.png',
+ link: '3'
},
{
- title: "Ticket Balance",
+ title: 'Ticket Balance',
statsValue: 0,
- icon: "assets/icon/new-design/ticket_balance.png",
- link: "4"
+ icon: 'assets/icon/new-design/ticket_balance.png',
+ link: '4'
}
];
@@ -122,12 +125,17 @@ export class HomePage implements OnInit {
public hasFinished = false;
public remainingTime: any;
public scheduledTime: any;
+ public spentHours: any;
public isCheckedIn = undefined;
public displayTime: any;
public menuEntries: any;
public percent: any;
+ public selEmp: string;
+ public selMenu: MenuResponse = new MenuResponse();
+ public respID: number;
+ public menuType: any;
accrualBalancesList: any;
- public countAllNotification: number = 0;
+ public countAllNotification = 0;
constructor(
public ts: TranslatorService,
@@ -150,13 +158,16 @@ export class HomePage implements OnInit {
private permissions: DevicePermissionsService,
public DS: DashboredService,
public accrualService: AccrualService,
+ //////////////////////////////////////// TIME AND DATE////////////////////////////
+ public timeCardService: TimeCardService,
+ ///////////////////// END/////////////////////////////////////////////////////////
public workListService: WorklistMainService
) {
- this.events.subscribe("img-change", displayImg => {
+ this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl(
- "data:Image/*;base64," + displayImg
+ 'data:Image/*;base64,' + displayImg
);
- console.log("html saved img: " + this.userImage);
+ console.log('html saved img: ' + this.userImage);
});
}
@@ -170,7 +181,7 @@ export class HomePage implements OnInit {
ionViewWillEnter() {
this.remainingTime = 0;
- this.displayTime = "00:00:00";
+ this.displayTime = '00:00:00';
this.runTimer = false;
this.getUserDetails();
}
@@ -215,20 +226,20 @@ export class HomePage implements OnInit {
const hours = Math.floor(secNum / 3600);
const minutes = Math.floor((secNum - hours * 3600) / 60);
const seconds = secNum - hours * 3600 - minutes * 60;
- let hoursString = "";
- let minutesString = "";
- let secondsString = "";
- hoursString = hours < 10 ? "0" + hours : hours.toString();
- minutesString = minutes < 10 ? "0" + minutes : minutes.toString();
- secondsString = seconds < 10 ? "0" + seconds : seconds.toString();
- return hoursString + ":" + minutesString + ":" + secondsString;
+ let hoursString = '';
+ let minutesString = '';
+ let secondsString = '';
+ hoursString = hours < 10 ? '0' + hours : hours.toString();
+ minutesString = minutes < 10 ? '0' + minutes : minutes.toString();
+ secondsString = seconds < 10 ? '0' + seconds : seconds.toString();
+ return hoursString + ':' + minutesString + ':' + secondsString;
}
getDeviceLocation() {
const isVirtual = this.device.isVirtual;
if (isVirtual === true) {
- alert("emulater>>>>>>>" + isVirtual);
- alert("You are using virtual device");
+ alert('emulater>>>>>>>' + isVirtual);
+ alert('You are using virtual device');
return false;
}
this.permissions.requestLocationAutherization().then(granted => {
@@ -246,7 +257,7 @@ export class HomePage implements OnInit {
this.attendance();
})
.catch(error => {
- console.log("Error getting location", error);
+ console.log('Error getting location', error);
});
} else {
return false;
@@ -259,9 +270,9 @@ export class HomePage implements OnInit {
if (servicePrivilage.Previlege === false) {
document
.getElementById(servicePrivilage.ServiceName)
- .setAttribute("disabled", "disabled");
+ .setAttribute('disabled', 'disabled');
document.getElementById(servicePrivilage.ServiceName).style.filter =
- "grayscale(1)";
+ 'grayscale(1)';
}
}
}
@@ -288,7 +299,7 @@ export class HomePage implements OnInit {
this.longt = resp.coords.longitude;
})
.catch(error => {
- console.log("Error getting location", error);
+ console.log('Error getting location', error);
});
}
@@ -301,14 +312,14 @@ export class HomePage implements OnInit {
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
- this.events.publish("setMenu");
+ this.events.publish('setMenu');
this.userData = user;
this.sharedData.setSharedData(
this.userData,
AuthenticatedUser.SHARED_DATA
);
this.userImage = user.EMPLOYEE_IMAGE
- ? "data:image/png;base64," + user.EMPLOYEE_IMAGE
+ ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
this.callDashboardServices();
} else {
@@ -327,7 +338,7 @@ export class HomePage implements OnInit {
}
public Vacation_Rule() {
- this.common.navigateForward("/vacation-rule/home");
+ this.common.navigateForward('/vacation-rule/home');
}
private getMenu() {
@@ -339,7 +350,7 @@ export class HomePage implements OnInit {
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
- console.log("list menu");
+ console.log('list menu');
this.menuList = result.List_Menu;
this.getMenuDetails();
}
@@ -363,7 +374,7 @@ export class HomePage implements OnInit {
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.getMenuEntries(item);
// if (item.MENU_TYPE === 'M') {
- // this.common.openMyTeamPage();
+ // this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage");
// } else if (item.MENU_TYPE === 'S') {
// this.common.sharedService.setSharedData(item, 'mySpecList');
@@ -374,12 +385,15 @@ export class HomePage implements OnInit {
// }
}
+ openMyTeamPage() {
+ this.common.openMyTeamPage();
+ }
getMenuEntries(item) {
const request: any = {};
let selEmpNo: string = null;
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999;
- if (item.MENU_TYPE === "S") {
+ if (item.MENU_TYPE === 'S') {
request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(
@@ -534,35 +548,33 @@ export class HomePage implements OnInit {
return seconds;
}
- convertAndAssignTime(data) {
+convertAndAssignTime(data) {
console.log(data);
- this.remainingTime = this.convertInSeconds(
- data.P_REMAINING_HOURS.split(":")
- );
- this.scheduledTime = this.convertInSeconds(
- data.P_SCHEDULED_HOURS.split(":")
- );
- this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
- this.initTimer();
- }
+ this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
+ this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
+ this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
+ this.isCheckedIn = this.spentHours === 0 ? false : true;
+ if (this.isCheckedIn) {
+ this.initTimer();
+ }
+}
- showAttendanceTracking() {
- this.DS.getAttendanceTracking().subscribe(
- (result: AttendanceTrackingResponse) => {
- if (this.common.validResponse(result)) {
- const key = "GetAttendanceTrackingList";
- this.convertAndAssignTime(result[key]);
- }
+showAttendanceTracking() {
+ const request = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
+ };
+ this.DS.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
+ if (this.common.validResponse(result)) {
+ const key = 'GetAttendanceTrackingList';
+ this.convertAndAssignTime(result[key]);
}
- );
- }
+ });
+}
- openPeriodDateDashbored() {
- this.DS.getOpenPeriodDates(() => {
- console.log("Error ");
- }).subscribe((result: OpenPeriodDatesResponse) => {
+openPeriodDateDashbored() {
+ this.DS.getOpenPeriodDates(() => { console.log('Error '); }).subscribe((result: OpenPeriodDatesResponse) => {
if (this.common.validResponse(result)) {
- console.log("response");
+ console.log('response');
}
});
}
@@ -573,12 +585,12 @@ export class HomePage implements OnInit {
console.log("Error ");
}).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
- const key = "P_OPEN_NTF_NUMBER";
+ const key = 'P_OPEN_NTF_NUMBER';
this.countAllNotification = result[key];
this.ITGCountAllNotification();
this.common.sharedService.setSharedData(
result,
- "worklistNotifications"
+ 'worklistNotifications'
);
}
});
@@ -599,13 +611,13 @@ export class HomePage implements OnInit {
console.log("Error ");
}).subscribe((result: GetSubordinatesLeavesResponse) => {
if (this.common.validResponse(result)) {
- console.log("response");
+ console.log('response');
console.log(result);
}
});
}
- getSubordinatesAttStatus() {
+getSubordinatesAttStatus() {
const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; // test
request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/"; // test
@@ -613,7 +625,7 @@ export class HomePage implements OnInit {
console.log("Error ");
}).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.common.validResponse(result)) {
- console.log("response");
+ console.log('response');
console.log(result);
}
});
@@ -628,19 +640,22 @@ export class HomePage implements OnInit {
);
selMenu.GetMenuEntriesList = subMenu;
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
- if (subMenu.REQUEST_TYPE === "ABSENCE") {
+ if (subMenu.REQUEST_TYPE === 'ABSENCE') {
this.common.openAbsencePage();
- } else if (subMenu.REQUEST_TYPE === "EIT") {
+ } else if (subMenu.REQUEST_TYPE === 'EIT') {
this.common.openEitListPage();
- } else if (subMenu.REQUEST_TYPE === "PAYSLIP") {
+ } else if (subMenu.REQUEST_TYPE === 'PAYSLIP') {
this.common.openPayslipPage();
- } else if (subMenu.MENU_ENTRY_TYPE === "MENU") {
+ } else if (subMenu.MENU_ENTRY_TYPE === 'MENU') {
this.common.sharedService.setSharedData(
selMenu.GetMenuEntriesList,
- "menuEntries"
+ 'menuEntries'
);
this.common.openEITPage();
}
+ if (subMenu.REQUEST_TYPE === 'TIME_CARD') {
+ this.common.openTimeCardPage();
+ }
}
getAccrualBalance() {
@@ -687,13 +702,13 @@ export class HomePage implements OnInit {
});
}
- openattentracking() {
+openattentracking() {
this.common.openAttenTrackingpage();
- }
+}
- openProfilePage() {
+openProfilePage() {
this.common.openEditProfile();
- }
+}
openStatsButton(link: any) {
// console.log(link);
diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html
index d15c22b6..c6d09459 100644
--- a/Mohem/src/app/my-team/details/details.component.html
+++ b/Mohem/src/app/my-team/details/details.component.html
@@ -1,158 +1,281 @@
+
+
+
-
-
-
-
-
-
-
-
- {{employee.EMPLOYEE_NAME}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ Attendance
+
+
+ Team Members
+
+
+ About
+
+
+
+
+
+
+
+ {{ts.trPK('myTeam','todayAttendance')}}
+
+
+
+
+ {{ts.trPK('myTeam','checkIn')}}
+
{{attendanceTrackingList.P_SWIPE_IN | slice:0:-3}}
+ --:--
+
+
+
+
+ {{ts.trPK('myTeam','checkOut')}}
+
{{attendanceTrackingList.P_SWIPE_OUT | slice:0:-3}}
+ --:--
+
+
+
+
+ {{ts.trPK('myTeam','late')}}
+
{{attendanceTrackingList.P_LATE_IN_HOURS | slice:0:-3}}
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('myTeam','attendance-statistics')}}
+
+
+
+
+ {{ts.trPK('attendance','present')}}
+ {{attendedDays}}
+
+
+ {{ts.trPK('attendance','absent')}}
+ {{absentDays}}
+
+
+
+
+
{{totalAttendancePrecentage}}
+ {{ts.trPK('absenceList','days')}}
-
-
-
-
{{ts.trPK('myTeam','requestFor')}}
- {{employee.EMPLOYEE_NAME}}
+
+
-
-
0">
-
-
-
-
-
- {{subordinate.EMPLOYEE_NAME}}
- {{subordinate.POSITION_NAME}}
- {{subordinate.NUM_OF_SUBORDINATES}}
-
-
-
-
-
-
-
+
+
+
+
+ {{ts.trPK('attendance-tracking','schedule')}}
+
{{timeCardSummaryData.SCHEDULE_DAYS}}
+
+
+
+
+
+ {{ts.trPK('attendance-tracking','off-days')}}
+
{{timeCardSummaryData.OFF_DAYS}}
+
+
+
+
+
+ {{ts.trPK('attendance-tracking','non-analyzed')}}
+
{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}
+
+
+
+
+
+ {{ts.trPK('attendance-tracking','shortage-hours')}}
+
{{timeCardSummaryData.SHORTAGE_HRS}}
+
+
+
+
+
+
{{ts.trPK('attendance','monthly-attendance-calendar')}}
+
+
+
+
-
-
\ No newline at end of file
+
+
+
+
+
+
+ {{ts.trPK('searchForReplacment','name')}}
+ {{ts.trPK('searchForReplacment','userName')}}
+ {{ts.trPK('searchForReplacment','email')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Clear Search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss
index 5b22677a..48caae91 100644
--- a/Mohem/src/app/my-team/details/details.component.scss
+++ b/Mohem/src/app/my-team/details/details.component.scss
@@ -1 +1,415 @@
-.search-icons{font-size:.7cm}
\ No newline at end of file
+ion-content {
+ --ion-background-color: whitesmoke;
+}
+ion-title{
+ color: white;
+ position: absolute;
+ top: 0;
+ text-align: center;
+ left: 15%;
+ right: 15%;
+ font-size: 0.42cm;
+ font-weight: bold;
+ height: 100%;
+}
+.contentBg{
+ padding: 0px 20px;
+}
+
+.contentBg:before {
+ position: absolute;
+ content: "";
+ background: #22c6b3;
+ height: 140px;
+ width: 100%;
+ left: 0;
+ top: 0px;
+ z-index: 1;
+}
+
+ .user-info{
+ text-align: center;
+ margin-bottom: 15px;
+ .user-image-container{
+ position: relative;
+ width: 80px;
+ height: 80px;
+ display: block;
+ margin: 0 auto;
+ // &:before{
+ // position: absolute;
+ // content: "";
+ // width: 20px;
+ // height: 20px;
+ // border-radius: 20px;
+ // border: 1px solid white;
+ // top: 0;
+ // right: 0;
+ // background-color: red;
+ // z-index: 9;
+ // }
+ // &.present:before{
+ // background-color: green !important;
+ // }
+ }
+ .user-image{
+ overflow: hidden;
+ position: relative;
+ display: block;
+ width: 100%;
+ height: 100%;
+ border-radius: 80px;
+ border: 1px solid #ccc;
+ margin: 0px auto 6px;
+ }
+ h1{
+ margin: 0;
+ padding: 0;
+ font-family: WorkSans-Bold;
+ font-size: 18px;
+ margin-bottom: 4px;
+ }
+ span{
+ font-size: 14px;
+ display: block;
+ color: #888
+ }
+ }
+ $actionBtnSize : 36px;
+ .user-actions{
+ text-align: center;
+ .action-button{
+ font-size: 11px;
+ white-space: nowrap;
+ color: #888;
+ .action-button-icon{
+ width: $actionBtnSize;
+ height: $actionBtnSize;
+ border-radius: $actionBtnSize;
+ margin: 0 auto;
+ display: block;
+ background-color: #22c6b3;
+ line-height: $actionBtnSize;
+ margin-bottom: 3px;
+ img{
+ margin: 0 auto;
+ vertical-align: middle;
+ }
+ }
+ }
+ }
+.employee-information-indetail{
+ background: white;
+ margin-top: 15px;
+ border-radius: 20px;
+ margin-bottom: 15px;
+ ion-col{
+ padding: 15px;
+ border-bottom: 1px solid #ccc;
+ }
+ h2{
+ font-size: 13px;
+ font-family: WorkSans-Bold;
+ margin: 0;
+ }
+ p{
+ font-size: 13px;
+ margin: 0;
+ }
+}
+
+.segments-container {
+ border-radius: 100px;
+ overflow: hidden;
+ margin-top: 15px;
+ background: white;
+ color: black;
+}
+
+.active-Segment {
+ font-size: 0.3cm !important;
+ background: #22c6b3 !important;
+ text-transform: none;
+ --color-checked: none;
+ border-radius: 100px;
+ border:0;
+ }
+ .active-Segment ion-label{
+ font-size: 11px;
+ color: white !important;
+ }
+ .normal-Segment ion-label{
+ color: black !important;
+ font-size: 11px;
+ }
+ .normal-Segment {
+ font-size: 0.3cm !important;
+ text-transform: none;
+ --color-checked: none;
+ border: 0;
+ }
+ .colum-container{
+ padding: 15px;
+ border-bottom: 1px solid #ccc;
+ }
+
+ ///////////////////////// Team Members css //////////////////////@extend
+
+.filters-row {
+ margin-top: 10px;
+}
+
+.search-dropdown{
+ background: #22c6b3;
+ ion-select {
+ .select-text{
+ margin-left: -10px;
+ }
+ .select-icon{
+ .select-icon-inner{
+ opacity: 1;
+ color: white;
+ margin-top: -1px;
+ }
+ }
+ }
+}
+
+.input-container{
+ background: white;
+ ion-input{
+ border-bottom-color: transparent;
+ }
+}
+
+.search-container{
+ margin-top: 15px;
+ ion-col{
+ background: white;
+ border-radius: 12px;
+ padding-right: 10px;
+ flex: none;
+ ion-icon{
+ margin-right: 3px;
+ font-size: 14px;
+ margin-left: 3px;
+ vertical-align: middle;
+ }
+ span{
+ font-size: 12px;
+ vertical-align: middle;
+ }
+ }
+}
+
+
+/////////////////////////////////////////////////////// Attendance ///////////////////////
+.header{
+ margin-top: 20px;
+}
+
+.slidPrev{
+ margin-left: 10px;
+ background: transparent;
+}
+
+.slidNext{
+ background: transparent;
+ margin-top: -1px;
+ margin-left: 43px;
+}
+.activeArrow{
+ height: 20px;
+ width: 20px;
+ color: #22c6b3;
+}
+.disabledArrow{
+ height: 20px;
+ width: 20px;
+ color: gray;
+}
+
+.result-graph {
+ position: relative;
+ background: white;
+ margin-top: 20px;
+ padding-bottom: 20px;
+ border-radius: 20px;
+ z-index: 1;
+ margin-bottom: 10px;
+}
+.request-heading {
+ span {
+ text-align: left;
+ display: block;
+ padding-top: 8px;
+ margin-bottom: 10px;
+ margin-left: 10px;
+ }
+}
+.result-text-container {
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ display: block;
+ text-align: center;
+ transform: translate(-50%, -50%);
+ h2 {
+ font-size: 38px;
+ font-family: WorkSans-Bold;
+ margin: 0 auto;
+ line-height: 36px;
+ }
+ span {
+ width: 125px;
+ display: block;
+ margin: 0 auto;
+ font-size: 12px;
+ font-family: workSans-Regular;
+ }
+ }
+ .today-graph {
+ width: 100%;
+ max-height: 4cm;
+ }
+
+.green-label{
+ font-size: 12px;
+ margin-top: -13px;
+}
+
+.green-amount{
+ font-size: 17px;
+ font-family: WorkSans-Bold;
+ margin-top: -3px;
+}
+
+.blue-label{
+ font-size: 12px;
+ margin-top: -13px;
+}
+
+.blue-amount{
+ font-size: 17px;
+ font-family: WorkSans-Bold;
+ margin-top: -4px;
+}
+
+.labelGrid{
+ background-color: white !important;
+ border-radius: 20px !important;
+ height: 88px !important;
+ border: 1px solid #d6d4d4;
+ position: relative;
+ padding: 10px;
+
+ label {
+ font-size: 9px;
+ line-height: 11px !important;
+ display: block;
+ }
+ h2 {
+ font-size: 25px;
+ font-weight: bold;
+ display: block;
+ text-align: right;
+ margin:0;
+ position: absolute;
+ bottom: 0;
+ left:0;
+ width: 100%;
+ padding: 10px;
+ }
+}
+
+.bodyGrid{
+ margin-top: 7px !important;
+ margin-left: 15px !important;
+ margin-right: 15px !important;
+ background-color: white !important;
+ border-radius: 20px !important;
+ height: 321px !important;
+ border: 1px solid #d6d4d4 !important;
+}
+.attendance-information{
+ background: white;
+ border-radius: 20px;
+ padding: 10px;
+ h2{
+ padding: 0;
+ margin: 0;
+ font-size: 22px;
+ }
+ span{
+ font-size: 11px;
+ }
+}
+
+.month-year-span{
+ font-size: 20px;
+ font-family: WorkSans-Bold;
+}
+
+.green-label-container{
+ border-top: 5px solid #22c6b3;
+ padding: 1px 0px;
+ margin: 15px 0px
+}
+
+.blue-label-container{
+ border-top: 5px solid #094875;
+ padding: 1px 0px;
+ margin: 15px 0px
+}
+.span-one{
+ display: block;
+ font-size: 12px;
+ color: black;
+}
+.span-two{
+ display: block;
+ font-size: 22px;
+ font-family: WorkSans-Bold;
+}
+.graph-container{
+ margin-left: -50px;
+ position: relative;
+ margin-right: 50px;
+}
+.label-container{
+ position: absolute;
+ width: 20%;
+ right: 30px;
+ top: 50%;
+ margin-top: -60px;
+}
+.attendance-summary .attendance-information {
+ span{
+ height: 32px;
+ display: block;
+ line-height: 14px;
+ }
+ h2{
+ text-align: right;
+ font-family: WorkSans-Bold;
+ }
+
+}
+.calendar-container{
+ background: white;
+ margin-bottom: 100px;
+ margin-top: 20px;
+ border-radius: 20px;
+ span{
+ text-align: left;
+ display: block;
+ padding-top: 8px;
+ margin-bottom: 10px;
+ margin-left: 10px;
+ }
+}
+
+
+
diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts
index 25693833..3a98c7c1 100644
--- a/Mohem/src/app/my-team/details/details.component.ts
+++ b/Mohem/src/app/my-team/details/details.component.ts
@@ -1,36 +1,99 @@
-import { Component, OnInit,ViewChild } from "@angular/core";
-import { Location } from "@angular/common";
-import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
-import { CommonService } from "src/app/hmg-common/services/common/common.service";
-import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
-import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
-import { MyTeamService } from "../service/my-team.service";
-import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
-import { ModalController } from "@ionic/angular";
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { Location } from '@angular/common';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { MyTeamService } from '../service/my-team.service';
+import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
+import { ModalController } from '@ionic/angular';
import { IonInfiniteScroll } from '@ionic/angular';
+import * as moment from 'moment';
+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 { 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({
- selector: "app-details",
- templateUrl: "./details.component.html",
- styleUrls: ["./details.component.scss"]
+ selector: 'app-details',
+ templateUrl: './details.component.html',
+ styleUrls: ['./details.component.scss']
})
export class DetailsComponent implements OnInit {
- public static opendEmployeesARR='opend_employees_arr';
+ public static opendEmployeesARR = 'opend_employees_arr';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
- pageNum: number = 1;
- pageLimit: number = 50;
- modalFlag: any = false;
+ public activeSegment = 'Attendance';
+ pageNum = 1;
+ pageLimit = 50;
empSubordinate: any;
employee: any;
- IsReachEnd: boolean = false;
+ isReachEnd = false;
searchKey: any;
- public searchKeySelect: any;
+ public isSearch = false;
+ public searchKeySelect = 'Name';
+ public getEmployeeSubordinatesRequestObject: any;
infiniteRequest: any;
- isSpecialist: boolean = false;
+ isSpecialist = false;
selMenu: MenuResponse = new MenuResponse();
- public opendEmployees :any=[];
- public headerTitle: string = "";
+ public opendEmployees: any = [];
+ public headerTitle = '';
+ public userImage: any = '../assets/imgs/profile.png';
+ public menuType: any;
+ public selEmp: string;
+ public dateFrom: any = new Date();
+ public dateTo: any = new Date();
+ public respID: number;
+ public timeCardSummaryData: any = [];
+ public dayHoursData: any = [];
+ public selectedShift: any;
+ public dayAndHoursPageNumber = 1;
+ public monthName: any;
+ public yearDate: any;
+ public absentDays: number;
+ public attendedDays: number;
+ public futrueDays = 0;
+ public totalAttendancePrecentage = 0;
+ public arrDaysAttendance: any = [];
+ public arrDaysAbsent: any = [];
+ public arrDaysOff: any = [];
+ public normalDays: any = [];
+ public monthTitle: string = moment().format('MMMM');
+ public yearTitle: string;
+ public activeMonth: any;
+ public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
+ public showData = false;
+ public currentYear = new Date().getFullYear();
+ public attendanceTrackingList: any = [];
+ public currentDate = new Date();
+ public dayHoursTypeDetailsList = [];
+ month: any;
+ year: any;
+ preMonth: number;
+ nextMonth: any;
+
+ public options = {
+ cutoutPercentage: 80,
+ tooltips: { enabled: false },
+ legend: { display: false }
+ };
+
+ public data = {};
+
+ public slideOptsOne = {
+ slidesPerView: 4,
+ spaceBetween: 10
+ };
+
+ public previousActiveIndex = 0;
+ public currentActiveIndex = 0;
+ public searchNameOrUserName = '';
+ public searchEmail = '';
+ public showEmailInput = false;
+ public showUserNameOrNameInput = true;
+
constructor(
+ public timeCardService: TimeCardService,
public menuService: MenuService,
public common: CommonService,
public myTeamService: MyTeamService,
@@ -38,58 +101,281 @@ export class DetailsComponent implements OnInit {
public modalController: ModalController,
private location: Location,
public authService: AuthenticationService,
- ) {
- console.log("Constuctor called");
- }
+ public dashboardService: DashboredService,
+ ) { }
+
ngOnInit() {
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) {
+ this.activeSegment = event.detail.value;
+ if (this.activeSegment === 'Attendance') {
+ this.normalDays = [];
+ this.initAttendance();
+ }
+ }
+
+ initAttendance() {
+ this.showData = false;
+ this.nextMonth = new Date().getMonth() + 2;
+ this.preMonth = new Date().getMonth() - 2;
+ 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());
+ }
+
+ calendarConfig(month?, year?) {
+ this.arrDaysOff = [];
+ this.arrDaysAttendance = [];
+ this.arrDaysAbsent = [];
+ this.month = month;
+ this.year = year;
+ this.getTimeCardSummaryDetails(month, year);
+ this.getDayHoursTypeDetails(month, year);
+ }
+
+ public getDayHoursTypeDetails(month?, year?) {
+ console.log('getDayHoursTypeDetails');
+ const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
+ this.monthName = month;
+ this.yearDate = year;
+ this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
+ this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+
+ dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
+ dayAndHoursReqObj.P_MENU_TYPE = 'M';
+ dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
+ dayAndHoursReqObj.SearchMonth = this.monthName;
+ dayAndHoursReqObj.SearchYear = this.yearDate;
+ dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
+ dayAndHoursReqObj.P_PAGE_LIMIT = 100;
+
+ this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ console.log(result.GetDayHoursTypeDetailsList);
+ this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
+ this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
+ this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
+ }
+ });
+
+ }
+
+ nextSlide() {
+ this.normalDays = [];
+ if (this.currentMonthName !== this.month) {
+ this.showData = false;
+ if (this.nextMonth > 12) {
+ this.currentYear = this.currentYear + 1;
+ this.nextMonth = 1;
+ }
+ this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
+ this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
+ this.nextMonth = this.nextMonth + 1;
+ this.preMonth = this.nextMonth - 2;
+ }
+ }
+
+ previousSlide() {
+ this.normalDays = [];
+ this.showData = false;
+ if (this.preMonth === 0) {
+ this.currentYear = this.currentYear - 1;
+ 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.preMonth = this.preMonth - 1;
+ this.nextMonth = this.preMonth + 2;
+ }
+
+
+ changeMonthTitle(title) {
+ this.monthTitle = title;
+ this.getTimeCardSummaryDetails();
+ }
+ changeYear(year) {
+ this.yearTitle = year;
}
- intializeMemberDetail(userID?){
-
+ countAllAttendDays(allDays) {
+ // tslint:disable-next-line:prefer-for-of
+ for (let i = 0; i < allDays.length; i++) {
+ // tslint:disable-next-line: triple-equals
+ if (allDays[i].ATTENDED_FLAG == 'Y') {
+ allDays[i].present = true;
+ allDays[i].absent = false;
+ allDays[i].daysOff = false;
+ allDays[i].schedule = false;
+ 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({
+ 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
+ } 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;
+ console.log(this.arrDaysOff);
+ console.log(this.arrDaysAttendance);
+ console.log(this.arrDaysAbsent);
+ console.log(this.normalDays);
+ }
+
+ public getTimeCardSummaryDetails(month?, year?) {
+ const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
+ this.monthName = month;
+ this.yearDate = year;
+
+ this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
+ this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+
+ timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
+ timeCardSummaryReqObj.P_MENU_TYPE = 'M';
+ timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
+ timeCardSummaryReqObj.SearchMonth = this.monthName;
+ timeCardSummaryReqObj.SearchYear = this.yearDate;
+
+ this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).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 = {
+ datasets: [
+ {
+ data: [this.absentDays, this.attendedDays],
+ backgroundColor: [
+ '#094875',
+ '#22c6b3'
+ ],
+ borderWidth: 2
+ }]
+ };
+ }
+ }
+ });
+ }
+
+ public getMonthName(value: any): any {
+ switch (value) {
+ case 1:
+ return 'January';
+ case 2:
+ return 'February';
+ case 3:
+ return 'March';
+ case 4:
+ return 'April';
+ case 5:
+ return 'May';
+ case 6:
+ return 'June';
+ case 7:
+ return 'July';
+ case 8:
+ return 'August';
+ case 9 :
+ return 'September';
+ case 10:
+ return 'October';
+ case 11:
+ return 'November';
+ case 12:
+ return 'December';
+
+ }
+ }
+
+ intializeMemberDetail(userID?) {
+ this.empSubordinate = [];
+ this.activeSegment = 'About';
this.pageLimit = 50;
this.pageNum = 1;
- this.employee = this.common.sharedService.getSharedData(
- MyTeamService.EMPLOYEE_SHARED_DATA,
- false
- );
- let employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
- if( employees ){
+ this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
+ const employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
+ if ( employees ) {
this.opendEmployees.push(this.employee);
this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
}
- //this.opendEmployees = employees;
-
- console.log(this.employee);
- this.selMenu = this.common.sharedService.getSharedData(
- MenuResponse.SHARED_DATA,
- false
- );
- this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
-
-
- this.isSpecialist = this.common.sharedService.getSharedData(
- 'isSpecialist',
- false
- ) ? true :false;
-
- // this.isSpecialist = this.navParams.get("isSpecialist")
- // ? this.navParams.get("isSpecialist")
- // : false;
-
- if (this.employee) this.getEmpSubordinate(userID);
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
+ this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
+ this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false;
+ if (this.employee) {
+ this.getEmpSubordinate(userID);
+ }
}
goback() {
- //this.location.back();
const user = this.authService.getAuthenticatedUser();
- if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){
- this.opendEmployees=[];
+ if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length === 1) {
+ this.opendEmployees = [];
this.common.openMyTeamPage();
- }else{
- for(let i=0;i
{
- this.handleEmpResult(result);
- });
+ this.getEmployeeSubordinatesRequestObject = body;
+ this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
+ console.log('one');
+ if (this.common.validResponse(result)) {
+ this.handleEmpResult(result.GetEmployeeSubordinatesList);
+ }
+ });
}
handleEmpResult(result) {
- //let employeeSubordinate=resFlag.GetEmployeeSubordinatesList;
- //this.nav.push("MyTeamPage",{empSubordinate:employeeSubordinate});
- if (this.common.validResponse(result)) {
- if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
- this.empSubordinate = result.GetEmployeeSubordinatesList;
- // this.pageNum++;
- this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
- let lastItemIndex = this.empSubordinate.length - 1;
- if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
- let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
- if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
- this.IsReachEnd = true;
- } else {
- this.IsReachEnd = false;
- }
+ const lastItemIndex = result.length - 1;
+ const lastItem = result[lastItemIndex];
+ if (lastItem) {
+ if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
+ this.isReachEnd = true;
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
}
} else {
- this.empSubordinate = [];
+ this.isReachEnd = false;
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
+ }
}
}
- }
- doInfinite(infiniteScroll) {
- if (!this.IsReachEnd && this.infiniteRequest) {
- // this.infiniteRequest.P_PAGE_NUM = this.pageNum;
- this.myTeamService
- .getEmployeeSubordinates(this.infiniteRequest)
- .subscribe(
- (result: any) => {
- if (this.common.validResponse(result)) {
- this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
-
- if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
- result.GetEmployeeSubordinatesList.forEach(vr => {
- if (vr.ROW_NUM == vr.NO_OF_ROWS) {
- this.IsReachEnd = true;
- } else {
- this.IsReachEnd = false;
- }
- this.empSubordinate.push(vr);
- // this.pro.GetVacationRulesList.push(vr);
- });
- } else {
- this.IsReachEnd = true;
- }
- }
- //this.P_PAGE_NUM++;
- if (infiniteScroll) this.infiniteScroll.complete();
-
- // console.log(resFlag);
- },
- Error => console.log(Error),
- () => this.infiniteScroll.complete()
- );
+ if (this.common.hasData(result)) {
+ this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++;
+ if (this.empSubordinate.length === 0) {
+ this.empSubordinate = result;
+ } else {
+ this.empSubordinate = this.empSubordinate.concat(result);
+ }
} else {
- if (infiniteScroll) this.infiniteScroll.complete();
+ this.empSubordinate = [];
+ }
+}
+
+doInfinite(infiniteScroll) {
+ if (!this.isReachEnd) {
+ this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
+ console.log('two');
+ if (this.common.validResponse(result)) {
+ this.handleEmpResult(result.GetEmployeeSubordinatesList);
+ }
+ this.infiniteScroll.complete();
+ });
+ } else {
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
}
}
+}
+
getDetails(index) {
- //this.empSubordinate[index].isModal = true;
- this.common.sharedService.setSharedData(
- this.empSubordinate[index],
- MyTeamService.EMPLOYEE_SHARED_DATA
- );
+ this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
this.intializeMemberDetail();
- // this.presentModal();
- }
- async presentModal() {
- //this.modalFlag = true;
- const modal = await this.modalController.create({
- component: DetailsComponent,
- keyboardClose: true,
- animated: false
- });
- let dismissed = modal.onDidDismiss();
- dismissed.then(() => {
- this.modalFlag = false;
- });
- return await modal.present();
}
+
getMenuEntries(item) {
- let selEmpNo: String = null;
- let respID: any = -999;
- let menuType: string = "M";
+ let selEmpNo = null;
+ const respID: any = -999;
+ let menuType = 'M';
let nationality: string;
- if (this.isSpecialist == true) {
- // respID = this.sharedData.getSharedData(
- // MenuResponse.SHARED_SEL_RESP_ID,
- // true
- // );
- menuType = "S";
+ if (this.isSpecialist === true) {
+ menuType = 'S';
}
selEmpNo = item.EMPLOYEE_NUMBER;
nationality = item.NATIONALITY_CODE;
const body = {
- P_MENU_TYPE: menuType, //to check
+ P_MENU_TYPE: menuType, // to check
P_SELECTED_EMPLOYEE_NUMBER: selEmpNo,
P_SELECTED_RESP_ID: respID,
NationalityCode: nationality
};
- //set emp and resp id
- this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP);
- this.common.sharedService.setSharedData(
+ // set emp and resp id
+ this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP);
+ this.common.sharedService.setSharedData(
body.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
@@ -283,35 +518,28 @@ export class DetailsComponent implements OnInit {
}
sortMenuEntires(list) {
- this.close().then(() => {
- });
- let tree = this.common.list_to_tree(list);
- this.common.sharedService.setSharedData(tree, "menuEntries");
- // this.common.navigateForward("/eit/homepage");
+ const tree = this.common.list_to_tree(list);
+ this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.openEITPage();
- // let tree = this.common.list_to_tree(list);
- // this.navCtrl.push("MenuEntriesPage", { menuEntries: tree });
}
- public async close() {
- const modal = await this.modalController.getTop();
- if (modal) {
- modal.dismiss();
- }
- }
goToSubordinate() {
- this.selMenu.search=true;
+ this.selMenu.search = true;
this.common.sharedService.setSharedData(
this.selMenu,
MenuResponse.SHARED_DATA
);
-
+
this.common.openMyTeamPage();
- //this.navCtrl.push("MySubordinatePage", { isSearch: true });
}
- dismiss() {
- this.modalController.dismiss({
- dismissed: true
- });
+
+ showSelectedField(value: any) {
+ if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') {
+ this.showEmailInput = false;
+ this.showUserNameOrNameInput = true;
+ } else if (this.searchKeySelect === 'Email') {
+ this.showUserNameOrNameInput = false;
+ this.showEmailInput = true;
+ }
}
}
diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html
index bb64c178..350c763e 100644
--- a/Mohem/src/app/my-team/home/home.component.html
+++ b/Mohem/src/app/my-team/home/home.component.html
@@ -1,76 +1,83 @@
-
-
-
+
+
+
+
+
+ {{ts.trPK('myTeam','todayAttendance')}}
+
+
+
{{totalEmployees}}
+ {{ts.trPK('myTeam','total')}}
{{ts.trPK('myTeam','team-members')}}
+
+
+
+
+
-
-
-
-
- {{ts.trPK('general','search')}}
+
+
+
- {{ts.trPK('searchForReplacment','name')}}
- {{ts.trPK('searchForReplacment','userName')}}
- {{ts.trPK('searchForReplacment','email')}}
-
-
-
-
-
-
-
- 0">
-
-
-
-
-
- {{subordinate.EMPLOYEE_NAME}}
- {{subordinate.POSITION_NAME}}
- {{subordinate.NUM_OF_SUBORDINATES}}
-
-
-
+ [(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)">
+ {{ts.trPK('searchForReplacment','name')}}
+ {{ts.trPK('searchForReplacment','userName')}}
+ {{ts.trPK('searchForReplacment','email')}}
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+ Clear Search
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
-
- {{ts.trPK('general','search')}}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/home/home.component.scss b/Mohem/src/app/my-team/home/home.component.scss
index d24aa6cf..650979e9 100644
--- a/Mohem/src/app/my-team/home/home.component.scss
+++ b/Mohem/src/app/my-team/home/home.component.scss
@@ -1,6 +1,163 @@
-.search-icons{font-size:.7cm}
-.badge{
- padding: 10px;
- border-radius: 50%;
- width: 50px;
-}
\ No newline at end of file
+ion-title{
+ color: white;
+ position: absolute;
+ top: 0;
+ text-align: center;
+ left: 15%;
+ right: 15%;
+ font-size: 0.42cm;
+ font-weight: bold;
+ height: 100%;
+}
+
+.contentBg{
+ padding: 0px 20px;
+}
+
+.contentBg:before {
+ position: absolute;
+ content: "";
+ background: #22c6b3;
+ height: 140px;
+ width: 100%;
+ left: 0;
+ top: 0px;
+ z-index: 1;
+}
+ion-content {
+ --ion-background-color: whitesmoke;
+}
+.request-heading {
+ span {
+ text-align: center;
+ display: block;
+ padding-top: 8px;
+ font-family: workSans-Regular;
+ }
+}
+
+.result-graph {
+ position: relative;
+ background: white;
+ margin-top: 20px;
+ padding-bottom: 20px;
+ border-radius: 20px;
+ z-index: 1;
+ }
+ .result-text-container {
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ display: block;
+ text-align: center;
+ transform: translate(-50%, -50%);
+ h2 {
+ font-size: 38px;
+ font-family: WorkSans-Bold;
+ margin: 0 auto;
+ line-height: 36px;
+ }
+ span {
+ width: 125px;
+ display: block;
+ margin: 0 auto;
+ font-size: 12px;
+ font-family: workSans-Regular;
+ }
+ }
+ .today-graph {
+ width: 100%;
+ max-height: 4cm;
+ }
+
+.swiper-container {
+ margin: 0 !important;
+ width: 100% !important;
+}
+.filters-row {
+ margin-top: 10px;
+}
+.search-input {
+ margin-top: 15px;
+ background: white;
+ border-radius: 15px;
+ ion-input {
+ border-bottom-color: transparent;
+ }
+}
+.search-dropdown{
+ background: #22c6b3;
+ ion-select {
+ .select-text{
+ margin-left: -10px;
+ }
+ .select-icon{
+ .select-icon-inner{
+ opacity: 1;
+ color: white;
+ margin-top: -1px;
+ }
+ }
+ }
+}
+.input-container{
+ background: white;
+ ion-input{
+ border-bottom-color: transparent;
+ }
+}
+
+.user-image-container{
+ position: relative;
+ width: 80px;
+ height: 80px;
+ display: block;
+ margin: 0 auto;
+ &:before{
+ position: absolute;
+ content: "";
+ width: 20px;
+ height: 20px;
+ border-radius: 20px;
+ border: 1px solid white;
+ top: 0;
+ right: 0;
+ background-color: red;
+ z-index: 9;
+ }
+ &.present:before{
+ background-color: green !important;
+ }
+}
+.user-image{
+ overflow: hidden;
+ position: relative;
+ display: block;
+ width: 100%;
+ height: 100%;
+ border-radius: 80px;
+ border: 1px solid #ccc;
+ margin: 0px auto 6px;
+}
+
+.search-container{
+ margin-top: 15px;
+ ion-col{
+ background: white;
+ border-radius: 12px;
+ padding-right: 10px;
+ flex: none;
+ ion-icon{
+ margin-right: 3px;
+ font-size: 14px;
+ margin-left: 3px;
+ vertical-align: middle;
+ }
+ span{
+ font-size: 12px;
+ vertical-align: middle;
+ }
+ }
+}
diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts
index c0f8c7e8..46d4048a 100644
--- a/Mohem/src/app/my-team/home/home.component.ts
+++ b/Mohem/src/app/my-team/home/home.component.ts
@@ -1,32 +1,87 @@
-import { Component, OnInit, ViewChild } from "@angular/core";
-import { Location } from "@angular/common";
-import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
-import { CommonService } from "src/app/hmg-common/services/common/common.service";
-import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
-import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
-import { MyTeamService } from "../service/my-team.service";
-import { ModalController, IonInfiniteScroll } from "@ionic/angular";
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { Location } from '@angular/common';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { MyTeamService } from '../service/my-team.service';
+import { ModalController, IonInfiniteScroll } from '@ionic/angular';
import { DetailsComponent } from '../details/details.component';
@Component({
- selector: "app-home",
- templateUrl: "./home.component.html",
- styleUrls: ["./home.component.scss"]
+ selector: 'app-home',
+ templateUrl: './home.component.html',
+ styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
- pageNum: number = 1;
- pageLimit: number = 50;
- empSubordinate: any;
- employee: any;
- public headerTitle: string = "";
- IsReachEnd: boolean = false;
- searchKey: any;
- public isSearch: boolean = false;
- public searchKeySelect: any;
- infiniteRequest: any;
- selMenu: any;
- selEmpNo: any;
+ public pageNum = 1;
+ public pageLimit = 50;
+ public empSubordinate = [];
+ public employee: any;
+ public isReachEnd = false;
+ public searchKey: any;
+ public isSearch = false;
+ public searchKeySelect = 'Name';
+ public getEmployeeSubordinatesRequestObject: any;
+ public selMenu: any;
+ public selEmpNo: any;
+ public totalEmployees = 0;
+
+ public options = {
+ cutoutPercentage: 80,
+ tooltips: { enabled: false },
+ legend: { display: false }
+ };
+ public data = {
+ datasets: [
+ {
+ data: [100],
+ backgroundColor: [
+ '#22c6b3'
+ ],
+ borderWidth: 5
+ }]
+ };
+ // 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 = {
+ slidesPerView: 4,
+ spaceBetween: 10
+ };
+
+ public previousActiveIndex = 0;
+ public currentActiveIndex = 0;
+ public searchNameOrUserName = '';
+ public searchEmail = '';
+ public showEmailInput = false;
+ public showUserNameOrNameInput = true;
+
constructor(
public ts: TranslatorService,
public authService: AuthenticationService,
@@ -40,63 +95,44 @@ export class HomeComponent implements OnInit {
this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR);
this.setIntitial();
}
+
+ // activeFilter(index: number) {
+ // this.previousActiveIndex = this.currentActiveIndex;
+ // this.currentActiveIndex = index;
+ // this.filters[this.previousActiveIndex].active = false;
+ // this.filters[this.currentActiveIndex].active = true;
+ // }
+
goback() {
this.location.back();
}
- getData() {}
+
setIntitial() {
- this.selMenu = this.common.sharedService.getSharedData(
- MenuResponse.SHARED_DATA,
- false
- );
- this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmpNo = this.selMenu.userid;
this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch;
- // this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false;
- if (!this.isSearch) this.getEmpSubordinate();
+ if (!this.isSearch) {
+ this.getEmpSubordinate();
+ }
+ }
+
+ searchEmployee() {
+ this.isSearch = true;
+ this.empSubordinate = [];
+ this.getEmpSubordinate();
}
+
getEmpSubordinate() {
- console.log("getEmpSubordinate my team home");
this.pageNum = 1;
- this.IsReachEnd = false;
- let searchEmpNum = "";
- let searchEmpName = "";
- let searchEmpEmail = "";
- if (this.searchKey) {
- switch (this.searchKeySelect) {
- case "1": {
- searchEmpName = this.searchKey;
- searchEmpNum = "";
- searchEmpEmail = "";
+ this.isReachEnd = false;
+ const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : '';
+ const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : '';
+ const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : '';
- break;
- }
- case "2": {
- searchEmpNum = this.searchKey;
- searchEmpName = "";
- searchEmpEmail = "";
- break;
- }
- case "3": {
- searchEmpEmail = this.searchKey;
- searchEmpNum = "";
- searchEmpName = "";
- break;
- }
- default: {
- searchEmpNum = "";
- searchEmpName = "";
- searchEmpEmail = "";
- break;
- }
- }
- } else {
- searchEmpNum = "";
- searchEmpName = "";
- searchEmpEmail = "";
- }
if (this.isSearch) {
this.selEmpNo = null;
+ } else {
+ this.selEmpNo = this.selMenu.userid;
}
const body = {
@@ -107,172 +143,85 @@ export class HomeComponent implements OnInit {
P_PAGE_NUM: this.pageNum,
P_PAGE_LIMIT: this.pageLimit
};
- this.infiniteRequest = body;
- this.myTeamService
- .getEmployeeSubordinates(body)
- .subscribe((result: any) => {
- this.handleEmpResult(result);
- });
+ this.getEmployeeSubordinatesRequestObject = body;
+ this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
+ if (this.common.validResponse(result)) {
+ this.totalEmployees = result.P_NUM_OF_SUBORDINATES;
+ this.handleEmpResult(result.GetEmployeeSubordinatesList);
+ }
+ });
}
handleEmpResult(result) {
- if (this.common.validResponse(result)) {
- if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
-
- this.empSubordinate = result.GetEmployeeSubordinatesList;
- this.infiniteRequest.P_PAGE_NUM++;
- const lastItemIndex = this.empSubordinate.length - 1;
- if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
- const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
- if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
- this.IsReachEnd = true;
- } else {
- this.IsReachEnd = false;
+ const lastItemIndex = result.length - 1;
+ const lastItem = result[lastItemIndex];
+ if (lastItem) {
+ if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
+ this.isReachEnd = true;
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
}
+ } else {
+ this.isReachEnd = false;
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
+ }
+ }
+ }
+ if (this.common.hasData(result)) {
+ this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++;
+ if (this.empSubordinate.length === 0) {
+ this.empSubordinate = result;
+ } else {
+ this.empSubordinate = this.empSubordinate.concat(result);
}
} else {
this.empSubordinate = [];
}
- }
- }
-
-
-
-
-
-
-
- doInfinite1(infiniteScroll) {
- console.log("test");
- if (!this.IsReachEnd && this.infiniteRequest) {
- console.log("not ReachEnd");
-
- this.infiniteRequest.P_PAGE_NUM = this.pageNum;
- this.myTeamService
- .getEmployeeSubordinates(this.infiniteRequest)
- .subscribe(
- (result: any) => {
- if (this.common.validResponse(result)) {
- this.pageNum++;
- if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
- result.GetEmployeeSubordinatesList.forEach(vr => {
- if (vr.ROW_NUM == vr.NO_OF_ROWS) {
- this.IsReachEnd = true;
- } else {
- this.IsReachEnd = false;
- }
- this.empSubordinate.push(vr);
- // this.pro.GetVacationRulesList.push(vr);
- });
- } else {
- this.IsReachEnd = true;
- }
- }
- //this.P_PAGE_NUM++;
- if (infiniteScroll) {
- infiniteScroll.complete();
- }
- // console.log(resFlag);
- },
- Error => console.log(Error),
- () => infiniteScroll.complete()
- );
- } else {
- if (infiniteScroll) {
- infiniteScroll.complete();
- }
- }
}
-
doInfinite(infiniteScroll) {
- //this.pageNum= this.pageNum + 1;
- console.log("test doInfinite");
- if (!this.IsReachEnd) {
- console.log("test doInfinite not ReachEnd");
-
- this.myTeamService
- .getEmployeeSubordinates(this.infiniteRequest).subscribe(
- (result: any) => {
+ if (!this.isReachEnd) {
+ this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
if (this.common.validResponse(result)) {
- this.infiniteRequest.P_PAGE_NUM++;
- if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
- result.GetEmployeeSubordinatesList.forEach(element => {
- if (element.ROW_NUM == element.NO_OF_ROWS) {
- this.IsReachEnd = true;
- } else {
- this.IsReachEnd = false;
- }
- this.empSubordinate.push(element);
- });
- } // if list length >0
- else {
- this.IsReachEnd = true;
- }
- } // if response == 1
- //this.pageNum++;
+ this.handleEmpResult(result.GetEmployeeSubordinatesList);
+ }
this.infiniteScroll.complete();
- }
- );
+ });
} else {
- if (this.infiniteScroll)
+ if (this.infiniteScroll) {
this.infiniteScroll.complete();
+ }
}
- } //end infiniteScroll
-
-
-
+ }
+ clearSearch() {
+ this.isSearch = false;
+ this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
+ this.empSubordinate = [];
+ this.isReachEnd = false;
+ this.searchNameOrUserName = '';
+ this.searchEmail = '';
+ this.getEmpSubordinate();
+ }
getDetails(index) {
- this.common.sharedService.setSharedData(
- this.empSubordinate[index],
- MyTeamService.EMPLOYEE_SHARED_DATA
- );
-
- this.common.sharedService.setSharedData(
- this.selMenu,
- MenuResponse.SHARED_DATA
- );
- this.close().then(() => {
- this.common.openMyTeamDetails();
- });
-
- //this.modalController.dismiss();
- //this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]});
- }
- public async close() {
- const modal = await this.modalController.getTop();
- if (modal) {
- modal.dismiss();
- }
- }
- toggleSearch() {
- this.isSearch = !this.isSearch;
+ this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
+ this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA);
+ this.common.openMyTeamDetails();
}
+
goToSubordinate() {
- //this.navCtrl.push("MySubordinatePage",{isSearch:true});
- //this.getEmpSubordinate();
- this.presentModal();
- }
- async presentModal() {
- const modal = await this.modalController.create({
- component: HomeComponent,
- keyboardClose: true,
- animated: false,
- componentProps: { isSearch: true }
- });
- modal.cssClass="full-modal";
- let dismissed = modal.onDidDismiss();
- dismissed.then(() => {
- this.isSearch = false;
- });
- return await modal.present();
+ // this.presentModal();
}
- dismiss() {
- this.modalController.dismiss({
- dismissed: true
- });
+
+ showSelectedField(value: any) {
+ if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') {
+ this.showEmailInput = false;
+ this.showUserNameOrNameInput = true;
+ } else if (this.searchKeySelect === 'Email') {
+ this.showUserNameOrNameInput = false;
+ this.showEmailInput = true;
+ }
}
-
}
diff --git a/Mohem/src/app/time-card/home/home.component.html b/Mohem/src/app/time-card/home/home.component.html
index afc16a36..f853e899 100644
--- a/Mohem/src/app/time-card/home/home.component.html
+++ b/Mohem/src/app/time-card/home/home.component.html
@@ -1,3 +1,34 @@
-
- home works!
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{timeCard.heading}}
+ {{timeCard.description}}
+
+
+
+
+
+
+
+
+
+
diff --git a/Mohem/src/app/time-card/home/home.component.scss b/Mohem/src/app/time-card/home/home.component.scss
index e69de29b..1477aa51 100644
--- a/Mohem/src/app/time-card/home/home.component.scss
+++ b/Mohem/src/app/time-card/home/home.component.scss
@@ -0,0 +1,59 @@
+ion-header{
+ overflow: hidden;
+}
+ion-content{
+ --ion-background-color: #f2f2f3;
+}
+
+ion-card-content {
+ padding: 0px;
+}
+
+ion-card {
+ box-shadow: none !important;
+ background-color: white;
+ margin-bottom: 15px;
+}
+ion-header {
+ background: #f2f2f3;
+}
+ion-title{
+ text-align: center;
+ font-family: WorkSans-Bold;
+ font-size: 18px;
+}
+.time-card-home-container{
+ margin-right: 10px;
+ margin-left: 10px;
+ margin-top: 20px
+}
+.header-toolbar-new{
+ --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%);
+ border-bottom-right-radius: 30px;
+ border-bottom-left-radius: 30px;
+}
+
+.time-card-image{
+ padding: 10px;
+}
+.time-card-details{
+ padding: 0px;
+ margin-top: 25px;
+ line-height: 10px;
+}
+
+.time-card-heading{
+ font-weight: bold;
+ font-size: 13px;
+ color: #666666;
+ font-family: WorkSans-Bold;
+}
+
+.time-card-description{
+ font-size: 10px;
+}
+
+.time-card-rightIcon{
+ padding: 8px;
+ margin-top: 18px;
+}
diff --git a/Mohem/src/app/time-card/home/home.component.ts b/Mohem/src/app/time-card/home/home.component.ts
index a7aad8ad..a33764ae 100644
--- a/Mohem/src/app/time-card/home/home.component.ts
+++ b/Mohem/src/app/time-card/home/home.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
@Component({
selector: 'app-home',
@@ -7,8 +8,38 @@ import { Component, OnInit } from '@angular/core';
})
export class HomeComponent implements OnInit {
- constructor() { }
+ public timeCardOptions: any = [
+ {
+ imageName: 'MyTimeCard.png',
+ heading: 'My Time Card',
+ description: 'View your attendance records.',
+ pageLink: '/time-card/time-card-details'
+ },
+ {
+ imageName: 'Timeback.png',
+ heading: 'Time Back',
+ description: 'View and use your extra work time.',
+ pageLink: '/time-card/home'
+ },
+ {
+ imageName: 'MissingSwipe.png',
+ heading: 'Missing Swipe',
+ description: 'Resolve swipe and attendance records',
+ pageLink: '/time-card/home'
+ },
+ {
+ imageName: 'WorkOnBreak.png',
+ heading: 'Work on Break',
+ description: 'Record your work time in during break.',
+ pageLink: '/time-card/home'
+ }
+ ];
+
+ constructor(public common: CommonService) {}
ngOnInit() {}
+ public openDetailPage(path) {
+ this.common.navigatePage(path);
+ }
}
diff --git a/Mohem/src/app/time-card/select-period/select-period.component.html b/Mohem/src/app/time-card/select-period/select-period.component.html
new file mode 100644
index 00000000..0bc9515f
--- /dev/null
+++ b/Mohem/src/app/time-card/select-period/select-period.component.html
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+ Date From
+
+
+
+
+
+
+ Date To
+
+
+
+
+
+
+
+
+ {{filter.name}}
+
+
+
+
+
+
+ Shift type
+
+
+ {{shift.SHT_TYPE_DESC}}
+
+
+
+
+
+ Search
+
diff --git a/Mohem/src/app/time-card/select-period/select-period.component.scss b/Mohem/src/app/time-card/select-period/select-period.component.scss
new file mode 100644
index 00000000..038155ad
--- /dev/null
+++ b/Mohem/src/app/time-card/select-period/select-period.component.scss
@@ -0,0 +1,30 @@
+.footer-modal-button{
+ position: absolute;
+ bottom: 0;
+ color: white;
+ width: 100%;
+ text-align: center;
+ }
+ .footer-modal-button button{
+ font-size: 20px;
+ background: white;
+ line-height: 2;
+ }
+ .filters-container{
+ display: inline-block;
+ text-align: center;
+ margin-top: 10px;
+ }
+ .filter-tag-button{
+ display: inline-block;
+ border-radius: 5px;
+ border: 2px solid #A3D077;
+ color: #606161;
+ text-align: center;
+ font-size: 18px;
+ padding: 5px;
+ margin: 5px;
+ }
+ .filters-container .selected {
+ background-color: #d4f0e4;
+ }
\ No newline at end of file
diff --git a/Mohem/src/app/time-card/select-period/select-period.component.spec.ts b/Mohem/src/app/time-card/select-period/select-period.component.spec.ts
new file mode 100644
index 00000000..bde45178
--- /dev/null
+++ b/Mohem/src/app/time-card/select-period/select-period.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SelectPeriodComponent } from './select-period.component';
+
+describe('SelectPeriodComponent', () => {
+ let component: SelectPeriodComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SelectPeriodComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SelectPeriodComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/time-card/select-period/select-period.component.ts b/Mohem/src/app/time-card/select-period/select-period.component.ts
new file mode 100644
index 00000000..5ecc7a18
--- /dev/null
+++ b/Mohem/src/app/time-card/select-period/select-period.component.ts
@@ -0,0 +1,128 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, NavParams } from '@ionic/angular';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TimeCardService } from 'src/app/time-card/service/time-card.service';
+
+@Component({
+ selector: 'app-select-period',
+ templateUrl: './select-period.component.html',
+ styleUrls: ['./select-period.component.scss'],
+})
+export class SelectPeriodComponent implements OnInit {
+ public shiftTypesArray: any = [];
+ public dateFrom: any;
+ public dateTo: any;
+ public selectedShiftType: any;
+
+ public filtersArray: any = [
+ {
+ name: 'Excess',
+ active: false,
+ key: 'P_EXCESS_FLAG',
+ value: ''
+ },
+ {
+ name: 'Timeback',
+ active: false,
+ key: 'P_TIMEBACK_FLAG',
+ value: ''
+ },
+ {
+ name: 'Comp Off',
+ active: false,
+ key: 'P_COMP_OFF_FLAG',
+ value: ''
+ },
+ {
+ name: 'Non scheduled',
+ active: false,
+ key: 'P_NON_SCHEDULED_FLAG',
+ value: ''
+ },
+ {
+ name: 'Late In',
+ active: false,
+ key: 'P_LATE_IN_FLAG',
+ value: ''
+ },
+ {
+ name: 'Early Out',
+ active: false,
+ key: 'P_EARLY_OUT_FLAG',
+ value: ''
+ },
+ {
+ name: 'Shortage',
+ active: false,
+ key: 'P_SHORTAGE_FLAG',
+ value: ''
+ },
+ {
+ name: 'Missing Swipe',
+ active: false,
+ key: 'P_MISSING_SWIPE_FLAG',
+ value: ''
+ },
+ {
+ name: 'Work On Break',
+ active: false,
+ key: 'P_ACTUAL_WOB_SEC',
+ value: ''
+ },
+ {
+ name: 'Analyzed',
+ active: false,
+ key: 'P_ANALAYZED_FLAG',
+ value: ''
+ },
+ {
+ name: 'Approved Timeback',
+ active: false,
+ key: 'P_APPR_TIMEBACK_FLAG',
+ value: ''
+ },
+ ];
+ constructor(
+ public modalController: ModalController,
+ public common: CommonService,
+ public timeCardService: TimeCardService,
+ public navParams: NavParams) { }
+
+ ngOnInit() {
+ this.getShiftTypes();
+ this.dateFrom = this.navParams.get('dateFrom');
+ this.dateTo = this.navParams.get('dateTo');
+ }
+
+ public dismissModal() {
+ const selectedFilters: any = {};
+ for (const filter of this.filtersArray) {
+ selectedFilters[filter.key] = filter;
+ }
+ this.modalController.dismiss({
+ dismissed: true,
+ keySelectedFilters: selectedFilters,
+ selectedShiftType: this.selectedShiftType,
+ dateFrom: this.dateFrom,
+ dateTo: this.dateTo
+ });
+ }
+
+ public changeFiltersSelection(i: any) {
+ this.filtersArray[i].active = !this.filtersArray[i].active;
+ if (this.filtersArray[i].active) {
+ this.filtersArray[i].value = 'Y';
+ } else {
+ this.filtersArray[i].value = '';
+ }
+ }
+
+ public getShiftTypes() {
+ this.timeCardService.getShiftType().subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ this.shiftTypesArray = result.GetShiftTypesList;
+ }
+ });
+ }
+
+}
diff --git a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts
index 987dc09c..2bca5468 100644
--- a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts
+++ b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts
@@ -5,8 +5,8 @@ export class GetDayAndHoursDetailsRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_MENU_TYPE: string;
public P_SELECTED_RESP_ID: number;
- public P_SCHEDULE_DATE_FROM: DateTimeInput;
- public P_SCHEDULE_DATE_TO: DateTimeInput;
+ public P_SCHEDULE_DATE_FROM: string;
+ public P_SCHEDULE_DATE_TO: string;
public P_EXCESS_FLAG: string;
public P_TIMEBACK_FLAG: string;
public P_COMP_OFF_FLAG: string;
@@ -21,4 +21,6 @@ export class GetDayAndHoursDetailsRequest extends Request {
public P_ACTUAL_WOB_SEC: string;
public P_PAGE_NUM: number;
public P_PAGE_LIMIT: number;
+ public SearchMonth: string;
+ public SearchYear: number;
}
diff --git a/Mohem/src/app/time-card/service/models/get-swipes-request.ts b/Mohem/src/app/time-card/service/models/get-swipes-request.ts
index 006f16e3..b0afbf15 100644
--- a/Mohem/src/app/time-card/service/models/get-swipes-request.ts
+++ b/Mohem/src/app/time-card/service/models/get-swipes-request.ts
@@ -3,7 +3,7 @@ import { DateTimeInput } from "src/app/uI-elements/date-time.input";
export class GetSwipesRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string;
- public P_SCHEDULE_DATE: DateTimeInput;
+ public P_SCHEDULE_DATE: string;
public P_PAGE_NUM: number;
public P_PAGE_LIMIT: number;
}
diff --git a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts
index 7e5036f0..05aed6fa 100644
--- a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts
+++ b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts
@@ -5,8 +5,8 @@ export class GetTimeCardSummaryRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_MENU_TYPE: string;
public P_SELECTED_RESP_ID: number;
- public P_SCHEDULE_DATE_FROM: DateTimeInput;
- public P_SCHEDULE_DATE_TO: DateTimeInput;
+ public P_SCHEDULE_DATE_FROM: string;
+ public P_SCHEDULE_DATE_TO: string;
public P_EXCESS_FLAG: string;
public P_TIMEBACK_FLAG: string;
public P_COMP_OFF_FLAG: string;
@@ -19,4 +19,6 @@ export class GetTimeCardSummaryRequest extends Request {
public P_APPR_TIMEBACK_FLAG: string;
public P_SHT_TYPE: string;
public P_ACTUAL_WOB_SEC: string;
+ public SearchMonth: string;
+ public SearchYear: number;
}
diff --git a/Mohem/src/app/time-card/service/time-card.service.ts b/Mohem/src/app/time-card/service/time-card.service.ts
index 7e8f2cc3..b4fba9fe 100644
--- a/Mohem/src/app/time-card/service/time-card.service.ts
+++ b/Mohem/src/app/time-card/service/time-card.service.ts
@@ -1,27 +1,27 @@
-import { Injectable } from "@angular/core";
-import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
-import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
-import { Request } from "src/app/hmg-common/services/models/request";
+import { Injectable } from '@angular/core';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+import { Request } from 'src/app/hmg-common/services/models/request';
-import { Observable } from "rxjs";
-import { GetShiftTypeResponse } from "./models/get-shift-type.response";
-import { GetDayAndHoursDetailsResponse } from "./models/get-day-hours-type-details.response";
-import { GetTimeCardSummaryResponse } from "./models/get-time-card-summary.response";
-import { GetShiftDetailResponse } from "./models/get-shift-detail.response";
-import { GetSwipesResponse } from "./models/get-swipes-response";
+import { Observable } from 'rxjs';
+import { GetShiftTypeResponse } from './models/get-shift-type.response';
+import { GetDayAndHoursDetailsResponse } from './models/get-day-hours-type-details.response';
+import { GetTimeCardSummaryResponse } from './models/get-time-card-summary.response';
+import { GetShiftDetailResponse } from './models/get-shift-detail.response';
+import { GetSwipesResponse } from './models/get-swipes-response';
@Injectable({
- providedIn: "root"
+ providedIn: 'root'
})
export class TimeCardService {
- public static getShiftTypeUrl = "Services/ERP.svc/REST/GET_SHIFT_TYPES";
+ public static getShiftTypeUrl = 'Services/ERP.svc/REST/GET_SHIFT_TYPES';
public static getTimeCardSummaryUrl =
- "Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY";
+ 'Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY';
public static getDayHourDetailsUrl =
- "Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS";
+ 'Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS';
public static getShiftDetailUrl =
- "Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS";
- public static getSwipeUrl = "Services/ERP.svc/REST/GET_SWIPES";
+ 'Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS';
+ public static getSwipeUrl = 'Services/ERP.svc/REST/GET_SWIPES';
constructor(
public con: ConnectorService,
diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.html b/Mohem/src/app/time-card/shift-details/shift-details.component.html
new file mode 100644
index 00000000..2e8a1ee3
--- /dev/null
+++ b/Mohem/src/app/time-card/shift-details/shift-details.component.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+ 0 && selectedShift.origin === 'shiftDetails'">
+
+
+ Shift details
+ {{ shiftData.SCHEDULE_DATE | date }}
+
+
+
+ Shift type
+
+
+ {{shiftData.SHT_TYPE_DESC}}
+
+
+
+
+ Shift
+
+
+ {{shiftData.SHT_NAME}}
+
+
+
+
+ Break
+
+
+ {{shiftData.BREAK_NAME}}
+
+
+
+
+ Work On Break
+
+
+ {{shiftData.ACTUAL_WOB_HRS}}
+
+
+
+ Actual Swipe(s)
+
+
+
+ Start
+
+
+ {{shiftData.SHT_ACTUAL_START_TIME}}
+
+
+
+
+ End
+
+
+ {{shiftData.SHT_ACTUAL_END_TIME}}
+
+
+
+ Approved Swipe(s)
+
+
+
+ Start
+
+
+ {{shiftData.APPROVED_START_TIME}}
+
+
+
+
+ Start Reason
+
+
+ {{shiftData.APPROVED_START_REASON_DESC}}
+
+
+
+
+ End
+
+
+ {{shiftData.APPROVED_END_TIME}}
+
+
+
+
+ End Reason
+
+
+ {{shiftData.APPROVED_END_REASON_DESC}}
+
+
+
+
+ Actual Hours
+
+
+ {{shiftData.SHT_ACTUAL_HRS}}
+
+
+
+
+
+
+
+
+
+
+ Employee Swipe(s)
+ {{ swipeData.SCHEDULE_DATE | date }}
+
+
+
+
+ Swipe Date
+
+
+ {{swipeData.SWIPE_DATE}}
+
+
+
+
+ Swipe Time
+
+
+ {{swipeData.SWIPE_TIME}}
+
+
+
+
+ Swipe Status
+
+
+ {{swipeData.SWIPE_STATUS}}
+
+
+
+
+ Machine Location
+
+
+ {{swipeData.MACHINE_LOCATION}}
+
+
+
+
+ Unit Number
+
+
+ {{swipeData.UNIT_NUMBER}}
+
+
+
+
+ Unit Name
+
+
+ {{swipeData.UNIT_NAME}}
+
+
+
+
+ Exclude
+
+
+ {{swipeData.EXCLUDE_FLAG}}
+
+
+
+
+ Error Message
+
+
+ {{swipeData.RETURN_MESSAGE}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.scss b/Mohem/src/app/time-card/shift-details/shift-details.component.scss
new file mode 100644
index 00000000..976ada04
--- /dev/null
+++ b/Mohem/src/app/time-card/shift-details/shift-details.component.scss
@@ -0,0 +1,30 @@
+ion-header{
+ overflow: hidden;
+ background: #f2f2f3;
+}
+ion-content{
+ --ion-background-color: #f2f2f3;
+}
+
+ion-card-content {
+ padding: 0px;
+}
+
+ion-card {
+ box-shadow: none !important;
+ background-color: white;
+ margin: 10px;
+}
+
+ion-title{
+ text-align: center;
+ font-family: WorkSans-Bold;
+ font-size: 18px;
+ margin-right: 45px;
+}
+
+.header-toolbar-new{
+ --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%);
+ border-bottom-right-radius: 30px;
+ border-bottom-left-radius: 30px;
+}
diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts
new file mode 100644
index 00000000..808e6498
--- /dev/null
+++ b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ShiftDetailsComponent } from './shift-details.component';
+
+describe('ShiftDetailsComponent', () => {
+ let component: ShiftDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ShiftDetailsComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ShiftDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.ts
new file mode 100644
index 00000000..cd3cb9f2
--- /dev/null
+++ b/Mohem/src/app/time-card/shift-details/shift-details.component.ts
@@ -0,0 +1,75 @@
+import { Component, OnInit } from '@angular/core';
+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 { GetShiftDetailRequest } from 'src/app/time-card/service/models/get-shift-detail.request';
+import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-request';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import * as moment from 'moment';
+
+@Component({
+ selector: 'app-shift-details',
+ templateUrl: './shift-details.component.html',
+ styleUrls: ['./shift-details.component.scss'],
+})
+export class ShiftDetailsComponent implements OnInit {
+ public selectedShift: any;
+ // public selectedShiftDay: any;
+ public shiftDetailsData: any = [];
+ public swipeDetailsData: any = [];
+ constructor(
+ public timeCardService: TimeCardService,
+ public common: CommonService,
+ public sharedData: SharedDataService) { }
+
+ ngOnInit() {
+ this.selectedShift = this.sharedData.getSharedData('selectedShift', false);
+ console.log(this.selectedShift);
+ if (this.selectedShift.origin === 'shiftDetails') {
+ this.getScheduleShiftDetails();
+ } else if (this.selectedShift.origin === 'shiftSwipes') {
+ this.getSwipesDetails();
+ }
+
+ // this.selectedShiftDay = this.sharedData.getSharedData('selectedShiftDay', false);
+ // console.log(this.selectedShiftDay);
+ // if (this.selectedShiftDay.origin === 'shiftDetails') {
+ // this.getScheduleShiftDetails();
+ // } else if (this.selectedShiftDay.origin === 'shiftSwipes') {
+ // this.getSwipesDetails();
+ // }
+ }
+
+ getScheduleShiftDetails() {
+ console.log("getScheduleShiftDetails");
+ const GetShiftDetailRequestObject = new GetShiftDetailRequest();
+ GetShiftDetailRequestObject.P_RTP_ID = this.selectedShift.RTP_ID;
+ GetShiftDetailRequestObject.P_PAGE_NUM = 1;
+ GetShiftDetailRequestObject.P_PAGE_LIMIT = 10;
+ console.log(GetShiftDetailRequestObject);
+ this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ console.log(result);
+ this.shiftDetailsData = result.GetScheduleShiftsDetailsList;
+ // this.common.sharedService.setSharedData(this.shiftDetailsData,'shiftDetailsData');
+ }
+ })
+ }
+
+ getSwipesDetails() {
+ console.log("getSwipesDetails");
+
+ const GetSwipesRequestObject = new GetSwipesRequest();
+ GetSwipesRequestObject.P_SELECTED_EMPLOYEE_NUMBER = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
+ GetSwipesRequestObject.P_SCHEDULE_DATE = this.common.convertISODateToJsonDate(this.selectedShift.SCHEDULE_DATE);
+ GetSwipesRequestObject.P_PAGE_NUM = 1;
+ GetSwipesRequestObject.P_PAGE_LIMIT = 10;
+ this.timeCardService.getSwipes(GetSwipesRequestObject).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ console.log(result);
+ this.swipeDetailsData = result.GetSwipesList;
+ }
+ });
+ }
+
+}
diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html
index 633c94d1..87f13add 100644
--- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html
+++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html
@@ -1,3 +1,148 @@
-
- time-card-details works!
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{timeCardSummaryData.SCHEDULE_DAYS}}
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{timeCardSummaryData.OFF_DAYS}}
+ 0
+
+
+
+
+
+
+
+
+ {{timeCardSummaryData.UNAUTHORIZED_LEAVE}}
+ 0
+
+
+
+
+
+
+ {{timeCardSummaryData.SHORTAGE_HRS}}
+ 0
+
+
+
+
+
+
+
+ {{ts.trPK('attendance','monthly-attendance-calendar')}}
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss
index e69de29b..77f4f263 100644
--- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss
+++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss
@@ -0,0 +1,487 @@
+ion-header{
+ overflow: hidden;
+ background: #f2f2f3;
+}
+ion-content{
+ --ion-background-color: #f2f2f3;
+}
+
+ion-card-content {
+ padding: 0px;
+}
+
+ion-card {
+ box-shadow: none !important;
+ background-color: white;
+ margin: 10px -15px;
+ margin-bottom: 20px;
+}
+
+ion-title{
+ text-align: center;
+ font-family: WorkSans-Bold;
+ font-size: 18px;
+ margin-right: 35px;
+}
+
+///////////////////////////////here
+.slidPrev{
+ // margin-top: 8px;
+ margin-left: 10px;
+ background: transparent;
+}
+
+.slidNext{
+ background: transparent;
+ margin-top: -1px;
+ margin-left: 43px;
+}
+.activeArrow{
+ height: 20px;
+ width: 20px;
+color: white;
+}
+.disabledArrow{
+ height: 20px;
+ width: 20px;
+color: gray;
+// margin-right: 5px;
+}
+
+.header-toolbar-new{
+ --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%);
+ border-bottom-right-radius: 30px;
+ border-bottom-left-radius: 30px;
+}
+
+.active-Segment {
+ border-radius: 5px !important;
+ font-size: 0.3cm !important;
+ background: white !important;
+ color: #fff !important;
+ font-weight: bold !important;
+ border: 1px solid white !important;
+ text-transform: none;
+ --color-checked: none;
+ }
+ .active-Segment ion-label{
+ // color: #A3D077 !important;
+ color: #11975F !important;
+ font-size: 11px;
+ }
+ .normal-Segment ion-label{
+ // color: #A3D077 !important;
+ color: white !important;
+ font-size: 11px;
+ }
+ .normal-Segment {
+ border-radius: 5px !important;
+ font-size: 0.3cm !important;
+ background: #A3D077 !important;
+ color: #fff !important;
+ font-weight: bold !important;
+ border: 1px solid white !important;
+ text-transform: none;
+ --color-checked: none;
+ }
+ .time-card-details-container{
+ margin-right: 20px;
+ margin-left: 20px;
+ }
+
+ .card-summary-heading{
+ margin-left: 10px;
+ margin-top: 12px;
+ color: #606161;
+ font-family: WorkSans-Bold;
+ }
+ .card-summary-heading-hours{
+ color: #606161;
+ font-family: WorkSans-Bold;
+ }
+
+ .card-summary-heading-hours-extended-heading{
+ color: #D3D3D3;
+ font-family: WorkSans-Bold;
+ }
+
+ /////////////////////////////////
+
+ .time-card-details {
+ background: white;
+ margin: 20px;
+ border-radius: 5px;
+ }
+
+ .time-card-details-heading-two {
+ color: #606161;
+ font-family: WorkSans-Bold;
+ }
+ .time-card-details-heading-two h2 {
+ margin-top: 15px;
+ font-size: 15px;
+ }
+
+ .time-card-span img{
+ height: 30px;
+ margin-top: -5px;
+ margin-left: 10px;
+ }
+ .dayhours-button-container{
+ width: 100%;
+ padding-right: 5px;
+ padding-left: 5px;
+ }
+
+ .dayhours-button{
+ width: 50%;
+ height: 35px;
+ font-size: 15px;
+ color: white;
+ background: #606161;
+ }
+
+ /////////////////////////////////////
+.footer-modal-button{
+ position: absolute;
+ bottom: 0;
+ color: white;
+ width: 100%;
+ text-align: center;
+}
+.footer-modal-button button{
+ font-size: 20px;
+ background: white;
+ line-height: 2;
+ margin: -42px auto 0;
+ display: block;
+}
+
+////////////////////////////
+.right-slider-icon{
+ float: right;
+ height: 100%;
+ width: 15%;
+ position: fixed;
+ right: -5%;
+ top: 31%;
+}
+
+.left-slider-icon{
+ width: 15%;
+ position: fixed;
+ top: 32%;
+ left: -4%;
+ height: 100%;
+}
+
+
+//////////////////////////////////////////ENAD CODE////////////////////////////////////////////
+
+
+.colorBG{
+ --background: #f0efef;
+ }
+
+.header-div {
+
+ background-color: #22C6B3;
+ text-transform: capitalize;
+ height: 180px;
+ position: relative;
+ display: block;
+ margin-bottom: -28px;
+}
+.Title{
+ text-align: center !important;
+ color: white !important;
+ margin-top: -86px !important;
+ font-size: 17px !important;
+ font-family: workSans-Regular;
+}
+
+.header{
+ margin-top: -221px;
+}
+
+.chart-modal .modal-Wrapper {
+ --background: rgb(116, 108, 108) !important;
+ --border-color:white!important ;
+ width: 85%!important ;
+ height: 40px !important ;
+
+ }
+
+ .navbar{
+ font-size: 10px !important;
+ --background: #22C6B3 !important;
+ color: aliceblue !important;
+// margin-top: 10px !important;
+
+ }
+
+ .menu{
+ // margin-left:330px !important;
+ margin-top: 0px !important;
+ font-size: 35px !important;
+ background: #22C6B3;
+ color: aliceblue;
+ margin-left: 0px !important;
+
+ }
+
+ .person{
+
+ margin-left:100px !important;
+ margin-top: 0px !important;
+ font-size: 23px !important;
+ background: #22C6B3 !important;
+ color: aliceblue !important;
+
+ }
+
+ .grid{
+margin-bottom: 550px !important;
+margin-top: 20px !important;
+margin-left: 15px !important;
+margin-right: 15px !important;
+background-color:white !important;
+border-radius: 20px !important;
+height: 250px !important;
+ }
+
+ .headerGrid{
+ margin-top: 5px !important;
+ margin-left: 15px !important;
+ margin-right: 15px !important;
+ background-color: white !important;
+ border-radius: 20px !important;
+height: 250px !important;
+border: 1px solid #d6d4d4;
+ }
+
+ .green-label{
+ font-size: 12px;
+ margin-top: -13px;
+ }
+
+ .green-amount{
+ font-size: 17px;
+ font-family: WorkSans-Bold;
+ margin-top: -3px;
+ }
+
+ .blue-label{
+ font-size: 12px;
+ margin-top: -13px;
+ }
+
+ .blue-amount{
+ font-size: 17px;
+ font-family: WorkSans-Bold;
+ margin-top: -4px;
+ }
+
+.today-graph{
+ display:block !important;
+ height: 150px !important;
+ width: 300 !important;
+ margin-left: -70px !important;
+}
+ .bodyGrid{
+ // margin-bottom: 550px !important;
+ // margin-top: 7px !important;
+ // margin-left: 15px !important;
+ // margin-right: 15px !important;
+ // background-color:white !important;
+ // border-radius: 20px !important;
+ // height: 270px !important;
+ // border: 1px solid #d6d4d4 !important;
+
+ margin-top: 7px !important;
+ margin-left: 15px !important;
+ margin-right: 15px !important;
+ background-color: white !important;
+ border-radius: 20px !important;
+ height: 321px !important;
+ border: 1px solid #d6d4d4 !important;
+
+ }
+ .labelGrid{
+ // margin-top: -30px !important;
+ // background-color:white !important;
+ // border-radius: 20px !important;
+ // height: 100px !important;
+ // border: 1px solid #d6d4d4;
+ margin-top: -30px !important;
+ background-color: white !important;
+ border-radius: 23px !important;
+ height: 100px !important;
+ border: 1px solid #d6d4d4;
+ padding-right: 0px;
+ }
+
+.ionSliders{
+ margin: 0px !important;
+ padding: 0px !important;
+
+}
+
+
+ .ionSlide{
+ margin-top: 5px !important;
+ margin-left: 190px !important;
+ color: black !important;
+
+ }
+ .dateLable{
+
+ margin-left: 90px !important;
+ color: black !important;
+ font-size: small !important;
+ margin-top: 15px !important;
+ }
+// h1{
+// font-size: 15px !important;
+// text-align: center !important;
+// }
+.arrowDropright{
+ margin-left:100px !important;
+ font-size: 20px !important;
+ color: rgb(168, 165, 165) !important;
+ margin-top: 15px !important;
+
+}
+.arrowDropleft{
+ font-size: 20px !important;
+ margin-left: 10px !important;
+ margin-top: 15px !important;
+ color: rgb(116, 108, 108) !important;
+}
+
+ .ionLable{
+ font-size: 10px !important;
+ }
+
+ .number{
+
+ font-size: 18px !important;
+ font-weight: bolder !important;
+ color: black !important;
+ }
+
+ .header-div{
+ background:var(--primary);
+ background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
+ background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
+ background: #22C6B3;
+ // background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%);
+ color:var(--light);
+ text-transform: capitalize;
+
+ display: block;
+ position: relative;
+ height: 210px;
+ margin-bottom:60px;
+ // border-radius: 0px 0px 70px 70px;
+ }
+
+ .request-heading {
+
+ span {
+
+ // text-align: center;
+
+ // display: block;
+
+ // padding-top: 8px;
+
+ // font-family: workSans-Regular;
+ // text-align: center;
+ display: block;
+ padding-top: 8px;
+ /* font-family: workSans-Regular; */
+ margin-left: -157px;
+ margin-top: -19px;
+ padding-bottom: 16px;
+
+ }
+
+ }
+
+
+
+ .result-graph {
+
+ position: relative;
+
+ background: white;
+
+ margin-right: 20px;
+
+ margin-left: 20px;
+
+ margin-top: 20px;
+
+ padding-bottom: 20px;
+
+ border-radius: 20px;
+
+ }
+
+
+
+ .result-text-container {
+
+ padding: 0;
+
+ margin: 0;
+
+ position: absolute;
+
+ left: 38%;
+ top: 60%;
+
+ display: block;
+
+ text-align: center;
+
+ transform: translate(-50%, -50%);
+
+ h2 {
+
+ font-size: 25px;
+
+ font-family: WorkSans-Bold;
+ color: black !important;
+ margin: 0 auto;
+
+ line-height: 36px;
+
+ }
+ p {
+
+ font-size: 20px;
+ color: black !important;
+ // font-family: WorkSans-Bold;
+
+ margin: 0 auto;
+
+ line-height: 36px;
+
+ }
+
+ span {
+
+ width: 125px;
+
+ display: block;
+
+ margin: 0 auto;
+
+ font-size: 12px;
+ color: black !important;
+ font-family: workSans-Regular;
+ }
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts
index 8fa456db..0599e497 100644
--- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts
+++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts
@@ -1,4 +1,15 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ViewChild, Input } from '@angular/core';
+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';
+import * as moment from 'moment';
+import { getDate } from 'date-fns';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-time-card-details',
@@ -6,9 +17,372 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./time-card-details.component.scss'],
})
export class TimeCardDetailsComponent implements OnInit {
+ slideView: any;
+ sliderOne: any;
+ @ViewChild('slides') slides: IonSlides;
+ @ViewChild('slideWithNav') slideWithNav: IonSlides;
+ slideOptsOne = {
+ initialSlide: 0,
+ slidesPerView: 1,
+ autoplay: true
+ };
+ month: any;
+ year: any;
+ preMonth: number;
+ nextMonth: any;
+ constructor(
+ public timeCardService: TimeCardService,
+ public common: CommonService,
+ public modalController: ModalController,
+ public sharedData: SharedDataService,
+ public ts: TranslatorService
+ ) { }
+ @ViewChild('sliderRef') protected sliderRef: IonSlides;
- constructor() { }
+ public activeSegment: any = 'time-card-summary';
+ public showMore: any = true;
+ public menuType: any;
+ public selEmp: string;
+ public dateFrom: any = new Date();
+ public dateTo: any = new Date();
+ public selMenu: MenuResponse = new MenuResponse();
+ public respID: number;
+ public timeCardSummaryData: any = [];
+ public dayHoursData: any = [];
+ public selectedShift: any;
+ public rightIconActive = false;
+ public leftIconActive = false;
+ public loadMore = false;
+ public dayAndHoursPageNumber = 1;
+ public selectedFilters: any = {};
+ public selectedShiftFilter: any;
+ public loadMoreDateHoursData = false;
+ public monthName: any;
+ public yearDate: any;
+ public absentDays: number;
+ public attendedDays: number;
+ public futrueDays = 0;
+ public totalAttendancePrecentage = 0;
+ public arrDaysAttendance: any = [];
+ public arrDaysAbsent: any = [];
+ public arrDaysOff: any = [];
+ public monthTitle: string = moment().format('MMMM');
+ 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 }
+ };
- ngOnInit() {}
+ public data = {
+ datasets: [
+ {
+ data: [120, 50],
+ backgroundColor: [
+ '#22c6b3',
+ '#094875',
+ ],
+ borderWidth: 2
+ }]
+ };
+ ngOnInit() {
+ this.nextMonth = new Date().getMonth() + 2;
+ this.preMonth = new Date().getMonth() - 2;
+ 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());
+ }
+
+ calendarConfig(month?, year?) {
+ this.arrDaysOff = [];
+ this.arrDaysAttendance = [];
+ this.arrDaysAbsent = [];
+ this.month = month;
+ this.year = year;
+ this.getTimeCardSummaryDetails(month, year);
+ this.getDayHoursTypeDetails(month, year);
+ }
+
+ public segmentChanged(event: any) {
+ console.log('segmentChanged');
+ this.activeSegment = event.detail.value;
+ if (this.activeSegment === 'time-card-details' && this.dayHoursData.length === 0) {
+ this.getDayHoursTypeDetails();
+ } else {
+ this.rightIconActive = true;
+ this.leftIconActive = false;
+ }
+ }
+
+ public toggleButton() {
+ this.showMore = !this.showMore;
+ }
+
+ public getDayHoursTypeDetails(month?, year?) {
+ const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
+ this.monthName = month;
+ this.yearDate = year;
+ this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
+ this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+
+ dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
+ dayAndHoursReqObj.P_MENU_TYPE = this.menuType;
+ dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
+ dayAndHoursReqObj.SearchMonth = this.monthName;
+ dayAndHoursReqObj.SearchYear = this.yearDate;
+ dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
+ 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) => {
+ if (this.common.validResponse(result)) {
+ console.log(result.GetDayHoursTypeDetailsList);
+ this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
+ this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
+ this.loadMoreDateHoursData = false;
+ 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;
+ }
+ }
+ });
+
+ }
+
+ countAllAttendDays(allDays) {
+ // tslint:disable-next-line:prefer-for-of
+ for (let i = 0; i < allDays.length; i++) {
+ if (allDays[i].DAY_TYPE === 'Off') {
+ // offDay
+ this.arrDaysOff.push({
+ startTime: new Date(allDays[i].SCHEDULE_DATE),
+ endTime: new Date(allDays[i].SCHEDULE_DATE)
+ });
+ } else if (allDays[i].DAY_TYPE === 'SCHEDULED') {
+ // attendace
+ this.arrDaysAttendance.push({
+ startTime: new Date(allDays[i].SCHEDULE_DATE),
+ endTime: new Date(allDays[i].SCHEDULE_DATE)
+ });
+ } else {
+ // absent
+ this.arrDaysAbsent.push({
+ startTime: new Date(allDays[i].SCHEDULE_DATE),
+ endTime: new Date(allDays[i].SCHEDULE_DATE),
+ isoTime: '09:00:00',
+ allDay: false
+ });
+ }
+ }
+ this.showData = true;
+ }
+
+ public getTimeCardSummaryDetails(month?, year?) {
+ console.log('getTimeCardSummaryDetails');
+ const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
+ if (this.isChange) {
+ this.monthName = month;
+ console.log('' + this.monthName);
+ this.yearDate = year;
+ console.log('' + this.yearDate);
+
+ } else {
+ this.monthName = month;
+ this.yearDate = year;
+ }
+
+ this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
+ this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
+ this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+
+ timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
+ timeCardSummaryReqObj.P_MENU_TYPE = this.menuType;
+ timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
+ timeCardSummaryReqObj.SearchMonth = this.monthName;
+ 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) => {
+ 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;
+ this.options = {
+ cutoutPercentage: 80,
+ tooltips: { enabled: false },
+ legend: { display: false }
+ };
+ if (this.absentDays === 0 && this.attendedDays === 0) {
+ this.futrueDays = this.totalAttendancePrecentage;
+ }
+ this.data = {
+ datasets: [
+ {
+ data: [this.absentDays, this.attendedDays, this.futrueDays],
+ backgroundColor: [
+ '#094875',
+ '#22c6b3',
+ '#9e9e9e'
+ ],
+ borderWidth: 2
+ }]
+ };
+ }
+ });
+ }
+
+ async openSelectPeriodModal() {
+ const modal = await this.modalController.create({
+ component: SelectPeriodComponent,
+ cssClass: 'select-period-custom-modal',
+ componentProps: {
+ dateFrom: this.dateFrom,
+ dateTo: this.dateTo
+ }
+ });
+ modal.onDidDismiss().then(result => {
+ this.loadMore = false;
+ this.rightIconActive = false;
+ this.leftIconActive = false;
+ this.dayHoursData = [];
+ this.timeCardSummaryData = [];
+ this.dayAndHoursPageNumber = 1;
+ this.loadMoreDateHoursData = false;
+ this.dateFrom = result.data.dateFrom;
+ this.dateTo = result.data.dateTo;
+ this.selectedFilters = result.data.keySelectedFilters;
+ this.selectedShiftFilter = result.data.selectedShiftType;
+ if (this.dateFrom && this.dateTo) {
+ this.getDayHoursTypeDetails();
+ this.getTimeCardSummaryDetails();
+ }
+ });
+ return await modal.present();
+ }
+
+showShiftDetails(origin: string) {
+ this.sliderRef.getActiveIndex().then((index: number) => {
+ this.selectedShift = this.dayHoursData[index];
+ this.selectedShift.origin = origin;
+ this.sharedData.setSharedData(this.selectedShift, 'selectedShift');
+ this.common.navigatePage('/time-card/shift-details');
+ });
+}
+
+nextSlide() {
+ if (this.currentMonthName !== this.month) {
+ this.showData = false;
+ if (this.nextMonth > 12) {
+ this.currentYear = this.currentYear + 1;
+ this.nextMonth = 1;
+ }
+ this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
+ this.nextMonth = this.nextMonth + 1;
+ this.preMonth = this.nextMonth - 2;
+ }
+}
+
+previousSlide() {
+ this.showData = false;
+ if (this.preMonth === 0) {
+ this.currentYear = this.currentYear - 1;
+ this.preMonth = 12;
+ }
+ this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
+ this.preMonth = this.preMonth - 1;
+ this.nextMonth = this.preMonth + 2;
+}
+
+changeMonthTitle(title) {
+ this.monthTitle = title;
+ this.isChange = true;
+ this.getTimeCardSummaryDetails();
+}
+
+changeYear(year) {
+ this.yearTitle = year;
+}
+
+getHeaderMonth(date: any) {
+ return this.getMonthName(date.getMonth() + 1) + ' ' + date.getFullYear();
+}
+
+public getMonthName(value: any): any {
+ switch (value) {
+ case 1:
+ return 'January';
+ case 2:
+ return 'February';
+ case 3:
+ return 'March';
+ case 4:
+ return 'April';
+ case 5:
+ return 'May';
+ case 6:
+ return 'June';
+ case 7:
+ return 'July';
+ case 8:
+ return 'August';
+ case 9 :
+ return 'September';
+ case 10:
+ return 'October';
+ case 11:
+ return 'November';
+ case 12:
+ return 'December';
+
+ }
+}
}
diff --git a/Mohem/src/app/time-card/time-card.module.ts b/Mohem/src/app/time-card/time-card.module.ts
index e79e452f..6ea5c17b 100644
--- a/Mohem/src/app/time-card/time-card.module.ts
+++ b/Mohem/src/app/time-card/time-card.module.ts
@@ -8,6 +8,11 @@ import { IonicModule } from '@ionic/angular';
import { TimeCardPage } from './time-card.page';
import { TimeCardDetailsComponent } from './time-card-details/time-card-details.component';
import { HomeComponent } from './home/home.component';
+import { SelectPeriodComponent } from './select-period/select-period.component';
+import { ShiftDetailsComponent } from './shift-details/shift-details.component';
+import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+
+
const routes: Routes = [
{
@@ -21,6 +26,10 @@ const routes: Routes = [
{
path: 'time-card-details',
component: TimeCardDetailsComponent
+ },
+ {
+ path: 'shift-details',
+ component: ShiftDetailsComponent
}
]
}
@@ -31,12 +40,18 @@ const routes: Routes = [
CommonModule,
FormsModule,
IonicModule,
- RouterModule.forChild(routes)
+ RouterModule.forChild(routes),
+ HmgCommonModule
],
declarations: [
TimeCardPage,
HomeComponent,
- TimeCardDetailsComponent
- ]
+ TimeCardDetailsComponent,
+ SelectPeriodComponent,
+ ShiftDetailsComponent
+ ],
+ entryComponents: [
+ SelectPeriodComponent
+ ],
})
export class TimeCardPageModule {}
diff --git a/Mohem/src/assets/imgs/call_icon.png b/Mohem/src/assets/imgs/call_icon.png
new file mode 100644
index 00000000..b7f0e83d
Binary files /dev/null and b/Mohem/src/assets/imgs/call_icon.png differ
diff --git a/Mohem/src/assets/imgs/create_request_icon.png b/Mohem/src/assets/imgs/create_request_icon.png
new file mode 100644
index 00000000..b6da2a40
Binary files /dev/null and b/Mohem/src/assets/imgs/create_request_icon.png differ
diff --git a/Mohem/src/assets/imgs/green_call_icon.png b/Mohem/src/assets/imgs/green_call_icon.png
new file mode 100644
index 00000000..13768143
Binary files /dev/null and b/Mohem/src/assets/imgs/green_call_icon.png differ
diff --git a/Mohem/src/assets/imgs/message_icon.png b/Mohem/src/assets/imgs/message_icon.png
new file mode 100644
index 00000000..956dd4a0
Binary files /dev/null and b/Mohem/src/assets/imgs/message_icon.png differ
diff --git a/Mohem/src/assets/imgs/time-card/ArrowDown.png b/Mohem/src/assets/imgs/time-card/ArrowDown.png
new file mode 100644
index 00000000..19693c85
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowDown.png differ
diff --git a/Mohem/src/assets/imgs/time-card/ArrowRight.png b/Mohem/src/assets/imgs/time-card/ArrowRight.png
new file mode 100644
index 00000000..e04b5a21
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowRight.png differ
diff --git a/Mohem/src/assets/imgs/time-card/ArrowUp.png b/Mohem/src/assets/imgs/time-card/ArrowUp.png
new file mode 100644
index 00000000..faaa61e8
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowUp.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Asset 18.png b/Mohem/src/assets/imgs/time-card/Asset 18.png
new file mode 100644
index 00000000..df97a248
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 18.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Asset 19.png b/Mohem/src/assets/imgs/time-card/Asset 19.png
new file mode 100644
index 00000000..585150ba
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 19.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Asset 20.png b/Mohem/src/assets/imgs/time-card/Asset 20.png
new file mode 100644
index 00000000..661cb83e
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 20.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Asset 21.png b/Mohem/src/assets/imgs/time-card/Asset 21.png
new file mode 100644
index 00000000..e03be489
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 21.png differ
diff --git a/Mohem/src/assets/imgs/time-card/EarlyOut.png b/Mohem/src/assets/imgs/time-card/EarlyOut.png
new file mode 100644
index 00000000..d7c3e48e
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/EarlyOut.png differ
diff --git a/Mohem/src/assets/imgs/time-card/ExcessTime.png b/Mohem/src/assets/imgs/time-card/ExcessTime.png
new file mode 100644
index 00000000..2f7105e1
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ExcessTime.png differ
diff --git a/Mohem/src/assets/imgs/time-card/LateIn.png b/Mohem/src/assets/imgs/time-card/LateIn.png
new file mode 100644
index 00000000..829cf045
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/LateIn.png differ
diff --git a/Mohem/src/assets/imgs/time-card/MissingSwipe.png b/Mohem/src/assets/imgs/time-card/MissingSwipe.png
new file mode 100644
index 00000000..ec7ffcf5
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/MissingSwipe.png differ
diff --git a/Mohem/src/assets/imgs/time-card/MyTimeCard.png b/Mohem/src/assets/imgs/time-card/MyTimeCard.png
new file mode 100644
index 00000000..9ff482cc
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/MyTimeCard.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Notification.png b/Mohem/src/assets/imgs/time-card/Notification.png
new file mode 100644
index 00000000..a4ff12a7
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Notification.png differ
diff --git a/Mohem/src/assets/imgs/time-card/PlannedOT.png b/Mohem/src/assets/imgs/time-card/PlannedOT.png
new file mode 100644
index 00000000..188e7306
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/PlannedOT.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Remarks.png b/Mohem/src/assets/imgs/time-card/Remarks.png
new file mode 100644
index 00000000..e1a07b3d
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Remarks.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Shift Hours.png b/Mohem/src/assets/imgs/time-card/Shift Hours.png
new file mode 100644
index 00000000..9d2000b6
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Shift Hours.png differ
diff --git a/Mohem/src/assets/imgs/time-card/SwipeIn.png b/Mohem/src/assets/imgs/time-card/SwipeIn.png
new file mode 100644
index 00000000..82b381e1
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/SwipeIn.png differ
diff --git a/Mohem/src/assets/imgs/time-card/SwipeOut.png b/Mohem/src/assets/imgs/time-card/SwipeOut.png
new file mode 100644
index 00000000..a84e1c9d
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/SwipeOut.png differ
diff --git a/Mohem/src/assets/imgs/time-card/TimeBackIcon.png b/Mohem/src/assets/imgs/time-card/TimeBackIcon.png
new file mode 100644
index 00000000..42f13fb5
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/TimeBackIcon.png differ
diff --git a/Mohem/src/assets/imgs/time-card/Timeback.png b/Mohem/src/assets/imgs/time-card/Timeback.png
new file mode 100644
index 00000000..287f57ab
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Timeback.png differ
diff --git a/Mohem/src/assets/imgs/time-card/TotalHours.png b/Mohem/src/assets/imgs/time-card/TotalHours.png
new file mode 100644
index 00000000..f1ec0e8c
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/TotalHours.png differ
diff --git a/Mohem/src/assets/imgs/time-card/WorkOnBreak.png b/Mohem/src/assets/imgs/time-card/WorkOnBreak.png
new file mode 100644
index 00000000..f1f1faa2
Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/WorkOnBreak.png differ
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json
index e3e5dfce..7da67784 100644
--- a/Mohem/src/assets/localization/i18n.json
+++ b/Mohem/src/assets/localization/i18n.json
@@ -1041,6 +1041,22 @@
"attendance": {
"ar": "الحضور",
"en": "Attendance"
+ },
+ "monthly-attendance": {
+ "ar": "الحضور الشهري",
+ "en": "Monthly Attendance"
+ },
+ "monthly-attendance-calendar": {
+ "ar": "تقويم الحضور الشهري",
+ "en": "Monthly Attendance Calendar"
+ },
+ "present": {
+ "ar": "حضور",
+ "en": "Present"
+ },
+ "absent": {
+ "ar": "غياب",
+ "en": "Absent"
}
},
"vacation-rule": {
@@ -1321,6 +1337,38 @@
"requestFor": {
"en": "Request for",
"ar": "اطلب ل"
+ },
+ "todayAttendance": {
+ "en": "Today's Attendance",
+ "ar": "Today's Attendance"
+ },
+ "checkIn": {
+ "en": "Check-In",
+ "ar": "CheckIn"
+ },
+ "checkOut": {
+ "en": "Check-Out",
+ "ar": "CheckOut"
+ },
+ "late": {
+ "en": "Late",
+ "ar": "Late"
+ },
+ "attendance-statistics": {
+ "en": "Attendance Statistics",
+ "ar": "Attendance Statistics"
+ },
+ "myTeam-header": {
+ "en": "MY TEAM",
+ "ar": "MY TEAM"
+ },
+ "total": {
+ "en": "TOTAL",
+ "ar": "TOTAL"
+ },
+ "team-members": {
+ "en": "TEAM MEMBERS",
+ "ar": "TEAM MEMBERS"
}
},
"searchForReplacment": {
@@ -2242,27 +2290,57 @@
"ar":"Mark Attendance "
},
"check-in":{
- "en": "CHECK IN",
- "ar":"CHECK IN"
+ "en": "Check In",
+ "ar":"وقت الدخول"
},
"check-out":{
- "en": "CHECK OUT",
- "ar":"CHECK OUT"
+ "en": "Check Out",
+ "ar":"وقت الخروج"
},
"regular":{
- "en": "REGULAR",
- "ar":"REGULAR"
+ "en": "Regular",
+ "ar":"المنتظم"
},
"late-in":{
- "en": "LATE IN",
- "ar":"LATE IN"
+ "en": "Late In",
+ "ar":"القدوم المتأخر"
+ },
+ "shortage":{
+ "en": "Shortage",
+ "ar":"ساعات التقصير"
+ },
+ "excess":{
+ "en": "Excess",
+ "ar":"فائض"
+ },
+ "early-out":{
+ "en": "Early Out",
+ "ar":"الخروج المبكر"
},
"today-time-left":{
"en": "TODAY'S TIME LEFT",
"ar":"TODAY'S TIME LEFT"
},
-
-
+ "shortage-hours":{
+ "en": "Shortage Hours",
+ "ar":"ساعات التقصير"
+ },
+ "schedule":{
+ "en": "Schedule",
+ "ar":"ايام العمل"
+ },
+ "off-days":{
+ "en": "Off Days",
+ "ar":"ايام الراحه"
+ },
+ "non-analyzed":{
+ "en": "Non Analyzed",
+ "ar":"لايوجد تحليل"
+ },
+ "attendance-statistics":{
+ "en": "Attendance Statistics",
+ "ar":"احصائيات الحضور"
+ },
"confirm-alert1":{
"en": "Are you sure, you want to",
"ar":"Are you sure, you want to"
@@ -2276,8 +2354,8 @@
"ar":"You did't complate today shift"
},
"shift-time":{
- "en":"SHIFT TIME",
- "ar":"SHIFT TIME"
+ "en":"Shift Time",
+ "ar":"وقت التناوب"
}
},
"sms": {
diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss
index 08f4c5e7..b470d616 100644
--- a/Mohem/src/theme/styles.scss
+++ b/Mohem/src/theme/styles.scss
@@ -1238,6 +1238,166 @@ border:0px
font-size: 20px;
}
+// .select-text{
+// --margin-left: -10px;
+// margin-left:0;
+// }
+// .search-dropdown{
+// background: #22c6b3;
+// ion-select {
+// .select-text{
+// margin-left: -10px;
+// }
+// .select-icon{
+// .select-icon-inner{
+// opacity: 1;
+// color: white;
+// margin-top: -1px;
+// }
+// }
+// }
+// }
+
+.monthview-primary-with-event, .absent, .present, .dayoff {
+
+ background-color: #fff !important;
+ z-index: 1;
+ color: #fff !important;
+ position: relative;
+
+}
+
+.advanced-search-modal {
+ --height: 12cm !important;
+ --width: 80% !important;
+ --border-radius: 0.4cm;
+}
+
+.calendar-modal {
+ --height: 15cm !important;
+ --width: 88% !important;
+ --border-radius: 0.4cm;
+
+ // height: 544px !important;
+ // width: 332px !important;
+}
+
+
+.monthview-datetable {
+ *{
+ font-size: 12px !important;
+ font-weight: normal !important;
+ }
+
+ thead th {
+ border:none !important;
+ color:#888;
+ }
+ tbody td{
+ border:none !important;
+ line-height: 40px !important;
+ background: none !important;
+ padding: 0 !important;
+
+ &.text-muted {
+ visibility: hidden;
+ }
+
+ &.monthview-selected {
+ color: black;
+ }
+
+ &.monthview-selected.present,
+ &.present {
+ color:#fff !important;
+ &:before {
+ background-color: #22c6b3 !important;
+ }
+ }
+
+ &.monthview-selected.absent,
+ &.absent {
+ color:#fff !important;
+ &:before {
+ background-color:#1a586d !important;
+ }
+ }
+
+ &.monthview-selected.dayoff,
+ &.dayoff {
+ color:#555 !important;
+ &:before {
+ background-color:#e5e5e5 !important;
+ }
+ }
+
+ &.monthview-selected.scheduleDay,
+ &.scheduleDay {
+ color: #000 !important;
+ &:before {
+ background-color: #fff !important;
+ border: 1px solid #ccc !important;
+ }
+ }
+
+ &:before {
+ content: "";
+ width: 40px;
+ height: 40px;
+ display: block;
+ border-radius: 100px;
+ text-align: center;
+ margin: 9px auto -40px;
+ }
+ }
+}
+
+.table-bordered{
+ border:none !important;
+}
+// .monthview-primary-with-event::after, .absent::after, .present::after, .dayoff::after {
+// content: " ";
+// width: 80%;
+// height: 3px;
+// background: #77cfb8;
+// position: absolute;
+// bottom: 0;
+// left: 0;
+// right: 0;
+// margin: auto;
+// height: 100%;
+// color: #fff;
+// z-index: -1;
+// border-radius: 50%;
+// }
+// .absent::after{
+// background: #094875;
+// }
+
+// .present::after{
+// background: #77cfb8;
+// }
+// .dayoff::after{
+// background: gray;
+// }
+
+
+[dir=ltr] .monthview-container .swiper-slide,
+
+[dir=rtl] .monthview-container .swiper-slide {
+
+ margin: 0 !important;
+
+}
+
+
+
+table.monthview-datetable th small {
+
+ font-size: 60%;
+
+}
+
.modal-wrapper{
border-radius: 20px !important;
}