fixed child education

MOHEMM-Q3-DEV-LATEST
umasoodch 4 years ago
parent 7ab6e0e46a
commit ef73fc8bc3

@ -1,3 +1,24 @@
<p>
add-cei works!
</p>
<app-generic-header
showBack="!getPassdirfromNotifiPage"
[updateDirection]="getPassdirfromNotifiPage"
[headerText]="headerTitle"
(trigger)="closeModal()"
>
</app-generic-header>
<ion-content padding>
<ion-item class="country dynamicField" lines="none" *ngIf="showEffectiveDate">
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-label>{{showEffectiveDate}}</ion-label>
</ion-item>
<div #containerDiv id="containerDiv">
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="submitChildEducationTransaction()">
{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,45 @@
.footer-button {
border-radius: 2px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
ion-label {
color: var(--customnavy) !important;
}
.daynamicForm-Label {
font-size: 16px;
color: #a2a5a6 !important;
display: block;
overflow: hidden;
-webkit-flex: 1;
flex: 1;
font-size: inherit;
white-space: normal;
padding: 5px 0px;
margin: 10px auto;
padding-left: 10px;
}
.header-toolbar-new{
--background: #269DB8;
}
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}
.country{
margin-top: 10px;
padding: 10px;
}

File diff suppressed because it is too large Load Diff

@ -39,4 +39,4 @@
</div>
</div>
</ion-content>
<ion-icon class="addClass" name="add" (click)="addEITRrq()"></ion-icon>
<ion-icon class="addClass" name="add" (click)="addCEIRrq()"></ion-icon>

@ -315,5 +315,16 @@
margin-right: 1px;
margin-left: 5px;
}
.addEitOkButton{
white-space: normal !important;
text-transform: capitalize !important;
min-height: 45px !important;
min-width: 5px !important;
margin: 8px !important;
background-color: #269DB8;
width: 80% !important;
color: white!important;
border-radius: 16px !important;
}

@ -104,21 +104,21 @@ export class CeiListComponent implements OnInit {
}
}
addEITRrq(i?) {
public addCEIRrq(i?) {
this.pAction = EIT_ACTION.ADD;
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
this.openEitNew(i);
this.openCEINew(i);
}
openEitNew(index) {
openCEINew(index) {
let item: any = [];
if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResCEITransactionList[index].Collection_Transaction;
}
this.transactionNo++;
// tslint:disable-next-line: max-line-length
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddEitPage();
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddCEIPage();
}
}

