|
|
|
@ -11,6 +11,7 @@ import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/wor
|
|
|
|
import { DatePipe } from '@angular/common';
|
|
|
|
import { DatePipe } from '@angular/common';
|
|
|
|
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
|
|
|
|
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
|
|
|
|
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
|
|
|
|
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
|
|
|
|
|
|
|
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: 'app-home',
|
|
|
|
selector: 'app-home',
|
|
|
|
@ -22,6 +23,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
public static REQUSET_INFO = 'requset_info';
|
|
|
|
public static REQUSET_INFO = 'requset_info';
|
|
|
|
public static ALL_REQUEST = 'all_request';
|
|
|
|
public static ALL_REQUEST = 'all_request';
|
|
|
|
public static NOTIFICATION_DATA = 'notification_data';
|
|
|
|
public static NOTIFICATION_DATA = 'notification_data';
|
|
|
|
|
|
|
|
public static COUNT_CHANGED = 'count_changed';
|
|
|
|
public static NOTIFICATION_ARR = 'notification_arr';
|
|
|
|
public static NOTIFICATION_ARR = 'notification_arr';
|
|
|
|
public static NAMES_ALL_iTEMS = 'names-all-items';
|
|
|
|
public static NAMES_ALL_iTEMS = 'names-all-items';
|
|
|
|
public static IS_ALL_NAME = 'is_all_names';
|
|
|
|
public static IS_ALL_NAME = 'is_all_names';
|
|
|
|
@ -70,7 +72,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
public showSearchButton = false;
|
|
|
|
public showSearchButton = false;
|
|
|
|
public itemType = 'HRSSA';
|
|
|
|
public itemType = 'HRSSA';
|
|
|
|
public receivedITGCount = false;
|
|
|
|
public receivedITGCount = false;
|
|
|
|
|
|
|
|
public countChanged: any = false;
|
|
|
|
public totalHR = 0;
|
|
|
|
public totalHR = 0;
|
|
|
|
public totalPO = 0;
|
|
|
|
public totalPO = 0;
|
|
|
|
public totalPR = 0;
|
|
|
|
public totalPR = 0;
|
|
|
|
@ -199,12 +201,10 @@ export class HomeComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
ionViewWillEnter() {
|
|
|
|
ionViewWillEnter() {
|
|
|
|
this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest();
|
|
|
|
this.totalRequestCount = this.common.getTotalNumberOfWorklistRequest();
|
|
|
|
const values = this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false));
|
|
|
|
const values = this.common.getFiltersData();
|
|
|
|
this.data = values.data;
|
|
|
|
this.data = values.data;
|
|
|
|
this.filters = values.filters;
|
|
|
|
this.filters = values.filters;
|
|
|
|
console.log(this.filters);
|
|
|
|
|
|
|
|
console.log(this.data);
|
|
|
|
|
|
|
|
console.log(this.totalRequestCount);
|
|
|
|
|
|
|
|
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
|
|
|
|
const loadWorkList = this.common.sharedService.getSharedData('loadWorkList', false);
|
|
|
|
if (loadWorkList) {
|
|
|
|
if (loadWorkList) {
|
|
|
|
this.receivedITGCount = false;
|
|
|
|
this.receivedITGCount = false;
|
|
|
|
@ -229,22 +229,34 @@ export class HomeComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
callWorkListServices() {
|
|
|
|
callWorkListServices() {
|
|
|
|
|
|
|
|
// if (this.countChanged) {
|
|
|
|
this.Count();
|
|
|
|
this.Count();
|
|
|
|
|
|
|
|
// }
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
this.getAllPushNotificationFun();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openNotificationsDashboard() {
|
|
|
|
openNotificationsDashboard() {
|
|
|
|
this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
|
|
|
|
// if (this.countChanged) {
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
|
|
|
this.worklistNotifications = result;
|
|
|
|
// this.DS.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
|
|
|
|
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
// if (this.common.validResponse(result)) {
|
|
|
|
this.resetFiltersUI();
|
|
|
|
// this.countChanged = false;
|
|
|
|
this.assignDataToFilters();
|
|
|
|
// this.worklistNotifications = result;
|
|
|
|
this.common.sharedService.setSharedData(result, 'worklistNotifications');
|
|
|
|
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
|
|
|
|
//this.resetFiltersUI();
|
|
|
|
|
|
|
|
// this.assignDataToFilters();
|
|
|
|
|
|
|
|
// this.common.sharedService.setSharedData(result, 'worklistNotifications');
|
|
|
|
this.Details();
|
|
|
|
this.Details();
|
|
|
|
this.callWorkListServices();
|
|
|
|
this.callWorkListServices();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
|
|
|
|
|
|
|
|
// this.resetFiltersUI();
|
|
|
|
|
|
|
|
// this.assignDataToFilters();
|
|
|
|
|
|
|
|
// this.Details();
|
|
|
|
|
|
|
|
// this.callWorkListServices();
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
assignDataToFilters() {
|
|
|
|
assignDataToFilters() {
|
|
|
|
@ -608,6 +620,7 @@ export class HomeComponent implements OnInit {
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
if (result.RequestType) {
|
|
|
|
if (result.RequestType) {
|
|
|
|
if (result.RequestType.length > 0) {
|
|
|
|
if (result.RequestType.length > 0) {
|
|
|
|
|
|
|
|
this.countChanged = false;
|
|
|
|
this.ITGSegment[0] = {
|
|
|
|
this.ITGSegment[0] = {
|
|
|
|
name: 'All',
|
|
|
|
name: 'All',
|
|
|
|
code: 'All',
|
|
|
|
code: 'All',
|
|
|
|
@ -638,14 +651,30 @@ export class HomeComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Details() {
|
|
|
|
Details() {
|
|
|
|
this.workListService.getITGDetails('', '', this.isPostNoLoad)
|
|
|
|
// var result = this.common.sharedService.getSharedData(MenuResponse.ITG_COUNTS, false);
|
|
|
|
.subscribe((result: any) => {
|
|
|
|
// if (this.countChanged) {
|
|
|
|
this.ITGCount = result.TotalCount;
|
|
|
|
// this.workListService.getITGDetails('', '', this.isPostNoLoad)
|
|
|
|
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
// .subscribe((result: any) => {
|
|
|
|
this.data.datasets[0].data[4] = this.ITGCount;
|
|
|
|
// this.countChanged = false;
|
|
|
|
this.filters[4].value = result.TotalCount;
|
|
|
|
// this.ITGCount = result.TotalCount;
|
|
|
|
|
|
|
|
// // this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
|
|
|
// this.data.datasets[0].data[4] = this.ITGCount;
|
|
|
|
|
|
|
|
// this.filters[4].value = result.TotalCount;
|
|
|
|
|
|
|
|
// this.receivedITGCount = true;
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//this.workListService.getITGDetails('', '', this.isPostNoLoad)
|
|
|
|
|
|
|
|
//.subscribe((result: any) => {
|
|
|
|
|
|
|
|
this.ITGCount = this.common.filterKeys['ITG'];//result.TotalCount;
|
|
|
|
|
|
|
|
// this.totalRequestCount = this.totalRequestCount + result.TotalCount;
|
|
|
|
|
|
|
|
this.data.datasets[0].data[4] = this.common.filterKeys['ITG'];//this.ITGCount;
|
|
|
|
|
|
|
|
this.filters[4].value = this.common.filterKeys['ITG'];
|
|
|
|
this.receivedITGCount = true;
|
|
|
|
this.receivedITGCount = true;
|
|
|
|
});
|
|
|
|
//});
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
searchBtn() {
|
|
|
|
searchBtn() {
|
|
|
|
|