|
|
|
@ -53,26 +53,26 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
this.P_PAGE_NUM = 1;
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
this.P_PAGE_LIMIT = 50;
|
|
|
|
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
|
|
|
|
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
|
|
|
|
console.log(this.getPassActionMode);
|
|
|
|
|
|
|
|
// this.getFavruite();
|
|
|
|
// this.getFavruite();
|
|
|
|
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
|
|
|
|
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
|
|
|
|
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
|
|
|
|
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
|
|
|
|
console.log(this.getpassResAttr);
|
|
|
|
|
|
|
|
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
|
|
|
|
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
|
|
|
|
|
|
|
|
|
|
|
|
// tslint:disable-next-line: max-line-length
|
|
|
|
// tslint:disable-next-line: max-line-length
|
|
|
|
this.arr = this.cs.sharedService.getSharedData('actionHistoryData', false) ? this.cs.sharedService.getSharedData('actionHistoryData', false) : [];
|
|
|
|
this.arr = this.cs.sharedService.getSharedData('actionHistoryData', false) ? this.cs.sharedService.getSharedData('actionHistoryData', false) : [];
|
|
|
|
var lookupObject = {};
|
|
|
|
var lookupObject = {};
|
|
|
|
|
|
|
|
|
|
|
|
for(var i in this.arr) {
|
|
|
|
// tslint:disable-next-line: forin
|
|
|
|
|
|
|
|
for (var i in this.arr) {
|
|
|
|
lookupObject[this.arr[i]['USER_NAME']] = this.arr[i];
|
|
|
|
lookupObject[this.arr[i]['USER_NAME']] = this.arr[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// tslint:disable-next-line: forin
|
|
|
|
|
|
|
|
for (i in lookupObject) {
|
|
|
|
|
|
|
|
this.actionHistory.push(lookupObject[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for(i in lookupObject) {
|
|
|
|
|
|
|
|
this.actionHistory.push(lookupObject[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.actionHistory);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.getPassActionMode === 'ANSWER_INFO') {
|
|
|
|
if (this.getPassActionMode === 'ANSWER_INFO') {
|
|
|
|
this.isAnswer = true;
|
|
|
|
this.isAnswer = true;
|
|
|
|
@ -214,7 +214,6 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select(selectEmp, index) {
|
|
|
|
select(selectEmp, index) {
|
|
|
|
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
|
|
|
|
|
|
|
|
this.selEmp = selectEmp
|
|
|
|
this.selEmp = selectEmp
|
|
|
|
this.active = index;
|
|
|
|
this.active = index;
|
|
|
|
this.userSelected = true;
|
|
|
|
this.userSelected = true;
|
|
|
|
@ -251,11 +250,7 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
if (this.selEmp && this.isAnswer == false) {
|
|
|
|
if (this.selEmp && this.isAnswer == false) {
|
|
|
|
// this.selectedUserInf = this.ReplacementList[this.selEmp];
|
|
|
|
// this.selectedUserInf = this.ReplacementList[this.selEmp];
|
|
|
|
this.selectedUserInf = this.selEmp;
|
|
|
|
this.selectedUserInf = this.selEmp;
|
|
|
|
console.log("selEmp " + this.selEmp.USER_NAME);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
|
|
|
|
if (this.selectedUserInf && this.selectedUserInf.USER_NAME) {
|
|
|
|
|
|
|
|
|
|
|
|
console.log("userInfo " + this.selectedUserInf.USER_NAME);
|
|
|
|
|
|
|
|
if (this.userNote) {
|
|
|
|
if (this.userNote) {
|
|
|
|
|
|
|
|
|
|
|
|
if (this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD") {
|
|
|
|
if (this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD") {
|
|
|
|
@ -267,7 +262,6 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote;
|
|
|
|
this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote;
|
|
|
|
|
|
|
|
|
|
|
|
this.P_RESPOND_ATTRIBUTES_TBL = this.getpassResAttr;
|
|
|
|
this.P_RESPOND_ATTRIBUTES_TBL = this.getpassResAttr;
|
|
|
|
console.log(this.P_RESPOND_ATTRIBUTES_TBL);
|
|
|
|
|
|
|
|
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
|
|
|
|
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME;
|
|
|
|
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
|
|
|
|
this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode;
|
|
|
|
this.WorkListActionObj.P_COMMENTS = ""// response Attr
|
|
|
|
this.WorkListActionObj.P_COMMENTS = ""// response Attr
|
|
|
|
@ -353,8 +347,9 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
'dismissed': true,
|
|
|
|
'dismissed': true,
|
|
|
|
data: "Success"
|
|
|
|
data: "Success"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (this.selEmp && this.isAnswer == false)
|
|
|
|
if (this.selEmp && this.isAnswer == false) {
|
|
|
|
this.setFavorite(this.selEmp);
|
|
|
|
this.setFavorite(this.selEmp);
|
|
|
|
|
|
|
|
}
|
|
|
|
}, 5000);
|
|
|
|
}, 5000);
|
|
|
|
|
|
|
|
|
|
|
|
this.cs.openNotificationPage();
|
|
|
|
this.cs.openNotificationPage();
|
|
|
|
@ -416,15 +411,16 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//this.P_PAGE_NUM++;
|
|
|
|
//this.P_PAGE_NUM++;
|
|
|
|
if (infiniteScroll)
|
|
|
|
if (infiniteScroll) {
|
|
|
|
infiniteScroll.target.complete();
|
|
|
|
infiniteScroll.target.complete();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(resFlag);
|
|
|
|
|
|
|
|
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
|
|
|
|
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (infiniteScroll)
|
|
|
|
if (infiniteScroll) {
|
|
|
|
infiniteScroll.target.complete();
|
|
|
|
infiniteScroll.target.complete();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -438,7 +434,6 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
selectedType;
|
|
|
|
selectedType;
|
|
|
|
onChangeSelect(select) {
|
|
|
|
onChangeSelect(select) {
|
|
|
|
console.log(select.detail.value);
|
|
|
|
|
|
|
|
let selectValue = select.detail.value;
|
|
|
|
let selectValue = select.detail.value;
|
|
|
|
|
|
|
|
|
|
|
|
if (selectValue == '1') {
|
|
|
|
if (selectValue == '1') {
|
|
|
|
@ -446,14 +441,13 @@ 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;
|
|
|
|
} else if(selectValue === '4'){
|
|
|
|
} else if (selectValue === '4') {
|
|
|
|
console.log(this.listOfFav.length)
|
|
|
|
if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) {
|
|
|
|
if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined ) {
|
|
|
|
|
|
|
|
this.getFavruite();
|
|
|
|
this.getFavruite();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.isFilter = true;
|
|
|
|
this.isFilter = true;
|
|
|
|
this.selectedType = 4;
|
|
|
|
this.selectedType = 4;
|
|
|
|
} else if( selectValue === '2' || selectValue === '3' || selectValue === '5'){
|
|
|
|
} else if (selectValue === '2' || selectValue === '3' || selectValue === '5') {
|
|
|
|
this.isSelect = true;
|
|
|
|
this.isSelect = true;
|
|
|
|
this.isFilter = false;
|
|
|
|
this.isFilter = false;
|
|
|
|
this.selectedType = 0;
|
|
|
|
this.selectedType = 0;
|
|
|
|
@ -494,8 +488,20 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
this.cs.stopLoading();
|
|
|
|
this.cs.stopLoading();
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
|
|
|
|
this.listOfFav = this.favoriteUserList;
|
|
|
|
this.listOfFav = this.favoriteUserList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**** THIS CODE TO CHECK STAR OF EMPLOYEE IF THE IT IS IN FAVOORIT LIST AND SHOW IN WORKFLOW LIST****/
|
|
|
|
|
|
|
|
// this.actionHistory.forEach((obj, i) => {
|
|
|
|
|
|
|
|
// if(this.favoriteUserList.some(x => x['USER_NAME'] === obj.USER_NAME)) {
|
|
|
|
|
|
|
|
// this.actionHistory[i].isInFavorite = true;
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.actionHistory[i].isInFavorite = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// console.log(this.actionHistory);
|
|
|
|
|
|
|
|
/**** END ****/
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
saveUserFavruiteList(request) {
|
|
|
|
saveUserFavruiteList(request) {
|
|
|
|
this.worklistService.saveFavoriteList(request, () => {
|
|
|
|
this.worklistService.saveFavoriteList(request, () => {
|
|
|
|
@ -511,80 +517,80 @@ export class WorkListReplacementRollComponent implements OnInit {
|
|
|
|
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
|
|
|
|
selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
|
|
|
|
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
|
|
|
|
selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
|
|
|
|
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
|
|
|
|
selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
|
|
|
|
var confirmBoxhtml = `<div>
|
|
|
|
if (this.favoriteUserList.some(x => x['USER_NAME'] === selEmp.USER_NAME)) {
|
|
|
|
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
|
|
|
|
let confirmBoxhtml = `<div>
|
|
|
|
<br/>
|
|
|
|
<h4>Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list </h4>
|
|
|
|
<br/>
|
|
|
|
<br/>
|
|
|
|
<div class="fav-profileImageDiv"><ion-row>`;
|
|
|
|
<br/>
|
|
|
|
if (selEmp.EMPLOYEE_IMAGE)
|
|
|
|
<div class="fav-profileImageDiv"><ion-row>`;
|
|
|
|
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
|
|
|
|
if (selEmp.EMPLOYEE_IMAGE) {
|
|
|
|
if (!selEmp.EMPLOYEE_IMAGE)
|
|
|
|
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="data:image/png;base64,' + selEmp.EMPLOYEE_IMAGE + '"></div>';
|
|
|
|
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!selEmp.EMPLOYEE_IMAGE) {
|
|
|
|
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
|
|
|
|
confirmBoxhtml += '<div class="img-box"><img class="empImgeRep" src="../assets/imgs/profile.png"></div>';
|
|
|
|
|
|
|
|
}
|
|
|
|
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ion-label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div></ion-row> </div>
|
|
|
|
|
|
|
|
</div>`
|
|
|
|
|
|
|
|
let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
|
|
|
|
|
|
|
|
if (userIndex == -1)
|
|
|
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
|
|
|
confirmBoxhtml
|
|
|
|
|
|
|
|
, () => {
|
|
|
|
|
|
|
|
var request =
|
|
|
|
|
|
|
|
[{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
|
|
|
}, () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
|
|
|
|
|
|
|
|
// this.isSelect = true;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else {
|
|
|
|
|
|
|
|
// this.isSelect = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
confirmBoxhtml += ` <div class="name-box"><ion-label class="fav-employee-details">
|
|
|
|
|
|
|
|
<span>` + selEmp.EMPLOYEE_DISPLAY_NAME + `</span>
|
|
|
|
|
|
|
|
</ion-label>
|
|
|
|
|
|
|
|
</div></ion-row> </div>
|
|
|
|
|
|
|
|
</div>`;
|
|
|
|
|
|
|
|
const userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] === selEmp.USER_NAME)
|
|
|
|
|
|
|
|
if (userIndex === -1) {
|
|
|
|
|
|
|
|
this.cs.presentConfirmDialog(
|
|
|
|
|
|
|
|
confirmBoxhtml
|
|
|
|
|
|
|
|
, () => {
|
|
|
|
|
|
|
|
const request =
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'USER_NAME': selEmp['USER_NAME'],
|
|
|
|
|
|
|
|
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
|
|
|
|
|
|
|
|
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
|
|
|
|
|
|
|
|
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
|
|
|
|
|
|
|
|
'IsFavorite': true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
|
|
|
}, () => { });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
const request =
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
'USER_NAME': selEmp['USER_NAME'],
|
|
|
|
|
|
|
|
'EMPLOYEE_DISPLAY_NAME': selEmp['EMPLOYEE_DISPLAY_NAME'],
|
|
|
|
|
|
|
|
'EMAIL_ADDRESS': selEmp.EMAIL_ADDRESS,
|
|
|
|
|
|
|
|
'EMPLOYEE_IMAGE': selEmp.EMPLOYEE_IMAGE,
|
|
|
|
|
|
|
|
'IsFavorite': false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
this.saveUserFavruiteList(request);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// onChangeInput() {
|
|
|
|
|
|
|
|
// if (this.inputSearch.length > 0) {
|
|
|
|
|
|
|
|
// this.searchKeyEnter = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.searchKeyEnter = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
if(val === '') {
|
|
|
|
if (val === '') {
|
|
|
|
this.actionHistory = this.listOfRealted;
|
|
|
|
this.actionHistory = this.listOfRealted;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.actionHistory = this.listOfRealted.filter((item) => {
|
|
|
|
this.actionHistory = this.listOfRealted.filter((item) => {
|
|
|
|
return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if(this.selectedType === 4) {
|
|
|
|
} else if (this.selectedType === 4) {
|
|
|
|
if(val === '') {
|
|
|
|
if (val === '') {
|
|
|
|
this.favoriteUserList = this.listOfFav;
|
|
|
|
this.favoriteUserList = this.listOfFav;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.favoriteUserList = this.listOfFav.filter((item) => {
|
|
|
|
this.favoriteUserList = this.listOfFav.filter((item) => {
|
|
|
|
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|