Merge branch 'MOHEMM-Q3-DEV-LATEST' into enad-pre-live
commit
f5d0f0fd68
@ -0,0 +1,3 @@
|
||||
<p>
|
||||
add-cei works!
|
||||
</p>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { AddCeiComponent } from './add-cei.component';
|
||||
|
||||
describe('AddCeiComponent', () => {
|
||||
let component: AddCeiComponent;
|
||||
let fixture: ComponentFixture<AddCeiComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddCeiComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AddCeiComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-cei',
|
||||
templateUrl: './add-cei.component.html',
|
||||
styleUrls: ['./add-cei.component.scss'],
|
||||
})
|
||||
export class AddCeiComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
<p>
|
||||
cei-homepage works!
|
||||
</p>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CeiHomepageComponent } from './cei-homepage.component';
|
||||
|
||||
describe('CeiHomepageComponent', () => {
|
||||
let component: CeiHomepageComponent;
|
||||
let fixture: ComponentFixture<CeiHomepageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CeiHomepageComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CeiHomepageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cei-homepage',
|
||||
templateUrl: './cei-homepage.component.html',
|
||||
styleUrls: ['./cei-homepage.component.scss'],
|
||||
})
|
||||
export class CeiHomepageComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
<p>
|
||||
confirm-add-cei works!
|
||||
</p>
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConfirmAddCeiComponent } from './confirm-add-cei.component';
|
||||
|
||||
describe('ConfirmAddCeiComponent', () => {
|
||||
let component: ConfirmAddCeiComponent;
|
||||
let fixture: ComponentFixture<ConfirmAddCeiComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ConfirmAddCeiComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfirmAddCeiComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,14 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-add-cei',
|
||||
templateUrl: './confirm-add-cei.component.html',
|
||||
styleUrls: ['./confirm-add-cei.component.scss'],
|
||||
})
|
||||
export class ConfirmAddCeiComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
.date-container{
|
||||
margin:0px 20px;
|
||||
}
|
||||
|
||||
.label{
|
||||
font-size: 16px;
|
||||
// margin-left: 15px;
|
||||
color: #a2a5a6 !important;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
/* font-size: inherit; */
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
white-space: normal;
|
||||
// padding-top: 10px;
|
||||
padding: 5px 0px;
|
||||
padding-left: 10px !important;
|
||||
margin: 10px auto;
|
||||
:root[dir="ltr"]{
|
||||
font-family: var(--fontFamilySemiBoldEN) !important;
|
||||
}
|
||||
:root[dir="rtl"]{
|
||||
font-family: var(--fontFamilyIOSAR) !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.Field-en{
|
||||
border-radius: 30px;
|
||||
border: 1px solid #a2a5a6 !important;
|
||||
margin-bottom: 0px;
|
||||
padding-left: 20px !important;
|
||||
padding-top: 0px !important;
|
||||
color: #999999 !important;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.Field-ar{
|
||||
border-radius: 30px;
|
||||
border: 1px solid #a2a5a6!important;
|
||||
margin-bottom: 20px;
|
||||
padding-right: 20px !important;
|
||||
padding-top: 0px !important;
|
||||
color: #999999 !important;
|
||||
height:80px
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
<ion-header>
|
||||
<ion-toolbar class="header-toolbar-new">
|
||||
<nav-buttons></nav-buttons>
|
||||
<ion-title [ngClass]=" direction === 'en' ? 'title' : 'title-ar'" color="light">{{headerTitle}}</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content>
|
||||
<!-------------------------------Start New design ---------------------------------------->
|
||||
<ion-grid>
|
||||
<ion-row style="margin-top: 20px;margin-left: 12px;">
|
||||
<ion-col>
|
||||
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'" >{{'general, addAttach' | translate}}</div>
|
||||
</ion-col>
|
||||
<ion-col style="padding-left: 7%;" size="2">
|
||||
<div class="fileDiv">
|
||||
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
|
||||
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
|
||||
<label end for="file" class="attachLable">
|
||||
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
|
||||
</label></div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
|
||||
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
|
||||
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
|
||||
<div *ngFor="let attachList of attachListOver ; let i = index">
|
||||
<ion-row>
|
||||
<ion-col size="1">
|
||||
<ion-label style="color: black !important;">
|
||||
{{attachList.AttachmentID +1 }} .
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col style="text-align: left;" size="10">
|
||||
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
|
||||
{{attachList.P_FILE_NAME }}
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size="1">
|
||||
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
|
||||
(click)="removeFile(attachList)">
|
||||
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
|
||||
</button>
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
<ion-grid *ngIf="attachmentRes?.length > 0">
|
||||
<div *ngFor="let attachRes of attachmentRes">
|
||||
<ion-row>
|
||||
<ion-col col-8>
|
||||
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
|
||||
</div>
|
||||
<ion-label>
|
||||
{{attachRes.FILE_NAME }} </ion-label>
|
||||
|
||||
</ion-col>
|
||||
<ion-col col-4>
|
||||
<button float-end class="attachImgBtn"
|
||||
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
|
||||
<img class="attachImg" src="../assets/imgs/view.png">
|
||||
</button>
|
||||
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
|
||||
class="attachImg" src="../assets/imgs/deletegray.png"></button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
<ion-grid class="">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
|
||||
<ion-item class="submitNote" lines="none">
|
||||
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="approvalList">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
|
||||
<div class="noDataDiv" *ngIf="approversList?.length == 0">
|
||||
<p>{{ 'general, empty' | translate}}</p>
|
||||
</div>
|
||||
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
|
||||
<ion-list class="notification-list ">
|
||||
<div class="timeline">
|
||||
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
|
||||
|
||||
<div class="timeline-item" slot="start">
|
||||
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
|
||||
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
|
||||
src="../assets/imgs/profile.png"> </div>
|
||||
</div>
|
||||
<ion-col>
|
||||
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
|
||||
{{employee.APPROVER}}
|
||||
</ion-label>
|
||||
<ion-label style="color:black !important ;padding-top: 4%;">
|
||||
{{employee.POSITION_TITLE}}
|
||||
</ion-label>
|
||||
|
||||
</ion-col>
|
||||
<div class="line"></div>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="confirmEitOkButton" color="customnavy" ion-button (click)="openSubmitModal()">
|
||||
{{ 'general, submit' | translate }}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,263 @@
|
||||
.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: #269DB8;
|
||||
}
|
||||
.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: #269DB8;
|
||||
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 { ConfirmContactComponent } from './confirm-contact.component';
|
||||
|
||||
describe('ConfirmContactComponent', () => {
|
||||
let component: ConfirmContactComponent;
|
||||
let fixture: ComponentFixture<ConfirmContactComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ConfirmContactComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfirmContactComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,435 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { FileUploader } from 'ng2-file-upload';
|
||||
import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component';
|
||||
import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
|
||||
import { BasicRequest } from "../models/basic.request";
|
||||
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
|
||||
import { EitService } from 'src/app/eit/services/eit.service';
|
||||
import { SubmitEitModalComponent } from 'src/app/eit/submit-eit-modal/submit-eit-modal.component';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
|
||||
import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq';
|
||||
import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
|
||||
import { ProfileService } from '../service/profile.service';
|
||||
import { SubmitAddressModalComponent } from '../submit-eit-modal/submit-address-modal.component';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-contact',
|
||||
templateUrl: './confirm-contact.component.html',
|
||||
styleUrls: ['./confirm-contact.component.scss'],
|
||||
})
|
||||
export class ConfirmContactComponent implements OnInit {
|
||||
|
||||
private P_TransactionID: number;
|
||||
private basicRequest: BasicRequest;
|
||||
approversList = [];
|
||||
basicResponseList: any;
|
||||
eitComments: string = "";
|
||||
menuType: string = "";
|
||||
selEmp: string = "";
|
||||
respID: number;
|
||||
selMenu: MenuResponse;
|
||||
getAttachList: any;
|
||||
attachListDisplay: any = [];
|
||||
headerTitle: string = "";
|
||||
isTrue: any = 0;
|
||||
attachItems: any;
|
||||
public isResubmitEIT: boolean = false;
|
||||
private itemKey: string = "";
|
||||
private pActionMode: string = "SUBMIT";
|
||||
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
|
||||
attachmentRes: any;
|
||||
objIndex1: any;
|
||||
attachListOver: any = [];
|
||||
index: any = 0;
|
||||
getPassNotificationDetails: any;
|
||||
isSubmitBtnClicked: boolean;
|
||||
// isDelete: boolean = false;
|
||||
|
||||
/***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, public profileService: ProfileService) {
|
||||
this.direction = TranslatorService.getCurrentLanguageName()
|
||||
this.isSubmitBtnClicked = false;
|
||||
this.basicRequest = new BasicRequest();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
||||
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
||||
this.basicRequest = this.cs.sharedService.getSharedData(BasicRequest.SHARED_DATA, false);
|
||||
|
||||
this.selEmp = this.basicRequest.P_SELECTED_EMPLOYEE_NUMBER;
|
||||
|
||||
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
||||
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
|
||||
this.basicResponseList = this.cs.sharedService.getSharedData('contact-details-response', false);
|
||||
console.log(this.basicResponseList);
|
||||
this.itemKey = this.basicResponseList.P_ITEM_KEY;
|
||||
this.P_TransactionID = this.basicResponseList.P_TRANSACTION_ID;
|
||||
// this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
|
||||
|
||||
this.getApproversList();
|
||||
|
||||
}
|
||||
|
||||
getApproversList() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID,
|
||||
P_AME_TRANSACTION_TYPE: "SSHRMS",
|
||||
P_PAGE_NUM: 1,
|
||||
P_PAGE_LIMIT: 1000
|
||||
}
|
||||
this.eitService.getApproversList(body).subscribe((result: any) => {
|
||||
this.handleApproversResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleApproversResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.approversList = result.GetApprovesList;
|
||||
}
|
||||
}
|
||||
|
||||
startEitApproval() {
|
||||
if (this.attachListOver) {
|
||||
let request = {
|
||||
AddAttachmentList: this.attachListOver
|
||||
}
|
||||
|
||||
this.eitService.addAttachment(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleAddAttachmentResults(result);
|
||||
});
|
||||
} else {
|
||||
this.startContactApprovalProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
handleAddAttachmentResults(result) {
|
||||
|
||||
if (this.cs.validResponse(result)) {
|
||||
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.startContactApprovalProcess();
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startContactApprovalProcess() {
|
||||
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.profileService.startContactApprovalProcess(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleResults(result);
|
||||
});
|
||||
}
|
||||
cancelEitProcess() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID
|
||||
}
|
||||
this.eitService.cancelHRTransaction(
|
||||
body).
|
||||
subscribe((result: any) => {
|
||||
this.handleCancelResults(result);
|
||||
});
|
||||
|
||||
}
|
||||
handleCancelResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = false;
|
||||
}
|
||||
}
|
||||
handleResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = true;
|
||||
let msg: string = this.ts.trPK("eit", "approval-message-success");
|
||||
this.cs.presentAlert(msg);
|
||||
this.cs.openNotificationPage();
|
||||
}
|
||||
}
|
||||
|
||||
async addAttachment(str: boolean, attachItems: any) {
|
||||
//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.updateFile(data, attachDocID);
|
||||
} else {
|
||||
console.log(data);
|
||||
this.attachListDisplay = data.data;
|
||||
this.attachItems = this.attachListDisplay.map(function (el) {
|
||||
var o = Object.assign({}, el);
|
||||
o.isSuccess = false;
|
||||
return o;
|
||||
});
|
||||
|
||||
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
/*****submit modal********/
|
||||
async openSubmitModal() {
|
||||
this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList');
|
||||
this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
|
||||
const modal = await this.modalController.create({
|
||||
component: SubmitAddressModalComponent,
|
||||
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.attachListOver) {
|
||||
let index2 = this.attachListOver.findIndex(item => item == objectitem);
|
||||
if (index2 > -1) {
|
||||
this.attachListOver.splice(index2, 1);
|
||||
}
|
||||
}
|
||||
if (this.attachmentRes) {
|
||||
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
|
||||
if (index3 > -1) {
|
||||
this.attachmentRes.splice(index3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getAttachment(NotificationID) {
|
||||
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
|
||||
this.eitService.getAttach(this.attachReqObj).
|
||||
subscribe((result: NotificationGetAttachResponse) => {
|
||||
this.handleWorkListAttachResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleWorkListAttachResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.GetAttachementList != null) {
|
||||
this.attachmentRes = result.GetAttachementList;
|
||||
} // if result == null
|
||||
} // valid it
|
||||
|
||||
}
|
||||
|
||||
async OpenAttachFiles(value, Type) {
|
||||
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
|
||||
const modal = await this.modalController.create({
|
||||
component: WorkListAttachViewComponent
|
||||
});
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then((data) => {
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
|
||||
delelteFile(attach) {
|
||||
this.cs.confirmAlertDialog((data) => {
|
||||
if (data == true) {
|
||||
this.continueDelete(attach);
|
||||
}
|
||||
}, this.ts.trPK('general', 'ok'), () => {
|
||||
|
||||
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
|
||||
}
|
||||
|
||||
continueDelete(attach) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
|
||||
}
|
||||
this.eitService.deleteAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "deleteAttach");
|
||||
this.cs.presentAlert(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateFile(attachList, attachDocID) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attachDocID,
|
||||
P_FILE_DATA: attachList[0].P_FILE_DATA,
|
||||
P_FILE_NAME: attachList[0].P_FILE_NAME,
|
||||
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
|
||||
}
|
||||
this.eitService.updateAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.MessageStatus == 1) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "attachUpdate");
|
||||
this.cs.presentAlert(msg);
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("general", "notSupport");
|
||||
this.cs.presentAlert(msg);
|
||||
return
|
||||
} // todo: show alert that you tried uploading wrong files
|
||||
|
||||
else {
|
||||
const file = input.target.files[0];
|
||||
this.getBase64(file).then(
|
||||
data => this.pushObject(data, file.name, file.type)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
pushObject(fileData, name, type) {
|
||||
|
||||
console.log("before push: " + this.index);
|
||||
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) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<ion-content>
|
||||
<div class="head-title">
|
||||
|
||||
<app-generic-header showImage="false" showBack="true" [headerText]="'general,concurrent-report' | translate">
|
||||
</app-generic-header>
|
||||
</div>
|
||||
<div class="header"></div>
|
||||
<div class="bottom"></div>
|
||||
|
||||
<div class="main-container">
|
||||
|
||||
<div *ngIf="transactionList && transactionList.length>0" class="transaction-list">
|
||||
<ion-card *ngFor="let transaction of transactionList">
|
||||
<div class="date">{{getDate(transaction.REQUEST_DATE)}}</div>
|
||||
<ion-label class="ion-text-wrap">
|
||||
<ion-text color="primary">
|
||||
<div>
|
||||
<p class="display-created" >{{'transaction, request-id' | translate}}</p>
|
||||
<P class="inline-display">
|
||||
{{transaction.REQUEST_ID}}
|
||||
</P>
|
||||
</div>
|
||||
<p class="display-created" >{{'transaction, phase' | translate}}</p>
|
||||
<p class="display-created bold padding">{{transaction.CCP_PHASE}}</p>
|
||||
</ion-text>
|
||||
|
||||
<ion-text color="secondary">
|
||||
<div class="name-container">
|
||||
<p class="color-black display-inline">{{'transaction,program-name' | translate}}</p>
|
||||
<p class="display-inline red">{{transaction.CONCURRENT_PROGRAM_NAME}}</p>
|
||||
</div>
|
||||
</ion-text>
|
||||
|
||||
|
||||
<div class="output-container" >
|
||||
<p class="color-black display-inline">{{'transaction,output' | translate}}</p>
|
||||
<p class="display-inline" (click)="getCppOutput(transaction)" [ngClass]="transaction.CCP_PHASE =='Running' || transaction.CCP_PHASE =='Pending'? 'disabled-icon' : '' " ><ion-icon name="download" class="download"></ion-icon></p>
|
||||
<p class="display-inline" (click)="refresh(transaction)"><ion-icon name="refresh" class="refresh"></ion-icon></p>
|
||||
</div>
|
||||
|
||||
</ion-label>
|
||||
</ion-card>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@ -0,0 +1,138 @@
|
||||
.display-created{
|
||||
display: inline-block;
|
||||
|
||||
color:#000;
|
||||
}
|
||||
#containerDiv{
|
||||
margin-top:20px;
|
||||
}
|
||||
.padding{
|
||||
padding-left:5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.bold{
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
.color-black{
|
||||
color:#000;
|
||||
}
|
||||
.date{
|
||||
position: absolute;
|
||||
font-size: 14px;
|
||||
padding: 10px;
|
||||
right:0;
|
||||
width: 100px;
|
||||
color:#969696;
|
||||
}
|
||||
.transaction-list{
|
||||
margin-top:20px;
|
||||
}
|
||||
.date-container{
|
||||
margin:0px 20px;
|
||||
}
|
||||
|
||||
.label{
|
||||
font-size: 16px;
|
||||
// margin-left: 15px;
|
||||
color: #a2a5a6 !important;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
/* font-size: inherit; */
|
||||
// text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
white-space: normal;
|
||||
// padding-top: 10px;
|
||||
padding: 5px 0px;
|
||||
padding-left: 10px !important;
|
||||
margin: 10px auto;
|
||||
:root[dir="ltr"]{
|
||||
font-family: var(--fontFamilySemiBoldEN) !important;
|
||||
}
|
||||
:root[dir="rtl"]{
|
||||
font-family: var(--fontFamilyIOSAR) !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.Field-en{
|
||||
border-radius: 30px;
|
||||
border: 1px solid #a2a5a6!important;
|
||||
margin-bottom: 15px;
|
||||
padding-left: 20px !important;
|
||||
padding-top: 6px !important;
|
||||
color: #999999 !important;
|
||||
}
|
||||
|
||||
.Field-ar{
|
||||
border-radius: 30px;
|
||||
border: 1px solid #a2a5a6!important;
|
||||
margin-bottom: 20px;
|
||||
padding-right: 20px !important;
|
||||
padding-top: 6px !important;
|
||||
color: #999999 !important;
|
||||
}
|
||||
select{
|
||||
width: 300px !important;
|
||||
border: none !important;
|
||||
}
|
||||
.padding_date{
|
||||
padding-left:5px !important;
|
||||
}
|
||||
.date-icon{
|
||||
font-size: 20px;
|
||||
left: -1px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
ion-card{
|
||||
padding:10px;
|
||||
border-radius: 11px;
|
||||
box-shadow: 0px 1px 2px 1px #ccc;
|
||||
}
|
||||
.display-inline{
|
||||
display:inline-block;
|
||||
|
||||
}
|
||||
.red{
|
||||
color:#CA3332;
|
||||
font-weight: 600;
|
||||
margin:0px 5px;
|
||||
overflow: hidden;
|
||||
width: 90%;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.inline-display{
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
padding-left:8px;
|
||||
}
|
||||
.download{
|
||||
font-size: 26px;
|
||||
margin: 0px 10px;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
color: #CA3332;
|
||||
}
|
||||
.refresh{
|
||||
font-size: 22px;
|
||||
margin: 0px 10px;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
color: #CA3332;
|
||||
}
|
||||
.disabled-icon{
|
||||
pointer-events: none;
|
||||
opacity: .5;
|
||||
}
|
||||
.output-container{
|
||||
position: relative;
|
||||
bottom: 10px;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TransactionListComponent } from './transaction-list.component';
|
||||
|
||||
describe('TransactionListComponent', () => {
|
||||
let component: TransactionListComponent;
|
||||
let fixture: ComponentFixture<TransactionListComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TransactionListComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TransactionListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,55 @@
|
||||
import { copyStyles } from '@angular/animations/browser/src/util';
|
||||
import { Component, ElementRef, OnInit } from '@angular/core';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { ReportServiceService } from '../report-service.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-transaction-list',
|
||||
templateUrl: './transaction-list.component.html',
|
||||
styleUrls: ['./transaction-list.component.scss'],
|
||||
})
|
||||
export class TransactionListComponent implements OnInit {
|
||||
transactionList: any = [];
|
||||
selectedMenu: any;
|
||||
template: any;
|
||||
constructor(public cs: CommonService, private elementRef: ElementRef, public reports: ReportServiceService, public ts: TranslatorService,) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.selectedMenu = this.cs.sharedService.getSharedData(MenuResponse.SELECTED_MENU, false);
|
||||
this.transactionList = this.cs.sharedService.getSharedData(ReportServiceService.TRANSACTION_LIST, false);
|
||||
this.template = this.cs.sharedService.getSharedData(ReportServiceService.TEMPLATE, false);
|
||||
}
|
||||
getDate(date) {
|
||||
return this.cs.evaluteDate(date);
|
||||
}
|
||||
getCppOutput(transaction) {
|
||||
var request: any = {
|
||||
P_REQUEST_ID: transaction['REQUEST_ID']
|
||||
};
|
||||
this.cs.startLoading();
|
||||
this.reports.getCppOutput(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
|
||||
|
||||
console.log(result);
|
||||
this.cs.stopLoading();
|
||||
|
||||
});
|
||||
}
|
||||
refresh(transaction) {
|
||||
var request: any = {
|
||||
P_REQUEST_ID: transaction['REQUEST_ID']
|
||||
};
|
||||
this.cs.startLoading();
|
||||
var request: any = {};
|
||||
request.P_MENU_TYPE = this.selectedMenu.MENU_TYPE;
|
||||
request.P_SELECTED_RESP_ID = -999;
|
||||
request.P_FUNCTION_NAME = this.selectedMenu.FUNCTION_NAME;
|
||||
request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME;
|
||||
|
||||
this.reports.getTransaction(request, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
|
||||
this.cs.stopLoading();
|
||||
this.transactionList = result['GetCcpTransactionsList_New'];
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
<app-generic-header showImage="false" showBack="true" [headerText]="'general,termination' | translate">
|
||||
</app-generic-header>
|
||||
|
||||
<ion-content>
|
||||
<!-------------------------------Start New design ---------------------------------------->
|
||||
<ion-grid>
|
||||
<ion-row style="margin-top: 20px;margin-left: 12px;">
|
||||
<ion-col>
|
||||
<div size="10" [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'" >{{'general, addAttach' | translate}}</div>
|
||||
</ion-col>
|
||||
<ion-col style="padding-left: 7%;" size="2">
|
||||
<div class="fileDiv">
|
||||
<input end class="inputfile" style="margin-top: 10px;z-index: 99999;position: absolute;opacity: 0;" type="file" ng2FileSelect [uploader]="uploader"
|
||||
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
|
||||
<label end for="file" class="attachLable">
|
||||
<ion-icon style="font-size: 22px;" name="add"></ion-icon>
|
||||
</label></div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-item class="attachmentDiv" *ngIf="attachListOver?.length == 0">
|
||||
<ion-img style="height: 26px;width:100%;margin-top:12px" src="../assets/imgs/attach-icon.png"></ion-img>
|
||||
<ion-label style="margin-top: -24px;" position="floating" class="boldTxtNav">{{ 'general, notAttch' | translate}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="attachmentDiv" *ngIf="attachListOver?.length > 0">
|
||||
<div *ngFor="let attachList of attachListOver ; let i = index">
|
||||
<ion-row>
|
||||
<ion-col size="1">
|
||||
<ion-label style="color: black !important;">
|
||||
{{attachList.AttachmentID +1 }} .
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col style="text-align: left;" size="10">
|
||||
<ion-label style="color: blue !important;" (click)="OpenAttachFiles(attachList.P_FILE_DATA,attachList.P_FILE_CONTENT_TYPE)">
|
||||
{{attachList.P_FILE_NAME }}
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
<ion-col size="1">
|
||||
<button float-end [disabled]="attachList.isSuccess" class="attachImgBtn removeLable"
|
||||
(click)="removeFile(attachList)">
|
||||
<ion-icon style="font-size:22px;margin-left:-7px;margin-top:-2px;" name="close"></ion-icon>
|
||||
</button>
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
<ion-grid *ngIf="attachmentRes?.length > 0">
|
||||
<div *ngFor="let attachRes of attachmentRes">
|
||||
<ion-row>
|
||||
<ion-col col-8>
|
||||
<div> <img float-start class="attachImg" src="../assets/imgs/file.png">
|
||||
</div>
|
||||
<ion-label>
|
||||
{{attachRes.FILE_NAME }} </ion-label>
|
||||
|
||||
</ion-col>
|
||||
<ion-col col-4>
|
||||
<button float-end class="attachImgBtn"
|
||||
(click)="OpenAttachFiles(attachRes.FILE_DATA,attachRes.FILE_CONTENT_TYPE)">
|
||||
<img class="attachImg" src="../assets/imgs/view.png">
|
||||
</button>
|
||||
<button float-end [disabled]="!isResubmitEIT" class="attachImgBtn" (click)="delelteFile(attachRes)"><img
|
||||
class="attachImg" src="../assets/imgs/deletegray.png"></button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
<ion-grid class="">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, comment' | translate}}</div>
|
||||
<ion-item class="submitNote" lines="none">
|
||||
<ion-textarea type="text" [(ngModel)]="eitComments"></ion-textarea>
|
||||
</ion-item>
|
||||
</ion-grid>
|
||||
|
||||
<ion-grid class="approvalList">
|
||||
<div [ngClass]=" direction === 'en' ? 'approvalTitle' : 'approvalTitle-ar'">{{'confirmAddEit, approverList' | translate}}</div>
|
||||
<div class="noDataDiv" *ngIf="approversList?.length == 0">
|
||||
<p>{{ 'general, empty' | translate}}</p>
|
||||
</div>
|
||||
<div style="background-color: white;border-radius: 32px;border: 1px solid #c8c4c4;" *ngIf="approversList?.length > 0">
|
||||
<ion-list class="notification-list ">
|
||||
<div class="timeline">
|
||||
<ion-item style="padding-left: 4%;" *ngFor="let employee of approversList">
|
||||
|
||||
<div class="timeline-item" slot="start">
|
||||
<div [class]="direction == 'en'? 'timeline-thumb-en timeline-icon': 'timeline-thumb-ar timeline-icon'">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImge"
|
||||
[src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
|
||||
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImge"
|
||||
src="../assets/imgs/profile.png"> </div>
|
||||
</div>
|
||||
<ion-col>
|
||||
<ion-label style="color:black !important ;font-weight: bold;padding-top: 0%;">
|
||||
{{employee.APPROVER}}
|
||||
</ion-label>
|
||||
<ion-label style="color:black !important ;padding-top: 4%;">
|
||||
{{employee.POSITION_TITLE}}
|
||||
</ion-label>
|
||||
|
||||
</ion-col>
|
||||
<div class="line"></div>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-grid>
|
||||
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<div class="centerDiv">
|
||||
<ion-button class="confirmEitOkButton" color="customnavy" ion-button (click)="openSubmitModal()">
|
||||
{{ 'general, submit' | translate }}</ion-button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
@ -0,0 +1,263 @@
|
||||
.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: #269DB8;
|
||||
}
|
||||
.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: #269DB8;
|
||||
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 { ConfirmTerminationComponent } from './confirm-termination.component';
|
||||
|
||||
describe('ConfirmTerminationComponent', () => {
|
||||
let component: ConfirmTerminationComponent;
|
||||
let fixture: ComponentFixture<ConfirmTerminationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ConfirmTerminationComponent ],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfirmTerminationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,430 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { FileUploader } from 'ng2-file-upload';
|
||||
import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component';
|
||||
import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
|
||||
import { EitService } from 'src/app/eit/services/eit.service';
|
||||
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
||||
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
|
||||
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
|
||||
import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq';
|
||||
import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
|
||||
import { BasicRequest } from 'src/app/profile/models/basic.request';
|
||||
import { SubmitAddressModalComponent } from 'src/app/profile/submit-eit-modal/submit-address-modal.component';
|
||||
import { TerminationServiceService } from '../service/termination-service.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-termination',
|
||||
templateUrl: './confirm-termination.component.html',
|
||||
styleUrls: ['./confirm-termination.component.scss'],
|
||||
})
|
||||
export class ConfirmTerminationComponent implements OnInit {
|
||||
|
||||
|
||||
private P_TransactionID: number;
|
||||
|
||||
approversList = [];
|
||||
responseList: any;
|
||||
eitComments: string = "";
|
||||
menuType: string = "";
|
||||
selEmp: string = "";
|
||||
respID: number;
|
||||
selMenu: MenuResponse;
|
||||
getAttachList: any;
|
||||
attachListDisplay: any = [];
|
||||
headerTitle: string = "";
|
||||
isTrue: any = 0;
|
||||
attachItems: any;
|
||||
public isResubmitEIT: boolean = false;
|
||||
private itemKey: string = "";
|
||||
private pActionMode: string = "SUBMIT";
|
||||
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
|
||||
attachmentRes: any;
|
||||
objIndex1: any;
|
||||
attachListOver: any = [];
|
||||
index: any = 0;
|
||||
getPassNotificationDetails: any;
|
||||
isSubmitBtnClicked: boolean;
|
||||
// isDelete: boolean = false;
|
||||
|
||||
/***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, public terminationService: TerminationServiceService) {
|
||||
this.direction = TranslatorService.getCurrentLanguageName()
|
||||
this.isSubmitBtnClicked = false;
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
|
||||
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
|
||||
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
|
||||
|
||||
|
||||
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
|
||||
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
|
||||
this.responseList = this.cs.sharedService.getSharedData(TerminationServiceService.SHARED_DATA, false);
|
||||
this.itemKey = this.responseList.P_ITEM_KEY;
|
||||
this.P_TransactionID = this.responseList.P_TRANSACTION_ID;
|
||||
// this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
|
||||
|
||||
this.getApproversList();
|
||||
|
||||
}
|
||||
|
||||
getApproversList() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID,
|
||||
P_AME_TRANSACTION_TYPE: "SSHRMS",
|
||||
P_PAGE_NUM: 1,
|
||||
P_PAGE_LIMIT: 1000
|
||||
}
|
||||
this.eitService.getApproversList(body).subscribe((result: any) => {
|
||||
this.handleApproversResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleApproversResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.approversList = result.GetApprovesList;
|
||||
}
|
||||
}
|
||||
|
||||
startEitApproval() {
|
||||
if (this.attachListOver) {
|
||||
let request = {
|
||||
AddAttachmentList: this.attachListOver
|
||||
}
|
||||
|
||||
this.eitService.addAttachment(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleAddAttachmentResults(result);
|
||||
});
|
||||
} else {
|
||||
this.startApprovalProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
handleAddAttachmentResults(result) {
|
||||
|
||||
if (this.cs.validResponse(result)) {
|
||||
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.startApprovalProcess();
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startApprovalProcess() {
|
||||
let request: any = {};
|
||||
|
||||
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.terminationService.startApprovalProcess(
|
||||
request).
|
||||
subscribe((result: any) => {
|
||||
this.handleResults(result);
|
||||
});
|
||||
}
|
||||
cancelEitProcess() {
|
||||
let body: any = {
|
||||
P_TRANSACTION_ID: this.P_TransactionID
|
||||
}
|
||||
this.eitService.cancelHRTransaction(
|
||||
body).
|
||||
subscribe((result: any) => {
|
||||
this.handleCancelResults(result);
|
||||
});
|
||||
|
||||
}
|
||||
handleCancelResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = false;
|
||||
}
|
||||
}
|
||||
handleResults(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
this.isSubmitBtnClicked = true;
|
||||
let msg: string = this.ts.trPK("eit", "approval-message-success");
|
||||
this.cs.presentAlert(msg);
|
||||
this.cs.openNotificationPage();
|
||||
}
|
||||
}
|
||||
|
||||
async addAttachment(str: boolean, attachItems: any) {
|
||||
//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.updateFile(data, attachDocID);
|
||||
} else {
|
||||
console.log(data);
|
||||
this.attachListDisplay = data.data;
|
||||
this.attachItems = this.attachListDisplay.map(function (el) {
|
||||
var o = Object.assign({}, el);
|
||||
o.isSuccess = false;
|
||||
return o;
|
||||
});
|
||||
|
||||
this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
/*****submit modal********/
|
||||
async openSubmitModal() {
|
||||
this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList');
|
||||
this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
|
||||
const modal = await this.modalController.create({
|
||||
component: SubmitAddressModalComponent,
|
||||
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.attachListOver) {
|
||||
let index2 = this.attachListOver.findIndex(item => item == objectitem);
|
||||
if (index2 > -1) {
|
||||
this.attachListOver.splice(index2, 1);
|
||||
}
|
||||
}
|
||||
if (this.attachmentRes) {
|
||||
let index3 = this.attachmentRes.findIndex(item => item == objectitem);
|
||||
if (index3 > -1) {
|
||||
this.attachmentRes.splice(index3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getAttachment(NotificationID) {
|
||||
this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
|
||||
this.eitService.getAttach(this.attachReqObj).
|
||||
subscribe((result: NotificationGetAttachResponse) => {
|
||||
this.handleWorkListAttachResult(result);
|
||||
});
|
||||
}
|
||||
|
||||
handleWorkListAttachResult(result) {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.GetAttachementList != null) {
|
||||
this.attachmentRes = result.GetAttachementList;
|
||||
} // if result == null
|
||||
} // valid it
|
||||
|
||||
}
|
||||
|
||||
async OpenAttachFiles(value, Type) {
|
||||
this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
|
||||
const modal = await this.modalController.create({
|
||||
component: WorkListAttachViewComponent
|
||||
});
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then((data) => {
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
|
||||
delelteFile(attach) {
|
||||
this.cs.confirmAlertDialog((data) => {
|
||||
if (data == true) {
|
||||
this.continueDelete(attach);
|
||||
}
|
||||
}, this.ts.trPK('general', 'ok'), () => {
|
||||
|
||||
}, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
|
||||
}
|
||||
|
||||
continueDelete(attach) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
|
||||
}
|
||||
this.eitService.deleteAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "deleteAttach");
|
||||
this.cs.presentAlert(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateFile(attachList, attachDocID) {
|
||||
let req = {
|
||||
P_ATTACHED_DOCUMENT_ID: attachDocID,
|
||||
P_FILE_DATA: attachList[0].P_FILE_DATA,
|
||||
P_FILE_NAME: attachList[0].P_FILE_NAME,
|
||||
P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
|
||||
}
|
||||
this.eitService.updateAttach(req).
|
||||
subscribe((result: any) => {
|
||||
if (this.cs.validResponse(result)) {
|
||||
if (result.MessageStatus == 1) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("eit", "attachUpdate");
|
||||
this.cs.presentAlert(msg);
|
||||
this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
|
||||
let msg: string = "";
|
||||
msg = this.ts.trPK("general", "notSupport");
|
||||
this.cs.presentAlert(msg);
|
||||
return
|
||||
} // todo: show alert that you tried uploading wrong files
|
||||
|
||||
else {
|
||||
const file = input.target.files[0];
|
||||
this.getBase64(file).then(
|
||||
data => this.pushObject(data, file.name, file.type)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
pushObject(fileData, name, type) {
|
||||
|
||||
console.log("before push: " + this.index);
|
||||
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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
#containerDiv{
|
||||
margin:15px;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Loading…
Reference in New Issue