diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index e962af56..9261a374 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -80,7 +80,7 @@ export class CommonService { ]; public filterKeys = { 'HRSSA': 0, - 'INVMOA': 0, + 'HRCKLTSK': 0, 'REQAPPRV': 0, 'POAPPRV': 0, 'INVITEM': 0, @@ -1634,7 +1634,9 @@ export class CommonService { public setFilterValues(data) { if (data.length > 0) { for (const notification of data) { - this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER + if (notification.ITEM_TYPE != 'HRWPM') { + this.filterKeys[notification.ITEM_TYPE] = notification.OPEN_NTF_NUMBER + } } } else { this.filterKeys['HRSSA'] = 0; @@ -1653,15 +1655,15 @@ export class CommonService { disable: false, total: 0 }, - // { - // value: 0, - // name: 'MR', - // active: false, - // color: '#3cb9d5', - // key: 'INVMOA', - // disable: false, - // total: 0 - // }, + { + value: 0, + name: 'HR-C', + active: false, + color: '#3cb9d5', + key: 'HRCKLTSK', + disable: false, + total: 0 + }, // { // value: 0, // name: 'PR', @@ -1741,8 +1743,8 @@ export class CommonService { this.filters[0].value = this.filterKeys['HRSSA']; this.data.datasets[0].data[0] = this.filterKeys['HRSSA']; - // this.filters[1].value = this.filterKeys['INVMOA']; - // this.data.datasets[0].data[1] = this.filterKeys['INVMOA']; + this.filters[1].value = this.filterKeys['HRCKLTSK']; + this.data.datasets[0].data[1] = this.filterKeys['HRCKLTSK']; // this.filters[2].value = this.filterKeys['REQAPPRV']; // this.data.datasets[0].data[2] = this.filterKeys['REQAPPRV']; diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index d55b66ed..42edb286 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -48,7 +48,7 @@ - +
@@ -70,7 +70,7 @@
-
+
{{ts.trPK('work-list','No-data-available')}} diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index f92f63d8..27bf3ae2 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -116,14 +116,15 @@ export class HomeComponent implements OnInit { key: 'HRSSA', disable: false }, - // { - // value: 0, - // name: 'MR', - // active: false, - // color: '#3cb9d5', - // key: 'INVMOA', - // disable: false - // }, + { + value: 0, + name: 'HR-C', + active: false, + color: '#3cb9d5', + key: 'HRCKLTSK', + disable: false, + total: 0 + }, // { // value: 0, // name: 'PR', diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index 1fb96de3..dfe8e525 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -27,6 +27,7 @@ import { UserItemTypes } from "../models/userItemTypeRequest"; @Injectable() export class WorklistMainService { public static getEITNotificationBody = "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY"; + public static getChecklistNotificationBody = "Services/ERP.svc/REST/GET_CHECKLIST_NTF_BODY"; public static getOPMNotificationBody = "Services/ERP.svc/REST/GET_OPM_NOTIFICATION_BODY"; public static getOLMNotificationBody = "Services/ERP.svc/REST/GET_OLM_NOTIFICATION_BODY"; public static getAbsenceNotificationBody = "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY"; @@ -95,6 +96,21 @@ export class WorklistMainService { ); } + public getChecklistNotification( + WorkListBodyRequest: any, + onError?: any, + errorLabel?: string + ): Observable { + const request = WorkListBodyRequest; + this.authService.authenticateRequest(request); + return this.api.post( + WorklistMainService.getChecklistNotificationBody, + request, + onError, + errorLabel + ); + } + public getOLMNotification( WorkListBodyRequest: any, onError?: any, diff --git a/Mohem/src/app/notification/service/worklist.service.ts b/Mohem/src/app/notification/service/worklist.service.ts index b35b867d..8ee2935d 100644 --- a/Mohem/src/app/notification/service/worklist.service.ts +++ b/Mohem/src/app/notification/service/worklist.service.ts @@ -16,6 +16,7 @@ export class WorklistService { public static getReplacmentEmployeeList = 'Services/ERP.svc/REST/GET_REPLACEMENT_LIST'; public static getRFCEmployeeList = 'Services/ERP.svc/REST/GET_RFC_EMPLOYEE_LIST'; public static getActionHistory = 'Services/ERP.svc/REST/GET_ACTION_HISTORY'; + public static getActionHistoryCheckList = 'Services/ERP.svc/REST/GET_CHECKLIST_ACTION_HISTORY'; public static getFavorite = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacements'; public static getFavoriteWithoutImage = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacementsWithoutImage'; public static saveFavorite = 'Services/ERP.svc/REST/Mohemm_ChangeFavoriteReplacements'; @@ -53,6 +54,12 @@ export class WorklistService { return this.api.post(WorklistService.getActionHistory, request, onError, errorLabel); } + public getActionHistoryCheckList(historyActionReq: any, onError?: any, errorLabel?: string): Observable { + const request = historyActionReq; + this.authService.authenticateRequest(request); + return this.api.post(WorklistService.getActionHistoryCheckList, request, onError, errorLabel); + } + public getFavorite(req: any, onError?: any, errorLabel?: string): Observable { this.authService.authenticateRequest(req); console.log(req); diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index 7c7a888a..626e8856 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -63,7 +63,7 @@
+ stampMsNotificationBodyRes?.length === 0 && checklistNotificationBodyRes?.length === 0">

{{ 'general, empty' | translate}}

@@ -87,6 +87,10 @@
+
+ +
+
@@ -1070,10 +1074,17 @@
- + {{actionHistory.NAME}} + + {{actionHistory.FROM_USER}} + + + + +
@@ -1101,9 +1112,15 @@ - {{actionHistory.NOTIFICATION_DATE}} + {{actionHistory.NOTIFICATION_DATE}} + + + + {{actionHistory.ACTION_DATE}} + - + { + this.handleWorkListBodyResult(result, "HRCKLTSK"); + }); + } + getAbsenceNotificationDetails(notificationBodyObj) { this.notificationBodyRes = []; this.worklistMainService @@ -525,6 +539,11 @@ export class WorklistMainComponent implements OnInit { this.notificationBodyRes = result.OLM_Notification_Body.P_ENROLLMENT_DETAILS_LIST; } } + else if (Type === "HRCKLTSK") { + if (result.CheckList_NTF_Body_Obj) { + this.checklistNotificationBodyRes = result.CheckList_NTF_Body_Obj.P_GET_CHECKLIST_NTF_BODY; + } + } } } //End handleWorkListBodyResult @@ -657,7 +676,7 @@ export class WorklistMainComponent implements OnInit { this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA); this.checkRequestType(index); } else { - if (this.arr_hr_req_only) { + if (this.arr_hr_req_only.length > 0) { let requestIndex = this.arr_hr_req_only.findIndex(x => x.ROW_NUM === itemNo); requestIndex++; if (requestIndex < this.arr_hr_req_only.length) { @@ -665,9 +684,18 @@ export class WorklistMainComponent implements OnInit { this.intializeNotificationDetail(); } else { this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); - //this.common.setTotalNumberOfWorklistRequest(true); this.common.openNotificationPage(); } + } else if(this.checkListArray.length > 0) { + let requestIndex = this.checkListArray.findIndex(x => x.ROW_NUM === itemNo); + requestIndex++; + if (requestIndex < this.checkListArray.length) { + this.common.sharedService.setSharedData(this.checkListArray[requestIndex], HomeComponent.NOTIFICATION_DATA); + this.intializeNotificationDetail(); + } else { + this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.openNotificationPage(); + } } } } else { @@ -746,7 +774,8 @@ export class WorklistMainComponent implements OnInit { ButtonAction == "APPROVED" || ButtonAction == "REJECTED" || ButtonAction == "DEL" || - ButtonAction == "CLOSE" + ButtonAction == "CLOSE" || + ButtonAction == "COMPLETE" ) { this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_ACTION_MODE = ButtonAction; @@ -781,6 +810,9 @@ export class WorklistMainComponent implements OnInit { else if (ButtonAction === "CLOSE") { this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') } + else if(ButtonAction === "COMPLETE") { + this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') + } this.common.confirmAlertDialogAction( () => { @@ -1026,31 +1058,40 @@ export class WorklistMainComponent implements OnInit { this.IsReachEnd = true; this.actionHistoryRes = []; console.log(" this.P_PAGE_NUM: " + this.P_PAGE_NUM); - this.worklistService.getActionHistory(WorkListActionHistoryObj). + if (this.selectedFilter == 'HRCKLTSK') { + this.worklistService.getActionHistoryCheckList(WorkListActionHistoryObj). + subscribe((result: WorkListActionHistoryResponse) => { + this.handleWorkListActionHistoryResult(result); + }); + } else { + this.worklistService.getActionHistory(WorkListActionHistoryObj). subscribe((result: WorkListActionHistoryResponse) => { this.handleWorkListActionHistoryResult(result); }); + } + } handleWorkListActionHistoryResult(result) { console.log("1" + this.IsReachEnd); if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetActionHistoryList)) { - this.actionHistoryRes = result.GetActionHistoryList; + if (this.common.hasData(result.GetActionHistoryList) || this.common.hasData(result.CheckList_Action_History_List)) { + if (this.selectedFilter == 'HRCKLTSK') { + this.actionHistoryRes = result.CheckList_Action_History_List; + } else { + this.actionHistoryRes = result.GetActionHistoryList; + } + this.P_PAGE_NUM++; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; let lastItemIndex = this.actionHistoryRes.length - 1; - if (result.GetActionHistoryList[lastItemIndex]) { - let lastitem = result.GetActionHistoryList[lastItemIndex]; + if (this.actionHistoryRes[lastItemIndex]) { + let lastitem = this.actionHistoryRes[lastItemIndex]; if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { this.IsReachEnd = true; - console.log("2" + this.IsReachEnd); - } else { this.IsReachEnd = false; - console.log("3" + this.IsReachEnd); - } } this.turnCateFun(this.actionHistoryRes); @@ -1287,9 +1328,10 @@ export class WorklistMainComponent implements OnInit { for (let i = 0; i < this.notificationArray.length; i++) { if (this.notificationArray[i].ITEM_TYPE === 'HRSSA' || this.notificationArray[i].ITEM_TYPE === 'STAMP') { this.arr_hr_req_only.push(this.notificationArray[i]); + } else if (this.notificationArray[i].ITEM_TYPE === 'HRCKLTSK') { + this.checkListArray.push(this.notificationArray[i]); } } - console.log(this.arr_hr_req_only); } returnDateTime(stringDate: string) {