|
|
|
|
@ -89,6 +89,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public showEmailInput = false;
|
|
|
|
|
public showUserNameOrNameInput = true;
|
|
|
|
|
public showUserNameInput = false;
|
|
|
|
|
arrList: any[];
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
@ -133,10 +134,33 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchEmployee() {
|
|
|
|
|
this.isSearch = true;
|
|
|
|
|
this.empSubordinate = [];
|
|
|
|
|
this.getEmpSubordinate();
|
|
|
|
|
searchEmployee(event) {
|
|
|
|
|
// this.isSearch = true;
|
|
|
|
|
// this.empSubordinate = [];
|
|
|
|
|
// this.getEmpSubordinate();
|
|
|
|
|
const val = event.target.value;
|
|
|
|
|
console.log(this.searchKeySelect)
|
|
|
|
|
if (val === '') {
|
|
|
|
|
this.empSubordinate = this.arrList;
|
|
|
|
|
this.isSearch = false;
|
|
|
|
|
}
|
|
|
|
|
if(this.searchKeySelect === 'Name'){
|
|
|
|
|
this.empSubordinate = this.arrList.filter((item) => {
|
|
|
|
|
this.isSearch = true;
|
|
|
|
|
return (item.EMPLOYEE_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
} else if(this.searchKeySelect === 'User Name'){
|
|
|
|
|
this.empSubordinate = this.arrList.filter((item) => {
|
|
|
|
|
this.isSearch = true;
|
|
|
|
|
return (item.EMPLOYEE_NUMBER.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
} else if(this.searchKeySelect === 'Email'){
|
|
|
|
|
this.empSubordinate = this.arrList.filter((item) => {
|
|
|
|
|
this.isSearch = true;
|
|
|
|
|
return (item.EMPLOYEE_EMAIL_ADDRESS.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getEmpSubordinate() {
|
|
|
|
|
@ -199,6 +223,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
} else {
|
|
|
|
|
this.empSubordinate = [];
|
|
|
|
|
}
|
|
|
|
|
this.arrList = this.empSubordinate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doInfinite(infiniteScroll) {
|
|
|
|
|
@ -218,13 +243,18 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
clearSearch() {
|
|
|
|
|
this.isSearch = false;
|
|
|
|
|
this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
|
|
|
|
|
this.empSubordinate = [];
|
|
|
|
|
this.isReachEnd = false;
|
|
|
|
|
this.empSubordinate = this.arrList;
|
|
|
|
|
this.searchNameOrUserName = '';
|
|
|
|
|
this.searchUserName = '';
|
|
|
|
|
this.searchEmail = '';
|
|
|
|
|
this.getEmpSubordinate();
|
|
|
|
|
// this.isSearch = false;
|
|
|
|
|
// this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
|
|
|
|
|
// this.empSubordinate = [];
|
|
|
|
|
// this.isReachEnd = false;
|
|
|
|
|
// this.searchNameOrUserName = '';
|
|
|
|
|
// this.searchUserName = '';
|
|
|
|
|
// this.searchEmail = '';
|
|
|
|
|
// this.getEmpSubordinate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDetails(index) {
|
|
|
|
|
@ -274,4 +304,13 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
// this.EmpTotal = result.GetSubordinatesAttdStatusList[0].NUMBER_OF_EMPLOYEES;
|
|
|
|
|
// console.log("total no "+this.EmpTotal)
|
|
|
|
|
// }
|
|
|
|
|
filterList(event) {
|
|
|
|
|
const val = event.target.value;
|
|
|
|
|
if (val === '') {
|
|
|
|
|
this.arrList = this.empSubordinate;
|
|
|
|
|
}
|
|
|
|
|
this.arrList = this.empSubordinate.filter((item) => {
|
|
|
|
|
return (item.title_EN.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|