fixed refresh issue

master
umasoodch 6 years ago
parent 06226c89e7
commit 39ade4effe

@ -183,6 +183,7 @@ export class HomePage implements OnInit {
ionViewWillEnter() {
this.common.startLoading();
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.remainingTime = 0;
this.displayTime = '00:00:00';
this.runTimer = false;

@ -175,9 +175,27 @@ export class HomeComponent implements OnInit {
ngOnInit() {
this.common.startLoading();
this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
this.openNotificationsDashboard();
}
ionViewWillEnter() {
console.log(this.filters);
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
if (loadWorkList) {
this.common.startLoading();
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
this.currentActiveIndex = 0;
this.previousActiveIndex = 0;
this.itemType = '';
this.selectedFilter = 'ALL';
this.isPostNoLoad = true;
this.disableFilters();
this.resetData();
this.direction = TranslatorService.getCurrentLanguageName();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
this.openNotificationsDashboard();
}
}
callWorkListServices() {
@ -222,6 +240,7 @@ export class HomeComponent implements OnInit {
}
activeFilter(index: number) {
console.log(this.filters);
if (this.currentActiveIndex !== index) {
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
@ -399,6 +418,7 @@ export class HomeComponent implements OnInit {
}
private handleWorkListResult(result: any) {
console.log(this.filters);
const lastItemIndex = result.length - 1;
const lastitem = result[lastItemIndex];
if (lastitem) {
@ -438,6 +458,7 @@ export class HomeComponent implements OnInit {
}
openNotificationDetail(obj) {
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
@ -468,6 +489,10 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
// initializeWorkList() {
// }
clearSearch() {
this.common.startLoading();
this.itemType = '';

@ -308,16 +308,15 @@ export class WorklistMainMRComponent implements OnInit {
handleApplayActionResult(result) {
if (this.common.validResponse(result)) {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
}
} // valid it
}
@ -1049,7 +1048,7 @@ export class WorklistMainMRComponent implements OnInit {
if (data.data == 'cancel' || data.data == undefined) {
return;
} else if (data.data == 'Success') {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}
@ -1081,7 +1080,7 @@ export class WorklistMainMRComponent implements OnInit {
if (data.data == 'cancel' || data.data == undefined) {
return;
} else if (data.data == 'Success') {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}

@ -339,18 +339,15 @@ export class WorklistMainPoComponent implements OnInit {
handleApplayActionResult(result) {
if (this.common.validResponse(result)) {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.openNotificationsDashboard();
this.nextNotfification();
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
}
} // valid it
}
@ -1121,7 +1118,7 @@ export class WorklistMainPoComponent implements OnInit {
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}

@ -336,16 +336,15 @@ export class WorklistMainPRComponent implements OnInit {
handleApplayActionResult(result) {
if (this.common.validResponse(result)) {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
// show succsfull popup
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
}, 5000);
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}
} // valid it
@ -1046,7 +1045,7 @@ export class WorklistMainPRComponent implements OnInit {
if (data.data == 'cancel' || data.data == undefined) {
return;
} else if (data.data == 'Success') {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}

@ -361,22 +361,21 @@ export class WorklistMainComponent implements OnInit {
handleApplayActionResult(result) {
if (this.common.validResponse(result)) {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.navCtrl.push("HomePage");
//this.common.openHome();
//this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){
// this.common.openHome();
// this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) {
// this.notificationArray.splice(i, 1);
// this.notificationArray.splice(i, 1);
// }
// }
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
@ -991,7 +990,7 @@ export class WorklistMainComponent implements OnInit {
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}
@ -1023,7 +1022,7 @@ export class WorklistMainComponent implements OnInit {
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
this.openNotificationsDashboard();
// this.openNotificationsDashboard();
this.nextNotfification();
}

Loading…
Cancel
Save