worklist count changes

MOHEMM-Q3-DEV-LATEST
Sultan Khan 4 years ago
parent 10a90c0c25
commit 39c45d840c

@ -236,8 +236,8 @@ export class ConfirmAddEitComponent implements OnInit {
// this.navCtrl.popToRoot();
// this.cs.openHome();
//this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.cs.setTotalNumberOfWorklistRequest(true);
this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.cs.setTotalNumberOfWorklistRequest(true);
this.cs.openNotificationPage();
}
}

@ -1587,11 +1587,9 @@ export class CommonService {
this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false));
return this.totalCounter ? this.totalCounter : 0;
}
setTotalNumberOfWorklistRequest(isAdd: boolean = false) {
if (this.totalCounter > 0 && !isAdd) {
setTotalNumberOfWorklistRequest() {
if (this.totalCounter > 0) {
this.totalCounter -= 1;
} else if (this.totalCounter >= 0 && isAdd) {
this.totalCounter++;
}
this.sharedService.setSharedData(this.totalCounter, 'total-count');
}

@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 180 * 1000;
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,

@ -44,6 +44,7 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component";
import * as moment from "moment";
import { count } from 'console';
import { HomeComponent } from "src/app/notification/home/home.component";
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
@ -371,6 +372,7 @@ export class HomePage implements OnInit {
callDashboardServices() {
this.getMenu();
this.setServicesPrivilage();
var isWorklistChanged = this.common.sharedService.getSharedData(HomeComponent.COUNT_CHANGED);
if (this.common.getTotalNumberOfWorklistRequest()) {
this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest();
} else {
@ -677,7 +679,7 @@ export class HomePage implements OnInit {
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
this.common.filterKeys['ITG'] = result.TotalCount;
this.statsButtons[1].statsValue = Math.floor(this.countAllNotification + result.TotalCount);
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
this.getCOCNotificationCount();
this.common.stopLoading();
});
@ -686,7 +688,7 @@ export class HomePage implements OnInit {
getCOCNotificationCount() {
const request = new COCRequest();
request.ItgPageSize = 1;
request.ItgPageNo = 1;
request.ItgPageNo = 1;
request.Date = moment(new Date()).format("YYYY-MM-DD");
this.workListService.getCOCCount(request, '', '', this.isPostNoLoad).subscribe((result: any) => {
@ -698,7 +700,7 @@ export class HomePage implements OnInit {
this.statsButtons[1].statsValue = Math.floor(this.statsButtons[1].statsValue + totalCount);
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
this.common.sharedService.setSharedData(this.statsButtons[1].statsValue, 'total-count');
this.common.stopLoading();
});

@ -429,10 +429,11 @@ export class WorklistMainIcComponent implements OnInit {
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
this.common.setTotalNumberOfWorklistRequest();
setTimeout(() => {
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification();
}, 5000);
}, 300);
} else {
this.common.redToastPK('worklist', 'save-error');
}
@ -482,13 +483,13 @@ export class WorklistMainIcComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
}
@ -1221,10 +1222,11 @@ export class WorklistMainIcComponent implements OnInit {
// this.openNotificationsDashboard();
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
this.common.setTotalNumberOfWorklistRequest();
setTimeout(() => {
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification();
}, 100);
}, 300);
// this.nextNotfification();
} else {

@ -430,13 +430,13 @@ export class WorklistMainMRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
}

@ -460,13 +460,13 @@ export class WorklistMainPoComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
}

@ -451,13 +451,13 @@ export class WorklistMainPRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
} else {
this.common.setTotalNumberOfWorklistRequest(true);
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage();
}
}

@ -561,11 +561,10 @@ export class WorklistMainComponent implements OnInit {
// }
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully');
this.common.setTotalNumberOfWorklistRequest();
setTimeout(() => {
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification();
}, 100);
}, 300);
} else {
this.common.redToastPK('worklist', 'save-error');
}
@ -631,15 +630,15 @@ export class WorklistMainComponent implements OnInit {
this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
this.intializeNotificationDetail();
} else {
// this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.openNotificationPage();
}
}
}
} else {
//this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.setTotalNumberOfWorklistRequest(true);
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
//this.common.setTotalNumberOfWorklistRequest(true);
this.common.openNotificationPage();
}
@ -1161,7 +1160,7 @@ export class WorklistMainComponent implements OnInit {
setTimeout(() => {
// this.messageSuccess = false;
this.nextNotfification();
}, 100);
}, 300);
// this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');

@ -270,9 +270,9 @@ export class ConfirmAddressComponent implements OnInit {
this.cs.greenToastPK("eit", "approval-message-success")
// }
// this.navCtrl.popToRoot();
//this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
// this.cs.openHome();
this.cs.setTotalNumberOfWorklistRequest(true);
//this.cs.setTotalNumberOfWorklistRequest(true);
this.cs.openNotificationPage();
}
}

Loading…
Cancel
Save