completed my-team except attendance one

MOHEMM-Q3-DEV-LATEST
umasoodch 6 years ago
parent 93e59d2618
commit 7406d6f990

@ -1107,6 +1107,7 @@ public getMonthNameAr(value: number): string {
this.nav.navigateForward(['/eit/homepage']); this.nav.navigateForward(['/eit/homepage']);
} }
public openMyTeamPage() { public openMyTeamPage() {
console.log('someeeeeeee');
this.nav.navigateForward(['/my-team/home']); this.nav.navigateForward(['/my-team/home']);
} }
public openMyTeamDetailPage() { public openMyTeamDetailPage() {

@ -36,6 +36,10 @@
border-radius: 80px; border-radius: 80px;
border: 1px solid #ccc; border: 1px solid #ccc;
margin: 0px auto 6px; margin: 0px auto 6px;
img {
width: 100%;
max-height: 100%;
}
} }
.employee-name{ .employee-name{

@ -1,7 +1,7 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar-new"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons> <nav-buttons (backClick)="goback()" [navigate]="false"></nav-buttons>
</ion-buttons> </ion-buttons>
<ion-title>EMPLOYEE DETAIL</ion-title> <ion-title>EMPLOYEE DETAIL</ion-title>
</ion-toolbar> </ion-toolbar>
@ -13,11 +13,11 @@
<div class="user-info"> <div class="user-info">
<div class="user-image-container present"> <div class="user-image-container present">
<div class="user-image"> <div class="user-image">
<img [src]="userImage" alt="Team Member Image"/> <img [src]="employee.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+employee.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" alt="Team Member Image"/>
</div> </div>
</div> </div>
<h1>Rohit Shety</h1> <h1>{{employee.EMPLOYEE_NAME}}</h1>
<span>Graphic Designer</span> <span>{{employee.JOB_NAME}}</span>
</div> </div>
<div class="user-actions"> <div class="user-actions">
<ion-row class="ion-justify-content-center"> <ion-row class="ion-justify-content-center">
@ -29,7 +29,7 @@
<span>Call</span> <span>Call</span>
</div> </div>
</ion-col> </ion-col>
<ion-col [size]="4"> <ion-col [size]="4" (click)="getMenuEntries(employee)">
<div class="action-button col-button"> <div class="action-button col-button">
<span class="action-button-icon"> <span class="action-button-icon">
<img src="../assets/imgs/create_request_icon.png"> <img src="../assets/imgs/create_request_icon.png">
@ -37,7 +37,7 @@
<span>Create Request</span> <span>Create Request</span>
</div> </div>
</ion-col> </ion-col>
<ion-col [size]="4"> <ion-col [size]="4" style="opacity:0.3;">
<div class="action-button col-button"> <div class="action-button col-button">
<span class="action-button-icon"> <span class="action-button-icon">
<img src="../assets/imgs/message_icon.png"> <img src="../assets/imgs/message_icon.png">
@ -71,6 +71,66 @@
</ion-segment> </ion-segment>
</div> </div>
<div *ngIf="activeSegment === 'Team Members'">
<ion-row class="filters-row">
<ion-slides [options]="slideOptsOne">
<ion-slide *ngFor="let filter of filters; let i=index">
<app-card-filter
[value]="filter.value"
[text]="filter.name"
[color]="filter.color"
[active]="filter.active"
(click)="activeFilter(i)"
></app-card-filter>
</ion-slide>
</ion-slides>
</ion-row>
<div style="margin-top: 15px;background: white;border-radius: 100px;overflow: hidden;">
<ion-row no-padding>
<ion-col [size]="3" class="search-dropdown" no-padding>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)">
<ion-select-option value="Name" selected="true">{{ts.trPK('searchForReplacment','name')}}</ion-select-option>
<ion-select-option value="User Name">{{ts.trPK('searchForReplacment','userName')}} </ion-select-option>
<ion-select-option value="Email">{{ts.trPK('searchForReplacment','email')}} </ion-select-option>
</ion-select>
</ion-col>
<ion-col [size]="7" class="input-container" no-padding>
<ion-input *ngIf="showEmailInput" placeholder="Employee Email" [(ngModel)]="searchEmail" pattern="email"></ion-input>
<ion-input *ngIf="showUserNameOrNameInput" placeholder="Search" [(ngModel)]="searchNameOrUserName"></ion-input>
</ion-col>
<ion-col [size]="2" style="background: #ccc;text-align: center;" no-padding (click)="searchEmployeeTwo()">
<ion-icon style="margin-top: 10px;font-size: 20px;" class="search-icons" color="light" name="search"></ion-icon>
</ion-col>
</ion-row>
</div>
<div *ngIf="isSearch">
<ion-row class="search-container">
<ion-col style="float: left;" size=[6] (click)="clearSearchTwo()">
<span style="margin-left: 5px;">Clear Search</span>
<ion-icon name="close" ></ion-icon>
</ion-col>
</ion-row>
</div>
<ng-container *ngFor="let subordinate of empSubordinate;let i=index">
<app-employee-information
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
checkIn="08:15"
checkOut="-"
(click)="getDetails(i)">
</app-employee-information>
</ng-container>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</div>
<div class="employee-information-indetail" *ngIf="activeSegment === 'About'"> <div class="employee-information-indetail" *ngIf="activeSegment === 'About'">
<ion-row> <ion-row>
<ion-col [size]="6" style="border-right: 1px solid #ccc;"> <ion-col [size]="6" style="border-right: 1px solid #ccc;">
@ -109,7 +169,7 @@
<h2>Position</h2> <h2>Position</h2>
<p>{{employee.POSITION_NAME}}</p> <p>{{employee.POSITION_NAME}}</p>
</ion-col> </ion-col>
<ion-col [size]="12"> <ion-col [size]="12" style="border-bottom: none;">
<h2>Grade</h2> <h2>Grade</h2>
<p>{{employee.GRADE_NAME}}</p> <p>{{employee.GRADE_NAME}}</p>
</ion-col> </ion-col>
@ -117,8 +177,5 @@
</div> </div>
</div> </div>
<!-- <ion-infinite-scroll *ngIf="selectedFilter === 'ALL'" (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> -->
</ion-content> </ion-content>

@ -111,6 +111,7 @@ ion-title{
background: white; background: white;
margin-top: 15px; margin-top: 15px;
border-radius: 20px; border-radius: 20px;
margin-bottom: 15px;
ion-col{ ion-col{
padding: 15px; padding: 15px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
@ -159,3 +160,52 @@ ion-title{
border-bottom: 1px solid #ccc; 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;
}
}
}

@ -20,18 +20,59 @@ export class DetailsComponent implements OnInit {
public activeSegment = 'About'; public activeSegment = 'About';
pageNum = 1; pageNum = 1;
pageLimit = 50; pageLimit = 50;
modalFlag: any = false;
empSubordinate: any; empSubordinate: any;
employee: any; employee: any;
IsReachEnd = false; isReachEnd = false;
searchKey: any; searchKey: any;
public searchKeySelect: any; public isSearch = false;
public searchKeySelect = 'Name';
public getEmployeeSubordinatesRequestObject: any;
infiniteRequest: any; infiniteRequest: any;
isSpecialist = false; isSpecialist = false;
selMenu: MenuResponse = new MenuResponse(); selMenu: MenuResponse = new MenuResponse();
public opendEmployees: any = []; public opendEmployees: any = [];
public headerTitle = ''; public headerTitle = '';
public userImage: any = '../assets/imgs/profile.png'; public userImage: any = '../assets/imgs/profile.png';
public 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( constructor(
public menuService: MenuService, public menuService: MenuService,
public common: CommonService, public common: CommonService,
@ -47,11 +88,12 @@ export class DetailsComponent implements OnInit {
} }
public segmentChanged(event: any) { public segmentChanged(event: any) {
console.log(event);
this.activeSegment = event.detail.value; this.activeSegment = event.detail.value;
} }
intializeMemberDetail(userID?) { intializeMemberDetail(userID?) {
this.empSubordinate = [];
this.activeSegment = 'About';
this.pageLimit = 50; this.pageLimit = 50;
this.pageNum = 1; this.pageNum = 1;
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
@ -60,14 +102,9 @@ export class DetailsComponent implements OnInit {
this.opendEmployees.push(this.employee); this.opendEmployees.push(this.employee);
this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR); this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
} }
this.selMenu = this.common.sharedService.getSharedData( this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
MenuResponse.SHARED_DATA,
false
);
this.headerTitle = this.selMenu.List_Menu.MENU_NAME; this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false; this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false;
if (this.employee) { if (this.employee) {
this.getEmpSubordinate(userID); this.getEmpSubordinate(userID);
} }
@ -76,11 +113,12 @@ export class DetailsComponent implements OnInit {
goback() { goback() {
const user = this.authService.getAuthenticatedUser(); const user = this.authService.getAuthenticatedUser();
if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length === 1) {
this.opendEmployees = []; this.opendEmployees = [];
this.common.openMyTeamPage(); this.common.openMyTeamPage();
} else { } else {
for (let i = 0; i < this.opendEmployees.length; i++){ // tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.opendEmployees.length; i++) {
if (this.opendEmployees[i].EMPLOYEE_NUMBER === this.employee.SUPERVISOR_NUMBER) { if (this.opendEmployees[i].EMPLOYEE_NUMBER === this.employee.SUPERVISOR_NUMBER) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.opendEmployees[i], this.opendEmployees[i],
@ -93,47 +131,30 @@ export class DetailsComponent implements OnInit {
} }
} }
searchEmployeeTwo() {
console.log('umar 1999');
this.isSearch = true;
this.empSubordinate = [];
this.getEmpSubordinate('');
}
clearSearchTwo() {
this.isSearch = false;
this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
this.empSubordinate = [];
this.isReachEnd = false;
this.searchNameOrUserName = '';
this.searchEmail = '';
this.getEmpSubordinate('');
}
getEmpSubordinate(userID) { getEmpSubordinate(userID) {
this.modalFlag = this.employee.isModal;
let selEmpNo: string = null; let selEmpNo: string = null;
this.pageNum = 1; this.pageNum = 1;
this.IsReachEnd = false; this.isReachEnd = false;
let searchEmpNum = ''; const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : '';
let searchEmpName = ''; const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : '';
let searchEmpEmail = ''; const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : '';
if (this.searchKey) {
switch (this.searchKeySelect) {
case '1': {
searchEmpName = this.searchKey;
searchEmpNum = '';
searchEmpEmail = '';
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 (userID) { if (userID) {
selEmpNo = userID; selEmpNo = userID;
} else { } else {
@ -147,83 +168,64 @@ export class DetailsComponent implements OnInit {
P_PAGE_NUM: this.pageNum, P_PAGE_NUM: this.pageNum,
P_PAGE_LIMIT: this.pageLimit P_PAGE_LIMIT: this.pageLimit
}; };
this.infiniteRequest = body; this.getEmployeeSubordinatesRequestObject = body;
this.myTeamService this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
.getEmployeeSubordinates(body) console.log('one');
.subscribe((result: any) => { if (this.common.validResponse(result)) {
this.handleEmpResult(result); this.handleEmpResult(result.GetEmployeeSubordinatesList);
}); }
});
} }
handleEmpResult(result) { handleEmpResult(result) {
if (this.common.validResponse(result)) { const lastItemIndex = result.length - 1;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { const lastItem = result[lastItemIndex];
this.empSubordinate = result.GetEmployeeSubordinatesList; if (lastItem) {
this.infiniteRequest.P_PAGE_NUM = this.pageNum++; if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
const lastItemIndex = this.empSubordinate.length - 1; this.isReachEnd = true;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) { if (this.infiniteScroll) {
const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; this.infiniteScroll.complete();
if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
} }
} else { } else {
this.empSubordinate = []; this.isReachEnd = false;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
} }
} }
} if (this.common.hasData(result)) {
doInfinite(infiniteScroll) { this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++;
if (!this.IsReachEnd && this.infiniteRequest) { if (this.empSubordinate.length === 0) {
this.myTeamService this.empSubordinate = result;
.getEmployeeSubordinates(this.infiniteRequest) } else {
.subscribe( this.empSubordinate = this.empSubordinate.concat(result);
(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);
});
} else {
this.IsReachEnd = true;
}
}
if (infiniteScroll) { this.infiniteScroll.complete(); }
},
Error => console.log(Error),
() => this.infiniteScroll.complete()
);
} else { } 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) { getDetails(index) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
this.empSubordinate[index],
MyTeamService.EMPLOYEE_SHARED_DATA
);
this.intializeMemberDetail(); this.intializeMemberDetail();
} }
async presentModal() {
const modal = await this.modalController.create({
component: DetailsComponent,
keyboardClose: true,
animated: false
});
const dismissed = modal.onDidDismiss();
dismissed.then(() => {
this.modalFlag = false;
});
return await modal.present();
}
getMenuEntries(item) { getMenuEntries(item) {
let selEmpNo = null; let selEmpNo = null;
const respID: any = -999; const respID: any = -999;
@ -261,19 +263,11 @@ export class DetailsComponent implements OnInit {
} }
sortMenuEntires(list) { sortMenuEntires(list) {
this.close().then(() => {
});
const tree = this.common.list_to_tree(list); const tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, 'menuEntries'); this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.openEITPage(); this.common.openEITPage();
} }
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
goToSubordinate() { goToSubordinate() {
this.selMenu.search = true; this.selMenu.search = true;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
@ -283,9 +277,14 @@ export class DetailsComponent implements OnInit {
this.common.openMyTeamPage(); this.common.openMyTeamPage();
} }
dismiss() {
this.modalController.dismiss({ showSelectedField(value: any) {
dismissed: true 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;
}
} }
} }

@ -16,7 +16,7 @@ export class HomeComponent implements OnInit {
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
public pageNum = 1; public pageNum = 1;
public pageLimit = 5; public pageLimit = 50;
public empSubordinate = []; public empSubordinate = [];
public employee: any; public employee: any;
public isReachEnd = false; public isReachEnd = false;
@ -157,10 +157,14 @@ export class HomeComponent implements OnInit {
if (lastItem) { if (lastItem) {
if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) { if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
this.isReachEnd = true; this.isReachEnd = true;
this.infiniteScroll.complete(); if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
} else { } else {
this.isReachEnd = false; this.isReachEnd = false;
this.infiniteScroll.complete(); if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
} }
} }
if (this.common.hasData(result)) { if (this.common.hasData(result)) {
@ -203,7 +207,7 @@ export class HomeComponent implements OnInit {
getDetails(index) { getDetails(index) {
this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA); this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA); this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA);
this.common.openMyTeamDetailPage(); this.common.openMyTeamDetails();
} }
goToSubordinate() { goToSubordinate() {

Loading…
Cancel
Save