Merge branch 'MOHEMM-Q3-DEV' into sultan-q3

# Conflicts:
#	Mohem/src/assets/localization/i18n.json
MOHEMM-Q3-DEV
Sultan Khan 4 years ago
commit e7755c1ef4

@ -96,7 +96,7 @@ export class SmsPageComponent implements OnInit {
initTimer() {
if (!this.timeInSeconds) {
this.timeInSeconds = 600;
this.timeInSeconds = 120;
}
this.time = this.timeInSeconds;
this.runTimer = false;

@ -1216,6 +1216,9 @@ export class CommonService {
public openWorklistMainPage() {
this.nav.navigateForward(['/notification/worklist-main']);
}
public openWorklistSettingsPage() {
this.nav.navigateForward(['/notification/worklist-settings']);
}
public openWorklistMainPRPage() {
this.nav.navigateForward(['/notification/worklist-main-PR']);
}

@ -41,11 +41,12 @@ export class GenericHeaderComponent implements OnInit {
}
async openNotifictionSetting() {
const modal = await this.modalController.create({
component: WorklistSettingComponent,
cssClass: 'app-update-modal-css',
});
return await modal.present();
// const modal = await this.modalController.create({
// component: WorklistSettingComponent,
// cssClass: 'app-update-modal-css',
// });
// return await modal.present();
this.common.openWorklistSettingsPage();
}
}

@ -638,33 +638,35 @@ export class HomeComponent implements OnInit {
this.ITGItem = [];
this.workListService.getITGCount('', '', this.isPostNoLoad)
.subscribe((result: any) => {
if (result.RequestType.length > 0) {
this.ITGSegment[0] = {
name: 'All',
code: 'All',
data: null,
style: false
};
this.ITGSegment[0].data = datas;
this.ITGSegment[0].names = names;
this.setActive(this.ITGSegment[0].code);
}
console.log(result.RequestType);
let count = 1;
for (let i = 0; i < result.RequestType.length; i++) {
console.log()
this.ITGSegment[count] = {
name: result.RequestType[i].RequestTypeName,
code: result.RequestType[i].RequestTypeCode,
data: result.RequestType[i].RequestDetails,
style: false
};
datas[i] = result.RequestType[i].RequestDetails;
names[i] = result.RequestType[i].RequestTypeCode;
count++;
if (result.RequestType) {
if (result.RequestType.length > 0) {
this.ITGSegment[0] = {
name: 'All',
code: 'All',
data: null,
style: false
};
this.ITGSegment[0].data = datas;
this.ITGSegment[0].names = names;
this.setActive(this.ITGSegment[0].code);
}
console.log(result.RequestType);
let count = 1;
for (let i = 0; i < result.RequestType.length; i++) {
console.log()
this.ITGSegment[count] = {
name: result.RequestType[i].RequestTypeName,
code: result.RequestType[i].RequestTypeCode,
data: result.RequestType[i].RequestDetails,
style: false
};
datas[i] = result.RequestType[i].RequestDetails;
names[i] = result.RequestType[i].RequestTypeCode;
count++;
}
//this.sortArrayOfAll(this.ITGSegment[0].data)
console.log(this.ITGSegment);
}
//this.sortArrayOfAll(this.ITGSegment[0].data)
console.log(this.ITGSegment);
});
}

@ -0,0 +1,6 @@
export class UserItemTypes extends Request {
public P_ITEM_TYPE: string;
public P_FYA_ENABLED_FALG: string;
public P_FYI_ENABLED_FLAG: string;
public ItemID: number;
}

@ -32,6 +32,7 @@ import { MoreActionModalComponent } from './more-action-modal/more-action-modal.
import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component';
import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component';
import { WorklistMainIcComponent } from './worklist-main-ic/worklist-main-ic.component';
import { WorklistSettingComponent } from './worklist-setting/worklist-setting.component';
const routes: Routes = [
@ -123,6 +124,10 @@ const routes: Routes = [
{
path: 'item-creation-IC',
component: WorklistMainIcComponent
},
{
path: 'worklist-settings',
component: WorklistSettingComponent
}
]
}

@ -20,6 +20,7 @@ import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes';
import { Request } from 'src/app/hmg-common/services/models/request';
import { LoginModel } from '../../authentication/models/LoginModel';
import { itgRequest } from '../models/itgFormDetailsRequest';
import { UserItemTypes } from "../models/userItemTypeRequest";
@Injectable()
export class WorklistMainService {
@ -30,6 +31,8 @@ export class WorklistMainService {
public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY";
public static getBasicDetailNotificationBody = "Services/ERP.svc/REST/GET_BASIC_DET_NTF_BODY";
public static getStampMSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_MS_NOTIFICATION_BODY";
public static getStampNSNotificationBody = "Services/ERP.svc/REST/GET_STAMP_NS_NOTIFICATION_BODY";
public static getAddressNotificationBody = "Services/ERP.svc/REST/GET_ADDRESS_NOTIFICATION_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
@ -41,6 +44,8 @@ export class WorklistMainService {
public static getITGFormTaskCount = 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType';
public static getITGFormTaskDetails = 'Services/COCWS.svc/REST/ITGFormsPendingTasks';
public static getITGFormDetails = 'Services/COCWS.svc/REST/ITGGetFormDetials';
public static getWorklistNotificationURL = 'Services/ERP.svc/REST/GET_USER_ITEM_TYPES';
public static updateWorklistNotificationURL = 'Services/ERP.svc/REST/UPDATE_USER_ITEM_TYPES';
@ -124,6 +129,36 @@ export class WorklistMainService {
);
}
public getStampMSNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getStampMSNotificationBody,
request,
onError,
errorLabel
);
}
public getStampNSNotificationBody(
WorkListBodyRequest: any,
onError?: any,
errorLabel?: string
): Observable<PRNotificatonBodyResponse> {
const request = WorkListBodyRequest;
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getStampNSNotificationBody,
request,
onError,
errorLabel
);
}
public getAddressNotificationBody(
WorkListBodyRequest: any,
onError?: any,
@ -346,4 +381,32 @@ export class WorklistMainService {
}
public getWorklistNotifications(
onError?: any,
errorLabel?: string
): Observable<any> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.api.post(
WorklistMainService.getWorklistNotificationURL,
request,
onError,
errorLabel
);
}
public updateWorklistNotifications(
requestData: any,
onError?: any,
errorLabel?: string
): Observable<any> {
this.authService.authenticateRequest(requestData);
return this.api.post(
WorklistMainService.updateWorklistNotificationURL,
requestData,
onError,
errorLabel
);
}
}

@ -112,10 +112,15 @@
<div *ngIf="approvalInfo.Notes">
<div class="containerNote">
<div class="containerNote" *ngIf='!actionHistory'>
Note: {{approvalInfo.Notes}}
</div>
<div class="containerNote" style="height: auto;" *ngIf='actionHistory'>
Note: {{approvalInfo.Notes}}
</div>
<div *ngIf='approvalInfo.Notes.length >= 16'>
<a (click)="actionHistory = !actionHistory">{{'general, show-more' | translate}}</a>
</div>
</div>
</div>

@ -62,6 +62,7 @@ export class WorkListMainItgComponent implements OnInit {
defaultSegment = '';
public slideIndex = 0;
public messageSuccess = false;
public actionHistory = false;
constructor(
public common: CommonService,
public ts: TranslatorService,
@ -271,13 +272,16 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(1);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else if (action === 2) {// reject
@ -291,13 +295,16 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(2);
this.skip();
this.messageSuccess = false;
// this.messageSuccess = false;
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -315,15 +322,18 @@ export class WorkListMainItgComponent implements OnInit {
}
if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(3);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -336,15 +346,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(4);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else if (action === 5) { // answer
@ -358,15 +371,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(5);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
@ -383,15 +399,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else {
@ -409,15 +428,18 @@ export class WorkListMainItgComponent implements OnInit {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
} else if (result.MessageStatus === 1) {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.sharedService.setSharedData(true, 'loadWorkList');
// this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.confirmMsg(6);
this.skip();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
} else {

@ -68,7 +68,7 @@ export class WorkListReplacementItgComponent implements OnInit {
this.relatedList.push(lookupObject[i]);
}
}
this.getFavruite();
// this.getFavruite();
} else {
this.select(this.delegtedEmp, 1);
}
@ -164,9 +164,11 @@ export class WorkListReplacementItgComponent implements OnInit {
if (this.isSave == true) {
if (this.selEmp) {
data = this.selEmp;
this.messageSuccess = true;
// this.messageSuccess = true;
this.cs.greenToastPK('worklist', 'save-successfully');
} else {
data = null;
this.cs.redToastPK('worklist', 'save-error');
}
if (typeof this.callback == 'function') {
this.callback(data);

@ -53,7 +53,7 @@ export class WorkListReplacementRollComponent implements OnInit {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
this.getFavruite();
// this.getFavruite();
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
@ -489,8 +489,13 @@ export class WorkListReplacementRollComponent implements OnInit {
// }
}
getPlaceHolder() {
return this.searchBy == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchBy == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail');
return this.searchBy === '1' ?
this.ts.trPK('replacementRoll', 'searchbyname') :
this.searchBy === '2' ?
this.ts.trPK('replacementRoll', 'searchbyusername') :
this.ts.trPK('replacementRoll', 'searchbyemail');
}
getFavruite() {
this.cs.startLoading();
this.worklistService.getFavorite({}, () => {
@ -503,20 +508,10 @@ export class WorkListReplacementRollComponent implements OnInit {
this.favoriteUserList.forEach((obj) => {
obj.IsFavorite = true;
});
/**** THIS CODE TO CHECK STAR OF EMPLOYEE IF IT IS IN FAVORITE LIST AND SHOW IN WORKFLOW LIST****/
// this.actionHistory.forEach((obj, i) => {
// if(this.favoriteUserList.some(x => x['USER_NAME'] === obj.USER_NAME)) {
// this.actionHistory[i].isInFavorite = true;
// } else {
// this.actionHistory[i].isInFavorite = false;
// }
// });
// console.log(this.actionHistory);
/**** END ****/
}
});
}
saveUserFavruiteList(request, isFav: boolean) {
this.worklistService.saveFavoriteList(request, () => {
}).subscribe((result) => {

@ -427,12 +427,15 @@ export class WorklistMainIcComponent implements OnInit {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
} // valid it
}
@ -1210,13 +1213,16 @@ export class WorklistMainIcComponent implements OnInit {
return;
} else if (data.data.data == "Success") {
// this.openNotificationsDashboard();
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');
}
});

@ -368,12 +368,15 @@ export class WorklistMainMRComponent implements OnInit {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
} // valid it
}
@ -1111,13 +1114,16 @@ export class WorklistMainMRComponent implements OnInit {
return;
} else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');
}
});

@ -404,12 +404,15 @@ export class WorklistMainPoComponent implements OnInit {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
} // valid it
}
@ -1187,9 +1190,11 @@ export class WorklistMainPoComponent implements OnInit {
return;
} else if (data.data.data == "Success") {
// this.openNotificationsDashboard();
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.common.redToastPK('worklist', 'save-error');
this.nextNotfification();
}, 2000);
// this.nextNotfification();

@ -394,13 +394,16 @@ export class WorklistMainPRComponent implements OnInit {
// tslint:disable-next-line: triple-equals
if (result.MessageStatus == 1) {
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.greenToastPK('worklist', 'save-successfully');
// show succsfull popup
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
}, 5000);
// this.messageSuccess = true;
// setTimeout(() => {
// this.messageSuccess = false;
// }, 5000);
// this.openNotificationsDashboard();
this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');
}
} // valid it
}
@ -1111,13 +1114,16 @@ export class WorklistMainPRComponent implements OnInit {
return;
} else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');
}
});