@ -1,3 +1,127 @@
<p>
confirm-add-cei works!
</p>
<ion-header>
<ion-toolbar class="header-toolbar-new">
<nav-buttons></nav-buttons>
<ion-title [ngClass]=" direction === 'en' ? 'title' : 'title-ar'" color="light">{{headerTitle}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<!-------------------------------Start New design ---------------------------------------->
<ion-grid>
<ion-row style="margin-top: 20px;margin-left: 12px;">
<ion-col>
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'" >{{'general, addAttach' | translate}}</div>
</ion-col>
<ion-col style="padding-left: 7%;" size="2">
<div class="fileDiv">
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
<label end for="file" class="attachLable">
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
</label></div>
</ion-col>
</ion-row>
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
</ion-item>
</ion-grid>
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
<div *ngFor="let attachList of attachListOver ; let i = index">
<ion-row>
<ion-col size="1">
<ion-label style="color: black !important;">
{{attachList.AttachmentID +1 }} .
</ion-label>
</ion-col>
<ion-col style="text-align: left;" size="10">
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
{{attachList.P_FILE_NAME }}
</ion-label>
</ion-col>
<ion-col size="1">
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
(click)="removeFile(attachList)">
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
</button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid *ngIf="attachmentRes?.length > 0">
<div *ngFor="let attachRes of attachmentRes">
<ion-row>
<ion-col col-8>
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
</div>
<ion-label>
{{attachRes.FILE_NAME }} </ion-label>
</ion-col>
<ion-col col-4>
<button float-end class="attachImgBtn"
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
<img class="attachImg" src="../assets/imgs/view.png">
</button>
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
class="attachImg" src="../assets/imgs/deletegray.png"></button>
</ion-col>
</ion-row>
</div>
</ion-grid>
<ion-grid class="">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
<ion-item class="submitNote" lines="none">
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
</ion-item>
</ion-grid>
<ion-grid class="approvalList">
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
<div class="noDataDiv" *ngIf="approversList?.length == 0">
<p>{{ 'general, empty' | translate}}</p>
</div>
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
<ion-list class="notification-list ">
<div class="timeline">
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
<div class="timeline-item" slot="start">
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
src="../assets/imgs/profile.png"> </div>
</div>
<ion-col>
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
{{employee.APPROVER}}
</ion-label>
<ion-label style="color:black !important ;padding-top: 4%;">
{{employee.POSITION_TITLE}}
</ion-label>
</ion-col>
<div class="line"></div>
</ion-item>
</div>
</ion-list>
</div>
</ion-grid>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="confirmEitOkButton" color="customnavy" ion-button (click)="openSubmitModal()">
{{ (isDelete ? 'general, delete' : 'general, submit') | translate }}</ion-button>
</div>
</ion-footer>

@ -1,4 +1,19 @@
import { WorkListAttachViewComponent } from './../../notification/work-list-attach-view/work-list-attach-view.component';
import { AddAttachComponent } from './../add-attach/add-attach.component';
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
import { EITNotificatonBodyResponse } from './../models/EITNotificationBodyRes';
import { WorkListButtonRequest } from './../models/NotificationButtonReq';
import { ApproversList } from './../../absence/models/approvers';
import { CeiRequest } from './../models/cei.request';
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
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 { EitService } from '../services/eit.service';
import { AddCeiResponse } from '../models/add.cei.response';
import { FileUploader } from 'ng2-file-upload';
import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component';
@Component({
selector: 'app-confirm-add-cei',
@ -7,8 +22,423 @@ import { Component, OnInit } from '@angular/core';
})
export class ConfirmAddCeiComponent implements OnInit {
constructor() { }
private P_TransactionID: number;
private ceiRequest: CeiRequest;
approversList = [];
addrespList: any;
eitComments: string = "";
menuType: string = "";
selEmp: string = "";
respID: number;
selMenu: MenuResponse;
getAttachList: any;
attachListDisplay: any = [];
headerTitle: string = "";
isTrue: any = 0;
attachItems: any;
public isResubmitEIT: boolean = false;
private itemKey: string = "";
private pActionMode: string = "SUBMIT";
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
attachmentRes: any;
objIndex1: any;
attachListOver: any = [];
index: any = 0;
getPassNotificationDetails: any;
isSubmitBtnClicked: boolean;
isDelete: boolean = false;
ngOnInit() {}
isUpload: boolean = false;
inQueue: boolean = false;
addAttachmentListReq: any;
attachmentID: number = 0;
addAttachRequest: any = [];
fileData: any;
fileType: any;
dirPage: any;
TransactionID: any;
indexLastObj: any = 0;
filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
direction: string;
constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) {
this.direction = TranslatorService.getCurrentLanguageName()
this.isSubmitBtnClicked = false;
this.ceiRequest = new CeiRequest();
}
ngOnInit() {
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.ceiRequest = this.cs.sharedService.getSharedData(CeiRequest.SHARED_DATA, false);
// this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false); //WARINING **
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
this.pActionMode = "RESUBMIT";
this.menuType = "E";
this.respID = -999;
this.selEmp = this.ceiRequest.P_SELECTED_EMPLOYEE_NUMBER;
this.getApproversList();
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "update-title");
this.headerTitle = msg;
} else {
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.addrespList = this.cs.sharedService.getSharedData(AddCeiResponse.SHARED_DATA);
this.itemKey = this.addrespList.SubmitCEITransactionList.P_ITEM_KEY;
this.P_TransactionID = this.addrespList.SubmitCEITransactionList.P_TRANSACTION_ID;
// this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
this.getApproversList();
}
}
getApproversList() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID,
P_AME_TRANSACTION_TYPE: "SSHRMS",
P_PAGE_NUM: 1,
P_PAGE_LIMIT: 1000
}
this.eitService.getApproversList(
body).
subscribe((result: any) => {
this.handleApproversResult(result);
});
}
handleApproversResult(result) {
if (this.cs.validResponse(result)) {
this.approversList = result.GetApprovesList;
}
}
startCeiApproval() {
if (this.attachListOver) {
let request = {
AddAttachmentList: this.attachListOver
}
this.eitService.addAttachment(
request).
subscribe((result: any) => {
this.handleAddAttachmentResults(result);
});
} else {
this.startCeiApprovalProcess();
}
}
handleAddAttachmentResults(result) {
if (this.cs.validResponse(result)) {
//this.isUpload=true;
this.isTrue = 0;
for (let i = 0; i < result.AddAttSuccessList.length; i++) {
if (!result.AddAttSuccessList[i].AddSuccess) {
this.attachListOver[i].isSuccess = false;
// if false display cancel button with waring icon or design
}// end if
else {
// if true remove cancel and set isSuccess = true
this.attachListOver[i].isSuccess = true;
this.isTrue = this.isTrue + 1; //count flag of attach status
} // end else
} // end for
if (this.isTrue == result.AddAttSuccessList.length) {
this.startCeiApprovalProcess();
}
else {
//stope
let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
this.attachListOver = filtered;
let msg: string = "";
msg = this.ts.trPK("eit", "attach-errorMsg");
this.cs.presentAlert(msg);
}
}
}
startCeiApprovalProcess() {
let request: any = {};
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
request.P_MENU_TYPE = this.menuType;
request.P_SELECTED_RESP_ID = this.respID;
request.P_TRANSACTION_ID = this.P_TransactionID;
request.P_ITEM_KEY = this.itemKey;
request.P_ACTION_MODE = this.pActionMode;
request.P_COMMENTS = this.eitComments;
this.eitService.startCeiApprovalProcess(
request).
subscribe((result: any) => {
this.handleResults(result);
});
}
cancelEitProcess() {
let body: any = {
P_TRANSACTION_ID: this.P_TransactionID
}
this.eitService.cancelHRTransaction(
body).
subscribe((result: any) => {
this.handleCancelResults(result);
});
}
handleCancelResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = false;
}
}
handleResults(result) {
if (this.cs.validResponse(result)) {
this.isSubmitBtnClicked = true;
let msg: string = this.ts.trPK("eit", "approval-message-success");
this.cs.presentAlert(msg);
this.cs.openNotificationPage();
}
}
async addAttachment(str: boolean, attachItems: any) {
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID;
this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID');
this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj');
const modal = await this.modalController.create({
component: AddAttachComponent
});
modal.onDidDismiss()
.then((data) => {
if (data == "cancel" || data == "undefined") {
return;
} else {
if (!str) {
this.updateFile(data, attachDocID);
} else {
console.log(data);
this.attachListDisplay = data.data;
this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el);
o.isSuccess = false;
return o;
});
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
}
}
});
return await modal.present();
}
/*****submit modal********/
async openSubmitModal() {
this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList');
this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
const modal = await this.modalController.create({
component: SubmitEitModalComponent,
backdropDismiss: false,
});
modal.cssClass = 'note-modal';
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
this.startCeiApproval();
}
});
return await modal.present();
}
removeFile(objectitem) {
if (this.attachListOver) {
let index2 = this.attachListOver.findIndex(item => item == objectitem);
if (index2 > -1) {
this.attachListOver.splice(index2, 1);
}
}
if (this.attachmentRes) {
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
if (index3 > -1) {
this.attachmentRes.splice(index3, 1);
}
}
}
getAttachment(NotificationID) {
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
this.eitService.getAttach(this.attachReqObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
});
}
handleWorkListAttachResult(result) {
if (this.cs.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
if (result.GetAttachementList != null) {
this.attachmentRes = result.GetAttachementList;
} // if result == null
} // valid it
}
async OpenAttachFiles(value, Type) {
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
const modal = await this.modalController.create({
component: WorkListAttachViewComponent
});
modal.onDidDismiss()
.then((data) => {
});
return await modal.present();
}
delelteFile(attach) {
this.cs.confirmAlertDialog((data) => {
if (data == true) {
this.continueDelete(attach);
}
}, this.ts.trPK('general', 'ok'), () => {
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
}
continueDelete(attach) {
let req = {
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
}
this.eitService.deleteAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
let msg: string = "";
msg = this.ts.trPK("eit", "deleteAttach");
this.cs.presentAlert(msg);
}
}
});
}
updateFile(attachList, attachDocID) {
let req = {
P_ATTACHED_DOCUMENT_ID: attachDocID,
P_FILE_DATA: attachList[0].P_FILE_DATA,
P_FILE_NAME: attachList[0].P_FILE_NAME,
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
}
this.eitService.updateAttach(req).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
let msg: string = "";
msg = this.ts.trPK("eit", "attachUpdate");
this.cs.presentAlert(msg);
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
}
} // val
});
}
ionViewWillLeave() {
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
this.cancelEitProcess();
}
public uploader: FileUploader = new FileUploader({
allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
maxFileSize: 10 * 1024 * 1024,
formatDataFunctionIsAsync: true,
formatDataFunction: async (item) => {
return new Promise((resolve, reject) => {
resolve({
name: item._file.name,
length: item._file.size,
contentType: item._file.type,
date: new Date()
});
});
}
});
onFileSelectedclick(event){
event.target.value = '';
}
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "notSupport");
this.cs.presentAlert(msg);
return
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
this.getBase64(file).then(
data => this.pushObject(data, file.name, file.type)
);
}
}
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
pushObject(fileData, name, type) {
try {
let array = name.split('.');
let attachType: string = array[array.length - 1];
this.attachListOver.push(
{
AttachmentID: this.attachListOver.length,
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
P_FILE_DATA: fileData.split(',')[1],
P_FILE_NAME: name,//.split('.')[0],
P_TRANSACTION_ID: this.P_TransactionID
})
} catch (e) {
}
}
}

