|
|
|
|
@ -33,8 +33,6 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
SentDate = '';
|
|
|
|
|
Subject = '';
|
|
|
|
|
inputSearch = '';
|
|
|
|
|
// HideDateInput = false;
|
|
|
|
|
// HideTextInput = false;
|
|
|
|
|
inputDate: string;
|
|
|
|
|
filteredNotificationList: any;
|
|
|
|
|
IsReachEnd = false;
|
|
|
|
|
@ -47,7 +45,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public isITG = false;
|
|
|
|
|
public isSearch = false;
|
|
|
|
|
public direction = 'ltr';
|
|
|
|
|
///// New /////////////
|
|
|
|
|
|
|
|
|
|
public currentActiveIndex = 0;
|
|
|
|
|
public previousActiveIndex = 0;
|
|
|
|
|
public worklistNotifications: any;
|
|
|
|
|
@ -57,6 +55,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
public showFormattedData = {};
|
|
|
|
|
public selectedFilter = 'ALL';
|
|
|
|
|
public showSearchButton = false;
|
|
|
|
|
public itemType = '';
|
|
|
|
|
public options = {
|
|
|
|
|
cutoutPercentage: 80,
|
|
|
|
|
tooltips: { enabled: false },
|
|
|
|
|
@ -82,42 +81,48 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
name: 'All',
|
|
|
|
|
active: true,
|
|
|
|
|
color: '#124375',
|
|
|
|
|
key: 'ALL'
|
|
|
|
|
key: 'ALL',
|
|
|
|
|
disable: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
name: 'HR',
|
|
|
|
|
active: false,
|
|
|
|
|
color: '#18a169',
|
|
|
|
|
key: 'HRSSA'
|
|
|
|
|
key: 'HRSSA',
|
|
|
|
|
disable: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
name: 'PO',
|
|
|
|
|
active: false,
|
|
|
|
|
color: '#38c9b3',
|
|
|
|
|
key: 'POAPPRV'
|
|
|
|
|
key: 'POAPPRV',
|
|
|
|
|
disable: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
name: 'PR',
|
|
|
|
|
active: false,
|
|
|
|
|
color: '#114475',
|
|
|
|
|
key: 'REQAPPRV'
|
|
|
|
|
key: 'REQAPPRV',
|
|
|
|
|
disable: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
name: 'MR',
|
|
|
|
|
active: false,
|
|
|
|
|
color: '#3cb9d5',
|
|
|
|
|
key: 'INVMOA'
|
|
|
|
|
key: 'INVMOA',
|
|
|
|
|
disable: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 0,
|
|
|
|
|
name: 'ITG',
|
|
|
|
|
active: false,
|
|
|
|
|
color: '#cc3232',
|
|
|
|
|
key: 'ITG'
|
|
|
|
|
key: 'ITG',
|
|
|
|
|
disable: false
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
public slideOptsOne = {
|
|
|
|
|
@ -168,9 +173,9 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getFilteredData(filter: string) {
|
|
|
|
|
if(filter === 'ALL') {
|
|
|
|
|
if (filter === 'ALL') {
|
|
|
|
|
this.showFormattedData = this.allFormattedData;
|
|
|
|
|
} else {
|
|
|
|
|
let arrayToFilter;
|
|
|
|
|
@ -196,6 +201,25 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.common.openProfile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
disableFilters() {
|
|
|
|
|
for (const filter of this.filters) {
|
|
|
|
|
if (filter.key === this.itemType) {
|
|
|
|
|
filter.disable = false;
|
|
|
|
|
filter.active = true;
|
|
|
|
|
this.selectedFilter = filter.name;
|
|
|
|
|
} else if (this.itemType === 'none') {
|
|
|
|
|
filter.disable = false;
|
|
|
|
|
filter.active = false;
|
|
|
|
|
} else {
|
|
|
|
|
filter.disable = true;
|
|
|
|
|
filter.active = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.itemType === 'none') {
|
|
|
|
|
this.filters[0].active = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async openSearchModal() {
|
|
|
|
|
const modal = await this.modalController.create({
|
|
|
|
|
component: WorklistAdvancedSearchComponent,
|
|
|
|
|
@ -205,9 +229,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
});
|
|
|
|
|
modal.onDidDismiss().then(result => {
|
|
|
|
|
console.log(result.data);
|
|
|
|
|
if(result.data){
|
|
|
|
|
if(result.data.notificationType !== '' || result.data.selectedValue){
|
|
|
|
|
if (result.data) {
|
|
|
|
|
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
|
|
|
|
|
this.showSearchButton = true;
|
|
|
|
|
this.itemType = result.data.itemType;
|
|
|
|
|
this.notificationType = result.data.notificationType;
|
|
|
|
|
this.selectedValue = result.data.selectedValue;
|
|
|
|
|
this.inputDate = result.data.inputDate;
|
|
|
|
|
@ -222,58 +247,24 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
this.previousActiveIndex = 0;
|
|
|
|
|
this.filters[this.currentActiveIndex].active = true;
|
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
|
if (this.itemType !== '') {
|
|
|
|
|
this.disableFilters();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
return await modal.present();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ionViewDidLoad() {
|
|
|
|
|
// this.navBar.backButtonClick = () => {
|
|
|
|
|
// // you can set a full custom history here if you want
|
|
|
|
|
// let pages = [
|
|
|
|
|
// {
|
|
|
|
|
// page: "HomePage"
|
|
|
|
|
// }
|
|
|
|
|
// ];
|
|
|
|
|
// this.navCtrl.setPages(pages);
|
|
|
|
|
// };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ionViewWillEnter() {
|
|
|
|
|
// this.getAllPushNotificationFun(); //filter with item type
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getAllPushNotificationFun() {
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM = 1;
|
|
|
|
|
this.IsReachEnd = false;
|
|
|
|
|
|
|
|
|
|
if (this.selectedValue === '1') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch;
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
} else if (this.selectedValue === '2') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch;
|
|
|
|
|
} else if (this.selectedValue === '3') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
if (this.inputDate) {
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.inputDate).format(
|
|
|
|
|
'DD-MMM-YYYY'
|
|
|
|
|
);
|
|
|
|
|
} else { this.WorkListObj.P_SEARCH_SENT_DATE = ''; }
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
} else if (this.selectedValue === '4') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch;
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = '';
|
|
|
|
|
} else if (this.selectedValue === '5') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
|
|
|
|
|
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';;
|
|
|
|
|
if (this.selectedValue === '5') {
|
|
|
|
|
this.WorkListObj.P_SEARCH_FROM_USER = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
|
|
|
|
|
this.WorkListObj.P_SEARCH_SENT_DATE = '';
|
|
|
|
|
@ -290,10 +281,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
categorizeData(arrayToCategorize: any) {
|
|
|
|
|
const datePipe = new DatePipe('en-US');
|
|
|
|
|
let formattedData = {};
|
|
|
|
|
const formattedData = {};
|
|
|
|
|
for (const workList of arrayToCategorize) {
|
|
|
|
|
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
|
|
|
|
|
if (!(workList.FORMATTED_DATE in formattedData)) {
|
|
|
|
|
if (!(workList.FORMATTED_DATE in formattedData)) {
|
|
|
|
|
formattedData[workList.FORMATTED_DATE] = new Array();
|
|
|
|
|
formattedData[workList.FORMATTED_DATE].push(workList);
|
|
|
|
|
} else {
|
|
|
|
|
@ -323,7 +314,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
if (this.common.hasData(result)) {
|
|
|
|
|
this.WorkListObj.P_PAGE_NUM++;
|
|
|
|
|
if(this.newWorkListResponse.length === 0) {
|
|
|
|
|
if (this.newWorkListResponse.length === 0) {
|
|
|
|
|
this.newWorkListResponse = result;
|
|
|
|
|
} else {
|
|
|
|
|
this.newWorkListResponse = this.newWorkListResponse.concat(result);
|
|
|
|
|
@ -342,22 +333,16 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
console.log(obj);
|
|
|
|
|
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
|
|
|
|
|
// this.common.openWorklistMainPage();
|
|
|
|
|
if(obj.REQUEST_TYPE == 'PR'){
|
|
|
|
|
if (obj.REQUEST_TYPE === 'PR') {
|
|
|
|
|
this.common.openWorklistMainPRPage();
|
|
|
|
|
}
|
|
|
|
|
else if(obj.REQUEST_TYPE == 'PO'){
|
|
|
|
|
} else if (obj.REQUEST_TYPE === 'PO') {
|
|
|
|
|
this.common.openWorklistMainPOPage();
|
|
|
|
|
}
|
|
|
|
|
else if(obj.REQUEST_TYPE == 'MO'){
|
|
|
|
|
} else if (obj.REQUEST_TYPE === 'MO') {
|
|
|
|
|
this.common.openWorklistMainMRPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
} else {
|
|
|
|
|
this.common.openWorklistMainPage();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this.navCtrl.push("WorkListMainPage", { passNotificationList: obj });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isEmptyObject() {
|
|
|
|
|
@ -365,6 +350,8 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
clearSearch() {
|
|
|
|
|
this.itemType = 'none';
|
|
|
|
|
this.disableFilters();
|
|
|
|
|
this.showSearchButton = false;
|
|
|
|
|
this.notificationType = '';
|
|
|
|
|
this.selectedValue = '';
|
|
|
|
|
@ -398,7 +385,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
if (this.infiniteScroll && this.selectedFilter === 'ALL') {
|
|
|
|
|
if (this.infiniteScroll && this.selectedFilter === 'ALL') {
|
|
|
|
|
this.infiniteScroll.complete();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -407,105 +394,54 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
Count() {
|
|
|
|
|
this.workListService.getITGCount()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log('ENAD ITG COUNT:')
|
|
|
|
|
console.log('ENAD ITG COUNT:');
|
|
|
|
|
console.log(result);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
filterNotificationByRequestType(reqType) {
|
|
|
|
|
let filterdType = [];
|
|
|
|
|
if (reqType == 'All') {
|
|
|
|
|
this.filteredNotificationList = this.WorkListResObj;
|
|
|
|
|
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') {
|
|
|
|
|
this.noData = true;
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
this.noData = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.WorkListResObj.length; i++) {
|
|
|
|
|
if(reqType=='HR'){
|
|
|
|
|
if ('EIT' == this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' == this.WorkListResObj[i].REQUEST_TYPE) {
|
|
|
|
|
filterdType.push(this.WorkListResObj[i]);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if (reqType == this.WorkListResObj[i].REQUEST_TYPE) {
|
|
|
|
|
filterdType.push(this.WorkListResObj[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.filteredNotificationList = filterdType;
|
|
|
|
|
if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == '') {
|
|
|
|
|
this.noData = true;
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
this.noData = false;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// filterNotificationByRequestType(reqType) {
|
|
|
|
|
// const filterdType = [];
|
|
|
|
|
// if (reqType === 'All') {
|
|
|
|
|
// this.filteredNotificationList = this.WorkListResObj;
|
|
|
|
|
// if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') {
|
|
|
|
|
// this.noData = true;
|
|
|
|
|
// return false;
|
|
|
|
|
// } else {
|
|
|
|
|
// this.noData = false;
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// for (let i = 0; i < this.WorkListResObj.length; i++) {
|
|
|
|
|
// if (reqType === 'HR') {
|
|
|
|
|
// if ('EIT' === this.WorkListResObj[i].REQUEST_TYPE || 'ABSENCE' === this.WorkListResObj[i].REQUEST_TYPE) {
|
|
|
|
|
// filterdType.push(this.WorkListResObj[i]);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (reqType === this.WorkListResObj[i].REQUEST_TYPE) {
|
|
|
|
|
// filterdType.push(this.WorkListResObj[i]);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// this.filteredNotificationList = filterdType;
|
|
|
|
|
// if (this.filteredNotificationList === [] || this.filteredNotificationList == null || this.filteredNotificationList === '') {
|
|
|
|
|
// this.noData = true;
|
|
|
|
|
// return false;
|
|
|
|
|
// } else {
|
|
|
|
|
// this.noData = false;
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
Details() {
|
|
|
|
|
this.workListService.getITGDetails()
|
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
|
console.log('ENAD ITG Details:')
|
|
|
|
|
console.log('ENAD ITG Details:');
|
|
|
|
|
console.log(result);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AllNotification() {
|
|
|
|
|
this.filterNotificationByRequestType('All');
|
|
|
|
|
this.isAll = true;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PRNotification() {
|
|
|
|
|
this.filterNotificationByRequestType('PR');
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = true;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PONotification() {
|
|
|
|
|
this.filterNotificationByRequestType('PO');
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = true;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MRNotification() {
|
|
|
|
|
this.filterNotificationByRequestType('MO');
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = true;
|
|
|
|
|
this.isHR = false;
|
|
|
|
|
this.isITG = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRNotification() {
|
|
|
|
|
this.filterNotificationByRequestType('HR');
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
this.isPR = false;
|
|
|
|
|
this.isPO = false;
|
|
|
|
|
this.isMR = false;
|
|
|
|
|
this.isHR = true;
|
|
|
|
|
this.isITG = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ITGNotification() {
|
|
|
|
|
// this.Details();
|
|
|
|
|
this.isAll = false;
|
|
|
|
|
|