ADDED SIT
parent
95009a1e80
commit
27338e6b73
@ -0,0 +1,77 @@
|
|||||||
|
<ion-header>
|
||||||
|
<ion-toolbar class="header-toolbar">
|
||||||
|
<nav-buttons></nav-buttons>
|
||||||
|
<ion-title color="light">{{'general, addAttach' | translate}}</ion-title>
|
||||||
|
|
||||||
|
<ion-buttons slot="primary">
|
||||||
|
<ion-button style="background: none !important;" (click)="closeBtnModal()">
|
||||||
|
<ion-icon slot="icon-only" name="close"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header class="boxHdr">
|
||||||
|
<ion-grid no-padding>
|
||||||
|
|
||||||
|
<ion-row style="width: 100%;" nowrap align-items-center>
|
||||||
|
<ion-col size="10">
|
||||||
|
<div class="hrTitle">{{'general, addAttach' | translate}}</div>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="2">
|
||||||
|
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
|
||||||
|
(change)="onFileSelected($event)" />
|
||||||
|
<label end for="file">
|
||||||
|
<ion-icon style="font-size: 30px;" name="add"></ion-icon>
|
||||||
|
</label></div>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
</ion-grid>
|
||||||
|
<!-- <div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
|
||||||
|
(change)="onFileSelected($event)" />
|
||||||
|
<label end for="file">
|
||||||
|
<ion-icon name="add"></ion-icon>
|
||||||
|
</label></div> -->
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
|
||||||
|
<ion-row class="rowAH titleH" align-items-center>
|
||||||
|
<ion-col size="4">
|
||||||
|
<label class="Header" for="">{{'addAttach, name' | translate}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="4">
|
||||||
|
<label class="Header" for="">{{'addAttach, size' | translate}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="4">
|
||||||
|
<label class="Header" for="">{{'addAttach, remove' | translate}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row class="rowAH" *ngFor="let item of uploader.queue">
|
||||||
|
<ion-col size="4">
|
||||||
|
<label for="">{{ item?.file?.name }}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="4">
|
||||||
|
<label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }} MB</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="4">
|
||||||
|
<button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize"
|
||||||
|
src="../assets/imgs/deletegray.png"></button>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
<ion-footer>
|
||||||
|
<div class="centerDiv">
|
||||||
|
<ion-button class="footer-button" color="customnavy" ion-button (click)="OkBtnModal()">
|
||||||
|
{{'general, ok' | translate}}</ion-button>
|
||||||
|
</div>
|
||||||
|
</ion-footer>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
.inputfile {
|
||||||
|
width: 0.1px;
|
||||||
|
height: 0.1px;
|
||||||
|
opacity: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
// z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgSize {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
.Header {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1a586d;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AddAttachComponent } from './add-attach.component';
|
||||||
|
|
||||||
|
describe('AddAttachComponent', () => {
|
||||||
|
let component: AddAttachComponent;
|
||||||
|
let fixture: ComponentFixture<AddAttachComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ AddAttachComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AddAttachComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
import { AddEitResponse } from './../models/add.eit.response';
|
||||||
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FileUploader } from 'ng2-file-upload';
|
||||||
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-add-attach',
|
||||||
|
templateUrl: './add-attach.component.html',
|
||||||
|
styleUrls: ['./add-attach.component.scss'],
|
||||||
|
})
|
||||||
|
export class AddAttachComponent implements OnInit {
|
||||||
|
|
||||||
|
private eitResponse: any;//AddEitResponse=new AddEitResponse();
|
||||||
|
isUpload: boolean = false;
|
||||||
|
inQueue: boolean = false;
|
||||||
|
addAttachmentListReq: any;
|
||||||
|
attachmentID: number = 0;
|
||||||
|
addAttachRequest: any = [];
|
||||||
|
fileData: any;
|
||||||
|
fileType: any;
|
||||||
|
index: any = 1;
|
||||||
|
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'];
|
||||||
|
|
||||||
|
|
||||||
|
constructor(public cs: CommonService, public ts: TranslatorService, public modalCtrl: ModalController) {
|
||||||
|
this.eitResponse = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA, false);
|
||||||
|
this.TransactionID = this.cs.sharedService.getSharedData('TransactionID', false);
|
||||||
|
this.indexLastObj = this.cs.sharedService.getSharedData('indexLastObj', false);
|
||||||
|
|
||||||
|
// console.log("this.TransactionID : "+ this.TransactionID);
|
||||||
|
this.isUpload = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() { }
|
||||||
|
|
||||||
|
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()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
public hasBaseDropZoneOver: boolean = false;
|
||||||
|
public hasAnotherDropZoneOver: boolean = false;
|
||||||
|
|
||||||
|
public fileOverBase(e: any): void {
|
||||||
|
this.hasBaseDropZoneOver = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public fileOverAnother(e: any): void {
|
||||||
|
this.hasAnotherDropZoneOver = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
OkBtnModal() {
|
||||||
|
let fileCount: number = this.uploader.queue.length;
|
||||||
|
if (fileCount > 0) {
|
||||||
|
let data: any = this.addAttachRequest;
|
||||||
|
// this.viewCtrl.dismiss(data);
|
||||||
|
|
||||||
|
this.modalCtrl.dismiss(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let msg: string = "";
|
||||||
|
msg = this.ts.trPK("general", "noFileSelect");
|
||||||
|
this.cs.presentAlert(msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} // end ok button
|
||||||
|
|
||||||
|
closeBtnModal() {
|
||||||
|
// this.viewCtrl.dismiss("cancel");
|
||||||
|
this.modalCtrl.dismiss("cancel");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
onFileSelected(input) {
|
||||||
|
|
||||||
|
// this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
|
// console.log(file);
|
||||||
|
|
||||||
|
//var encoded = Base64.encode(file);
|
||||||
|
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) {
|
||||||
|
|
||||||
|
// console.log("before push: "+ this.index);
|
||||||
|
this.indexLastObj++;
|
||||||
|
try {
|
||||||
|
let array = name.split('.');
|
||||||
|
let attachType: string = array[array.length - 1];
|
||||||
|
|
||||||
|
this.addAttachRequest.push(
|
||||||
|
{
|
||||||
|
AttachmentID: this.indexLastObj,
|
||||||
|
P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1],
|
||||||
|
P_FILE_DATA: fileData.split(',')[1],
|
||||||
|
P_FILE_NAME: name,//.split('.')[0],
|
||||||
|
P_TRANSACTION_ID: this.TransactionID
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//console.log("after push: "+ this.index);
|
||||||
|
// return this.addAttachRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
removeFile(objectitem) {
|
||||||
|
|
||||||
|
let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
|
||||||
|
this.uploader.queue.splice(objIndex1, 1);
|
||||||
|
let objIndex = this.addAttachRequest.findIndex(item => item.AttachmentID == objectitem.AttachmentID);
|
||||||
|
this.addAttachRequest.splice(objIndex, 1);
|
||||||
|
// this.addAttachRequest =this.addAttachRequest.filter(item => item.AttachmentID !== objectitem.AttachmentID);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
<!-- <ion-header>
|
||||||
|
<ion-toolbar class="header-toolbar-new">
|
||||||
|
<ion-buttons *ngIf="getPassdirfromNotifiPage != true" slot="start">
|
||||||
|
<nav-buttons backLink=""></nav-buttons>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title color="light">{{headerTitle}}</ion-title>
|
||||||
|
|
||||||
|
<ion-buttons *ngIf="getPassdirfromNotifiPage == true" slot="primary">
|
||||||
|
<ion-button style="background: none !important;" (click)="closemodal()">
|
||||||
|
<ion-icon slot="icon-only" name="close"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-buttons>
|
||||||
|
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
<app-generic-header
|
||||||
|
showBack="!getPassdirfromNotifiPage"
|
||||||
|
[updateDirection]="getPassdirfromNotifiPage"
|
||||||
|
[headerText]="headerTitle"
|
||||||
|
(trigger)="closeModal()"
|
||||||
|
>
|
||||||
|
</app-generic-header>
|
||||||
|
|
||||||
|
<!-- <app-generic-header
|
||||||
|
showBack="true"
|
||||||
|
[headerText]="headerTitle">
|
||||||
|
</app-generic-header> -->
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<div #containerDiv id="containerDiv">
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
<ion-footer>
|
||||||
|
<div class="centerDiv">
|
||||||
|
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="validateEITTransaction()">
|
||||||
|
{{'vacation-rule, next-label' | translate}}</ion-button>
|
||||||
|
</div>
|
||||||
|
</ion-footer>
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
.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: #29B5BF;
|
||||||
|
}
|
||||||
|
.addEitOkButton{
|
||||||
|
white-space: normal !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
min-height: 45px !important;
|
||||||
|
min-width: 5px !important;
|
||||||
|
margin: 8px !important;
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 80% !important;
|
||||||
|
color: white!important;
|
||||||
|
border-radius: 16px !important;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AddEitComponent } from './add-eit.component';
|
||||||
|
|
||||||
|
describe('AddEitComponent', () => {
|
||||||
|
let component: AddEitComponent;
|
||||||
|
let fixture: ComponentFixture<AddEitComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ AddEitComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AddEitComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,267 @@
|
|||||||
|
<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 class="attachImgBtn"
|
||||||
|
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
|
||||||
|
<img class="attachImg" src="../assets/imgs/view.png">
|
||||||
|
</button> -->
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <button [disabled]="!isResubmitEIT" class="iconButton" (click)="addAttachment(false,attachRes)"><img
|
||||||
|
class="imgSize" src="../assets/imgs/editIcon.png"></button>
|
||||||
|
<button (click)="delelteFile(attachRes)" class="iconButton" [disabled]="!isResubmitEIT"><img
|
||||||
|
class="imgSize" src="../assets/imgs/cancel.png"></button> -->
|
||||||
|
</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-label position="floating" class="boldTxtNav">{{'confirmAddEit, comment' | translate}}</ion-label> -->
|
||||||
|
<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>
|
||||||
|
<!-------------------------------End New design ---------------------------------------->
|
||||||
|
<!-- <ion-card>
|
||||||
|
<ion-card-header class="boxHdr">
|
||||||
|
<div class="hrTitle">{{'confirmAddEit, approverList' | translate}}</div>
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-grid no-padding class=" gridAH" *ngIf="approversList?.length > 0">
|
||||||
|
<ion-row class="rowAH titleH" nowrap>
|
||||||
|
<ion-col size="1">
|
||||||
|
<ion-label class="Header" for="">{{'confirmAddEit, no' | translate}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="Header" for="">{{'confirmAddEit, approver' | translate}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="Header" for="">{{'confirmAddEit, approverCategory' | translate}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="Header" for="">{{'confirmAddEit, approverType' | translate}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="2">
|
||||||
|
<ion-label class="Header" for="">{{'confirmAddEit, status' | translate}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ion-row class="rowAH" *ngFor="let item of approversList" nowrap>
|
||||||
|
<ion-col size="1">
|
||||||
|
<ion-label class="tbData" for="">{{item.APPROVER_ORDER_NUMBER}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="tbData" for="">{{item.APPROVER}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="tbData" for="">{{item.APPROVER_CATEGORY}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="3">
|
||||||
|
<ion-label class="tbData" for="">{{item.APPROVER_TYPE}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col csize="2">
|
||||||
|
<ion-label class="tbData" for="">{{item.APPROVAL_STATUS}}</ion-label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
<ion-item padding>
|
||||||
|
<ion-label class="boldTxtNav">{{'confirmAddEit, comment' | translate}}</ion-label>
|
||||||
|
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<ion-card>
|
||||||
|
|
||||||
|
<ion-card-header class="boxHdr">
|
||||||
|
<ion-grid no-padding>
|
||||||
|
<ion-row style="width: 100%;" class="hrTitle" nowrap>
|
||||||
|
<ion-col size="10">
|
||||||
|
<ion-text style="font-size: larger;"><b>{{"absenceList, attachList" | translate}}</b></ion-text>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="2">
|
||||||
|
<button class="btnBack" ion-button (click)="addAttachment(true,-1)">
|
||||||
|
<img class="imgSize" src="../assets/imgs/attachment.png"></button>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
</ion-card-header>
|
||||||
|
|
||||||
|
<ion-card-content>
|
||||||
|
<ion-grid *ngIf="attachListOver?.length > 0">
|
||||||
|
<div *ngFor="let attachList of attachListOver ; let i = index">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col col-8>
|
||||||
|
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
|
||||||
|
</div>
|
||||||
|
<ion-label>
|
||||||
|
{{attachList.P_FILE_NAME }} </ion-label>
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
<ion-col col-4>
|
||||||
|
<button float-end class="attachImgBtn"
|
||||||
|
(click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
|
||||||
|
<img class="attachImg" src="../assets/imgs/view.png">
|
||||||
|
</button>
|
||||||
|
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn"
|
||||||
|
(click)="removeFile(attachList)"><img class="attachImg" src="../assets/imgs/deletegray.png"></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-card-content>
|
||||||
|
</ion-card> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</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>
|
||||||
@ -0,0 +1,262 @@
|
|||||||
|
.footer-button {
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 0 1.1em;
|
||||||
|
min-height: 45px;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imgSize {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Header {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #1a586d !important;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbData {
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnBack {
|
||||||
|
background: transparent;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachmentDiv{
|
||||||
|
background: #ffffff;
|
||||||
|
height: auto;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 1px;
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noDataDiv{
|
||||||
|
background: #ffffff;
|
||||||
|
height: 11%;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.submitNote{
|
||||||
|
background: #ffffff;
|
||||||
|
height: 80px;
|
||||||
|
padding-top: 1px;
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 15px;
|
||||||
|
border: 1px solid grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approvalList{
|
||||||
|
--background: #f0efef;
|
||||||
|
height: auto;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************New Design**********************************/
|
||||||
|
.notification-list{
|
||||||
|
background: none;
|
||||||
|
background: none;
|
||||||
|
border-radius: 32px;
|
||||||
|
ion-item{
|
||||||
|
// margin-top: 5px;
|
||||||
|
// margin-bottom: 5px;
|
||||||
|
|
||||||
|
background-color: transparent;
|
||||||
|
.item-date{
|
||||||
|
width: 100%;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
text-align: start;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 12%;
|
||||||
|
}
|
||||||
|
ion-label , [item-end]{
|
||||||
|
|
||||||
|
white-space: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
padding-top: 15%;
|
||||||
|
// :root[dir="ltr"]{
|
||||||
|
// margin-left: 10px;
|
||||||
|
// }
|
||||||
|
// :root[dir="rtl"]{
|
||||||
|
// margin-right: 10px;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.timeline {
|
||||||
|
position: relative;
|
||||||
|
margin: 15px 0 0 0;
|
||||||
|
// border-bottom: solid 1px var(--cusgray);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline:before {
|
||||||
|
|
||||||
|
content: '';
|
||||||
|
position: inherit !important;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 4px;
|
||||||
|
// background: #e4e4e4;
|
||||||
|
z-index: 1;
|
||||||
|
left: 35px;
|
||||||
|
/* margin-left: -10px; */
|
||||||
|
/* z-index: 1; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline .timeline-thumb {
|
||||||
|
|
||||||
|
border-radius: 500px;
|
||||||
|
width: 70px !important;
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
// :root[dir="ltr"]{
|
||||||
|
// left: 37px;
|
||||||
|
// }
|
||||||
|
// :root[dir="rtl"]{
|
||||||
|
// right: 37px;
|
||||||
|
// }
|
||||||
|
float: right;
|
||||||
|
top: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline .timeline-thumb.timeline-icon {
|
||||||
|
height: 70px;
|
||||||
|
// text-align: center;
|
||||||
|
// color: white;
|
||||||
|
// border: 5px solid #CBD0D3;
|
||||||
|
// transform: scale(0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.timeline .timeline-item {
|
||||||
|
width: 40px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline .timeline-stats {
|
||||||
|
position: relative;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--darkgray);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.empImge{
|
||||||
|
border-radius: 50%;
|
||||||
|
width:100%;
|
||||||
|
height: 100%;
|
||||||
|
border: #dedede solid 1px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.empImgeRep {
|
||||||
|
border-radius: 50% !important;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
border: #dedede solid 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line{
|
||||||
|
padding-bottom:87px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachLable{
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 0;
|
||||||
|
background: #30b8c6;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 0px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.removeLable{
|
||||||
|
top: 0px;
|
||||||
|
z-index: 0;
|
||||||
|
background: #d8252d;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 0px;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-modal {
|
||||||
|
// width: 90%;
|
||||||
|
// height: 50%;
|
||||||
|
// top: 20%;
|
||||||
|
// left: 5%;
|
||||||
|
// right: 5%;
|
||||||
|
// bottom: 5%;
|
||||||
|
background: rgba(0, 0, 0, 0.5) !important;
|
||||||
|
padding: 30% 10% !important;
|
||||||
|
--height: 12cm !important;
|
||||||
|
// --width: 80% !important;
|
||||||
|
--border-radius:20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.header-toolbar-new{
|
||||||
|
--background: #29B5BF;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
margin-top: -37px;
|
||||||
|
margin-left: 85px;
|
||||||
|
}
|
||||||
|
.title-ar{
|
||||||
|
margin-top: -37px;
|
||||||
|
margin-right: 101px;
|
||||||
|
}
|
||||||
|
.confirmEitOkButton{
|
||||||
|
white-space: normal !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
min-height: 45px !important;
|
||||||
|
min-width: 5px !important;
|
||||||
|
margin: 8px !important;
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 80% !important;
|
||||||
|
color: white!important;
|
||||||
|
border-radius: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approvalTitle-ar{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
}
|
||||||
|
.approvalTitle{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ConfirmAddEitComponent } from './confirm-add-eit.component';
|
||||||
|
|
||||||
|
describe('ConfirmAddEitComponent', () => {
|
||||||
|
let component: ConfirmAddEitComponent;
|
||||||
|
let fixture: ComponentFixture<ConfirmAddEitComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ConfirmAddEitComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ConfirmAddEitComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,568 @@
|
|||||||
|
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 { EitRequest } from './../models/eit.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 { AddEitResponse } from '../models/add.eit.response';
|
||||||
|
import { FileUploader } from 'ng2-file-upload';
|
||||||
|
import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-confirm-add-eit',
|
||||||
|
templateUrl: './confirm-add-eit.component.html',
|
||||||
|
styleUrls: ['./confirm-add-eit.component.scss'],
|
||||||
|
})
|
||||||
|
export class ConfirmAddEitComponent implements OnInit {
|
||||||
|
|
||||||
|
private P_TransactionID: number;
|
||||||
|
private eitRequest: EitRequest;
|
||||||
|
approversList = [];
|
||||||
|
addrespList: any;//EitRespModel;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/***Add Attchment Vars */
|
||||||
|
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.eitRequest = new EitRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
// console.log('ionViewDidLoad ConfirmAddEitPage');
|
||||||
|
// let selMenu:MenuResponse=new MenuResponse();
|
||||||
|
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.eitRequest = this.cs.sharedService.getSharedData(EitRequest.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 **
|
||||||
|
// console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails);
|
||||||
|
this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
|
||||||
|
// let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
|
||||||
|
|
||||||
|
this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
|
||||||
|
this.pActionMode = "RESUBMIT";
|
||||||
|
this.menuType = "E";
|
||||||
|
this.respID = -999;
|
||||||
|
this.selEmp = this.eitRequest.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(AddEitResponse.SHARED_DATA);
|
||||||
|
this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY;
|
||||||
|
this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID;
|
||||||
|
this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
|
||||||
|
|
||||||
|
|
||||||
|
this.getApproversList();
|
||||||
|
// this.confirmAddEit.submitEit(this.eitRequest).subscribe((result: AddEitResponse) => {
|
||||||
|
// this.handleSubmitEitResult(result);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
// console.log("approvers List" + this.approversList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startEitApproval() {
|
||||||
|
//first call add attach inside success call submit
|
||||||
|
// if(this.isResubmitEIT){
|
||||||
|
// this.startEITApprovalProcess();
|
||||||
|
// }else{
|
||||||
|
// let listToAdd:any=[];
|
||||||
|
if (this.attachListOver) {
|
||||||
|
// this.attachListOver.forEach(element => {
|
||||||
|
// if(element.toAdd==true)
|
||||||
|
// listToAdd.push(element);
|
||||||
|
// });
|
||||||
|
|
||||||
|
let request = {
|
||||||
|
AddAttachmentList: this.attachListOver
|
||||||
|
}
|
||||||
|
|
||||||
|
this.eitService.addAttachment(
|
||||||
|
request).
|
||||||
|
subscribe((result: any) => {
|
||||||
|
this.handleAddAttachmentResults(result);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.startEITApprovalProcess();
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
//this.attachItems[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.attachItems[i].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.startEITApprovalProcess();
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
// this.cs.presentAlert("fail to upload some attach file");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startEITApprovalProcess() {
|
||||||
|
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.startEitApprovalProcess(
|
||||||
|
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;
|
||||||
|
// this.navCtrl.popToRoot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
handleResults(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
this.isSubmitBtnClicked = true;
|
||||||
|
//if(this.isResubmitEIT==false){
|
||||||
|
let msg: string = this.ts.trPK("eit", "approval-message-success");
|
||||||
|
this.cs.presentAlert(msg);
|
||||||
|
// }
|
||||||
|
// this.navCtrl.popToRoot();
|
||||||
|
|
||||||
|
// this.cs.openHome();
|
||||||
|
this.cs.openNotificationPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// addAttachment(){
|
||||||
|
// this.navCtrl.push('AddAttachPage');
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
async addAttachment(str: boolean, attachItems: any) {
|
||||||
|
// console.log("inside attach modal");
|
||||||
|
//open the modal with return data
|
||||||
|
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.attachItems = data.map(function(el) {
|
||||||
|
// var o = Object.assign({}, el);
|
||||||
|
// o.isSuccess = false;
|
||||||
|
// return o;
|
||||||
|
// })
|
||||||
|
// this.objIndex1 =this.attachmentRes.findIndex(item => item == attachItems); //to use it in remove attach
|
||||||
|
//.ATTACHED_DOCUMENT_ID
|
||||||
|
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;
|
||||||
|
// this.attachListOver = this.attachListDisplay;
|
||||||
|
}
|
||||||
|
// this.attachListDisplay=data;
|
||||||
|
|
||||||
|
// this.attachItems = this.attachListDisplay.map(function(el) {
|
||||||
|
// var o = Object.assign({}, el);
|
||||||
|
// o.isSuccess = false;
|
||||||
|
// return o;
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
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.startEitApproval();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return await modal.present();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
removeFile(objectitem) {
|
||||||
|
|
||||||
|
|
||||||
|
// if (this.attachItems) {
|
||||||
|
// let index1 = this.attachItems.findIndex(item => item == objectitem);
|
||||||
|
// if (index1 > -1) {
|
||||||
|
|
||||||
|
// this.attachItems.splice(index1, 1);
|
||||||
|
// }
|
||||||
|
// this.attachListDisplay =this.attachListDisplay.filter(item => item.AttachmentID !== objectitem.AttachmentID);
|
||||||
|
// }
|
||||||
|
if (this.attachListOver) {
|
||||||
|
let index2 = this.attachListOver.findIndex(item => item == objectitem);
|
||||||
|
if (index2 > -1) {
|
||||||
|
this.attachListOver.splice(index2, 1);
|
||||||
|
}
|
||||||
|
//this.attachListOver =this.attachListOver.filter(item => item.AttachmentID !== objectitem.AttachmentID);
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
// let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type });
|
||||||
|
// modal.present();
|
||||||
|
|
||||||
|
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) {
|
||||||
|
// let alert = this.cs.confirmAlertDialog(this.translate.translate('general.deletePerm'));
|
||||||
|
|
||||||
|
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'));
|
||||||
|
|
||||||
|
// alert.onDidDismiss((data) => {
|
||||||
|
// if (data == true) {
|
||||||
|
// this.continueDelete(attach);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
continueDelete(attach) {
|
||||||
|
// console.log("trst" + attach.ATTACHED_DOCUMENT_ID);
|
||||||
|
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);
|
||||||
|
//this.cs.presentAlert("Success" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFile(attachList, attachDocID) {
|
||||||
|
//console.log("updateFile" + attachDocID.ATTACHED_DOCUMENT_ID);
|
||||||
|
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.cs.presentAlert("updated attach successfully" );
|
||||||
|
|
||||||
|
//flag to disable update and enable remove
|
||||||
|
// this.removeFile(attachList);
|
||||||
|
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||||
|
}
|
||||||
|
} // val
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ionViewWillLeave() {
|
||||||
|
if (this.P_TransactionID && this.isSubmitBtnClicked == false)
|
||||||
|
this.cancelEitProcess();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************Add attchement Functions*************/
|
||||||
|
|
||||||
|
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) {
|
||||||
|
|
||||||
|
// this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
|
// console.log(file);
|
||||||
|
|
||||||
|
//var encoded = Base64.encode(file);
|
||||||
|
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) {
|
||||||
|
|
||||||
|
console.log("before push: "+ this.index);
|
||||||
|
//this.attachListOver.length++;
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//console.log("after push: "+ this.index);
|
||||||
|
// return this.addAttachRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// removeFile(objectitem) {
|
||||||
|
|
||||||
|
// let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem);
|
||||||
|
// this.uploader.queue.splice(objIndex1, 1);
|
||||||
|
// let objIndex = this.addAttachRequest.findIndex(item => item.AttachmentID == objectitem.AttachmentID);
|
||||||
|
// this.addAttachRequest.splice(objIndex, 1);
|
||||||
|
// // this.addAttachRequest =this.addAttachRequest.filter(item => item.AttachmentID !== objectitem.AttachmentID);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,259 @@
|
|||||||
|
<app-generic-header
|
||||||
|
showBack="true"
|
||||||
|
[headerText]="headerTitle">
|
||||||
|
</app-generic-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<div class="">
|
||||||
|
<!-- class="colorBG" -->
|
||||||
|
<div class="content" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'">
|
||||||
|
|
||||||
|
<ion-grid class="headerGrid">
|
||||||
|
|
||||||
|
<p class="title">{{ts.trPK('absenceList','tickets-balance')}}</p>
|
||||||
|
<div style="color: black;">
|
||||||
|
|
||||||
|
<div class="result-graph">
|
||||||
|
<div >
|
||||||
|
<!-- <ion-datetime
|
||||||
|
[placeholder]="Select"
|
||||||
|
display-format="DD/MM/YYYY"
|
||||||
|
[min]="1900"
|
||||||
|
[max]="2100"
|
||||||
|
[(ngModel)]="dateTo"
|
||||||
|
doneText="Done"
|
||||||
|
cancelText="Cancel"
|
||||||
|
></ion-datetime> -->
|
||||||
|
<ion-datetime [(ngModel)]="Sdate" class="datetime" placeholder="Select" displayFormat="DD MMMM YYYY"
|
||||||
|
cancelText="{{ts.trPK('general','cancel')}}" doneText="{{ts.trPK('general','done')}}"
|
||||||
|
(ionChange)="getAccrualBalance()"></ion-datetime>
|
||||||
|
<!-- <ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY" placeholder="DD MMMM YYYY"
|
||||||
|
(ionChange)="getAccrualBalance()"></ion-datetime> -->
|
||||||
|
<ion-icon class="iconCalendar" ios="ios-calendar" md="md-calendar"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div style=" border-bottom: 1px solid #a7a4a4; margin-bottom: 12px;
|
||||||
|
margin-top: -10px; margin-right: -9px;"></div>
|
||||||
|
|
||||||
|
<!-- <div class="result-text-container">
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<p-chart #chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<ion-row>
|
||||||
|
<ion-col class="col" size="4">
|
||||||
|
<div class="light-dote"></div>
|
||||||
|
<!-- </ion-col>
|
||||||
|
<ion-col> -->
|
||||||
|
<label [ngClass]="direction == 'en' ? 'light-label':'light-label-ar' ">{{ts.trPK('absenceList','adult')}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col class="col" size="4">
|
||||||
|
<div class="blue-dote"></div>
|
||||||
|
<!-- </ion-col>
|
||||||
|
<ion-col> -->
|
||||||
|
<label class="blue-label">{{ts.trPK('absenceList','child')}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col class="col" size="4">
|
||||||
|
<div class="green-dote"></div>
|
||||||
|
<!-- </ion-col>
|
||||||
|
<ion-col> -->
|
||||||
|
<label [ngClass]="direction == 'en'? 'green-label':'green-label-ar'">{{ts.trPK('absenceList','infants')}} </label>
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-grid>
|
||||||
|
</div>
|
||||||
|
<!-- ///////////////////////////////////////////////// -->
|
||||||
|
<ion-grid [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'" >
|
||||||
|
<div class="gridService">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col class="columns">
|
||||||
|
<div [class]="direction =='en'? 'adult-dote':'adult-dote-ar'"></div>
|
||||||
|
<label>{{ts.trPK('absenceList','adult')}}</label>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<label class="service">{{accrualNetAdult}}</label>
|
||||||
|
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col class="columns">
|
||||||
|
<div [ngClass]="direction == 'en'? 'child-dote' :'child-dote-ar'"></div>
|
||||||
|
<label>{{ts.trPK('absenceList','child')}} </label>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<label class="service">{{accrualUNetChild}}</label>
|
||||||
|
|
||||||
|
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col class="columns">
|
||||||
|
<div [ngClass]="direction == 'en'? 'infants-dote': 'infants-dote-ar'"></div>
|
||||||
|
<label>{{ts.trPK('absenceList','infants')}} </label>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<label class="service">{{accrualNetInfants}}</label>
|
||||||
|
<br> <label class="services">{{ts.trPK('absenceList','tickets')}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-grid>
|
||||||
|
<!--
|
||||||
|
<ion-grid class="three-grid">
|
||||||
|
<ion-row>
|
||||||
|
<ion-col >
|
||||||
|
infants
|
||||||
|
</ion-col>
|
||||||
|
<ion-col >2</ion-col>
|
||||||
|
<ion-col >tickit</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col >
|
||||||
|
child
|
||||||
|
</ion-col>
|
||||||
|
<ion-col >2</ion-col>
|
||||||
|
<ion-col >tickit</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col >
|
||||||
|
adult
|
||||||
|
</ion-col>
|
||||||
|
<ion-col >2</ion-col>
|
||||||
|
<ion-col >tickit</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid> -->
|
||||||
|
|
||||||
|
<!-- //////////////////////////////////////////////////// -->
|
||||||
|
<!-- <ion-content padding> -->
|
||||||
|
|
||||||
|
<div *ngIf="eitAddedList && eitAddedList.length > 0 ">
|
||||||
|
<ion-card *ngFor="let eitAddedObj of eitAddedList; let i=index ">
|
||||||
|
|
||||||
|
<ion-card-header>
|
||||||
|
|
||||||
|
<!-- <button *ngIf="getPassMnuEntryObj.UPDATE_BUTTON == 'Y' && eitAddedObj.statusID!=2" ion-button icon-only
|
||||||
|
(click)="updateEITRrq(i)">
|
||||||
|
<ion-icon name="create"></ion-icon>
|
||||||
|
</button> -->
|
||||||
|
<button ion-button icon-only (click)="removeAddedItem(i)">
|
||||||
|
<ion-icon class="imgSize" name="trash"></ion-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
|
||||||
|
<ion-grid>
|
||||||
|
<div>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label for="">{{'confirmAddEit , status' | translate}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<label for="">{{eitAddedObj.status}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</div>
|
||||||
|
<div *ngFor="let item of eitAddedObj.Collection_Transaction">
|
||||||
|
<ion-row *ngIf="item.DISPLAY_FLAG != 'N' ">
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label for="">{{item.SEGMENT_PROMPT}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label for="">{{item.SEGMENT_VALUE_DSP}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-grid>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
</div>
|
||||||
|
<div class="no-dataDiv"
|
||||||
|
*ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0">
|
||||||
|
<!-- <div class="no-dataDiv"> -->
|
||||||
|
<ion-row>
|
||||||
|
<img class="empty-data" src="../assets/imgs/box.png" />
|
||||||
|
</ion-row>
|
||||||
|
<h4> {{'general, noData' | translate}}</h4>
|
||||||
|
</div>
|
||||||
|
<!-- <no-data *ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0" txt="{{'general.noData' | translate}}"></no-data> -->
|
||||||
|
<div *ngIf="getResEITTransactionList && getResEITTransactionList[0]?.Collection_Transaction.length > 0 ">
|
||||||
|
<!-- <div> -->
|
||||||
|
<div *ngFor="let EITTransactionList of getResEITTransactionList; let i=index ">
|
||||||
|
|
||||||
|
<!-- <ion-card-header class="boxHdr">
|
||||||
|
<div class="hrTitle">{{this.headerTitle}}</div>
|
||||||
|
|
||||||
|
<button ion-button (click)="deleteEIT(i)"
|
||||||
|
*ngIf="getPassMnuEntryObj.DELETE_BUTTON == 'Y' && EITTransactionList.statusID!=3">
|
||||||
|
<img class="imgSize" src="../assets/imgs/delete.png"></button>
|
||||||
|
<button ion-button *ngIf="getPassMnuEntryObj.UPDATE_BUTTON == 'Y' && EITTransactionList.statusID!=2"
|
||||||
|
(click)="updateEITRrq(i)">
|
||||||
|
<img class="imgSize" src="../assets/imgs/edit.png"></button>
|
||||||
|
</ion-card-header> -->
|
||||||
|
<!-- <ion-card-content> -->
|
||||||
|
|
||||||
|
|
||||||
|
<ion-grid>
|
||||||
|
<div>
|
||||||
|
<!-- <ion-row>
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label for="">status</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<label for="">{{EITTransactionList.status}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row> -->
|
||||||
|
</div>
|
||||||
|
<ion-grid class="grids">
|
||||||
|
<div *ngFor="let item of EITTransactionList.Collection_Transaction">
|
||||||
|
<!-- <ion-row *ngIf="item.DISPLAY_FLAG != 'N' ">
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label for="">{{item.SEGMENT_PROMPT}}</label>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<label for="">{{item.SEGMENT_VALUE_DSP}}</label>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row> -->
|
||||||
|
|
||||||
|
<ion-row *ngIf="item.DISPLAY_FLAG != 'N' " class="">
|
||||||
|
<ion-col class="" *ngIf="item.SEGMENT_PROMPT!=''">
|
||||||
|
<label style="color:#29B5BF;font-weight: bold;" class="label" for="">{{item.SEGMENT_PROMPT}} </label>
|
||||||
|
<br>
|
||||||
|
<label class="label" style="color:black;" for="">{{item.SEGMENT_VALUE_DSP}} </label>
|
||||||
|
<br>
|
||||||
|
<hr style="background-color: grey;height: 1px">
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-grid>
|
||||||
|
</ion-grid>
|
||||||
|
<!-- </ion-card-content> -->
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
|
||||||
|
<ion-infinite-scroll-content></ion-infinite-scroll-content>
|
||||||
|
</ion-infinite-scroll>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
<ion-icon class="addClass" name="add" (click)="addEITRrq()"></ion-icon>
|
||||||
|
|
||||||
|
<!-- <ion-footer>
|
||||||
|
<div class="centerDiv"> -->
|
||||||
|
<!-- <button *ngIf="getPassMnuEntryObj.ADD_BUTTON == 'Y'" ion-button (click)="addEITRrq()">{{'requestEit.add'
|
||||||
|
| translate}} </button> -->
|
||||||
|
<!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()">
|
||||||
|
{{'general, add' | translate}}</ion-button> -->
|
||||||
|
<!-- </div>
|
||||||
|
|
||||||
|
</ion-footer> -->
|
||||||
@ -0,0 +1,334 @@
|
|||||||
|
.footer-button {
|
||||||
|
border-radius: 2px;
|
||||||
|
padding: 0 1.1em;
|
||||||
|
min-height: 45px;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.datetime{
|
||||||
|
// text-align: center;
|
||||||
|
// font-family: WorkSans-Bold;
|
||||||
|
// margin-left: 111px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: WorkSans-Bold;
|
||||||
|
margin-left: 47px;
|
||||||
|
margin-top: -19px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.iconCalendar{
|
||||||
|
// margin-left: -241px;
|
||||||
|
// margin-top: 5px;
|
||||||
|
margin-left: 30px !important;
|
||||||
|
width: 22% !important;
|
||||||
|
height: 26px !important;
|
||||||
|
margin-top: -69px !important;
|
||||||
|
margin-bottom: 20px !important;
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
font-size: 2.2rem;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.grids{
|
||||||
|
border-radius: 20px !important;
|
||||||
|
background: white;
|
||||||
|
padding-left: 1px;
|
||||||
|
padding-right: 1px;
|
||||||
|
margin: 13px;
|
||||||
|
padding-top: 0px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
padding-left: 13px;
|
||||||
|
padding-right: 13px;
|
||||||
|
border: 1px solid #cac8c8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bgcolor {
|
||||||
|
|
||||||
|
color: white;
|
||||||
|
border-top-right-radius: 19px;
|
||||||
|
border-top-left-radius: 15px;
|
||||||
|
padding-top: 1;
|
||||||
|
padding-bottom: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
/* border-radius: 12px !important; */
|
||||||
|
background: #29B5BF;
|
||||||
|
border-bottom: 1px solid #a7a4a4;
|
||||||
|
border-top: 1px solid #cac8c8;
|
||||||
|
margin-left: -13px;
|
||||||
|
margin-right: -13px;
|
||||||
|
}
|
||||||
|
.colEit{
|
||||||
|
border-right: 1px solid #cac8c8;
|
||||||
|
border-bottom-left-radius: -10px !important;
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
margin-left: 18px;
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-div {
|
||||||
|
|
||||||
|
background-color: #29B5BF;
|
||||||
|
text-transform: capitalize;
|
||||||
|
height: 160px;
|
||||||
|
// position: relative;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: -28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-toolbar-new{
|
||||||
|
--background: #29B5BF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addClass{
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
right: 8%;
|
||||||
|
position: fixed;
|
||||||
|
color: white;
|
||||||
|
bottom: 5%;
|
||||||
|
border-radius: 50%;
|
||||||
|
z-index: 999;
|
||||||
|
-webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||||
|
-moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||||
|
box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59);
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentEit:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
// background: #29B5BF;
|
||||||
|
height: 140px;
|
||||||
|
width: 100%;
|
||||||
|
left: 0;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hrClass{
|
||||||
|
border-width: 0;
|
||||||
|
box-sizing: content-box;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
background: #fff !important;
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
.content:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
background: #29B5BF;
|
||||||
|
height: 140px;
|
||||||
|
width: 100%;
|
||||||
|
left: 0;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.colorBG{
|
||||||
|
--background: #f0efef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Title{
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
margin-top: -33px;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
text-align: center;
|
||||||
|
color: black;
|
||||||
|
margin-top: 5px;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.today-graph{
|
||||||
|
display: block !important;
|
||||||
|
height: 196px;
|
||||||
|
width: 365px;
|
||||||
|
/* padding-left: 51px; */
|
||||||
|
margin-left: 28px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerGrid{
|
||||||
|
// background-color: white !important;
|
||||||
|
// border: 1px solid #cac8c8 !important;
|
||||||
|
// border-radius: 20px !important;
|
||||||
|
// padding-top: 28px;
|
||||||
|
// padding-bottom: 53px;
|
||||||
|
// margin-left: 9px;
|
||||||
|
// margin-right: 13px;
|
||||||
|
// margin-top: -94px;
|
||||||
|
// margin-bottom: 10px;
|
||||||
|
background-color: white !important;
|
||||||
|
border: 1px solid #cac8c8 !important;
|
||||||
|
/* padding-top: 28px; */
|
||||||
|
padding-bottom: 53px;
|
||||||
|
padding-top: -30px;
|
||||||
|
margin-left: 13px;
|
||||||
|
margin-right: 13px;
|
||||||
|
/* margin-top: -86px; */
|
||||||
|
margin-bottom: 10px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-top: 17px;
|
||||||
|
}
|
||||||
|
.result-graph{
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: -48px;
|
||||||
|
margin-right: 3px;
|
||||||
|
margin-bottom: -30px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.green-label{
|
||||||
|
font-size: 15px !important;
|
||||||
|
margin-left: 7px !important;
|
||||||
|
margin-right: 42px;
|
||||||
|
}
|
||||||
|
.green-label-ar{
|
||||||
|
font-size: 15px !important;
|
||||||
|
margin-left: 7px !important;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
.blue-label{
|
||||||
|
font-size: 15px !important;
|
||||||
|
margin-left: 7px !important;
|
||||||
|
margin-right: 13px;
|
||||||
|
}
|
||||||
|
.light-label{
|
||||||
|
font-size: 15px !important;
|
||||||
|
margin-left: 7px !important;
|
||||||
|
margin-right: -26px;
|
||||||
|
}
|
||||||
|
.light-label-ar{
|
||||||
|
font-size: 15px !important;
|
||||||
|
margin-right: 7px !important;
|
||||||
|
margin-left: -26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-dote{
|
||||||
|
background-color: #3CB9D5;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.blue-dote{
|
||||||
|
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.green-dote{
|
||||||
|
background-color: #1FA269;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: -1px;
|
||||||
|
}
|
||||||
|
.col{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gridService{
|
||||||
|
|
||||||
|
/* margin-top: 87px; */
|
||||||
|
border-radius: 10px;
|
||||||
|
/* margin-bottom: -49px; */
|
||||||
|
margin-left: 14px;
|
||||||
|
margin-right: 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.columns{
|
||||||
|
margin: 3px;
|
||||||
|
margin-bottom: 13px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 27px;
|
||||||
|
padding-left: 30px;
|
||||||
|
padding-right: 6px;
|
||||||
|
padding-top: 19px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
border: 1px solid #cac8c8 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.service{
|
||||||
|
font-size: 22px;
|
||||||
|
color: black;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.services{
|
||||||
|
|
||||||
|
font-size: 12px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adult-dote{
|
||||||
|
background-color: #3CB9D5;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: -17px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adult-dote-ar{
|
||||||
|
background-color: #3CB9D5;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 0px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.child-dote{
|
||||||
|
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: -17px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.child-dote-ar{
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 1px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.infants-dote{
|
||||||
|
background-color: #1FA269;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: -17px;
|
||||||
|
margin-right: 5px;
|
||||||
|
// margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infants-dote-ar{
|
||||||
|
background-color: #1FA269;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 1px;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EitListComponent } from './eit-list.component';
|
||||||
|
|
||||||
|
describe('EitListComponent', () => {
|
||||||
|
let component: EitListComponent;
|
||||||
|
let fixture: ComponentFixture<EitListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EitListComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EitListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,609 @@
|
|||||||
|
import { AddEitComponent } from './../add-eit/add-eit.component';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||||
|
import { EitRequest } from './../models/eit.request';
|
||||||
|
import { EITTransactionsRequest } from './../models/EITTransactionsReq';
|
||||||
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { EitService } from '../services/eit.service';
|
||||||
|
import { EIT_ACTION } from '../models/submit.eit.action';
|
||||||
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||||
|
import { AddEitResponse } from '../models/add.eit.response';
|
||||||
|
import { AccrualService } from 'src/app/accrual-balances/services/accrual.service';
|
||||||
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
||||||
|
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-eit-list',
|
||||||
|
templateUrl: './eit-list.component.html',
|
||||||
|
styleUrls: ['./eit-list.component.scss'],
|
||||||
|
})
|
||||||
|
export class EitListComponent implements OnInit {
|
||||||
|
Sdate: any;
|
||||||
|
emp_no: any;
|
||||||
|
balance:any;
|
||||||
|
//////////////up
|
||||||
|
P_PAGE_NUM: number;
|
||||||
|
P_PAGE_LIMIT: number;
|
||||||
|
IsReachEnd = false;
|
||||||
|
userName: any;
|
||||||
|
isDelete = false;
|
||||||
|
getResEITTransactionList: any = [];
|
||||||
|
eitAddedList: any = [];
|
||||||
|
getPassMnuEntryObj: any;
|
||||||
|
selMenu: MenuResponse = new MenuResponse();
|
||||||
|
EITTransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest();
|
||||||
|
selEmp: string;
|
||||||
|
respID: number;
|
||||||
|
transactionNo = 0;
|
||||||
|
menuType = '';
|
||||||
|
public functionName = '';
|
||||||
|
private eitRequest: EitRequest;
|
||||||
|
private eitTransactionTbl: any = [];
|
||||||
|
private validEitTransactionTbl: any = [];
|
||||||
|
private desxFlexCode = '';
|
||||||
|
private selectedIndex: number;
|
||||||
|
private pAction = 0;
|
||||||
|
public headerTitle = '';
|
||||||
|
data: any;
|
||||||
|
accrualNetInfants: any;
|
||||||
|
accrualUNetChild: any;
|
||||||
|
accrualNetAdult: any;
|
||||||
|
|
||||||
|
public options = {
|
||||||
|
cutoutPercentage: 80,
|
||||||
|
tooltips: { enabled: false },
|
||||||
|
legend: { display: false }};
|
||||||
|
gaugeType = 'full';
|
||||||
|
accrualBalancesList: any;
|
||||||
|
common: any;
|
||||||
|
direction: string;
|
||||||
|
// gaugeValue = 11.200;
|
||||||
|
// gaugeLabel = "";
|
||||||
|
|
||||||
|
// tslint:disable-next-line: max-line-length
|
||||||
|
constructor(private cs: CommonService, private EITService: EitService, public ts: TranslatorService,
|
||||||
|
private modalCtrl: ModalController, public accrualService: AccrualService, public authService:AuthenticationService,) {
|
||||||
|
this.direction = TranslatorService.getCurrentLanguageName();
|
||||||
|
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.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList;
|
||||||
|
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
||||||
|
this.transactionNo = 0;
|
||||||
|
this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
|
||||||
|
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
|
||||||
|
this.validEitTransactionTbl = [];
|
||||||
|
this.P_PAGE_NUM = 1;
|
||||||
|
this.P_PAGE_LIMIT = 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
/////////////
|
||||||
|
this.Sdate = new Date().toISOString();
|
||||||
|
this.getUserDetails();
|
||||||
|
////////////////up
|
||||||
|
this.getEITTransactions();
|
||||||
|
|
||||||
|
this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false);
|
||||||
|
// accrualNetInfants
|
||||||
|
// accrualUNetChild
|
||||||
|
// accrualNetAdult
|
||||||
|
if(this.accrualBalancesList){
|
||||||
|
this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
this. accrualNetInfants = this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
}
|
||||||
|
this.data = {
|
||||||
|
// labels: ['earingTotal', 'deductionTotal'],
|
||||||
|
datasets: [
|
||||||
|
{ data: [this.accrualNetInfants, this.accrualUNetChild, this.accrualNetAdult],
|
||||||
|
backgroundColor: [
|
||||||
|
'#1FA269',
|
||||||
|
'#29B5BF',
|
||||||
|
'#3CB9D5', ],
|
||||||
|
borderWidth: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getUserDetails(){
|
||||||
|
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
||||||
|
if (user) {
|
||||||
|
// this.emp_no=user.EMPLOYEE_NUMBER;
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public getAccrualBalance() {
|
||||||
|
if (this.Sdate) {
|
||||||
|
let today = new Date(this.Sdate);
|
||||||
|
let day = today.getDate();
|
||||||
|
let month = today.getMonth() + 1;
|
||||||
|
let year = today.getFullYear();
|
||||||
|
let todayDate = month + '/' + day + '/' + year;
|
||||||
|
let effectiveDate = todayDate;
|
||||||
|
const request = {
|
||||||
|
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
|
||||||
|
P_EFFECTIVE_DATE: effectiveDate
|
||||||
|
};
|
||||||
|
this.accrualService
|
||||||
|
.getAccrualBalances(request)
|
||||||
|
.subscribe((result: any) => {
|
||||||
|
this.handleAccrualResult(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
handleAccrualResult(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
this.balance=result.GetAccrualBalancesList;
|
||||||
|
this.accrualNetAdult = this.balance[1].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
this.accrualUNetChild = this.balance[2].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
this. accrualNetInfants = this.balance[3].ACCRUAL_NET_ENTITLEMENT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///////////////////////////////////
|
||||||
|
|
||||||
|
getEITTransactions() {
|
||||||
|
this.IsReachEnd = false;
|
||||||
|
this.EITTransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
|
||||||
|
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||||
|
this.EITTransactionsListObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
||||||
|
this.EITTransactionsListObj.P_SELECTED_RESP_ID = this.respID;
|
||||||
|
this.EITTransactionsListObj.P_MENU_TYPE = this.selMenu.List_Menu.MENU_TYPE;
|
||||||
|
this.EITTransactionsListObj.P_FUNCTION_NAME = this.getPassMnuEntryObj.FUNCTION_NAME;
|
||||||
|
this.EITService.getEITTransactionsList(this.EITTransactionsListObj).
|
||||||
|
subscribe((result: any) => {
|
||||||
|
this.handleEITTransactionsResult(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleEITTransactionsResult(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
if (this.cs.hasData(result.GetEITTransactionList)) {
|
||||||
|
this.getResEITTransactionList = result.GetEITTransactionList;
|
||||||
|
this.P_PAGE_NUM++;
|
||||||
|
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||||
|
const lastItemIndex = this.getResEITTransactionList.length - 1;
|
||||||
|
if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) {
|
||||||
|
const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
|
||||||
|
this.IsReachEnd = true;
|
||||||
|
} else {
|
||||||
|
this.IsReachEnd = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doInfinite(infiniteScroll) {
|
||||||
|
if (!this.IsReachEnd) {
|
||||||
|
|
||||||
|
this.EITService.getEITTransactionsList(this.EITTransactionsListObj).
|
||||||
|
subscribe((result: any) => {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
if (this.cs.hasData(result.GetEITTransactionList)) {
|
||||||
|
this.P_PAGE_NUM++;
|
||||||
|
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
|
||||||
|
result.GetEITTransactionList.forEach(vr => {
|
||||||
|
console.log(vr.length);
|
||||||
|
if(vr.length && vr.length != 0){
|
||||||
|
if (vr.Collection_Transaction[0].ROW_NUM == vr.Collection_Transaction[0].NO_OF_ROWS) {
|
||||||
|
this.IsReachEnd = true;
|
||||||
|
} else {
|
||||||
|
this.IsReachEnd = false;
|
||||||
|
}
|
||||||
|
this.getResEITTransactionList.push(vr);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.IsReachEnd = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// this.P_PAGE_NUM++;
|
||||||
|
if (infiniteScroll) {
|
||||||
|
infiniteScroll.target.complete();
|
||||||
|
}
|
||||||
|
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
|
||||||
|
} else {
|
||||||
|
if (infiniteScroll) {
|
||||||
|
infiniteScroll.target.complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addEITRrq(i?) {
|
||||||
|
this.pAction = EIT_ACTION.ADD;
|
||||||
|
// this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
|
||||||
|
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
|
||||||
|
// this.navCtrl.push("AddEitPage");
|
||||||
|
// this.openEit(i);
|
||||||
|
this.openEitNew(i);
|
||||||
|
}
|
||||||
|
updateEITRrq(i) {
|
||||||
|
this.pAction = EIT_ACTION.UPDATE;
|
||||||
|
this.cs.sharedService.setSharedData(this.getResEITTransactionList[i].Collection_Transaction, EITTransactionsRequest.SHARED_DATA);
|
||||||
|
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
|
||||||
|
// this.fillEitTransactionTable(i);
|
||||||
|
// this.navCtrl.push("AddEitPage");
|
||||||
|
// this.openEit(i);
|
||||||
|
this.openEitNew(i);
|
||||||
|
}
|
||||||
|
deleteEIT(i) {
|
||||||
|
this.deleteEITRrq(i);
|
||||||
|
// let alert=this.common.showConfirmMsg(this.translate.translate('requestEit.deleteReq'));
|
||||||
|
// alert.onDidDismiss((data) => {
|
||||||
|
// if(data==true){
|
||||||
|
// this.deleteEITRrq(i);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteEITRrq(i) {
|
||||||
|
const list: any = this.getResEITTransactionList[i];
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (list.statusID != 2) {
|
||||||
|
this.selectedIndex = i;
|
||||||
|
// if(this.transactionNo==0)
|
||||||
|
this.transactionNo++;
|
||||||
|
this.pAction = EIT_ACTION.DELETE;
|
||||||
|
// this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
|
||||||
|
// this.sharedData.setSharedData(EIT_ACTION.DELETE,EITTransactionsRequest.SUBMIT_EIT_ACTION);
|
||||||
|
this.fillEitTransactionTable(i);
|
||||||
|
this.validateEITTransaction();
|
||||||
|
// this.submitEit();
|
||||||
|
// this.navCtrl.push("AddEitPage");
|
||||||
|
} else {
|
||||||
|
let msg = '';
|
||||||
|
msg = this.ts.trPK('general', 'attemptDel');
|
||||||
|
this.cs.presentAlert(msg);
|
||||||
|
|
||||||
|
// alert("You are attempting to delete a row that has already been deleted.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
openEitNew(index) {
|
||||||
|
let item: any = [];
|
||||||
|
if (this.pAction == EIT_ACTION.UPDATE) {
|
||||||
|
item = this.getResEITTransactionList[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.navCtrl.push('AddEitPage', { dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo });
|
||||||
|
}
|
||||||
|
async openEit(index) {
|
||||||
|
let item: any = [];
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (this.pAction == EIT_ACTION.UPDATE) {
|
||||||
|
item = this.getResEITTransactionList[index].Collection_Transaction;
|
||||||
|
}
|
||||||
|
this.transactionNo++;
|
||||||
|
// tslint:disable-next-line: max-line-length
|
||||||
|
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
|
||||||
|
const modalPage = await this.modalCtrl.create({
|
||||||
|
component: AddEitComponent
|
||||||
|
});
|
||||||
|
// modalPage.present();
|
||||||
|
|
||||||
|
modalPage.onDidDismiss()
|
||||||
|
.then((data: any) => {
|
||||||
|
if (data) {
|
||||||
|
// this.transactionNo++;
|
||||||
|
// this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated;
|
||||||
|
// this.notificationBodyRes[index].Collection_Transaction=data.updated;
|
||||||
|
this.selectedIndex = index;
|
||||||
|
this.desxFlexCode = data.eitRequest.P_DESC_FLEX_CONTEXT_CODE;
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (this.pAction == EIT_ACTION.ADD) {
|
||||||
|
index = this.eitAddedList.length + 1;
|
||||||
|
const status = this.ts.trPK('eit', '.added');
|
||||||
|
const statusID = EIT_ACTION.ADD;
|
||||||
|
const obj = { status, statusID, Collection_Transaction: data.updated };
|
||||||
|
this.eitAddedList.push(obj);
|
||||||
|
} else {
|
||||||
|
const status = this.ts.trPK('eit', '.updated');
|
||||||
|
const statusID = EIT_ACTION.UPDATE;
|
||||||
|
this.getResEITTransactionList[this.selectedIndex].status = status;
|
||||||
|
this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
|
||||||
|
}
|
||||||
|
this.updateTransactionList(data.eitRequest.EITTransactionTBL, false);
|
||||||
|
} else {
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (this.transactionNo != 0) {
|
||||||
|
this.transactionNo--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
modalPage.present();
|
||||||
|
// modalPage.onDidDismiss(data => {
|
||||||
|
// if (data) {
|
||||||
|
// // this.transactionNo++;
|
||||||
|
// //this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated;
|
||||||
|
// // this.notificationBodyRes[index].Collection_Transaction=data.updated;
|
||||||
|
// this.selectedIndex = index;
|
||||||
|
// this.desxFlexCode = data.eitRequest.P_DESC_FLEX_CONTEXT_CODE;
|
||||||
|
// if (this.pAction == EIT_ACTION.ADD) {
|
||||||
|
// index = this.eitAddedList.length + 1;
|
||||||
|
// let status = this.ts.trPK("eit", ".added");
|
||||||
|
// let statusID = EIT_ACTION.ADD;
|
||||||
|
// let obj = { status: status, statusID: statusID, Collection_Transaction: data.updated };
|
||||||
|
// this.eitAddedList.push(obj);
|
||||||
|
// } else {
|
||||||
|
// let status = this.ts.trPK("eit", ".updated");
|
||||||
|
// let statusID = EIT_ACTION.UPDATE;
|
||||||
|
// this.getResEITTransactionList[this.selectedIndex].status = status;
|
||||||
|
// this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
|
||||||
|
// }
|
||||||
|
// this.updateTransactionList(data.eitRequest.EITTransactionTBL, false);
|
||||||
|
// } else {
|
||||||
|
// if (this.transactionNo != 0)
|
||||||
|
// this.transactionNo--;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
fillEitTransactionTable(index) {
|
||||||
|
let obj = { peiObjVer: null, peiExtraInfoID: null };
|
||||||
|
const list: any = this.getResEITTransactionList[index].Collection_Transaction;
|
||||||
|
let valuseArr: any = [];
|
||||||
|
// tslint:disable-next-line: prefer-for-of
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
const item = list[i];
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
// tslint:disable-next-line: max-line-length
|
||||||
|
if (item.APPLICATION_COLUMN_NAME != 'PEI_ACTION' && item.APPLICATION_COLUMN_NAME != 'PEI_EXTRA_INFO_ID' && item.APPLICATION_COLUMN_NAME != 'PEI_OBJECT_VERSION_NUMBER') {
|
||||||
|
this.desxFlexCode = item.DESC_FLEX_CONTEXT_CODE;
|
||||||
|
// tslint:disable-next-line: triple-equals
|
||||||
|
if (item.DATE_VALUE == '') {
|
||||||
|
item.DATE_VALUE = null;
|
||||||
|
}
|
||||||
|
valuseArr.push(
|
||||||
|
{
|
||||||
|
TRANSACTION_NUMBER: this.transactionNo,
|
||||||
|
NAME: item.APPLICATION_COLUMN_NAME,
|
||||||
|
VARCHAR2_VALUE: item.VARCHAR2_VALUE,
|
||||||
|
NUMBER_VALUE: item.NUMBER_VALUE,
|
||||||
|
DATE_VALUE: item.DATE_VALUE,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (item.APPLICATION_COLUMN_NAME == 'PEI_OBJECT_VERSION_NUMBER') {
|
||||||
|
obj.peiObjVer = item.NUMBER_VALUE;
|
||||||
|
}
|
||||||
|
else if (item.APPLICATION_COLUMN_NAME == 'PEI_EXTRA_INFO_ID') {
|
||||||
|
obj.peiExtraInfoID = item.NUMBER_VALUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}// end for
|
||||||
|
// }
|
||||||
|
valuseArr = this.fillExtraInformation(valuseArr, 'DELETE_ROW', obj.peiExtraInfoID, obj.peiObjVer, this.transactionNo);
|
||||||
|
this.eitTransactionTbl = valuseArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
fillExtraInformation(values: any, peiAction: string, peiExtraInfoID: number, peiObjVer: number, transNo: number): any {
|
||||||
|
values.push(
|
||||||
|
{
|
||||||
|
TRANSACTION_NUMBER: transNo,
|
||||||
|
NAME: 'PEI_ACTION',
|
||||||
|
VARCHAR2_VALUE: peiAction,
|
||||||
|
NUMBER_VALUE: null,
|
||||||
|
DATE_VALUE: null
|
||||||
|
});
|
||||||
|
values.push(
|
||||||
|
{
|
||||||
|
TRANSACTION_NUMBER: transNo,
|
||||||
|
NAME: 'PEI_EXTRA_INFO_ID',
|
||||||
|
VARCHAR2_VALUE: null,
|
||||||
|
NUMBER_VALUE: peiExtraInfoID,
|
||||||
|
DATE_VALUE: null
|
||||||
|
});
|
||||||
|
values.push(
|
||||||
|
{
|
||||||
|
TRANSACTION_NUMBER: transNo,
|
||||||
|
NAME: 'PEI_OBJECT_VERSION_NUMBER',
|
||||||
|
VARCHAR2_VALUE: null,
|
||||||
|
NUMBER_VALUE: peiObjVer,
|
||||||
|
DATE_VALUE: null
|
||||||
|
});
|
||||||
|
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
submitEit() {
|
||||||
|
this.eitRequest = new EitRequest();
|
||||||
|
const list: any = this.fixTransactionNo();
|
||||||
|
this.eitRequest.EITTransactionTBL = list;
|
||||||
|
this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
||||||
|
this.eitRequest.P_MENU_TYPE = this.menuType;
|
||||||
|
this.eitRequest.P_SELECTED_RESP_ID = this.respID; // this.selMenu.List_Menu.RESP_ID,//-999,
|
||||||
|
this.eitRequest.P_FUNCTION_NAME = this.functionName;
|
||||||
|
this.eitRequest.P_DESC_FLEX_CONTEXT_CODE = this.desxFlexCode;
|
||||||
|
|
||||||
|
this.EITService.submitEit(this.eitRequest).subscribe((result: AddEitResponse) => {
|
||||||
|
this.handleSubmitEitResult(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
handleSubmitEitResult(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
|
||||||
|
this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA);
|
||||||
|
// this.addrespList=result.SubmitEITTransactionList;
|
||||||
|
// this.itemKey=this.addrespList.P_ITEM_KEY;
|
||||||
|
// this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID;
|
||||||
|
// this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA);
|
||||||
|
|
||||||
|
// //this.cs.sharedService.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit");
|
||||||
|
// // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA);
|
||||||
|
this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData');
|
||||||
|
this.cs.openConfirmEitPage();
|
||||||
|
// this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false, isDelete: this.isDelete });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
validateEITTransaction() {
|
||||||
|
this.isDelete = false;
|
||||||
|
this.eitRequest = {
|
||||||
|
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
|
||||||
|
P_MENU_TYPE: this.menuType,
|
||||||
|
P_SELECTED_RESP_ID: this.respID,
|
||||||
|
P_FUNCTION_NAME: this.functionName,
|
||||||
|
P_DESC_FLEX_CONTEXT_CODE: this.desxFlexCode,
|
||||||
|
EITTransactionTBL: this.eitTransactionTbl
|
||||||
|
};
|
||||||
|
|
||||||
|
this.EITService.validateEITTransaction(this.eitRequest).subscribe((result: any) => {
|
||||||
|
this.handleEITValidateTr(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private handleEITValidateTr(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
// public static SHARED_DATA = 'login-request';
|
||||||
|
// this.sharedData.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
|
||||||
|
const status = this.ts.trPK('eit', '.deleted');
|
||||||
|
const statusID = EIT_ACTION.DELETE;
|
||||||
|
this.isDelete = true;
|
||||||
|
this.getResEITTransactionList[this.selectedIndex].status = status;
|
||||||
|
this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
|
||||||
|
this.updateTransactionList(this.eitTransactionTbl, false);
|
||||||
|
this.submitEit();
|
||||||
|
} else {
|
||||||
|
if (this.transactionNo != 0) {
|
||||||
|
this.transactionNo--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateTransactionList(list, isRemove) {
|
||||||
|
// let newlist = this.validEitTransactionTbl.map(a => a.NAME='PEI_EXTRA_INFO_ID');
|
||||||
|
let isAnewRow = false;
|
||||||
|
let updateDelTransNo: number;
|
||||||
|
if (this.cs.hasData(this.validEitTransactionTbl)) {
|
||||||
|
this.validEitTransactionTbl.forEach(element => {
|
||||||
|
if (element.NAME == 'PEI_EXTRA_INFO_ID') {
|
||||||
|
if (element.NUMBER_VALUE == -1) {
|
||||||
|
isAnewRow = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
list.forEach(element => {
|
||||||
|
// NAME=PEI_EXTRA_INFO_ID
|
||||||
|
// const index = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
|
||||||
|
// let newlist = this.validEitTransactionTbl.map(a => a.NAME==='PEI_EXTRA_INFO_ID');
|
||||||
|
if (isAnewRow == true) {
|
||||||
|
const index: number = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
|
||||||
|
// if(index!=-1)
|
||||||
|
// this.validEitTransactionTbl.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
const index: number = this.validEitTransactionTbl.findIndex(x => x.NAME === 'PEI_EXTRA_INFO_ID' && x.NUMBER_VALUE === element.NUMBER_VALUE);
|
||||||
|
if (index != -1) {
|
||||||
|
// this.validEitTransactionTbl.splice(index, 1);
|
||||||
|
if (!updateDelTransNo) {
|
||||||
|
updateDelTransNo = this.validEitTransactionTbl[index].TRANSACTION_NUMBER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
if (updateDelTransNo) {
|
||||||
|
this.removeItems(updateDelTransNo);
|
||||||
|
}
|
||||||
|
if (isRemove == false) {
|
||||||
|
this.validEitTransactionTbl = this.validEitTransactionTbl ? this.validEitTransactionTbl.concat(list) : list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixTransactionNo(): any[] {
|
||||||
|
const list: any = [];
|
||||||
|
let newIndex = 1;
|
||||||
|
const length: number = this.validEitTransactionTbl.length;
|
||||||
|
for (let i = 0; i < length; i++) {
|
||||||
|
// let item :any={};
|
||||||
|
const item = Object.assign({}, this.validEitTransactionTbl[i]);
|
||||||
|
const transNo: number = item.TRANSACTION_NUMBER;
|
||||||
|
const obj: any = item;
|
||||||
|
if (i == 0) {
|
||||||
|
obj.TRANSACTION_NUMBER = newIndex;
|
||||||
|
list.push(obj);
|
||||||
|
} else {
|
||||||
|
const prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER;
|
||||||
|
if (transNo == prevEl) {
|
||||||
|
obj.TRANSACTION_NUMBER = newIndex;
|
||||||
|
list.push(obj);
|
||||||
|
} else {
|
||||||
|
newIndex++;
|
||||||
|
obj.TRANSACTION_NUMBER = newIndex;
|
||||||
|
list.push(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
removeItems(transNo) {
|
||||||
|
const list = [];
|
||||||
|
for (let i = 0; i < this.validEitTransactionTbl.length; i++) {
|
||||||
|
if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) {
|
||||||
|
list.push(this.validEitTransactionTbl[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.validEitTransactionTbl = list;
|
||||||
|
}
|
||||||
|
removeAddedItem(index) {
|
||||||
|
const list = [];
|
||||||
|
let item: any = [];
|
||||||
|
for (let i = 0; i < this.eitAddedList.length; i++) {
|
||||||
|
if (i != index) {
|
||||||
|
list.push(this.eitAddedList[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item = this.eitAddedList[index];
|
||||||
|
this.eitAddedList = list;
|
||||||
|
this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////
|
||||||
|
// getUserDetails(){
|
||||||
|
// this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
|
||||||
|
// if (user) {
|
||||||
|
// this.emp_no=user.EMPLOYEE_NUMBER;
|
||||||
|
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// public getAccrualBalance() {
|
||||||
|
// if (this.Sdate) {
|
||||||
|
// let today = new Date(this.Sdate);
|
||||||
|
// let day = today.getDate();
|
||||||
|
// let month = today.getMonth() + 1;
|
||||||
|
// let year = today.getFullYear();
|
||||||
|
// let todayDate = month + '/' + day + '/' + year;
|
||||||
|
// let effectiveDate = todayDate;
|
||||||
|
// const request = {
|
||||||
|
// P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,
|
||||||
|
// P_EFFECTIVE_DATE: effectiveDate
|
||||||
|
// };
|
||||||
|
// this.accrualService
|
||||||
|
// .getAccrualBalances(request)
|
||||||
|
// .subscribe((result: any) => {
|
||||||
|
// this.handleAccrualResult(result);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// handleAccrualResult(result) {
|
||||||
|
// if (this.cs.validResponse(result)) {
|
||||||
|
// this.balance=result.GetAccrualBalancesList;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
////////////////////////////////up
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
<ion-header>
|
||||||
|
<ion-toolbar class="header-toolbar-new">
|
||||||
|
<nav-buttons></nav-buttons>
|
||||||
|
<ion-title color="light">{{'eit, update-title' | translate}}</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content padding>
|
||||||
|
<!-- <button ion-button (click)="resubmitEit()">next</button> -->
|
||||||
|
<div *ngIf="notificationBodyRes?.length > 0 ">
|
||||||
|
<ion-card *ngFor="let item of notificationBodyRes; let i=index ">
|
||||||
|
<ion-card-header class="hrTitle">
|
||||||
|
|
||||||
|
<div class="hrTitle">{{'worklistMain, notfDetails' | translate}} </div>
|
||||||
|
|
||||||
|
<!-- <button ion-button icon-only *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
|
||||||
|
<ion-icon name="create"></ion-icon>
|
||||||
|
</button> -->
|
||||||
|
<div class="editIconDiv"><button ion-button *ngIf="item.Collection_Notification[0].ACTION!='DELETE_ROW'" (click)="updateEitNot(i)">
|
||||||
|
<img class="imgSize" src="../assets/imgs/edit.png"></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-card-header>
|
||||||
|
|
||||||
|
<ion-card-content>
|
||||||
|
<ion-grid class="grids">
|
||||||
|
<div *ngFor="let notificationBody of item.Collection_Notification ">
|
||||||
|
<ion-row *ngIf=" notificationBody.DISPLAY_FLAG != 'N' ">
|
||||||
|
<ion-col class="colBold">
|
||||||
|
<label style="color:#29B5BF;font-weight: bold;" class="label" for="">{{notificationBody.SEGMENT_PROMPT}}</label>
|
||||||
|
<!-- </ion-col>
|
||||||
|
<ion-col class="colBold"> -->
|
||||||
|
<br>
|
||||||
|
<label class="label" style="color:black;" for="">{{notificationBody.SEGMENT_VALUE_DSP}}</label>
|
||||||
|
<hr style="background-color: grey;height: 1px">
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-card-content>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-card>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
<ion-footer>
|
||||||
|
<div class="centerDiv">
|
||||||
|
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="resubmitEit()">
|
||||||
|
{{ 'general, next' | translate }}</ion-button>
|
||||||
|
</div>
|
||||||
|
</ion-footer>
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
.addEitOkButton{
|
||||||
|
white-space: normal !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
min-height: 45px !important;
|
||||||
|
min-width: 5px !important;
|
||||||
|
margin: 8px !important;
|
||||||
|
background-color: #29B5BF;
|
||||||
|
width: 80% !important;
|
||||||
|
color: white!important;
|
||||||
|
border-radius: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editIconDiv{
|
||||||
|
right: 10px;
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EitUpdateListComponent } from './eit-update-list.component';
|
||||||
|
|
||||||
|
describe('EitUpdateListComponent', () => {
|
||||||
|
let component: EitUpdateListComponent;
|
||||||
|
let fixture: ComponentFixture<EitUpdateListComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EitUpdateListComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EitUpdateListComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,135 @@
|
|||||||
|
import { AddEitComponent } from './../add-eit/add-eit.component';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { EitRequest } from './../models/eit.request';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||||
|
import { EITNotificatonBodyResponse } from '../models/EITNotificationBodyRes';
|
||||||
|
import { EitService } from '../services/eit.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-eit-update-list',
|
||||||
|
templateUrl: './eit-update-list.component.html',
|
||||||
|
styleUrls: ['./eit-update-list.component.scss'],
|
||||||
|
})
|
||||||
|
export class EitUpdateListComponent implements OnInit {
|
||||||
|
|
||||||
|
public notificationBodyRes: any = {};
|
||||||
|
private updatedData: any = [];
|
||||||
|
private updatedItem: any;
|
||||||
|
private itemKey: string = "";
|
||||||
|
private notificationId: number;
|
||||||
|
private selEmp: string;
|
||||||
|
private functionName: string;
|
||||||
|
private eitTransactionTbl: any = [];
|
||||||
|
private eitRequest: EitRequest;
|
||||||
|
private descFlex: string;
|
||||||
|
|
||||||
|
constructor(public cs: CommonService, public eitService: EitService, public modalController: ModalController) {
|
||||||
|
this.notificationBodyRes = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.SHARED_DATA, false);
|
||||||
|
let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);
|
||||||
|
this.itemKey = notification.ITEM_KEY;
|
||||||
|
this.notificationId = notification.NOTIFICATION_ID;
|
||||||
|
this.functionName = notification.FUNCTION_NAME;
|
||||||
|
this.selEmp = notification.SELECTED_EMPLOYEE_NUMBER;
|
||||||
|
this.descFlex = notification.DESC_FLEX_CONTEXT_CODE;
|
||||||
|
this.fillEitTransactionTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() { console.log("ngOnInit");}
|
||||||
|
|
||||||
|
async updateEitNot(index) {
|
||||||
|
let item = this.notificationBodyRes[index].Collection_Notification;
|
||||||
|
this.cs.sharedService.setSharedData({ dirfromNotificationPage: true, submitEITObjList: item }, 'AddEITData')
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: AddEitComponent
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.onDidDismiss()
|
||||||
|
.then((data: any) => {
|
||||||
|
// console.log("data" + data);
|
||||||
|
// console.log("data" + data.data.updated);
|
||||||
|
// console.log("data" + data.data.eitRequest.EITTransactionTBL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(data.data == undefined)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (data.data) {
|
||||||
|
this.updatedData = this.updatedData ? this.updatedData.concat(data.data.updated) : data.data.updated;
|
||||||
|
this.notificationBodyRes[index].Collection_Notification = data.data.updated;
|
||||||
|
this.updateTransactionList(data.data.eitRequest.EITTransactionTBL);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTransactionList(list) {
|
||||||
|
list.forEach(element => {
|
||||||
|
const index = this.eitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
|
||||||
|
if (index != -1)
|
||||||
|
this.eitTransactionTbl.splice(index, 1);
|
||||||
|
});
|
||||||
|
this.eitTransactionTbl = this.eitTransactionTbl ? this.eitTransactionTbl.concat(list) : list;
|
||||||
|
}
|
||||||
|
|
||||||
|
resubmitEit() {
|
||||||
|
this.eitRequest = new EitRequest();
|
||||||
|
this.eitRequest.EITTransactionTBL = this.eitTransactionTbl;
|
||||||
|
this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
|
||||||
|
this.eitRequest.P_MENU_TYPE = "E";
|
||||||
|
this.eitRequest.P_SELECTED_RESP_ID = -999;
|
||||||
|
this.eitRequest.P_FUNCTION_NAME = this.functionName;
|
||||||
|
this.eitRequest.P_DESC_FLEX_CONTEXT_CODE = this.descFlex;
|
||||||
|
let body = {
|
||||||
|
P_NOTIFICATION_ID: this.notificationId,
|
||||||
|
P_ITEM_KEY: this.itemKey,
|
||||||
|
EITTransactionTBL: this.eitTransactionTbl
|
||||||
|
}
|
||||||
|
this.eitService.reSubmitEit(body).subscribe((result: any) => {
|
||||||
|
this.handleResubmitEit(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleResubmitEit(result) {
|
||||||
|
if (this.cs.validResponse(result)) {
|
||||||
|
this.cs.sharedService.setSharedData(result.ResubmitEITTransactionList.P_TRANSACTION_ID, "TransactionIDResubmit");
|
||||||
|
this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
|
||||||
|
this.cs.sharedService.setSharedData({ isResubmit: true }, 'confirmAddEITData');
|
||||||
|
this.cs.openConfirmEitPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fillEitTransactionTable() {
|
||||||
|
let valuseArr: any = [];
|
||||||
|
let varcharValue: any = null;
|
||||||
|
let numbervalue: any = 0;
|
||||||
|
let dateValue: any = null;
|
||||||
|
let transNo: number = 1;
|
||||||
|
let textValue = "";
|
||||||
|
// if(this.ExtraObj.transactionNo)
|
||||||
|
// transNo=this.ExtraObj.transactionNo;
|
||||||
|
for (let j = 0; j < this.notificationBodyRes.length; j++) {
|
||||||
|
let list = this.notificationBodyRes[j].Collection_Notification;
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
let item = list[i];
|
||||||
|
varcharValue = null;
|
||||||
|
numbervalue = null;
|
||||||
|
dateValue = null;
|
||||||
|
valuseArr.push(
|
||||||
|
{
|
||||||
|
TRANSACTION_NUMBER: item.TRANSACTION_NUMBER,
|
||||||
|
NAME: item.APPLICATION_COLUMN_NAME,
|
||||||
|
VARCHAR2_VALUE: item.VARCHAR2_VALUE,
|
||||||
|
NUMBER_VALUE: item.NUMBER_VALUE,
|
||||||
|
DATE_VALUE: item.DATE_VALUE,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}// end for
|
||||||
|
}
|
||||||
|
this.eitTransactionTbl = valuseArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
import { AddAttachComponent } from './add-attach/add-attach.component';
|
||||||
|
import { ConfirmAddEitComponent } from './confirm-add-eit/confirm-add-eit.component';
|
||||||
|
import { AddEitComponent } from './add-eit/add-eit.component';
|
||||||
|
import { HmgCommonModule } from 'src/app/hmg-common/hmg-common.module';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
import { EITPage } from './eit.page';
|
||||||
|
import { HomeComponent } from './home/home.component';
|
||||||
|
import { EitListComponent } from './eit-list/eit-list.component';
|
||||||
|
import { DatePicker } from '@ionic-native/date-picker/ngx';
|
||||||
|
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
|
||||||
|
import { EitUpdateListComponent } from './eit-update-list/eit-update-list.component';
|
||||||
|
import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component';
|
||||||
|
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: EITPage,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'homepage',
|
||||||
|
component: HomeComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'eit-list',
|
||||||
|
component: EitListComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'add-eit',
|
||||||
|
component: AddEitComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'confirm-add-eit',
|
||||||
|
component: ConfirmAddEitComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'add-attach',
|
||||||
|
component: AddAttachComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'eit-update-list',
|
||||||
|
component: EitUpdateListComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'eit-submit-modal',
|
||||||
|
component: SubmitEitModalComponent
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
HmgCommonModule,
|
||||||
|
RouterModule.forChild(routes)
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
EITPage,
|
||||||
|
HomeComponent,
|
||||||
|
EitListComponent,
|
||||||
|
AddEitComponent,
|
||||||
|
ConfirmAddEitComponent,
|
||||||
|
AddAttachComponent,
|
||||||
|
EitUpdateListComponent,
|
||||||
|
SubmitEitModalComponent
|
||||||
|
],
|
||||||
|
entryComponents: [
|
||||||
|
WorkListAttachViewComponent
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
DatePicker
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class EITPageModule { }
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
<ion-content>
|
||||||
|
<ion-router-outlet></ion-router-outlet>
|
||||||
|
</ion-content>
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EITPage } from './eit.page';
|
||||||
|
|
||||||
|
describe('EITPage', () => {
|
||||||
|
let component: EITPage;
|
||||||
|
let fixture: ComponentFixture<EITPage>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EITPage ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(EITPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-eit',
|
||||||
|
templateUrl: './eit.page.html',
|
||||||
|
styleUrls: ['./eit.page.scss'],
|
||||||
|
})
|
||||||
|
export class EITPage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,87 @@
|
|||||||
|
<app-generic-header
|
||||||
|
showBack="true"
|
||||||
|
[headerText]="headerTitle">
|
||||||
|
</app-generic-header>
|
||||||
|
<!-- backLink="/home" -->
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
|
||||||
|
|
||||||
|
<!--From Home List-->
|
||||||
|
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" *ngIf="pageType=='home'">
|
||||||
|
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu.children; let i=index"
|
||||||
|
(click)="openPage(menuItem, i);">
|
||||||
|
<ion-row style="width: 100%;">
|
||||||
|
<!-- Parent Pages -->
|
||||||
|
<ion-col size="12" class="">
|
||||||
|
<div [ngClass]="{'selectedDiv': selectedMenu == i,'notSelected': selectedMenu != i }">
|
||||||
|
<ion-label>
|
||||||
|
<b text-wrap>{{menuItem.PROMPT}}</b>
|
||||||
|
|
||||||
|
<ion-icon [ngClass]='direction == "en"? "span-arrow-en":"span-arrow-ar"' name="arrow-forward"></ion-icon>
|
||||||
|
|
||||||
|
</ion-label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Child Pages -->
|
||||||
|
<ion-list [hidden]="selectedMenu != i" lines="full">
|
||||||
|
<ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
|
||||||
|
(click)="openPage(subPage, i2)">
|
||||||
|
<!-- <ion-row>
|
||||||
|
<ion-col size="10" class="menu-name"><span ion-text color="color2"> {{subPage.PROMPT}} </span> -->
|
||||||
|
<ion-label><span ion-text color="color2"> {{subPage.PROMPT}} </span>
|
||||||
|
<ion-icon [ngClass]='direction == "en"? "span-arrow-en":"span-arrow-ar"' name="arrow-forward"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
|
<!-- </ion-col>
|
||||||
|
</ion-row> -->
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<!-- <ion-icon [name]="selectedMenu == i? 'ios-arrow-down' : 'ios-arrow-forward'"
|
||||||
|
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> -->
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--From My Team List-->
|
||||||
|
|
||||||
|
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" *ngIf="pageType=='myteam'">
|
||||||
|
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index"
|
||||||
|
(click)="openPage(menuItem, i);">
|
||||||
|
<ion-row style="width: 100%;">
|
||||||
|
<!-- Parent Pages -->
|
||||||
|
<ion-col size="12" class="">
|
||||||
|
<div [ngClass]="{'selectedDiv': selectedMenu == i,'notSelected': selectedMenu != i }">
|
||||||
|
<ion-label>
|
||||||
|
<b text-wrap>{{menuItem.PROMPT}}</b>
|
||||||
|
|
||||||
|
<!-- <ion-icon style="float: right;font-size: 25px;color: grey;" name="arrow-forward"></ion-icon> -->
|
||||||
|
<ion-icon [ngClass]='direction == "en"? "span-arrow-en":"span-arrow-ar"' name="arrow-forward"></ion-icon>
|
||||||
|
|
||||||
|
</ion-label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Child Pages -->
|
||||||
|
<ion-list [hidden]="selectedMenu != i" lines="full">
|
||||||
|
<ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
|
||||||
|
(click)="openPage(subPage, i2)">
|
||||||
|
<!-- <ion-row>
|
||||||
|
<ion-col size="10" class="menu-name"><span ion-text color="color2"> {{subPage.PROMPT}} </span> -->
|
||||||
|
<ion-label><span ion-text color="color2"> {{subPage.PROMPT}} </span>
|
||||||
|
<!-- <ion-icon style="float: right;font-size: 25px;color: grey;" name="arrow-forward"></ion-icon> -->
|
||||||
|
<ion-icon [ngClass]='direction == "en"? "arrow-forward":"arrow-forward-ar"' name="arrow-forward"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
|
<!-- </ion-col>
|
||||||
|
</ion-row> -->
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
<!-- <ion-icon [name]="selectedMenu == i? 'ios-arrow-down' : 'ios-arrow-forward'"
|
||||||
|
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> -->
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
ion-item.custCollabs.item.item-block.item-md,
|
||||||
|
ion-item.custCollabs.item.item-block.item-ios {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ion-item-styling {
|
||||||
|
color: black;
|
||||||
|
line-height: 2;
|
||||||
|
margin: 8px 2px;
|
||||||
|
min-height: 40px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-bottom: 1px solid #c8c8c8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-toolbar-new{
|
||||||
|
--background: #29B5BF;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-item.item.item-block {
|
||||||
|
.item-inner {
|
||||||
|
border: 0px !important;
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-item.childItem.item.item-block {
|
||||||
|
padding: 0px 5px;
|
||||||
|
width: 100%;
|
||||||
|
ion-label.label.label-md,
|
||||||
|
ion-label.label.label-ios {
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
border-bottom: 1px solid #e4e5e7;
|
||||||
|
border-radius: 0px;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-col.menu-name.col {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.selectedDiv {
|
||||||
|
background: #209a83;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 0px 10px;
|
||||||
|
min-height: 40px;
|
||||||
|
}
|
||||||
|
div.notSelected {
|
||||||
|
padding: 0px 10px;
|
||||||
|
}
|
||||||
|
// ion-label.label.label-md,
|
||||||
|
// ion-label.label.label-ios {
|
||||||
|
}
|
||||||
|
|
||||||
|
ion-icon::before {
|
||||||
|
line-height: 2;
|
||||||
|
}
|
||||||
|
.arrow-down{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
// .list-md > .item-block:last-child .item-inner,
|
||||||
|
// .list-ios > .item-block:last-child .item-inner{
|
||||||
|
|
||||||
|
// border-bottom: 1px solid #dedede;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.span-arrow-en{
|
||||||
|
float: right;
|
||||||
|
font-size: 25px;
|
||||||
|
color: grey;
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-arrow-ar{
|
||||||
|
float: left;
|
||||||
|
font-size: 25px;
|
||||||
|
color: grey;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow-forward{
|
||||||
|
float: right;
|
||||||
|
font-size: 25px;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
.arrow-forward-ar{
|
||||||
|
float: left;
|
||||||
|
font-size: 25px;
|
||||||
|
color: grey;
|
||||||
|
-webkit-transform: rotate(180deg);
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { HomeComponent } from './home.component';
|
||||||
|
|
||||||
|
describe('HomeComponent', () => {
|
||||||
|
let component: HomeComponent;
|
||||||
|
let fixture: ComponentFixture<HomeComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ HomeComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(HomeComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||||
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-home',
|
||||||
|
templateUrl: './home.component.html',
|
||||||
|
styleUrls: ['./home.component.scss'],
|
||||||
|
})
|
||||||
|
export class HomeComponent implements OnInit {
|
||||||
|
|
||||||
|
menu: any;
|
||||||
|
pages: any;
|
||||||
|
headerTitle: string;
|
||||||
|
selMenu: MenuResponse = new MenuResponse();
|
||||||
|
// Selected Side Menu
|
||||||
|
selectedMenu: any;
|
||||||
|
direction: string;
|
||||||
|
pageType: string;
|
||||||
|
|
||||||
|
constructor(private cs: CommonService, private ts: TranslatorService) {
|
||||||
|
this.direction = TranslatorService.getCurrentLanguageName();
|
||||||
|
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
|
||||||
|
this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false);
|
||||||
|
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||||
|
const title: string = this.ts.trPK('eit', 'my-requests');
|
||||||
|
this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() { }
|
||||||
|
|
||||||
|
openPage(page, index) {
|
||||||
|
console.log(page + "index" + index);
|
||||||
|
// Reset the content nav to have just this page
|
||||||
|
// we wouldn't want the back button to show in this scenario
|
||||||
|
if (page.children.length === 0) {
|
||||||
|
this.goToRequest(page);
|
||||||
|
} else {
|
||||||
|
if (this.selectedMenu === 0) {
|
||||||
|
this.selectedMenu = -1;
|
||||||
|
} else if (this.selectedMenu !== -1) {
|
||||||
|
this.selectedMenu = -1;
|
||||||
|
} else {
|
||||||
|
this.selectedMenu = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('selected>>>>>>>' + this.selectedMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
goToRequest(menuEntry) {
|
||||||
|
let selMenu: MenuResponse = new MenuResponse();
|
||||||
|
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||||
|
selMenu.GetMenuEntriesList = menuEntry;
|
||||||
|
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
|
||||||
|
if (menuEntry.REQUEST_TYPE === 'ABSENCE') {
|
||||||
|
this.cs.openAbsencePage();
|
||||||
|
} else if (menuEntry.REQUEST_TYPE === 'EIT') {
|
||||||
|
this.cs.openEitListPage();
|
||||||
|
} else if (menuEntry.REQUEST_TYPE === 'BASIC_DETAILS') {
|
||||||
|
this.cs.openProfile('basicDetails');
|
||||||
|
} else if (menuEntry.REQUEST_TYPE === 'ADDRESS') {
|
||||||
|
this.cs.openProfile('address');
|
||||||
|
}
|
||||||
|
if (menuEntry.REQUEST_TYPE === 'PAYSLIP') {
|
||||||
|
this.cs.openPayslipPage();
|
||||||
|
}
|
||||||
|
if (menuEntry.REQUEST_TYPE === 'TIME_CARD') {
|
||||||
|
this.cs.openTimeCardPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
export class EITNotificationBodyItems {
|
||||||
|
public TRANSACTION_NUMBER :number;
|
||||||
|
public DESC_FLEX_NAME : string;
|
||||||
|
public ACTION : string;
|
||||||
|
public EXTRA_INFO_ID :number;
|
||||||
|
public DESC_FLEX_CONTEXT_COD : string;
|
||||||
|
public APPLICATION_COLUMN_NAME : string;
|
||||||
|
public SEGMENT_SEQ_NUM :number;
|
||||||
|
public DATATYPE : string;
|
||||||
|
public SEGMENT_NAME : string;
|
||||||
|
public VARCHAR2_VALUE : string;
|
||||||
|
public SEGMENT_PROMPT : string;
|
||||||
|
public NUMBER_VALUE :number;
|
||||||
|
public SEGMENT_VALUE_DSP : string;
|
||||||
|
public DATE_VALUE : string ;
|
||||||
|
public PREV_SEGMENT_VALUE_DSP : string;
|
||||||
|
public DISPLAY_FLAG : string ;
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { EITNotificationBodyItems } from './EITNotificationBodyItems';
|
||||||
|
import { Response } from '../../hmg-common/services/models/response';
|
||||||
|
|
||||||
|
export class EITNotificatonBodyResponse extends Response {
|
||||||
|
public static SHARED_DATA = 'Notif_BODY_List';
|
||||||
|
public static NOT_WORKLIST = 'Notif_WORK_LOST';
|
||||||
|
public EITNotificationBodyItems: EITNotificationBodyItems [];
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
import { Request } from '../../hmg-common/services/models/request';
|
||||||
|
|
||||||
|
export class EITTransactionsRequest extends Request{
|
||||||
|
public static SUBMIT_EIT_ACTION='submit-eit-action';
|
||||||
|
public static SHARED_DATA='submit_eit_obj';
|
||||||
|
public P_PAGE_NUM : Number;
|
||||||
|
public P_PAGE_LIMIT : Number;
|
||||||
|
public P_MENU_TYPE:String;
|
||||||
|
public P_SELECTED_EMPLOYEE_NUMBER:String;
|
||||||
|
public P_FUNCTION_NAME:String;
|
||||||
|
public P_SELECTED_RESP_ID : Number;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import { Request } from '../../hmg-common/services/models/request';
|
||||||
|
|
||||||
|
export class WorkListButtonRequest extends Request{
|
||||||
|
//public static SHARED_DATA = '';
|
||||||
|
public P_NOTIFICATION_ID :any;
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
import { Response } from '../../hmg-common/services/models/response';
|
||||||
|
|
||||||
|
export class NotificationGetAttachResponse extends Response {
|
||||||
|
public static SHARED_DATA = '';
|
||||||
|
public SEQ_NUM = 0;// Int
|
||||||
|
public FILE_NAME = '';//String
|
||||||
|
public FILE_DATA = '';//base64
|
||||||
|
public PK1_VALUE = '';//String
|
||||||
|
public PK2_VALUE = '';//String
|
||||||
|
public PK3_VALUE = '';//String
|
||||||
|
public PK4_VALUE = '';//String
|
||||||
|
public FILE_CONTENT_TYPE = '';//String
|
||||||
|
public ATTACHED_DOCUMENT_ID = 0;//Int
|
||||||
|
public DOCUMENT_ID = 0;//Int
|
||||||
|
public CATEGORY_ID = 0;//Int
|
||||||
|
public DATATYPE_ID = 0;//Int
|
||||||
|
public ENTITY_NAME = '';//String
|
||||||
|
public FILE_ID = 0;//Int
|
||||||
|
public PK5_VALUE = '';//String
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import { Response } from '../../hmg-common/services/models/response';
|
||||||
|
import { EitRespModel } from './eit.response.model'
|
||||||
|
|
||||||
|
export class AddEitResponse extends Response {
|
||||||
|
public static SHARED_DATA = 'add-eit-response';
|
||||||
|
SubmitEITTransactionList: EitRespModel;
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
import { EitTransactionModel } from './eit.transaction.model';
|
||||||
|
|
||||||
|
export class EitAddressRequest {
|
||||||
|
public static SHARED_DATA = 'eit-request';
|
||||||
|
public P_MENU_TYPE: string;
|
||||||
|
public P_SELECTED_EMPLOYEE_NUMBER: string;
|
||||||
|
public P_FUNCTION_NAME: string;
|
||||||
|
public P_SELECTED_RESP_ID: Number;
|
||||||
|
P_DESC_FLEX_CONTEXT_CODE: string;
|
||||||
|
EITTransactionTBL: EitTransactionModel[];
|
||||||
|
P_COUNTRY_CODE: string;
|
||||||
|
P_EFFECTIVE_DATE: string;
|
||||||
|
P_ACTION: string;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import { EitTransactionModel } from './eit.transaction.model';
|
||||||
|
|
||||||
|
export class EitRequest {
|
||||||
|
public static SHARED_DATA = 'eit-request';
|
||||||
|
public P_MENU_TYPE: string;
|
||||||
|
public P_SELECTED_EMPLOYEE_NUMBER: string;
|
||||||
|
public P_FUNCTION_NAME: string;
|
||||||
|
public P_SELECTED_RESP_ID: Number;
|
||||||
|
P_DESC_FLEX_CONTEXT_CODE: string;
|
||||||
|
EITTransactionTBL: EitTransactionModel[];
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
export class EitRespModel {
|
||||||
|
P_ITEM_KEY: string;
|
||||||
|
P_RETURN_MSG:string;
|
||||||
|
P_RETURN_STATUS:string;
|
||||||
|
P_TRANSACTION_ID:number;
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
export class EitTransactionModel {
|
||||||
|
TRANSACTION_NUMBER: number;
|
||||||
|
NUMBER_VALUE: number;
|
||||||
|
NAME: string;
|
||||||
|
DATE_VALUE: string;
|
||||||
|
VARCHAR2_VALUE: string;
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
// tslint:disable-next-line:class-name
|
||||||
|
export enum EIT_ACTION {
|
||||||
|
ADD = 1,
|
||||||
|
DELETE = 2,
|
||||||
|
UPDATE=3
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { EitService } from './eit.service';
|
||||||
|
|
||||||
|
describe('EitService', () => {
|
||||||
|
beforeEach(() => TestBed.configureTestingModule({}));
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
const service: EitService = TestBed.get(EitService);
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
import { NotificationGetAttachResponse } from './../models/NotificationGetAttachRes';
|
||||||
|
import { EITTransactionsRequest } from './../models/EITTransactionsReq';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
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 { ApproversList } from 'src/app/absence/models/approvers';
|
||||||
|
import { WorkListButtonRequest } from '../models/NotificationButtonReq';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class EitService {
|
||||||
|
|
||||||
|
/* EIT Services URLs */
|
||||||
|
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
|
||||||
|
public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS';
|
||||||
|
public static getEITDFFStrutre = 'Services/ERP.svc/REST/GET_EIT_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 resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
|
||||||
|
public static startEitProcess = 'Services/ERP.svc/REST/START_EIT_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';
|
||||||
|
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
|
||||||
|
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
|
||||||
|
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
|
||||||
|
|
||||||
|
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
|
||||||
|
|
||||||
|
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string, isPostNoLoad = false): Observable<any> {
|
||||||
|
const request = menuEntries;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
if (isPostNoLoad) {
|
||||||
|
return this.con.postNoLoad(EitService.getMenuEntries, request, onError, errorLabel);
|
||||||
|
} else {
|
||||||
|
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line: no-shadowed-variable
|
||||||
|
public getEITTransactionsList(EITTransactionsRequest: EITTransactionsRequest, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = EITTransactionsRequest;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getEITTransctions, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public submitEit(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);
|
||||||
|
return this.con.post(EitService.validateEITTransctions, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getEITDFFStrutre(EITDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = EITDFFStrutreReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getEITDFFStrutre, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = SetValueReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getSetValue, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getDefaultValue(DefaultValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = DefaultValueReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getDefaultValue, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getApproversList(abProcess: any, onError?: any, errorLabel?: string): Observable<ApproversList> {
|
||||||
|
const request = abProcess;
|
||||||
|
request.P_AME_TRANSACTION_TYPE = 'SSHRMS';
|
||||||
|
request.P_PAGE_NUM = 1;
|
||||||
|
request.P_PAGE_LIMIT = 1000; // check later on
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getApproversList, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public addAttachment(addAttachrequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = addAttachrequest;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.addAttachment, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public startEitApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = eitProcess;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.startEitProcess, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public cancelHRTransaction(transactionID: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = transactionID;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.cancelHRTransaction, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getAttach(getAttachReq: WorkListButtonRequest, onError?: any, errorLabel?: string): Observable<NotificationGetAttachResponse> {
|
||||||
|
const request = getAttachReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.getAttach, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteAttach(delteAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = delteAttachReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.deleteAttach, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public updateAttach(updateAttachReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = updateAttachReq;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.updateAttach, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public reSubmitEit(eit: any, onError?: any, errorLabel?: string): Observable<any> {
|
||||||
|
const request = eit;
|
||||||
|
this.authService.authenticateRequest(request);
|
||||||
|
return this.con.post(EitService.resubmitEit, request, onError, errorLabel);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
<ion-content padding>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<ion-col col-1
|
||||||
|
style="margin-right: -22px;margin-top: -10px;">
|
||||||
|
<ion-button class="closeIcon" (click)="closeModal()">
|
||||||
|
<img src="../assets/imgs/close.png">
|
||||||
|
|
||||||
|
</ion-button>
|
||||||
|
</ion-col> -->
|
||||||
|
|
||||||
|
|
||||||
|
<h2><div class="Header">{{'eit,confirmation' | translate}}</div></h2>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div *ngIf="submitAttachmentList.length==0" class="labelcheck" lines="none" style="text-align: center;">
|
||||||
|
{{'eit,no-attachment' | translate}}
|
||||||
|
</div>
|
||||||
|
<div *ngIf="eitComments==''" class="labelcheck" style="text-align: center;margin-bottom: 5px;padding-bottom: 16px;">
|
||||||
|
{{'eit,no-note' | translate}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-footer style="border-top: 1px solid grey !important;">
|
||||||
|
<ion-row class="rowBtn">
|
||||||
|
<ion-label class="labelRadio">{{'eit,submit' | translate}}</ion-label>
|
||||||
|
<ion-button class="submitOkButton" (click)="OkBtnModal()"> {{ts.trPK('general','ok')}}
|
||||||
|
</ion-button>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
<ion-row class="rowBtn">
|
||||||
|
<ion-button class="submitCancelButton" (click)="closeModal()"> {{ts.trPK('general','cancel')}}
|
||||||
|
</ion-button>
|
||||||
|
|
||||||
|
</ion-row>
|
||||||
|
</ion-footer>
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
.rowBtn{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Header{
|
||||||
|
color: black !important;
|
||||||
|
font-size: 25px !important;
|
||||||
|
font-weight: bold !important;;
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.labelRadio{
|
||||||
|
color: black !important;
|
||||||
|
font-weight: bold !important;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.labelcheck{
|
||||||
|
color: red !important;
|
||||||
|
font-weight: bold !important;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitOkButton{
|
||||||
|
white-space: normal !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
min-height: 45px !important;
|
||||||
|
min-width: 5px !important;
|
||||||
|
margin: 8px !important;
|
||||||
|
--background:: #29B5BF;
|
||||||
|
width: 100% !important;
|
||||||
|
color: white!important;
|
||||||
|
border-radius: 16px !important;
|
||||||
|
}
|
||||||
|
.submitCancelButton{
|
||||||
|
white-space: normal !important;
|
||||||
|
text-transform: capitalize !important;
|
||||||
|
min-height: 45px !important;
|
||||||
|
min-width: 5px !important;
|
||||||
|
margin: 8px !important;
|
||||||
|
--background:: #29B5BF;
|
||||||
|
width: 100% !important;
|
||||||
|
color: white!important;
|
||||||
|
border-radius: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { SubmitEitModalComponent } from './submit-eit-modal.component';
|
||||||
|
|
||||||
|
describe('SubmitEitModalComponent', () => {
|
||||||
|
let component: SubmitEitModalComponent;
|
||||||
|
let fixture: ComponentFixture<SubmitEitModalComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ SubmitEitModalComponent ],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(SubmitEitModalComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-submit-eit-modal',
|
||||||
|
templateUrl: './submit-eit-modal.component.html',
|
||||||
|
styleUrls: ['./submit-eit-modal.component.scss'],
|
||||||
|
})
|
||||||
|
export class SubmitEitModalComponent implements OnInit {
|
||||||
|
submitAttachmentList :any =[];
|
||||||
|
eitComments: string;
|
||||||
|
constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){
|
||||||
|
this.submitAttachmentList = this.cs.sharedService.getSharedData('submitAttachmentList', false);
|
||||||
|
this.eitComments = this.cs.sharedService.getSharedData('eitComments', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
console.log("modal");
|
||||||
|
//this.actionBtns = this.cs.sharedService.getSharedData("passActionMore" , false);
|
||||||
|
console.log("modal");
|
||||||
|
|
||||||
|
}
|
||||||
|
closeModal() {
|
||||||
|
this.modalCtrl.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OkBtnModal() {
|
||||||
|
let data = "ok";
|
||||||
|
this.modalCtrl.dismiss(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue