worklist-done

MOE_DEV_NEW_TEMPORARY_DESIGN
Sultan Khan 4 years ago
parent 8587ba279f
commit 5eb2a68831

@ -78,6 +78,15 @@ export class CommonService {
'نوفمبر', 'نوفمبر',
'ديسمبر' 'ديسمبر'
]; ];
public filterKeys = {
'HRSSA': 0,
'INVMOA': 0,
'REQAPPRV': 0,
'POAPPRV': 0,
'INVITEM': 0,
"STAMP": 0,
'ITG': 0
}
private progressLoaders: any[] = []; private progressLoaders: any[] = [];
private loadingProgress: any; private loadingProgress: any;
@ -1571,7 +1580,7 @@ export class CommonService {
public totalCounter = 0; public totalCounter = 0;
getTotalNumberOfWorklistRequest() { getTotalNumberOfWorklistRequest() {
this.totalCounter = parseInt(this.sharedService.getSharedData('total-count')); this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false));
return this.totalCounter; return this.totalCounter;
} }
setTotalNumberOfWorklistRequest() { setTotalNumberOfWorklistRequest() {
@ -1579,6 +1588,14 @@ export class CommonService {
this.sharedService.setSharedData(this.totalCounter, 'total-count'); this.sharedService.setSharedData(this.totalCounter, 'total-count');
} }
public setFilterValues(data) {
for (const notification of data) {
this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER
}
}
public filters = [ public filters = [
{ {
value: 0, value: 0,
@ -1586,7 +1603,8 @@ export class CommonService {
active: false, active: false,
color: '#18a169', color: '#18a169',
key: 'HRSSA', key: 'HRSSA',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1594,7 +1612,8 @@ export class CommonService {
active: false, active: false,
color: '#3cb9d5', color: '#3cb9d5',
key: 'INVMOA', key: 'INVMOA',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1602,7 +1621,8 @@ export class CommonService {
active: false, active: false,
color: '#114475', color: '#114475',
key: 'REQAPPRV', key: 'REQAPPRV',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1610,7 +1630,8 @@ export class CommonService {
active: false, active: false,
color: '#38c9b3', color: '#38c9b3',
key: 'POAPPRV', key: 'POAPPRV',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1618,7 +1639,8 @@ export class CommonService {
active: false, active: false,
color: '#cc3232', color: '#cc3232',
key: 'ITG', key: 'ITG',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1626,7 +1648,8 @@ export class CommonService {
active: false, active: false,
color: '#9e7e97', color: '#9e7e97',
key: 'INVITEM', key: 'INVITEM',
disable: false disable: false,
total: 0
}, },
{ {
value: 0, value: 0,
@ -1634,8 +1657,10 @@ export class CommonService {
active: false, active: false,
color: '#ff9800', color: '#ff9800',
key: 'STAMP', key: 'STAMP',
disable: false disable: false,
} total: 0,
},
]; ];
public data = { public data = {
@ -1655,30 +1680,28 @@ export class CommonService {
}] }]
}; };
assignDataToFilters(result) { getFiltersData() {
const openNotificationsArray = result; // for (const notification of openNotificationsArray) {
// if (notification.ITEM_TYPE === 'HRSSA') {
for (const notification of openNotificationsArray) { this.filters[0].value = this.filterKeys['HRSSA'];
if (notification.ITEM_TYPE === 'HRSSA') { this.data.datasets[0].data[0] = this.filterKeys['HRSSA'];
this.filters[0].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'INVMOA') {
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; this.filters[1].value = this.filterKeys['INVMOA'];
} else if (notification.ITEM_TYPE === 'INVMOA') { this.data.datasets[0].data[1] = this.filterKeys['INVMOA'];
this.filters[1].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; this.filters[2].value = this.filterKeys['REQAPPRV'];
} else if (notification.ITEM_TYPE === 'REQAPPRV') { this.data.datasets[0].data[2] = this.filterKeys['REQAPPRV'];
this.filters[2].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'POAPPRV') {
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; this.filters[3].value = this.filterKeys['POAPPRV'];
} else if (notification.ITEM_TYPE === 'POAPPRV') { this.data.datasets[0].data[3] = this.filterKeys['POAPPRV'];
this.filters[3].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'INVITEM') {
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; this.filters[5].value = this.filterKeys['INVITEM'];
} else if (notification.ITEM_TYPE === 'INVITEM') { this.data.datasets[0].data[5] = this.filterKeys['INVITEM'];
this.filters[5].value = notification.OPEN_NTF_NUMBER; // } else if (notification.ITEM_TYPE === 'STAMP') {
this.data.datasets[0].data[5] = notification.OPEN_NTF_NUMBER; this.filters[6].value = this.filterKeys['STAMP'];
} else if (notification.ITEM_TYPE === 'STAMP') { this.data.datasets[0].data[6] = this.filterKeys['STAMP'];
this.filters[6].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[6] = notification.OPEN_NTF_NUMBER;
}
}
let val = { 'filters': [], 'data': {} }; let val = { 'filters': [], 'data': {} };
val.filters = this.filters; val.filters = this.filters;
val.data = this.data; val.data = this.data;

@ -6,6 +6,7 @@ export class MenuResponse {
public static SELECTED_MENU = 'selected_menu'; public static SELECTED_MENU = 'selected_menu';
public static SHARED_SEL_EMP = 'sel_empolyee'; public static SHARED_SEL_EMP = 'sel_empolyee';
public static SHARED_SEL_RESP_ID = 'sel_resp_id'; public static SHARED_SEL_RESP_ID = 'sel_resp_id';
public static ITG_COUNTS = 'itg-counts';
public userid: string; public userid: string;
public search: boolean; public search: boolean;
public List_Menu: ListMenu; public List_Menu: ListMenu;

@ -369,7 +369,12 @@ export class HomePage implements OnInit {
callDashboardServices() { callDashboardServices() {
this.getMenu(); this.getMenu();
this.setServicesPrivilage(); this.setServicesPrivilage();
if (this.common.getTotalNumberOfWorklistRequest()) {
this.statsButtons[1].statsValue = this.common.getTotalNumberOfWorklistRequest();
} else {
this.openNotificationsDashbored(); this.openNotificationsDashbored();
}
this.showOpenMissingSwipes(); this.showOpenMissingSwipes();
this.showAttendanceTracking(); this.showAttendanceTracking();
var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false); var accrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false);
@ -660,12 +665,15 @@ export class HomePage implements OnInit {
result, result,
'worklistNotifications' 'worklistNotifications'
); );
this.common.setFilterValues(result['GetOpenNotificationsList']);
} }
}); });
} }
ITGCountAllNotification() { ITGCountAllNotification() {
this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => { this.workListService.getITGDetails('', '', this.isPostNoLoad).subscribe((result: any) => {
this.common.sharedService.setSharedData(result, MenuResponse.ITG_COUNTS);
this.common.filterKeys['ITG'] = result.TotalCount;
this.statsButtons[1].statsValue = this.statsButtons[1].statsValue =
Math.floor(this.countAllNotification + result.TotalCount); Math.floor(this.countAllNotification + result.TotalCount);
this.common.stopLoading(); this.common.stopLoading();

@ -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() {

@ -195,6 +195,10 @@ export class WorkListMainItgComponent implements OnInit {
skip() { skip() {
// check if the user clicked on all type of request // check if the user clicked on all type of request
this.common.setTotalNumberOfWorklistRequest();
// this.common.assignDataToFilters(this.common.sharedService.getSharedData('worklistNotifications', false), 'ITG');
if (this.common.filterKeys['ITG'] != 0)
this.common.filterKeys['ITG'] = (this.common.filterKeys['ITG'] - 1)
if (this.is_all_items_sents) { if (this.is_all_items_sents) {
for (let i = 1; i < this.all_request_names.length; i++) { for (let i = 1; i < this.all_request_names.length; i++) {
for (let j = 0; j < this.all_request_names[i].data.length; j++) { for (let j = 0; j < this.all_request_names[i].data.length; j++) {
@ -277,6 +281,7 @@ export class WorkListMainItgComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1); this.confirmMsg(1);
this.skip(); this.skip();
}, 2000); }, 2000);

@ -430,8 +430,7 @@ export class WorklistMainIcComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -470,6 +469,9 @@ export class WorklistMainIcComponent implements OnInit {
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -480,9 +482,11 @@ export class WorklistMainIcComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1216,9 +1220,9 @@ export class WorklistMainIcComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {

@ -373,6 +373,7 @@ export class WorklistMainMRComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -414,7 +415,11 @@ export class WorklistMainMRComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -425,9 +430,11 @@ export class WorklistMainMRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1117,9 +1124,9 @@ export class WorklistMainMRComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
@ -1153,7 +1160,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.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
} }

@ -407,8 +407,7 @@ export class WorklistMainPoComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 5000); }, 5000);
} else { } else {
@ -446,7 +445,11 @@ export class WorklistMainPoComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE; let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -457,9 +460,11 @@ export class WorklistMainPoComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1184,8 +1189,9 @@ export class WorklistMainPoComponent implements OnInit {
} else if (data.data.data === 'Success') { } else if (data.data.data === 'Success') {
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
} }

@ -395,12 +395,7 @@ export class WorklistMainPRComponent implements OnInit {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList'); this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
// show succsfull popup this.common.setTotalNumberOfWorklistRequest();
// this.messageSuccess = true;
// setTimeout(() => {
// this.messageSuccess = false;
// }, 5000);
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
@ -440,9 +435,12 @@ export class WorklistMainPRComponent implements OnInit {
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo); console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index);
console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
let previousRequestType = this.notificationArray[index].ITEM_TYPE;
if (this.common.filterKeys[previousRequestType] != 0)
this.common.filterKeys[previousRequestType] = (this.common.filterKeys[previousRequestType] - 1)
index += 1; index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
@ -453,9 +451,11 @@ export class WorklistMainPRComponent implements OnInit {
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index); this.checkRequestType(index);
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
@ -1117,9 +1117,9 @@ export class WorklistMainPRComponent implements OnInit {
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {

@ -560,10 +560,9 @@ export class WorklistMainComponent implements OnInit {
// } // }
// this.messageSuccess = true; // this.messageSuccess = true;
this.common.greenToastPK('worklist', 'done-successfully'); this.common.greenToastPK('worklist', 'done-successfully');
this.common.setTotalNumberOfWorklistRequest();
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; this.common.setTotalNumberOfWorklistRequest();
// this.openNotificationsDashboard();
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 2000);
} else { } else {
@ -601,14 +600,20 @@ export class WorklistMainComponent implements OnInit {
if (document.getElementById("notificationDynamicFields") != null) { if (document.getElementById("notificationDynamicFields") != null) {
document.getElementById("notificationDynamicFields").innerHTML = ""; document.getElementById("notificationDynamicFields").innerHTML = "";
} }
let itemNo = this.getPassNotificationDetails.ROW_NUM; let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo); console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
console.log(index); console.log(index);
console.log(this.notificationArray); console.log(this.notificationArray);
let previousRequest = this.notificationArray[index].REQUEST_TYPE; let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1; if (previousRequest == 'STAMP_MS' || previousRequest == 'STAMP_NS') {
previousRequest = 'STAMP';
}
if (this.common.filterKeys[previousRequest] != 0)
this.common.filterKeys[previousRequest] = (this.common.filterKeys[previousRequest] - 1)
index += 1;
if (index < this.notificationArray.length) { if (index < this.notificationArray.length) {
this.activeSegment = 'info'; this.activeSegment = 'info';
if (this.selectedFilter === 'ALL') { if (this.selectedFilter === 'ALL') {
@ -622,11 +627,15 @@ export class WorklistMainComponent implements OnInit {
this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA); this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
this.intializeNotificationDetail(); this.intializeNotificationDetail();
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
} }
} }
} else { } else {
this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED);
this.common.openNotificationPage(); this.common.openNotificationPage();
} }
@ -1019,7 +1028,7 @@ export class WorklistMainComponent implements OnInit {
let jobTitle = title.split('.'); let jobTitle = title.split('.');
if (jobTitle && jobTitle.length > 1) { if (jobTitle && jobTitle.length > 1) {
jobName = jobTitle[0] + " " + jobTitle[1]; jobName = jobTitle[0] + " " + jobTitle[1];
} }
} else { } else {
jobName = ''; jobName = '';
} }
@ -1148,7 +1157,7 @@ export class WorklistMainComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
// this.messageSuccess = false; // this.messageSuccess = false;
this.nextNotfification(); this.nextNotfification();
}, 2000); }, 1000);
// this.nextNotfification(); // this.nextNotfification();
} else { } else {
this.common.redToastPK('worklist', 'save-error'); this.common.redToastPK('worklist', 'save-error');
@ -1170,6 +1179,7 @@ export class WorklistMainComponent implements OnInit {
return; return;
} else if (data.data == "Success") { } else if (data.data == "Success") {
// this.openNotificationsDashboard(); // this.openNotificationsDashboard();
this.common.setTotalNumberOfWorklistRequest();
this.nextNotfification(); this.nextNotfification();
} }
}); });

Loading…
Cancel
Save