@ -49,7 +49,19 @@
<!-- NOT ADDRESS & BASIC_DETAILS -->
<ion-col
*ngIf="getPassNotificationDetails?.REQUEST_TYPE != 'ADDRESS' && getPassNotificationDetails?.REQUEST_TYPE != 'BASIC_DETAILS' ">
<div *ngIf="notificationBodyRes?.length > 0 ">
<div *ngIf="showInformation">
<p>{{'worklist, loading'| translate}} <img style="width: 3%;"
src="../assets/icon/progress-loading.gif" /></p>
</div>
<div class="no-data-div" *ngIf="notificationBodyRes?.length === 0 &&
!showInformation && stampNsNotificationBodyRes?.length === 0 &&
stampMsNotificationBodyRes?.length === 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf="notificationBodyRes?.length > 0">
<ion-card *ngFor="let item of notificationBodyRes;let i=index; "
style="width: 91%;">
<ion-card-content *ngIf="item.Collection_Notification.length > 0">
@ -68,6 +80,165 @@
</ion-card-content>
</ion-card>
</div>
<div *ngIf="stampNsNotificationBodyRes?.length > 0">
<ion-card *ngFor="let item of stampNsNotificationBodyRes;let i=index; "
style="width: 91%;">
<ion-card-content>
<div>
<ion-row>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'userProfile, empNo'| translate}} </label>
<br />
<label>{{item.EMPLOYEE_NUMBER}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'workList, assignment-number'| translate}}</label>
<br />
<label> {{item.ASSIGNMENT_NUMBER}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'userProfile, name'| translate}}</label>
<br />
<label> {{item.EMPLOYEE_NAME}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'workList, schedule-date'| translate}}</label>
<br />
<label> {{item.SCHEDULE_DATE| date}}</label>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
<div *ngIf="stampMsNotificationBodyRes?.length > 0">
<ion-card *ngFor="let item of stampMsNotificationBodyRes;let i=index; "
style="width: 91%;">
<ion-card-content>
<div>
<ion-row>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'userProfile, empNo'| translate}} </label>
<br />
<label>{{item.EMPLOYEE_NUMBER}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'worklist, assignment-number'| translate}}</label>
<br />
<label> {{item.ASSIGNMENT_NUMBER}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'userProfile, name'| translate}}</label>
<br />
<label> {{item.EMPLOYEE_NAME}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
{{'worklist, schedule-date'| translate}}</label>
<br />
<label> {{item.SCHEDULE_DATE| date}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
Shift Type</label>
<br />
<label> {{item.SHT_TYPE_DESC}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
Shift</label>
<br />
<label> {{item.SHT_NAME}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
Break</label>
<br />
<label> {{item.BREAK_NAME}}</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<ion-row>
<label class="colItemReq">
Actual Swipe(s)</label>
<br />
<ion-col size="6">
<label class="colItemReq">
Start</label>
<br />
<label *ngIf="item.SHT_ACTUAL_START_TIME != ''">
{{item.SHT_ACTUAL_START_TIME}}</label>
<label
*ngIf="item.SHT_ACTUAL_START_TIME == ''">--</label>
</ion-col>
<ion-col size="6">
<label class="colItemReq">
End</label>
<br />
<label *ngIf='item.SHT_ACTUAL_END_TIME != ""'>
{{item.SHT_ACTUAL_END_TIME}}</label>
<label *ngIf='item.SHT_ACTUAL_END_TIME == ""'>--</label>
</ion-col>
</ion-row>
</ion-col>
</ion-row>
<ion-row>
<ion-col class="rowBorder" size="6">
<ion-row>
<label class="colItemReq">
Approved Swipe(s)</label>
<br />
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
Start</label>
<br />
<label *ngIf='item.APPROVED_START_TIME != ""'>
{{item.APPROVED_START_TIME}}</label>
<label *ngIf='item.APPROVED_START_TIME == ""'>--</label>
</ion-col>
<ion-col class="rowBorder" size="6">
<label class="colItemReq">
Start Reason</label>
<br />
<label *ngIf='item.APPROVED_START_REASON != ""'>
{{item.APPROVED_START_REASON}}</label>
<label
*ngIf='item.APPROVED_START_REASON == ""'>--</label>
</ion-col>
<ion-col size="6">
<label class="colItemReq">
End</label>
<br />
<label *ngIf='item.SHT_ACTUAL_END_TIME !=""'>
{{item.SHT_ACTUAL_END_TIME}}</label>
<label *ngIf='item.SHT_ACTUAL_END_TIME ==""'>--</label>
</ion-col>
<ion-col size="6">
<label class="colItemReq">
End Reason</label>
<br />
<label *ngIf="item.APPROVED_END_REASON_DESC != ''">
{{item.APPROVED_END_REASON_DESC}}</label>
<label
*ngIf="item.APPROVED_END_REASON_DESC == ''">--</label>
</ion-col>
</ion-row>
</ion-col>
</ion-row>
</div>
</ion-card-content>
</ion-card>
</div>
<div style="margin: 10px;font-weight: bold; "
*ngIf="subordinatesleaveList != undefined && subordinatesleaveList?.length > 0">
{{ts.trPK('worklistMain','employee-on-leave')}}
@ -123,6 +294,14 @@
<!-- IF BASIC_DETAILS -->
<ion-col *ngIf="getPassNotificationDetails?.REQUEST_TYPE == 'BASIC_DETAILS' ||
getPassNotificationDetails?.REQUEST_TYPE == 'ADDRESS'">
<div *ngIf="showInformation">
<p>{{'worklist, loading'| translate}} <img style="width: 3%;"
src="../assets/icon/progress-loading.gif" /></p>
</div>
<div class="no-data-div" *ngIf="notificationBodyRes?.length === 0 && !showInformation">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div *ngIf='notificationBodyRes.length > 0'>
<ion-card style="width: 91%;">
<ion-card-content>
@ -139,7 +318,7 @@
</ion-label>
</ion-col>
</ion-row>
<ion-row *ngFor="let item of notificationBodyRes;let i=index;">
<ion-row *ngFor="let item of notificationBodyRes;let i=index;">
<ion-col class="rowBorder" size="6"
[hidden]="item.UPDATED_FLAG == 'N'">
<label class="colItemReq">{{item.SEGMENT_PROMPT}}</label>

@ -137,6 +137,15 @@
border-radius: 10px;
margin: 10px;
}
.no-data-div{
background: #ffffff;
height: 100%;
text-align: center;
padding-top: 1px;
border-radius: 10px;
margin: 10px;
}
.container {
font-size: 14px;

@ -53,6 +53,8 @@ export class WorklistMainComponent implements OnInit {
public static PASS_RES_ATTR = "passResAttr";
TransactionID: number = -999;
notificationBodyRes: any = [];
stampNsNotificationBodyRes: any =[];
stampMsNotificationBodyRes: any =[];
actionHistoryRes: any = [];
notificationButtonRes: any;
actionMode: any;
@ -108,6 +110,8 @@ export class WorklistMainComponent implements OnInit {
closeDis: boolean = false;
public selectedFilter: string;
public arr_hr_req_only = [];
public showInformation = true;
constructor(
public worklistService: WorklistService,
@ -210,6 +214,8 @@ export class WorklistMainComponent implements OnInit {
HomeComponent.NOTIFICATION_DATA,
false
);
console.log('/////////////////////////////////////');
console.log(this.getPassNotificationDetails);
this.notificationArray = []
this.subordinatesleaveList = [];
@ -277,10 +283,30 @@ export class WorklistMainComponent implements OnInit {
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'ADDRESS') {
this.getAddressNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'BASIC_DETAILS') {
this.getBasicDetailsNotification(this.WorkListBodyObj)
this.getBasicDetailsNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'STAMP_MS') {
this.getStampMSNotification(this.WorkListBodyObj);
} else if (this.getPassNotificationDetails.REQUEST_TYPE === 'STAMP_NS') {
this.getStampNSNotification(this.WorkListBodyObj);
}
}
getStampMSNotification(notificationBodyObj) {
this.worklistMainService
.getStampMSNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "STAMP_MS");
});
}
getStampNSNotification(notificationBodyObj) {
this.worklistMainService
.getStampNSNotificationBody(notificationBodyObj)
.subscribe((result: PRNotificatonBodyResponse) => {
this.handleWorkListBodyResult(result, "STAMP_NS");
});
}
getBasicDetailsNotification(notificationBodyObj) {
this.worklistMainService
.getBasicDetailNotificationBody(notificationBodyObj)
@ -337,7 +363,7 @@ export class WorklistMainComponent implements OnInit {
}
handleWorkListBodyResult(result, Type) {
this.showInformation = false;
if (this.common.validResponse(result)) {
this.pInformation = result.P_INFORMATION;
this.pQuestion = result.P_QUESTION;
@ -381,6 +407,20 @@ export class WorklistMainComponent implements OnInit {
console.log(result);
}
}
else if (Type === "STAMP_MS"){
if (result.GetStampMsNotificationBodyList) {
this.stampMsNotificationBodyRes =
result.GetStampMsNotificationBodyList;
console.log(result);
}
}
else if (Type === "STAMP_NS"){
if (result.GetStampNsNotificationBodyList) {
this.stampNsNotificationBodyRes =
result.GetStampNsNotificationBodyList;
console.log(result);
}
}
}
} //End handleWorkListBodyResult
@ -449,12 +489,15 @@ export class WorklistMainComponent implements OnInit {
// this.notificationArray.splice(i, 1);
// }
// }
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
// this.openNotificationsDashboard();
this.nextNotfification();
}, 2000);
} else {
this.common.redToastPK('worklist', 'save-error');
}
} // valid it
}
@ -1029,12 +1072,15 @@ export class WorklistMainComponent implements OnInit {
if (data.data.data == "cancel" || data.data.data == undefined) {
return;
} else if (data.data.data == "Success") {
this.messageSuccess = true;
// this.messageSuccess = true;
this.common.greenToastPK('worklist', 'save-successfully');
setTimeout(() => {
this.messageSuccess = false;
// this.messageSuccess = false;
this.nextNotfification();
}, 2000);
// this.nextNotfification();
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
return await modal.present();
@ -1149,7 +1195,6 @@ export class WorklistMainComponent implements OnInit {
}
@ -1158,4 +1203,12 @@ export class WorklistMainComponent implements OnInit {
return this.locale[lang].month_names_short[month];
}
showLoading( notificationList ) {
if (notificationList.length < 0) {
return true;
} else if (notificationList === []){
return false;
} else {return true;}
}
}

@ -16,17 +16,26 @@
<br>
<ion-list>
<ion-item>
<ion-label>
<p *ngIf="direction == 'ltr'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; font-weight: bolder;">item type</p>
</ion-label>
<p *ngIf="direction == 'ltr'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; font-weight: bolder;">FYA</p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p *ngIf="direction == 'ltr'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; font-weight: bolder;">FYI</p>
</ion-item>
<ion-item *ngFor="let data of notificationList">
<ion-label>
<p *ngIf="direction == 'ltr'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; padding-bottom: 10px;">{{data.nameEn}}</p>
<p *ngIf="direction == 'rtl'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; padding-bottom: 10px;">{{data.nameAr}}</p>
<p *ngIf="direction == 'ltr'" style="color: black; padding: 5px; font-size: 16px; font-family: 'Poppins'; padding-bottom: 10px;">{{data.ITEM_TYPE}}</p>
</ion-label>
<ion-toggle [checked]="data.isChecked"></ion-toggle>
<ion-toggle (ionChange)="chnageToggle(data, 'FYA', data.FYA_ENABLED_FALG)" [checked]="data.FYA_ENABLED_FALG === 'Y'"></ion-toggle>
&nbsp;&nbsp;&nbsp;
<ion-toggle (ionChange)="chnageToggle(data, 'FYI', data.FYI_ENABLED_FLAG)" [checked]="data.FYI_ENABLED_FLAG === 'Y'"></ion-toggle>
</ion-item>
<br>
</ion-list>
</ion-content>
<ion-footer>
<ion-button style="font-size: 16px !important; width:371px; --background: #259CB8; background: white;" expand="block" (click)='dismiss()'>{{ 'worklist, save-changes' | translate}}</ion-button>
<ion-button (click)="saveChanges()" style="font-size: 16px !important; width:371px; --background: #259CB8; background: white;" expand="block">{{ 'worklist, save-changes' | translate}}</ion-button>
</ion-footer>

@ -1,6 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { UserItemTypes } from '../models/userItemTypeRequest';
import { WorklistMainService } from '../service/work-list.main.service';
@Component({
selector: 'app-worklist-setting',
@ -8,53 +11,76 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
styleUrls: ['./worklist-setting.component.scss'],
})
export class WorklistSettingComponent implements OnInit {
notificationList = [
{
id: 0,
nameEn: "Human Resource (HR)",
nameAr: "الموارد البشرية (HR)",
isChecked: false
},
{
id: 1,
nameEn: "Purchase Order (PO)",
nameAr: "امر شراء (PO)",
isChecked: false
},
{
id: 2,
nameEn: "Purchase Requesr (PR)",
nameAr: "طلب شراء (PR)",
isChecked: false
},
{
id: 3,
nameEn: "Move Request (MR)",
nameAr: "طلب نقل (MR)",
isChecked: false
},
{
id: 4,
nameEn: "Item Creation (IC)",
nameAr: "انشاء عنصر (IC)",
isChecked: false
}
];
notificationList = [];
request = [];
isChange = false;
public direction: string;
constructor(public modalController: ModalController, public ts: TranslatorService) { }
constructor(
public modalController: ModalController,
public ts: TranslatorService,
public common: CommonService,
public workListService: WorklistMainService) {}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.workListService.getWorklistNotifications()
.subscribe((result: any) => {
this.notificationList = result.GetUserItemTypesList;
for (let i = 0; i < this.notificationList.length; i++) {
this.request[i] = {
P_FYA_ENABLED_FALG: this.notificationList[i].FYA_ENABLED_FALG,
P_FYI_ENABLED_FLAG: this.notificationList[i].FYI_ENABLED_FLAG,
P_ITEM_TYPE: this.notificationList[i].ITEM_TYPE,
ItemID: i
};
}
});
}
chnageToggle(toggleValue, type, val) {
if ( val === 'Y') {
val = 'N';
} else if ( val === 'N') {
val = 'Y';
}
this.notificationList.forEach((el, index) => {
if ( el.ITEM_TYPE === toggleValue.ITEM_TYPE) {
if (type === 'FYI') {
this.request[index].P_FYI_ENABLED_FLAG = val;
} else if (type === 'FYA') {
this.request[index].P_FYA_ENABLED_FALG = val;
}
this.request[index].ItemID = index;
}
this.request[index].P_ITEM_TYPE = el.ITEM_TYPE;
});
}
dismiss() {
this.modalController.dismiss({
'dismissed': true
saveChanges() {
const body = {
UpdateItemTypeList: this.request
};
this.workListService.updateWorklistNotifications(body)
.subscribe((result: any) => {
if (result.UpdateItemTypeSuccessList) {
if (result.UpdateUserItemTypesList) {
this.common.greenToastPK('worklist', 'save-successfully');
this.dismiss();
} else {
this.common.redToastPK('worklist', 'save-error');
}
} else {
this.common.redToastPK('worklist', 'save-error');
}
});
}
public dismiss() {
this.common.sharedService.setSharedData(false, 'loadWorkList');
this.common.back();
}
}

@ -2582,6 +2582,26 @@
"save-changes": {
"en": "Save Changes",
"ar": "حفظ التغيرات"
},
"loading": {
"en": "Loading",
"ar": "يتم التحميل"
},
"save-successfully": {
"ar": "تم حفظ التغيير بنجاح",
"en": "Your change has been saved successfully"
},
"save-error": {
"ar": "هناك شئ خاطئ، يرجى المحاولة فى وقت لاحق",
"en": "Something went wrong please try again later"
},
"assignment-number": {
"ar": "رقم التخصيص ",
"en": "Assignment Number"
},
"schedule-date": {
"ar": "تاريخ الجدول",
"en": "Schedule Date"
}
},
"worklistMain": {

Loading…
Cancel
Save