|
|
|
|
@ -47,6 +47,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
userSelected: boolean;
|
|
|
|
|
actionHistory: [] = [];
|
|
|
|
|
favoriteUserList: [] = [];
|
|
|
|
|
isFilter = true;
|
|
|
|
|
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
|
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
|
@ -408,16 +409,29 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
closeModal() {
|
|
|
|
|
this.modalCtrl.dismiss();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectedType;
|
|
|
|
|
onChangeSelect(select) {
|
|
|
|
|
console.log(select.detail.value);
|
|
|
|
|
let selectValue = select.detail.value;
|
|
|
|
|
|
|
|
|
|
if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
|
|
|
|
|
if (selectValue == '1') {
|
|
|
|
|
this.isSelect = true;
|
|
|
|
|
this.isFilter = true;
|
|
|
|
|
this.selectedType = 1;
|
|
|
|
|
this.listOfRealted = this.actionHistory;
|
|
|
|
|
} else if(selectValue === '4'){
|
|
|
|
|
this.getFavruite();
|
|
|
|
|
this.isFilter = true;
|
|
|
|
|
this.selectedType = 4;
|
|
|
|
|
} else if( selectValue === '2' || selectValue === '3'){
|
|
|
|
|
this.isSelect = true;
|
|
|
|
|
} if(selectValue === '4'){this.getFavruite();}
|
|
|
|
|
this.isFilter = false;
|
|
|
|
|
this.selectedType = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.isSelect = false;
|
|
|
|
|
|
|
|
|
|
this.selectedType = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -450,6 +464,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
this.listOfFav = this.favoriteUserList;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
@ -518,4 +533,30 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
listOfRealted: any = [];
|
|
|
|
|
listOfFav: any = [];
|
|
|
|
|
|
|
|
|
|
filterList(event){
|
|
|
|
|
const val = event.target.value;
|
|
|
|
|
if(this.selectedType === 1){
|
|
|
|
|
if(val === '') {
|
|
|
|
|
this.actionHistory = this.listOfRealted;
|
|
|
|
|
} else {
|
|
|
|
|
this.actionHistory = this.listOfRealted.filter((item) => {
|
|
|
|
|
return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else if(this.selectedType === 4) {
|
|
|
|
|
if(val === '') {
|
|
|
|
|
this.favoriteUserList = this.listOfFav;
|
|
|
|
|
} else {
|
|
|
|
|
this.favoriteUserList = this.listOfFav.filter((item) => {
|
|
|
|
|
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|