@ -16,6 +16,8 @@ import { EitUpdateListComponent } from './eit-update-list/eit-update-list.compon
import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component';
import { CeiHomepageComponent } from './cei-homepage/cei-homepage.component';
import { CeiListComponent } from './cei-list/cei-list.component';
import { AddCeiComponent } from './add-cei/add-cei.component';
import { ConfirmAddCeiComponent } from './confirm-add-cei/confirm-add-cei.component';
const routes: Routes = [
{
@ -57,7 +59,15 @@ const routes: Routes = [
{
path: 'cei-list',
component: CeiListComponent
}
},
{
path: 'add-cei',
component: AddCeiComponent
},
{
path: 'confirm-cei',
component: ConfirmAddCeiComponent
},
]
}
];
@ -80,7 +90,9 @@ const routes: Routes = [
EitUpdateListComponent,
SubmitEitModalComponent,
CeiHomepageComponent,
CeiListComponent
CeiListComponent,
AddCeiComponent,
ConfirmAddCeiComponent
],
entryComponents: [
WorkListAttachViewComponent

@ -0,0 +1,8 @@
import { Response } from '../../hmg-common/services/models/response';
import { EitRespModel } from './eit.response.model'
export class AddCeiResponse extends Response {
public static SHARED_DATA = 'add-cei-response';
SubmitCEITransactionList: EitRespModel;
}

@ -0,0 +1,12 @@
import { EitTransactionModel } from './eit.transaction.model';
export class CeiRequest {
public static SHARED_DATA = 'cei-request';
public P_MENU_TYPE: string;
public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_FUNCTION_NAME: string;
public P_SELECTED_RESP_ID: Number;
P_CONTACT_RELATIONSHIP_ID: Number;
P_DESC_FLEX_CONTEXT_CODE: string;
EITTransactionTBL: EitTransactionModel[];
}

@ -8,5 +8,4 @@ export class EitRequest {
public P_SELECTED_RESP_ID: Number;
P_DESC_FLEX_CONTEXT_CODE: string;
EITTransactionTBL: EitTransactionModel[];
}

@ -5,6 +5,7 @@ import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AddEitResponse } from '../models/add.eit.response';
import { AddCeiResponse } from '../models/add.cei.response';
import { ApproversList } from 'src/app/absence/models/approvers';
import { WorkListButtonRequest } from '../models/NotificationButtonReq';
@ -18,12 +19,15 @@ export class EitService {
public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS';
public static getCEITransctions = 'Services/ERP.svc/REST/GET_CEI_TRANSACTIONS';
public static getEITDFFStrutre = 'Services/ERP.svc/REST/GET_EIT_DFF_STRUCTURE';
public static getCEIDFFStrutre = 'Services/ERP.svc/REST/GET_CEI_DFF_STRUCTURE';
public static getSetValue = 'Services/ERP.svc/REST/GET_VALUE_SET_VALUES';
public static getDefaultValue = 'Services/ERP.svc/REST/GET_DEFAULT_VALUE';
public static validateEITTransctions = 'Services/ERP.svc/REST/VALIDATE_EIT_TRANSACTION';
public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION';
public static submitCEI = 'Services/ERP.svc/REST/SUBMIT_CEI_TRANSACTION';
public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_APPROVAL_PROCESS';
public static startCeiProcess = 'Services/ERP.svc/REST/START_CEI_APPROVAL_PROCESS';
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
@ -65,6 +69,20 @@ export class EitService {
return this.con.post(EitService.submitEit, request, onError, errorLabel);
}
public submitChildEducation(cei: any, onError?: any, errorLabel?: string): Observable<AddCeiResponse> {
const request = cei;
request.EITTransactionTBL = cei.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(EitService.submitCEI, request, onError, errorLabel);
}
public submitCEI(eit: any, onError?: any, errorLabel?: string): Observable<AddEitResponse> {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(EitService.submitEit, request, onError, errorLabel);
}
public validateEITTransaction(validateEITTransactionReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = validateEITTransactionReq;
this.authService.authenticateRequest(request);
@ -77,6 +95,12 @@ export class EitService {
return this.con.post(EitService.getEITDFFStrutre, request, onError, errorLabel);
}
public getCEIDFFStrutre(EITDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = EITDFFStrutreReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getCEIDFFStrutre, request, onError, errorLabel);
}
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = SetValueReq;
this.authService.authenticateRequest(request);
@ -110,6 +134,12 @@ export class EitService {
return this.con.post(EitService.startEitProcess, request, onError, errorLabel);
}
public startCeiApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
const request = eitProcess;
this.authService.authenticateRequest(request);
return this.con.post(EitService.startCeiProcess, request, onError, errorLabel);
}
public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable<any> {
const request = transactionID;
this.authService.authenticateRequest(request);

@ -142,7 +142,7 @@ export class AuthenticationService {
} else {
mobileType = 'android';
}
request.VersionID = 3.3;//3.2;
request.VersionID = 3.4;//3.2;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;

@ -1129,9 +1129,15 @@ export class CommonService {
public openAddEitPage() {
this.nav.navigateForward(['/eit/add-eit']);
}
public openAddCEIPage() {
this.nav.navigateForward(['/eit/add-cei']);
}
public openConfirmEitPage() {
this.nav.navigateForward(['/eit/confirm-add-eit']);
}
public openConfirmCEIPage() {
this.nav.navigateForward(['/eit/confirm-cei']);
}
public openConfirmBasicDetailsPage() {
this.nav.navigateForward(['/profile/confirm-basic']);
}

@ -21,7 +21,7 @@
</ion-item>
<ion-item class="country dynamicField" lines="none" *ngIf="isUpdate ==false">
<ion-label> Effective Date</ion-label>
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-datetime [(ngModel)]="effectiveDate" min="1900" max="2100" displayFormat="DD/MM/YYYY " placeholder="MM/DD/YYYY"
></ion-datetime>
</ion-item>

@ -10,7 +10,7 @@
<ion-content padding>
<ion-item class="country dynamicField" lines="none" *ngIf="targetValue === 'correct' && showEffectiveDate">
<ion-label>Effective Date</ion-label>
<ion-label>{{'vacation-rule, effectiveDate' | translate}}</ion-label>
<ion-label>{{showEffectiveDate}}</ion-label>
</ion-item>
<div #containerDiv id="containerDiv">

@ -1585,6 +1585,10 @@
}
},
"vacation-rule": {
"effectiveDate": {
"en": "Effective Date",
"ar": "تاريخ الفعالية"
},
"vacationRule": {
"en": "Vacation Rule",
"ar": "الإنابة بالإجازات"

Loading…
Cancel
Save