|
|
|
@ -49,6 +49,12 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
arr = [];
|
|
|
|
arr = [];
|
|
|
|
favoriteUserList: any = [];
|
|
|
|
favoriteUserList: any = [];
|
|
|
|
isFilter = true;
|
|
|
|
isFilter = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slideOptsOne = {
|
|
|
|
|
|
|
|
slidesPerView: 6,
|
|
|
|
|
|
|
|
spaceBetween: 5
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
|
|
|
|
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
@ -433,7 +439,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
selectedType;
|
|
|
|
selectedType;
|
|
|
|
counter=0;
|
|
|
|
counter = 0;
|
|
|
|
onChangeSelect(select) {
|
|
|
|
onChangeSelect(select) {
|
|
|
|
let selectValue = select.detail.value;
|
|
|
|
let selectValue = select.detail.value;
|
|
|
|
|
|
|
|
|
|
|
|
@ -442,12 +448,11 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
this.isFilter = true;
|
|
|
|
this.isFilter = true;
|
|
|
|
this.selectedType = 1;
|
|
|
|
this.selectedType = 1;
|
|
|
|
this.listOfRealted = this.actionHistory;
|
|
|
|
this.listOfRealted = this.actionHistory;
|
|
|
|
if(this.counter > 0)
|
|
|
|
if (this.counter > 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
this.actionHistory.forEach((obj, i) => {
|
|
|
|
this.actionHistory.forEach((obj, i) => {
|
|
|
|
if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) {
|
|
|
|
if (this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) {
|
|
|
|
this.actionHistory[i].IsFavorite = true;
|
|
|
|
this.actionHistory[i].IsFavorite = true;
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
this.actionHistory[i].IsFavorite = false;
|
|
|
|
this.actionHistory[i].IsFavorite = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -496,20 +501,46 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
this.ts.trPK('replacementRoll', 'searchbyemail');
|
|
|
|
this.ts.trPK('replacementRoll', 'searchbyemail');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
favLetter = [];
|
|
|
|
|
|
|
|
favIsActive = [];
|
|
|
|
|
|
|
|
|
|
|
|
getFavruite() {
|
|
|
|
getFavruite() {
|
|
|
|
this.cs.startLoading();
|
|
|
|
this.cs.startLoading();
|
|
|
|
this.worklistService.getFavorite({}, () => {
|
|
|
|
this.worklistService.getFavoriteWithoutImage({}, () => {
|
|
|
|
|
|
|
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
}).subscribe((result) => {
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
this.listOfFav = this.favoriteUserList;
|
|
|
|
|
|
|
|
this.favoriteUserList.forEach((obj) => {
|
|
|
|
this.favoriteUserList.forEach((obj) => {
|
|
|
|
obj.IsFavorite = true;
|
|
|
|
obj.IsFavorite = true;
|
|
|
|
|
|
|
|
this.favLetter.push(obj.EMPLOYEE_DISPLAY_NAME.charAt(0).toUpperCase());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.favLetter = this.favLetter.filter((elem, index, self) => {
|
|
|
|
|
|
|
|
return index === self.indexOf(elem);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.favLetter.forEach((obj, index) => {
|
|
|
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
|
|
|
this.selectedLetter(obj);
|
|
|
|
|
|
|
|
this.favIsActive.push(true);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.favIsActive.push(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log(this.favLetter);
|
|
|
|
|
|
|
|
console.log(this.favIsActive);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// this.worklistService.getFavorite({}, () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }).subscribe((result) => {
|
|
|
|
|
|
|
|
// if (this.cs.validResponse(result)) {
|
|
|
|
|
|
|
|
// this.cs.stopLoading();
|
|
|
|
|
|
|
|
// this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
|
|
|
// this.listOfFav = this.favoriteUserList;
|
|
|
|
|
|
|
|
// this.favoriteUserList.forEach((obj) => {
|
|
|
|
|
|
|
|
// obj.IsFavorite = true;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
saveUserFavruiteList(request, isFav: boolean) {
|
|
|
|
saveUserFavruiteList(request, isFav: boolean) {
|
|
|
|
@ -586,6 +617,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
listOfRealted: any = [];
|
|
|
|
listOfRealted: any = [];
|
|
|
|
listOfFav: any = [];
|
|
|
|
listOfFav: any = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
filterList(event) {
|
|
|
|
filterList(event) {
|
|
|
|
const val = event.target.value;
|
|
|
|
const val = event.target.value;
|
|
|
|
if (this.selectedType === 1) {
|
|
|
|
if (this.selectedType === 1) {
|
|
|
|
@ -608,4 +640,29 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedLetter(el) {
|
|
|
|
|
|
|
|
this.favLetter.forEach((letter, index) => {
|
|
|
|
|
|
|
|
if (letter === el) {
|
|
|
|
|
|
|
|
this.favIsActive[index] = true;
|
|
|
|
|
|
|
|
this.worklistService.getFavoriteByLetter(letter,() => {
|
|
|
|
|
|
|
|
}).subscribe((result) => {
|
|
|
|
|
|
|
|
if (this.cs.validResponse(result)) {
|
|
|
|
|
|
|
|
this.cs.stopLoading();
|
|
|
|
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
|
|
|
|
this.listOfFav = this.favoriteUserList;
|
|
|
|
|
|
|
|
this.favoriteUserList.forEach((obj) => {
|
|
|
|
|
|
|
|
obj.IsFavorite = true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.favIsActive[index] = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
returnIsActiveFunction(i) {
|
|
|
|
|
|
|
|
return this.favIsActive[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|