completed my-team except attendance one

myteam
umasoodch 6 years ago
parent 93e59d2618
commit 7406d6f990

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

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

@ -1,7 +1,7 @@
<ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons>
<nav-buttons (backClick)="goback()" [navigate]="false"></nav-buttons>
</ion-buttons>
<ion-title>EMPLOYEE DETAIL</ion-title>
</ion-toolbar>
@ -13,11 +13,11 @@
<div class="user-info">
<div class="user-image-container present">
<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>
<h1>Rohit Shety</h1>
<span>Graphic Designer</span>
<h1>{{employee.EMPLOYEE_NAME}}</h1>
<span>{{employee.JOB_NAME}}</span>
</div>
<div class="user-actions">
<ion-row class="ion-justify-content-center">
@ -29,7 +29,7 @@
<span>Call</span>
</div>
</ion-col>
<ion-col [size]="4">
<ion-col [size]="4" (click)="getMenuEntries(employee)">
<div class="action-button col-button">
<span class="action-button-icon">
<img src="../assets/imgs/create_request_icon.png">
@ -37,7 +37,7 @@
<span>Create Request</span>
</div>
</ion-col>
<ion-col [size]="4">
<ion-col [size]="4" style="opacity:0.3;">
<div class="action-button col-button">
<span class="action-button-icon">
<img src="../assets/imgs/message_icon.png">
@ -71,6 +71,66 @@
</ion-segment>
</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'">
<ion-row>
<ion-col [size]="6" style="border-right: 1px solid #ccc;">
@ -109,7 +169,7 @@
<h2>Position</h2>
<p>{{employee.POSITION_NAME}}</p>
</ion-col>
<ion-col [size]="12">
<ion-col [size]="12" style="border-bottom: none;">
<h2>Grade</h2>
<p>{{employee.GRADE_NAME}}</p>
</ion-col>
@ -117,8 +177,5 @@
</div>
</div>
<!-- <ion-infinite-scroll *ngIf="selectedFilter === 'ALL'" (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> -->
</ion-content>

@ -111,6 +111,7 @@ ion-title{
background: white;
margin-top: 15px;
border-radius: 20px;
margin-bottom: 15px;
ion-col{
padding: 15px;
border-bottom: 1px solid #ccc;
@ -159,3 +160,52 @@ ion-title{
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';
pageNum = 1;
pageLimit = 50;
modalFlag: any = false;
empSubordinate: any;
employee: any;
IsReachEnd = false;
isReachEnd = false;
searchKey: any;
public searchKeySelect: any;
public isSearch = false;
public searchKeySelect = 'Name';
public getEmployeeSubordinatesRequestObject: any;
infiniteRequest: any;
isSpecialist = false;
selMenu: MenuResponse = new MenuResponse();
public opendEmployees: any = [];
public headerTitle = '';
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(
public menuService: MenuService,
public common: CommonService,
@ -47,11 +88,12 @@ export class DetailsComponent implements OnInit {
}
public segmentChanged(event: any) {
console.log(event);
this.activeSegment = event.detail.value;
}
intializeMemberDetail(userID?) {
this.empSubordinate = [];
this.activeSegment = 'About';
this.pageLimit = 50;
this.pageNum = 1;
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.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
}
this.selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
false
);
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);
}
@ -76,11 +113,12 @@ export class DetailsComponent implements OnInit {
goback() {
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.common.openMyTeamPage();
} 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) {
this.common.sharedService.setSharedData(
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) {
this.modalFlag = this.employee.isModal;
let selEmpNo: string = null;
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 = '';
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 = '';
}
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 : '';
if (userID) {
selEmpNo = userID;
} else {
@ -147,83 +168,64 @@ export class DetailsComponent 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) => {
console.log('one');
if (this.common.validResponse(result)) {
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 = this.pageNum++;
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.empSubordinate = [];
this.isReachEnd = false;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
}
}
}
doInfinite(infiniteScroll) {
if (!this.IsReachEnd && this.infiniteRequest) {
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);
});
} else {
this.IsReachEnd = true;
}
}
if (infiniteScroll) { this.infiniteScroll.complete(); }
},
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.common.sharedService.setSharedData(
this.empSubordinate[index],
MyTeamService.EMPLOYEE_SHARED_DATA
);
this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
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) {
let selEmpNo = null;
const respID: any = -999;
@ -261,19 +263,11 @@ export class DetailsComponent implements OnInit {
}
sortMenuEntires(list) {
this.close().then(() => {
});
const tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.openEITPage();
}
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
goToSubordinate() {
this.selMenu.search = true;
this.common.sharedService.setSharedData(
@ -283,9 +277,14 @@ export class DetailsComponent implements OnInit {
this.common.openMyTeamPage();
}
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;
}
}
}

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

Loading…
Cancel
Save