fixed refresh issue

master
umasoodch 6 years ago
parent 06226c89e7
commit 39ade4effe

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

@ -175,9 +175,27 @@ export class HomeComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.common.startLoading(); 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() { callWorkListServices() {
@ -222,6 +240,7 @@ export class HomeComponent implements OnInit {
} }
activeFilter(index: number) { activeFilter(index: number) {
console.log(this.filters);
if (this.currentActiveIndex !== index) { if (this.currentActiveIndex !== index) {
this.previousActiveIndex = this.currentActiveIndex; this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index; this.currentActiveIndex = index;
@ -399,6 +418,7 @@ export class HomeComponent implements OnInit {
} }
private handleWorkListResult(result: any) { private handleWorkListResult(result: any) {
console.log(this.filters);
const lastItemIndex = result.length - 1; const lastItemIndex = result.length - 1;
const lastitem = result[lastItemIndex]; const lastitem = result[lastItemIndex];
if (lastitem) { if (lastitem) {
@ -438,6 +458,7 @@ export class HomeComponent implements OnInit {
} }
openNotificationDetail(obj) { openNotificationDetail(obj) {
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') { if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage(); this.common.openWorklistMainPRPage();
@ -468,6 +489,10 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SUBJECT = ''; this.WorkListObj.P_SEARCH_SUBJECT = '';
} }
// initializeWorkList() {
// }
clearSearch() { clearSearch() {
this.common.startLoading(); this.common.startLoading();
this.itemType = ''; this.itemType = '';

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

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

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

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

Loading…
Cancel
Save