|
|
|
|
@ -35,6 +35,7 @@ import { WorkListSubmitterInfoRequest } from '../models/WorklistsubmitterInfoReq
|
|
|
|
|
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
|
|
|
|
|
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
|
|
|
|
|
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
|
|
|
|
|
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +98,9 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
dirfromNotificationPage: boolean = false;
|
|
|
|
|
direction: string;
|
|
|
|
|
defaultSegment = '';
|
|
|
|
|
public isPostNoLoad = true;
|
|
|
|
|
public worklistNotifications: any;
|
|
|
|
|
public totalRequestCount = 0;
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public worklistService: WorklistService,
|
|
|
|
|
@ -350,7 +354,7 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageSuccess = false;
|
|
|
|
|
this.getNotificationCountAfterSubmit();
|
|
|
|
|
this.openNotificationsDashboard();
|
|
|
|
|
this.nextNotfification();
|
|
|
|
|
}, 5000);
|
|
|
|
|
|
|
|
|
|
@ -363,21 +367,34 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
//let itemExist = false;
|
|
|
|
|
let itemNo = this.getPassNotificationDetails.ROW_NUM;
|
|
|
|
|
itemNo += 1;
|
|
|
|
|
if (itemNo > this.notificationArray.length) {
|
|
|
|
|
this.common.openNotificationPage();
|
|
|
|
|
} else {
|
|
|
|
|
for (let i = 0; i < this.notificationArray.length; i++) {
|
|
|
|
|
if (this.notificationArray[i].ROW_NUM == itemNo) {
|
|
|
|
|
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
|
|
|
|
|
// itemExist = true;
|
|
|
|
|
this.intializeNotificationDetail();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if(itemExist==false){
|
|
|
|
|
// this.nextNotfification();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
console.log( this.notificationArray);
|
|
|
|
|
let sortArr =this.sortArray(this.notificationArray);
|
|
|
|
|
console.log( sortArr);
|
|
|
|
|
|
|
|
|
|
const sortedActivities = this.notificationArray.slice().sort((a, b) => b.BEGIN_DATE - a.BEGIN_DATE)
|
|
|
|
|
console.log(sortedActivities);
|
|
|
|
|
// if (itemNo > this.notificationArray.length) {
|
|
|
|
|
// this.common.openNotificationPage();
|
|
|
|
|
// } else {
|
|
|
|
|
// for (let i = 0; i < this.notificationArray.length; i++) {
|
|
|
|
|
// if (this.notificationArray[i].ROW_NUM == itemNo) {
|
|
|
|
|
// this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
|
|
|
|
|
// // itemExist = true;
|
|
|
|
|
// this.intializeNotificationDetail();
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// // if(itemExist==false){
|
|
|
|
|
// // this.nextNotfification();
|
|
|
|
|
// // }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sortArray(arrayToSort: any) {
|
|
|
|
|
return arrayToSort.sort((a: any, b: any) =>
|
|
|
|
|
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
actionButton(action) {
|
|
|
|
|
@ -687,19 +704,19 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getNotificationCountAfterSubmit() {
|
|
|
|
|
const req: any = {};
|
|
|
|
|
this.menuService.getNotificationCount(req).subscribe((result: any) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.notificationCount =
|
|
|
|
|
result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
|
|
|
|
|
if (this.notificationCount <= 0) {
|
|
|
|
|
this.notificationCount = null;
|
|
|
|
|
}
|
|
|
|
|
this.events.publish("getNotCount", this.notificationCount);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// getNotificationCountAfterSubmit() {
|
|
|
|
|
// const req: any = {};
|
|
|
|
|
// this.menuService.getNotificationCount(req).subscribe((result: any) => {
|
|
|
|
|
// if (this.common.validResponse(result)) {
|
|
|
|
|
// this.notificationCount =
|
|
|
|
|
// result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
|
|
|
|
|
// if (this.notificationCount <= 0) {
|
|
|
|
|
// this.notificationCount = null;
|
|
|
|
|
// }
|
|
|
|
|
// this.events.publish("getNotCount", this.notificationCount);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
getAttachmentNotification(WorkListAttachObj) {
|
|
|
|
|
|
|
|
|
|
@ -904,7 +921,7 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
if (data.data == "cancel" || data.data == undefined) {
|
|
|
|
|
return;
|
|
|
|
|
} else if (data.data == "Success") {
|
|
|
|
|
this.getNotificationCountAfterSubmit();
|
|
|
|
|
this.openNotificationsDashboard();
|
|
|
|
|
this.nextNotfification();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -936,7 +953,7 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
if (data.data == "cancel" || data.data == undefined) {
|
|
|
|
|
return;
|
|
|
|
|
} else if (data.data == "Success") {
|
|
|
|
|
this.getNotificationCountAfterSubmit();
|
|
|
|
|
this.openNotificationsDashboard();
|
|
|
|
|
this.nextNotfification();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -1017,4 +1034,15 @@ export class WorklistMainComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}//end infiniteScroll
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openNotificationsDashboard() {
|
|
|
|
|
this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.worklistNotifications = result;
|
|
|
|
|
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
|
this.common.sharedService.setSharedData(result, 'worklistNotifications');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|