fixed refresh issue

mekawy-issues
umasoodch 6 years ago
parent 56ab8399d3
commit 94a3f61e91

@ -10,7 +10,7 @@
<div class="request-heading">
<span>{{ts.trPK('work-list','open-analysis')}}</span>
</div>
<div class="result-text-container" [ngStyle]="showChart === false ? {'visibility': 'hidden'} : {}">
<div class="result-text-container" [ngStyle]="showChart === false || receivedITGCount === false ? {'visibility': 'hidden'} : {}">
<span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} {{ts.trPK('work-list','of')}} </span>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} {{ts.trPK('work-list','of')}} </span>
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</h2>
@ -18,11 +18,11 @@
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2>
<span>{{ts.trPK('work-list','total')}} <br> {{ts.trPK('work-list','open-reqest')}}</span>
</div>
<p-chart *ngIf="!showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="!showChart || !receivedITGCount" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="showChart && receivedITGCount" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<ion-row class="filters-row" *ngIf="showChart">
<ion-row class="filters-row" *ngIf="showChart && receivedITGCount">
<ion-slides [options]="slideOptsOne">
<ion-slide *ngFor="let filter of filters; let i=index" [ngClass]="filter.disable === true ? 'disable-filter' : ''">
<app-card-filter

@ -69,6 +69,7 @@ export class HomeComponent implements OnInit {
public selectedFilter = 'ALL';
public showSearchButton = false;
public itemType = '';
public receivedITGCount = false;
public totalHR = 0;
public totalPO = 0;
@ -181,6 +182,8 @@ export class HomeComponent implements OnInit {
console.log(this.filters);
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
if (loadWorkList) {
this.receivedITGCount = false;
this.showChart = false;
this.common.startLoading();
if (this.infiniteScroll) {
this.infiniteScroll.complete();
@ -199,7 +202,7 @@ export class HomeComponent implements OnInit {
}
callWorkListServices() {
this.Details();
// this.Details();
this.Count();
this.getAllPushNotificationFun();
}
@ -210,6 +213,7 @@ export class HomeComponent implements OnInit {
this.worklistNotifications = result;
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.common.sharedService.setSharedData(result, 'worklistNotifications');
this.Details();
this.callWorkListServices();
}
});
@ -233,8 +237,8 @@ export class HomeComponent implements OnInit {
this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
}
this.data.datasets[0].data[4] = this.ITGCount;
}
// this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
this.common.stopLoading();
}
@ -559,8 +563,10 @@ export class HomeComponent implements OnInit {
Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => {
this.receivedITGCount = true;
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.data.datasets[0].data[4] = this.ITGCount;
this.filters[5].value = result.TotalCount;
});
}

@ -242,6 +242,7 @@ export class WorkListMainItgComponent implements OnInit {
} else if (result.MessageStatus == 1) {
console.log("hello action 1");
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
@ -260,6 +261,7 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(2)
@ -284,6 +286,7 @@ export class WorkListMainItgComponent implements OnInit {
}
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(3)
@ -303,6 +306,7 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(4)
@ -323,6 +327,7 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(5)
@ -346,6 +351,7 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.confirmMsg(6)

Loading…
Cancel
Save