implemented checklist

MOE-PHASE-2
umasoodch 2 years ago
parent d0db5d15e3
commit b78f365b20

@ -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'];

@ -48,7 +48,7 @@
</ion-col>
</ion-row>
<ion-row *ngIf='selectedFilter === "ITG"' class="filters-row">
<!-- <ion-row *ngIf='selectedFilter === "ITG"' class="filters-row">
<ion-col>
<ion-slides [options]="slideOptsTwo">
<ion-slide class='slideCss' *ngFor="let segment of ITGSegment">
@ -58,7 +58,7 @@
</ion-slide>
</ion-slides>
</ion-col>
</ion-row>
</ion-row> -->
<div [ngClass]="direction === 'ar' ? 'worklist-content-ar' : 'worklist-content'">
<div [ngClass]="showFormattedData.length > 0 && direction == 'en'? 'work-list-container' : 'work-list-container-ar'" *ngIf='selectedFilter != "ITG" && showFormattedData.length > 0'>
@ -70,7 +70,7 @@
</div>
</div>
</div>
<div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<!-- <div [ngClass]="ITGItem.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' >
<div *ngIf="activeSegment !== 'All'" (click)='openITG(segmentInfo)'>
@ -89,7 +89,7 @@
</div>
</div>
</div>
</div>
</div> -->
<div *ngIf="!isLoading">
<div class="no-data-available" *ngIf="showFormattedData.length === 0 && selectedFilter != 'ITG'">
<span>{{ts.trPK('work-list','No-data-available')}}</span>

@ -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',

@ -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<any> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getChecklistNotificationBody,
request,
onError,
errorLabel
);
}
public getOLMNotification(
WorkListBodyRequest: any,
onError?: any,

@ -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<WorkListActionHistoryResponse> {
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<WorkListActionHistoryResponse> {
this.authService.authenticateRequest(req);
console.log(req);

@ -63,7 +63,7 @@
<div class="no-data-div" *ngIf="notificationBodyRes?.length === 0 &&
!showInformation && stampNsNotificationBodyRes?.length === 0 &&
stampMsNotificationBodyRes?.length === 0">
stampMsNotificationBodyRes?.length === 0 && checklistNotificationBodyRes?.length === 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
@ -87,6 +87,10 @@
</ion-card>
</div>
<div *ngIf="checklistNotificationBodyRes">
<textarea style="border: 2px solid #ccc; border-radius: 4px; background-color: #f8f8f8;" cols="40" rows="20">{{checklistNotificationBodyRes}}</textarea>
</div>
<div *ngIf="stampNsNotificationBodyRes?.length > 0">
<ion-card *ngFor="let item of stampNsNotificationBodyRes;let i=index; "
style="width: 91%;">
@ -1070,10 +1074,17 @@
</div>
</div>
<ion-col size="8">
<ion-label class="name">
<ion-label *ngIf="selectedFilter != 'HRCKLTSK'" class="name">
{{actionHistory.NAME}}
</ion-label>
<ion-label *ngIf="selectedFilter == 'HRCKLTSK'" class="name">
{{actionHistory.FROM_USER}}
</ion-label>
<div *ngIf="actionHistory.NOTE != '' ">
<div *ngIf="!checkLines(actionHistory.NOTE)">
<div class="containerNote">
@ -1101,9 +1112,15 @@
<ion-label *ngIf="actionHistory.NOTIFICATION_DATE != ''"
class="dateActionHistory">
{{actionHistory.NOTIFICATION_DATE}} </ion-label>
{{actionHistory.NOTIFICATION_DATE}}
</ion-label>
<ion-label *ngIf="actionHistory.ACTION_DATE != '' && selectedFilter == 'HRCKLTSK'"
class="dateActionHistory">
{{actionHistory.ACTION_DATE}}
</ion-label>
</ion-col>
<ion-col size="4">
<ion-col size="4" *ngIf="selectedFilter != 'HRCKLTSK'">
<img class="req_info" src="assets/imgs/req info.svg"
(click)="openRequestInfoDel(actionHistory, 'REQUEST_INFO')" />
<img class="req_info" src="assets/imgs/delegate.svg"

@ -54,6 +54,7 @@ export class WorklistMainComponent implements OnInit {
public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999;
notificationBodyRes: any = [];
checklistNotificationBodyRes: any = [];
stampNsNotificationBodyRes: any = [];
stampMsNotificationBodyRes: any = [];
actionHistoryRes: any = [];
@ -111,6 +112,7 @@ export class WorklistMainComponent implements OnInit {
closeDis: boolean = false;
public selectedFilter: string;
public arr_hr_req_only = [];
public checkListArray = [];
public showInformation = true;
@ -226,9 +228,9 @@ export class WorklistMainComponent implements OnInit {
false
);
console.log(this.selectedFilter);
if (this.selectedFilter === 'HRSSA' || this.selectedFilter === 'STAMP') {
console.log("ENAD")
if (this.selectedFilter === 'HRSSA' || this.selectedFilter === 'HRCKLTSK') {
this.arr_hr_req_only = [];
this.checkListArray = [];
this.sortRequests();
}
this.WorkListBodyObj = new WorkListBodyRequest();
@ -266,8 +268,9 @@ export class WorklistMainComponent implements OnInit {
// this.WorkListSubmitterInfoObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
// this.WorkListSubmitterInfoObj.P_SEARCH_USER_NAME = "";
this.getsubmitterInfo(this.WorkListSubmitterInfoObj);
if (this.selectedFilter != 'HRCKLTSK') {
this.getsubmitterInfo(this.WorkListSubmitterInfoObj);
}
this.getNotificationButtons(this.WorkListButtonsObj);
this.getNotificationResAttr(this.WorkListButtonsObj);
@ -304,6 +307,8 @@ export class WorklistMainComponent implements OnInit {
this.getOPMNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'OLM') {
this.getOLMNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'HRCKLTSK') {
this.getChecklistNotification(this.WorkListBodyObj);
}
}
@ -419,6 +424,15 @@ export class WorklistMainComponent implements OnInit {
});
}
getChecklistNotification(notificationBodyObj) {
this.notificationBodyRes = []
this.worklistMainService
.getChecklistNotification(notificationBodyObj)
.subscribe((result: EITNotificatonBodyResponse) => {
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) {

Loading…
Cancel
Save