Merge branch 'MOHEMM-Q3-DEV-LATEST' into enad-pre-live

MOE_DEV_NEW_TEMPORARY_DESIGN
umasoodch 4 years ago
commit f5d0f0fd68

@ -47,7 +47,7 @@
<ion-item (click)="openMyRequestPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
<img style= "height: 20px !important;" src="../assets/imgs/hr-request.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('userProfile','HR-Request')}}
@ -57,7 +57,7 @@
<ion-item (click)="oepnMyRequest(menu)" *ngIf="menu.REQUEST_GROUP_NAME =='MBL_RG_01' && menu.MENU_TYPE =='E'">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
<img style= "height: 20px !important;" src="../assets/imgs/my-request.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{menu.MENU_NAME}}
@ -67,7 +67,7 @@
<ion-item (click)="oepnTransaction()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
<img style= "height: 20px !important;" src="../assets/imgs/pending-transaction.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('general','pending-transaction')}}

@ -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,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,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() {}
}

@ -46,7 +46,7 @@ export class HomeComponent implements OnInit {
this.selectedMenu = index;
}
}
if (page['FUNCTION_NAME'] == 'HR_TERM_EMP_SS') {
if (page['FUNCTION_NAME'] == 'HR_TERM_SS') {
this.cs.sharedService.setSharedData(page, TerminationServiceService.TERMINATION_PAGE);
this.cs.openTermination();

@ -85,26 +85,26 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
import { FileUploadModule } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera} from '@ionic-native/Camera/ngx';
import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component';
import { Camera } from '@ionic-native/Camera/ngx';
import { File } from '@ionic-native/file/ngx';
import { FileUploderProfileComponent } from './ui/file-uploder-profile/file-uploder-profile.component';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component';
import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import {DashboredService} from './services/dashbored/dashbored.service';
import {NgxGaugeModule} from 'ngx-gauge';
import { AccordinTabCustomComponent } from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import { DashboredService } from './services/dashbored/dashbored.service';
import { NgxGaugeModule } from 'ngx-gauge';
import { StatsButtonComponent } from './ui/stats-button/stats-button.component';
import { ServicesButtonComponent } from './ui/services-button/services-button.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
import {WelcomeComponent} from './ui/welcome-login/welcome.component'
import {FabButtonComponent} from './ui/fab-button/fab-button.component'
import { ConfirmLoginComponent } from '../authentication/confirm-login/confirm-login.component'
import { WelcomeComponent } from './ui/welcome-login/welcome.component'
import { FabButtonComponent } from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress';
import { CardFilterComponent } from './ui/card-filter/card-filter.component';
import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component';
import { CircleCalendarComponent } from './ui/circle-calendar/circle-calendar.component';
import { NgCalendarModule } from 'ionic2-calendar';
import { NgCalendarModule } from 'ionic2-calendar';
import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component';
import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
@ -112,6 +112,7 @@ import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
import { CardCalendarComponent } from './ui/card-calendar/card-calendar.component';
import { WorklistSettingComponent } from '../notification/worklist-setting/worklist-setting.component';
import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component';
@NgModule({
imports: [
@ -196,7 +197,8 @@ import { WorklistSettingComponent } from '../notification/worklist-setting/workl
GenericHeaderComponent,
AttendanceOptionsComponent,
CardCalendarComponent,
WorklistSettingComponent
WorklistSettingComponent,
SubmitAddressModalComponent
],
exports: [
FabButtonComponent,
@ -267,7 +269,8 @@ import { WorklistSettingComponent } from '../notification/worklist-setting/workl
Modal,
GenericHeaderComponent,
AttendanceOptionsComponent,
CardCalendarComponent
CardCalendarComponent,
SubmitAddressModalComponent
],
providers: [
AttendScanService,

@ -1299,6 +1299,9 @@ export class CommonService {
public openAddUpdateContact() {
this.nav.navigateForward(['/profile/add-update-contact']);
}
public confirmContact() {
this.nav.navigateForward(['/profile/confirm-contact']);
}
public openConfirmAddAddress() {
this.nav.navigateForward(['/profile/confirm-add-address']);
@ -1316,14 +1319,29 @@ export class CommonService {
this.nav.navigateForward(['/reports/concurrent-report']);
}
public openConcurrentTransaction() {
this.nav.navigateForward(['/reports/transaction-list']);
}
public openTermination() {
this.nav.navigateForward(['/termination/termination-form']);
}
public confirmTermination() {
this.nav.navigateForward(['/termination/confirm-termination']);
}
public openTransactions() {
this.nav.navigateForward(['/pending-transaction/home']);
}
public openItemForSale() {
this.nav.navigateForward('/itemforsale/items');
}
public openCreateitems() {
this.nav.navigateForward('/itemforsale/home');
}
public navigatePage(path) {
this.nav.navigateForward([path]);
}

@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,

@ -803,7 +803,7 @@ export class HomePage implements OnInit {
itemForSale() {
this.common.navigateForward('/itemforsale/items');
this.common.openItemForSale();
}
offersDiscount() {
this.common.navigateForward('/offersdiscount/home');

@ -53,85 +53,34 @@
<div class="offering" *ngIf="step==1">
<h2>What are you offering?</h2>
<h2>{{ts.trPK('itemforsale','offering')}}</h2>
</div>
<ion-grid *ngIf="step==1">
<ion-row>
<ion-col size="4">
<div class="sale-icon" (click)="nextStep()">
<ion-col size="4" *ngFor="let category of categories">
<div class="sale-icon" (click)="nextStep(category)">
<div class="top">
<img src="/assets/imgs/itemsforsale/mobile.svg">
<div class="top" [innerHTML]="category.content | sanitizeHTMLPipe" >
</div>
<div class="bottom-icon">
<p>Mobile & Tablets</p>
<p *ngIf="direction == 'ltr'">{{category.title}}</p>
<p *ngIf="direction =='rtl'">{{category.title_Ar}}</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon" (click)="openItem()">
<div class="top">
<img src="/assets/imgs/itemsforsale/cars.svg">
</div>
<div class="bottom-icon">
<p>Cars & Vehicles</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/electronic_appliances.svg">
</div>
<div class="bottom-icon">
<p>Electronic Applicance</p>
</div>
</div>
</ion-col>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/furniture.svg">
</div>
<div class="bottom-icon">
<p>Furniture & Home Decor</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/fashion.svg">
</div>
<div class="bottom-icon">
<p>Fashion & beauty</p>
</div>
</div>
</ion-col>
<ion-col size="4">
<div class="sale-icon">
<div class="top">
<img src="/assets/imgs/itemsforsale/book and sports.svg">
</div>
<div class="bottom-icon">
<p>Books, Sports & Hobbies</p>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-grid>
<div class="offering" *ngIf="step==2">
<h2>Add Details</h2>
<h2>{{ts.trPK('itemforsale','add-details')}}</h2>
</div>
<div class="add-details" *ngIf="step==2">
<ion-grid>
<ion-row>
<p>Item Info</p>
<p>{{ts.trPK('itemforsale','item-info')}}</p>
<ion-col size="12">
<ion-item lines="none">
<ion-input placeholder="Item Info"></ion-input>
<ion-input [placeholder]="ts.trPK('itemforsale','item-info')" [(ngModel)]="itemInfo"></ion-input>
</ion-item>
</ion-col>
</ion-row>
@ -142,77 +91,78 @@
<ion-item lines="none">
<ion-textarea rows="6" cols="20" placeholder="Description"></ion-textarea>
<ion-textarea rows="6" cols="20" [placeholder]="ts.trPK('worklist','item-description')" [(ngModel)]="itemDescription"></ion-textarea>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<p>Item Condition</p>
<ion-radio-group value="new">
<p>{{ts.trPK('itemforsale','item-condition')}}</p>
<ion-radio-group value="new" [(ngModel)]="itemCondition">
<ion-col>
<ion-radio value="new"></ion-radio>
<ion-label>New</ion-label>
<ion-label>{{ts.trPK('itemforsale','new')}}</ion-label>
</ion-col>
<ion-col>
<ion-radio value="used"></ion-radio>
<ion-label>Used</ion-label>
<ion-label>{{ts.trPK('itemforsale','used')}}</ion-label>
</ion-col>
</ion-radio-group>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<p class="boldTxtNav" >{{ts.trPK('itemforsale','region')}}</p>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="regionID">
<ion-select-option *ngFor="let region of regions" [value]="region.regionID" >{{region.regionName}}</ion-select-option>
</ion-select>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
<p>Item Price</p>
<p>{{ts.trPK('itemforsale','item-price')}}</p>
<ion-item lines="none">
<ion-input placeholder="Item Price"></ion-input>
<ion-input [placeholder]="ts.trPK('itemforsale','item-price')" [(ngModel)]="itemPrice"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row>
<p>Item Photos</p>
<p>{{ts.trPK('itemforsale','item-photos')}}</p>
</ion-row>
<ion-row>
<ion-col lines="none" size="3">
<div class="image-container">
<div class="uploaded">
<div class="closed">X</div>
<img src="assets/imgs/itemsforsale/fashion.svg" />
</div>
</div>
</ion-col>
<ion-col lines="none" size="3">
<div class="image-container">
<div class="uploaded">
<div class="closed">X</div>
<img src="assets/imgs/itemsforsale/fashion.svg" />
<div>
<div class="fileUpload btn btn-primary">
<img slot="start" style=" height: 55px;"src="../assets/imgs/add-photo.svg">
<input end class="upload" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" (click)="onFileSelectedclick($event)" />
</div>
</div>
</ion-col>
<ion-col lines="none" size="3">
<div class="image-container uploader-box">
<div class="uploaded">
<ion-icon name="camera" class="camera-icon"></ion-icon>
</div>
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let obj of addAttachRequest">
<div class="image-container">
<div class="uploaded">
<div class="closed" (click)="deletePhoto(item)">X</div>
<img [src]="getImgContent('data:image/png;base64, ' +obj.P_FILE_DATA) " />
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-slide>
</ion-slides>
</div>
</ion-col>
</ion-row>
</ion-grid>
</div>
@ -222,25 +172,48 @@
<div class="add-details" *ngIf="step==3">
<h2 class="review-title">Furniture Table</h2>
<h2 class="review-title" *ngIf="direction =='rtl'">
{{selectedCategory.title_Ar}}
</h2>
<h2 class="review-title" *ngIf="direction =='ltr'">
{{selectedCategory.title}}
</h2>
<p style="font-weight: 600;"> {{itemInfo}}</p>
<p>
Consectetur adipiscing elit. Donec blandit diam nulla, non euismod eros efficitur imperdiet. Fusce erat enim, volutpat at enim in, venenatis iaculis risus.
{{itemDescription}}
</p>
<div class="description-details">
<p class="orange">Used</p>
<p class="orange">{{itemCondition}}</p>
<img src="assets/imgs/itemsforsale/fashion.svg" />
<img src="assets/imgs/itemsforsale/fashion.svg" />
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let obj of addAttachRequest">
<div class="image-container">
<div class="uploaded">
<!-- <div class="closed" (click)="deletePhoto(item)">X</div> -->
<img [src]="getImgContent('data:image/png;base64, ' +obj.P_FILE_DATA) " />
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-slide>
</ion-slides>
<div class="selling">
<strong>Selling for </strong> <h2>500 SAR</h2>
<strong>{{ts.trPK('itemforsale','selling-for')}} </strong> <h2>{{itemPrice}} SAR</h2>
</div>
<div class="waring">
<img src="/assets/imgs/itemsforsale/alert.svg"> <label>This ad will be valid for 2 week after approval</label>
<img src="/assets/imgs/itemsforsale/alert.svg"> <label>{{ts.trPK('itemforsale','warning')}}</label>
</div>
</div>
@ -251,7 +224,7 @@
<ion-footer *ngIf="step==1">
<div class="centerDiv">
<ion-button class="footer-button red-button" ion-button>
cancel </ion-button>
{{ts.trPK('general','cancel')}} </ion-button>
</div>
@ -260,13 +233,16 @@
<ion-footer *ngIf="step>1">
<div class="centerDiv">
<ion-button class="footer-button red-button small-btn" ion-button (click)="step =3" *ngIf="step ==2 || step ==3">
cancel </ion-button>
<ion-button class="footer-button red-button small-btn" ion-button (click)="step =1" *ngIf="step ==2 || step ==3">
{{ts.trPK('general','cancel')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="step =3" *ngIf="step ==2">
{{ts.trPK('general','next')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="openItem()" *ngIf="step ==3">
Confirm </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="createItemForSale()" *ngIf="step ==3 && !editItem">
{{ts.trPK('general','confirm')}} </ion-button>
<ion-button class="footer-button small-btn" ion-button (click)="updateItemForSale()" *ngIf="step ==3 && editItem">
{{ts.trPK('general','update')}} </ion-button>
</div>
</ion-footer>

@ -214,7 +214,7 @@ margin-bottom: 70px;
background: #fff;
margin: 15px;
padding: 10px;
box-shadow: 3px 4px 3px -1px #ccc;
box-shadow: 0px 0px 2px 1px #ccc;
border-radius: 20px;
}
.add-details ion-item{
@ -246,7 +246,7 @@ position: relative;
right: 0;
font-size: 14px;
color: #fff;
top: -15px;
top: -10px;
right: -10px;
font-weight: bolder;
background: red;
@ -341,3 +341,44 @@ ion-footer{
position: absolute;
top: 15px;
}
.upload-container{
display: inline-block;
}
@media screen and (min-width: 325px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
}}
@media screen and (min-width: 1px) and (max-width:320px){
.fileUpload {
position: relative;
overflow: hidden;
margin: 10px;
}}
.fileUpload input.upload {
position: absolute;
top: 0;
right: 0;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
}
.iconButton .imgSize{
width: 10px !important;
height: 10px;
}
.close-btn{
color: red;
font-size: 22px;
position: relative;
top: 5px;
}

@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { FileUploader } from 'ng2-file-upload';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { ItemForSaleService } from '../services/service.service';
@ -10,22 +13,227 @@ import { ItemForSaleService } from '../services/service.service';
})
export class HomeComponent implements OnInit {
step: any = 1;
constructor(public ts: TranslatorService, public cs: CommonService, private itemService: ItemForSaleService) { }
categories: any = [];
direction: string;
uploaded: any = [];
public selectedFile: any;
indexLastObj: any;
addAttachRequest: any = [];
selectedCategory: any;
filterAllowedType: any = [
"image/jpeg",
"image/png",
"image/jpg",
];
itemInfo: string;
itemDescription: string;
itemCondition: string;
itemPrice: any;
regions: any = [];
regionID: any = 1;
editItem: any;
constructor(public ts: TranslatorService, private authService: AuthenticationService, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) { }
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.categories = this.cs.sharedService.getSharedData(ItemForSaleService.CATEGORIES, false);
this.getRegion();
this.editItem = this.cs.sharedService.getSharedData(ItemForSaleService.EDIT_ITEMS);
if (this.editItem) {
this.setEditPage();
}
}
getRegion() {
this.itemService.getRegion({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.regions = this.itemService.parser(result);
console.log(this.regions);
})
}
openItem() {
this.cs.navigateForward('/itemforsale/items');
}
nextStep() {
nextStep(category) {
this.selectedCategory = category;
this.step = 2;
}
openMyAds() {
this.cs.navigateForward('/itemforsale/my-ads');
}
onFileSelectedclick(event) {
event.target.value = '';
}
public uploader: FileUploader = new FileUploader({
allowedMimeType: [
"image/jpeg",
"image/png",
"image/jpg",
],
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()
});
});
}
});
onFileSelected(input) {
if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) {
let msg: string = "";
msg = this.ts.trPK("general", "notSupportFile");
this.cs.presentAlert(msg);
return;
} // todo: show alert that you tried uploading wrong files
else {
const file = input.target.files[0];
this.selectedFile = input.target.files;
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) {
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],
});
} catch (e) { }
}
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);
}
getImgContent(imgFile): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
createItemForSale() {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('title', this.itemInfo);
request.append('title_Ar', this.itemInfo);
request.append('categoryID', this.selectedCategory.categoryID);
request.append('description', this.itemDescription);
request.append('description_Ar', this.itemDescription);
request.append('employeeNumber', authUser.P_USER_NAME);
request.append('quotePrice', this.itemPrice);
request.append('isActive', 'true');
request.append('regionID', this.regionID);
request.append('status', this.itemCondition);
console.log(this.selectedFile);
if (this.selectedFile && this.selectedFile !== undefined) {
request.append('fileColl', this.addAttachRequest.toString());
}
request.append('Channel', authUser.Channel.toString());
request.append('LogInToken', authUser.LogInTokenID);
request.append('Token', authUser.TokenID);
request.append('EmployeeNumber', authUser.P_USER_NAME);
request.append('MobileNo', authUser.MobileNumber);
this.itemService.createItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.cs.greenToastPK("general", "success-create");
this.openItem();
} else {
this.cs.stopLoading();
this.cs.redToastPK("general", "try-again");
}
})
}
setEditPage() {
this.step = 2;
this.selectedCategory = {
categoryID: this.editItem.categoryID,
title: this.editItem.categoryTitle,
title_Ar: this.editItem.categoryTitle
}
this.itemInfo = this.editItem.title;
this.itemDescription = this.editItem.description;
this.itemPrice = this.editItem.quotePrice;
this.regionID = this.editItem.regionID;
this.itemCondition = this.editItem.status.toLowerCase();
}
updateItemForSale() {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('itmeSaleID', this.editItem.itemSaleID);
request.append('title', this.itemInfo);
request.append('title_Ar', this.itemInfo);
request.append('categoryID', this.selectedCategory.categoryID);
request.append('description', this.itemDescription);
request.append('description_Ar', this.itemDescription);
request.append('employeeNumber', authUser.P_USER_NAME);
request.append('quotePrice', this.itemPrice);
request.append('isActive', 'true');
request.append('regionID', this.regionID);
request.append('status', this.itemCondition);
console.log(this.selectedFile);
if (this.selectedFile && this.selectedFile !== undefined) {
request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
}
request.append('Channel', authUser.Channel.toString());
request.append('LogInToken', authUser.LogInTokenID);
request.append('Token', authUser.TokenID);
request.append('EmployeeNumber', authUser.P_USER_NAME);
request.append('MobileNo', authUser.MobileNumber);
this.itemService.updateItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
this.cs.stopLoading();
this.cs.greenToastPK("general", "success-create");
this.openItem();
} else {
this.cs.stopLoading();
this.cs.redToastPK("general", "try-again");
}
})
}
}

@ -1,4 +1,4 @@
<ion-content>
<ion-content *ngIf="itemDetails">
<div class="head-title">
<app-generic-header
@ -9,7 +9,7 @@
</div>
<div class="header"></div>
<div class="bottom"></div>
<div>
<div >
<ion-card>
<ion-card-header>
<!-- <img *ngIf="itemDetails.itemAttachments[0]" [src]="item.itemAttachments[0]" />
@ -27,7 +27,7 @@
<span *ngIf="direction == 'ltr'">{{itemDetails.description}}</span>
<span *ngIf="direction =='rtl'">{{itemDetails.description_Ar}}</span>
<div class="content-bottom">
<p class="green">New</p>
<p [class]="itemDetails.status=='Approved' ? 'green' : 'yellow'">{{itemDetails.status}}</p>
<h1> <strong>
{{itemDetails.quotePrice}} {{itemDetails.currencyCode}}
</strong></h1>

@ -4,21 +4,32 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
import { ItemForSaleService } from '../services/service.service';
import * as moment from 'moment';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-item-details',
templateUrl: './item-details.component.html',
styleUrls: ['./item-details.component.scss'],
})
export class ItemDetailsComponent implements OnInit {
itemDetails: any = {};
itemDetails: any;
direction: any;
constructor(public ts: TranslatorService, public cs: CommonService, private sanitizer: DomSanitizer,) { }
constructor(public ts: TranslatorService, public route: ActivatedRoute, public cs: CommonService, private sanitizer: DomSanitizer,) {
this.route
.params.subscribe(val => {
setTimeout(() => {
this.ionEnter();
}, 100);
});
}
ngOnInit() {
}
ionEnter() {
this.direction = TranslatorService.getCurrentDirection();
this.itemDetails = this.cs.sharedService.getSharedData(ItemForSaleService.ITEMS_SELECTED, false);
console.log(this.itemDetails);
}
getDate(date) {
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");

@ -58,7 +58,7 @@
</div>
<div class="grid-row">
<ion-row >
<ion-row *ngIf="items">
<ion-col size="6" (click)="openDetails(item)" *ngFor="let item of items">
<ion-card>
<ion-card-header>
@ -72,9 +72,7 @@
<ion-card-content>
<span *ngIf="direction == 'ltr'">{{getDotted(item.description, 60)}}</span>
<span *ngIf="direction =='rtl'">{{getDotted(item.description_Ar, 60)}}</span>
<p class="orange">
Used
</p>
<p [class]="item.status=='Approved' ? 'green' : 'yellow'">{{item.status}}</p>
<ion-row>
<ion-col size="10">
<strong>
@ -90,6 +88,14 @@
</ion-card>
</ion-col>
<div class="no-dataDiv" *ngIf="items.length == 0" >
<ion-row>
<img class="empty-data" src="../assets/imgs/box.png"/>
</ion-row>
<h4> {{ts.trPK('general','empty')}}</h4>
</div>
</ion-row>
<ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)">
<ion-infinite-scroll-content
@ -104,7 +110,7 @@
<ion-row>
<ion-item button detail="false" *ngFor="let item of itemsByEmployee">
<ion-thumbnail slot="start">
<img *ngIf="item.itemAttachments[0]" [src]="item.itemAttachments[0]" />
<img *ngIf="item.itemAttachments[0]" [src]="getImgContent('data:image/png;base64, ' +item.itemAttachments[0].content)" />
<img *ngIf="!item.itemAttachments[0]" src="assets/imgs/no-images.png" />
</ion-thumbnail>
<ion-label class="label-thumb">
@ -118,12 +124,12 @@
<p *ngIf="direction =='rtl'">{{getDotted(item.description_Ar, 30)}}</p>
<ion-row>
<ion-col size="8">
<p [class]="isApproved ? 'green' : 'yellow'">{{isApproved ? "Appoved" :"Pending"}}</p>
<p [class]="item.status=='Approved' ? 'green' : 'yellow'">{{item.status}}</p>
</ion-col>
<ion-col>
<img class="icon" src="assets/imgs/itemsforsale/delete.svg" />
<img class="icon edit" src="assets/imgs/itemsforsale/edit.svg" />
<!-- <img class="icon" src="assets/imgs/itemsforsale/delete.svg" /> -->
<img class="icon edit" src="assets/imgs/itemsforsale/edit.svg" (click)="editItems(item)" />
</ion-col>
</ion-row>
</ion-label>

@ -7,6 +7,12 @@
background: #259CB8;
top: 0;
}
.no-dataDiv{
position: absolute;
left: 0;
right: 0;
margin: auto;
}
.header-toolbar{
--background: #259CB8 !important;
}

@ -5,6 +5,7 @@ import { ItemForSaleService } from '../services/service.service';
import { deepCopy } from '@angular-devkit/core/src/utils/object';
import * as moment from 'moment';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-items',
@ -13,29 +14,41 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
})
export class ItemsComponent implements OnInit {
segment: any = '1';
items: any = [];
items: any;
categories: any = [];
direction: string;
activeClass: any;
pageNo: number = 1;
tempSearch: any = [];
itemsByEmployee: any = [];
constructor(public ts: TranslatorService, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) { }
constructor(public ts: TranslatorService, public route: ActivatedRoute, private sanitizer: DomSanitizer, public cs: CommonService, private itemService: ItemForSaleService) {
this.route
.params.subscribe(val => {
setTimeout(() => {
this.cs.startLoading();
this.getItemsCategories();
this.getItemsByEmployee();
}, 100);
});
}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.getItemsCategories();
this.getItemsByEmployee();
}
getItemsCategories() {
this.itemService.getCategories({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.categories = this.itemService.parser(result);
console.log(this.categories);
this.cs.sharedService.setSharedData(this.categories, ItemForSaleService.CATEGORIES);
})
this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items = [];
this.items = this.itemService.parser(result);
this.tempSearch = deepCopy(this.items);
this.cs.stopLoading();
})
}
openDetails(selected) {
@ -46,12 +59,17 @@ export class ItemsComponent implements OnInit {
this.segment = value.detail.value;
}
openSale() {
this.cs.navigateForward('/itemforsale/home');
this.cs.openCreateitems();
}
selectCategory(item) {
this.activeClass = item.categoryID
this.cs.startLoading();
this.activeClass = item.categoryID;
this.itemService.getItems({ pageNo: this.pageNo, ItgCategoryID: item.categoryID }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items = [];
this.items = this.itemService.parser(result);
this.tempSearch = deepCopy(this.items);
this.cs.stopLoading();
})
}
getDotted(temp: string, valueCount: number) {
temp = this.stripHtml(temp);
@ -66,7 +84,7 @@ export class ItemsComponent implements OnInit {
}
loadData(event) {
this.pageNo = this.pageNo + 1;
this.itemService.getItems({ pageNo: this.pageNo }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.itemService.getItems({ pageNo: this.pageNo, categoryID: this.activeClass }, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.items.concat(this.itemService.parser(result));
this.tempSearch = deepCopy(this.items);
event.target.complete();
@ -88,12 +106,15 @@ export class ItemsComponent implements OnInit {
}
getItemsByEmployee() {
this.cs.startLoading();
this.itemService.getItemsByEmployee({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.itemsByEmployee = this.itemService.parser(result);
this.cs.stopLoading();
console.log(this.itemsByEmployee);
})
}
getDate(date) {
return moment(date, "YYYY-MM-DD HH:mm:ss").format("DD-MMM-YYYY");
}
@ -101,4 +122,9 @@ export class ItemsComponent implements OnInit {
getImgContent(imgFile): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(imgFile);
}
editItems(items) {
this.cs.sharedService.setSharedData(items, ItemForSaleService.EDIT_ITEMS);
this.cs.openCreateitems();
}
}

@ -1,6 +1,8 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
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 { MowadhafiService } from 'src/app/mowadhafi/mowadhafi.service';
@Injectable({
providedIn: 'root'
@ -9,11 +11,16 @@ export class ItemForSaleService {
public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSale';
public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale';
public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion';
public static ITEMS_SELECTED = 'item-selected';
public static CATEGORIES = 'categories';
public static EDIT_ITEMS = 'edit-items';
constructor(
public con: ConnectorService,
private authService: AuthenticationService
private authService: AuthenticationService,
private http: HttpClient
) { }
public getItems(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
@ -21,14 +28,14 @@ export class ItemForSaleService {
request.ItgPageNo = request.pageNo;
request.ItgPageSize = 10;
request.ItgStatus = "Approved";
return this.con.post(ItemForSaleService.getItemForSale, request, onError, errorLabel);
return this.con.postNoLoad(ItemForSaleService.getItemForSale, request, onError, errorLabel);
}
public getCategories(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
return this.con.post(ItemForSaleService.getCategories, request, onError, errorLabel);
return this.con.postNoLoad(ItemForSaleService.getCategories, request, onError, errorLabel);
}
parser(response: any) {
try {
@ -45,7 +52,32 @@ export class ItemForSaleService {
getItemsByEmployee(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
request.ItgEmployeeNumber = 111209;
request.ItgEmployeeNumber = request.UserName; //request.UserName;
return this.con.post(ItemForSaleService.getItemForSaleByEmployee, request, onError, errorLabel);
}
getRegion(request: any, onError?: any, errorLabel?: string) {
this.authService.authenticateRequest(request);
request.EmployeeNumber = request.UserName;
request.ItgEmployeeNumber = request.UserName; //request.UserName;
return this.con.post(ItemForSaleService.getRegion, request, onError, errorLabel);
}
createItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
const request = itemRequest;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
}
)
}
updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
const request = itemRequest;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
return this.http.post(ConnectorService.host + ItemForSaleService.updateItemForSale, itemRequest, {
}
)
}
}

@ -24,6 +24,7 @@
right:0;
width: 100px;
color:#969696;
margin: -8px;
}
.transaction-list{
margin-top:20px;

@ -14,14 +14,21 @@ class="dependent-title"
<ion-label>Effective Date</ion-label>
<ion-label>{{showEffectiveDate}}</ion-label>
</ion-item>
<div #containerDiv id="containerDiv">
<div #containerDiv id="containerDiv" *ngIf="!isDelete">
<div #containerDivTwo id="containerDivTwo"></div>
</div>
<ion-item [ngClass]=" direction === 'en' ? 'custom-text-area-element padding_date Field-en' : 'custom-text-area-element padding_date Field-ar'" *ngIf="isDelete">
<ion-label position='floating' class="colBold requiredClass">{{ts.trPK('submitAbsence','endDate')}} </ion-label>
<ion-datetime (ionChange)="calcDay()" [(ngModel)]="endDate" min="1900" max="2100" displayFormat="MMM/DD/YYYY" placeholder="MM/DD/YYYY" required
cancelText="{{ts.trPK('general','cancel')}}"
doneText="{{ts.trPK('general','done')}}"></ion-datetime>
</ion-item>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="submitBasicDetailsTransaction()">
<ion-button class="addEitOkButton" color="customnavy" ion-button (click)="submitTransaction()">
{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
</ion-footer>

@ -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
}

@ -50,6 +50,7 @@ export class AddUpdateContactComponent implements OnInit {
private buttonInput: ButtonInput;
private hiddenInput: HiddenInput;
private eitResponse: any;
private eitDffResponse: any;
private eitColResponse: any;
private eitVALSettoCall: any = [];
@ -75,7 +76,8 @@ export class AddUpdateContactComponent implements OnInit {
public showEffectiveDate: string;
public userUpdateData: any;
public isDelete: boolean = false;
public selctedContact: any;
public endDate: any;
constructor(
public modalController: ModalController,
public cs: CommonService,
@ -92,9 +94,9 @@ export class AddUpdateContactComponent implements OnInit {
var empDetails = this.cs.sharedService.getSharedData(ProfileService.EMP_CONTACT_DETAILS);
this.employeeBasicDetails = empDetails ? empDetails : [];
//this.employeeBasicDetails = this.cs.sharedService.getSharedData('employeeDetails', false);
var isDelete = this.cs.sharedService.getSharedData(ProfileService.REMOVE_CONTACT);
this.isDelete = isDelete ? isDelete : false;
this.selctedContact = this.cs.sharedService.getSharedData(ProfileService.SELCTED_CONTACT, false);
this.direction = TranslatorService.getCurrentLanguageName();
this.selEmp = this.cs.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
@ -143,8 +145,8 @@ export class AddUpdateContactComponent implements OnInit {
ngOnInit() { }
ngAfterViewInit() {
this.getBasicffStructure();
if (!this.isDelete)
this.getBasicffStructure();
}
public getColumnStructure() {
@ -164,12 +166,20 @@ export class AddUpdateContactComponent implements OnInit {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
P_MENU_TYPE: this.menuType,
P_SELECTED_RESP_ID: this.respID,
'P_DESC_FLEX_CONTEXT_CODE': 'HMG_ADD_CONTACT_DETAILS'
};
this.profileService.getContactDFFStrutre(body).subscribe((result: any) => {
this.handleBasicDffStructureResult(result);
this.handleDffStructureResult(result);
});
}
handleDffStructureResult(result) {
if (result.GetContactDffStructureList != null) {
this.eitDffResponse = result.GetContactDffStructureList;
this.drawEitFields(result.GetContactDffStructureList, true);
this.fillBasicDetailsStructure();
}
}
private getBasicffStructure() {
const body = {
P_FUNCTION_NAME: this.functionName,
@ -186,9 +196,9 @@ export class AddUpdateContactComponent implements OnInit {
public handleBasicColStructureResult(result) {
if (result.GetContactColsStructureList != null) {
this.eitColResponse = result.GetContactColsStructureList;
if (this.employeeBasicDetails.length > 0) {
this.getEitDffStructure();
}
// if (this.employeeBasicDetails.length > 0) {
this.getEitDffStructure();
//}
this.drawEitFieldsStatic(result.GetContactColsStructureList);
}
@ -198,7 +208,8 @@ export class AddUpdateContactComponent implements OnInit {
if (result.GetBasicDetDffStructureList != null) {
this.getColumnStructure();
this.eitResponse = result.GetBasicDetDffStructureList;
this.drawEitFields(result.GetBasicDetDffStructureList);
this.drawEitFields(result.GetBasicDetDffStructureList, false);
}
}
@ -248,7 +259,7 @@ export class AddUpdateContactComponent implements OnInit {
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG
);
} else if (feildsList[i].DATATYPE == "DATE" && this.targetValue === 'new') {
} else if (feildsList[i].DATATYPE == "DATE") {
this.dateInput = new DateInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
@ -263,7 +274,7 @@ export class AddUpdateContactComponent implements OnInit {
}
}
}
this.fillBasicDetailsStructure();
}
public getElementsStaticValues(): any {
@ -288,12 +299,9 @@ export class AddUpdateContactComponent implements OnInit {
if (this.eitColResponse[i].DATATYPE == "VARCHAR2" || this.eitColResponse[i].DATATYPE == "NUMBER") {
elemVal = elemVal;
} else if (this.eitColResponse[i].DATATYPE == "DATE" && this.targetValue === 'new') {
} else if (this.eitColResponse[i].DATATYPE == "DATE") {
// date
elemVal = this.cs.formatDate(elemVal);
} else if (this.eitColResponse[i].DATATYPE == "DATE" && this.targetValue === 'correct') {
// date
elemVal = this.customiseDate(this.effectiveDate);
elemVal = this.cs.reverseFormatDate(elemVal);
}
if (this.targetValue === 'new') {
@ -394,7 +402,7 @@ export class AddUpdateContactComponent implements OnInit {
return valuseArr;
}
private drawEitFields(feildsList) {
private drawEitFields(feildsList, isDff: boolean) {
const containerId = "containerDiv";
this.eitVALSettoCall = [];
for (let i = 0; i < feildsList.length; i++) {
@ -550,12 +558,21 @@ export class AddUpdateContactComponent implements OnInit {
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG
);
this.fillDropdownList(
feildsList[i].SEGMENT_NAME,
feildsList[i].E_SERVICES_VS,
feildsList[i].E_SERVICES_DV
);
if (isDff) {
this.fillDropdownListDff(
feildsList[i].SEGMENT_NAME,
feildsList[i].E_SERVICES_VS,
feildsList[i].E_SERVICES_DV
);
} else {
this.fillDropdownList(
feildsList[i].SEGMENT_NAME,
feildsList[i].E_SERVICES_VS,
feildsList[i].E_SERVICES_DV
);
}
}
}
this.bindHtmlElemEvents(
feildsList[i].APPLICATION_COLUMN_NAME,
@ -577,6 +594,7 @@ export class AddUpdateContactComponent implements OnInit {
if (this.validateEitObj && this.validateEitObj.length > 0) {
this.fillEITStructure();
}
}
addFieldToDOM(
@ -709,6 +727,46 @@ export class AddUpdateContactComponent implements OnInit {
}
}
fillDropdownListDff(segmentName, optionList: any = [], DV: any = "") {
let elemID: any = "";
let eitObj: any;
if (optionList.length > 0) {
for (let i = 0; i < this.eitDffResponse.length; i++) {
if (this.eitDffResponse[i].SEGMENT_NAME == segmentName) {
eitObj = this.eitDffResponse[i];
if (
this.eitDffResponse[i].READ_ONLY == "Y" ||
this.eitDffResponse[i].DISPLAY_FLAG == "N"
) {
return false;
}
elemID = this.eitDffResponse[i].APPLICATION_COLUMN_NAME;
break;
}
}
let select = document.getElementById(elemID) as HTMLSelectElement;
document.getElementById(elemID).innerHTML = "";
if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") {
var firstoption = document.createElement("option");
firstoption.text = this.ts.trPK("general", "choose");
firstoption.value = "";
select.add(firstoption);
}
for (let i = 0; i < optionList.length; i++) {
var option = document.createElement("option");
option.text = optionList[i].VALUE_COLUMN_NAME;
option.value = optionList[i].ID_COLUMN_NAME;
select.add(option);
}
if (select.dataset.hiddenval) {
select.value = select.dataset.hiddenval;
} else {
select.value = DV.P_ID_COLUMN_NAME;
}
select.disabled = false;
}
}
public fillStaticDropdownList(segmentName, optionList: any = [], elemID: string) {
let eitObj: any;
if (optionList.length > 0) {
@ -1270,14 +1328,14 @@ export class AddUpdateContactComponent implements OnInit {
public fillBasicDetailsStructure() {
this.mutualBasicDetailsArray = this.mutualBasicDetailsArray.concat(this.eitResponse, this.eitColResponse);
this.mutualBasicDetailsArray = this.eitDffResponse.concat(this.mutualBasicDetailsArray.concat(this.eitResponse, this.eitColResponse));
for (let i = 0; i < this.employeeBasicDetails.length; i++) {
let val: any;
if (this.employeeBasicDetails[i].VARCHAR2_VALUE) {
val = this.employeeBasicDetails[i].VARCHAR2_VALUE;
} else if (this.employeeBasicDetails[i].DATE_VALUE) {
val = this.customiseDate(this.employeeBasicDetails[i].DATE_VALUE);
val = this.cs.formatDate(this.employeeBasicDetails[i].DATE_VALUE);
if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'EFFECTIVE_DATE') {
this.effectiveDate = this.employeeBasicDetails[i].DATE_VALUE;
this.showEffectiveDate = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP;
@ -1289,6 +1347,7 @@ export class AddUpdateContactComponent implements OnInit {
if (elem) {
if (val) {
let feldDetails = this.mutualBasicDetailsArray.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME
@ -1646,6 +1705,270 @@ export class AddUpdateContactComponent implements OnInit {
return valuseArr;
} // end getElementsValues
public getElementsValuesDff(): any {
this.updatedValues = []; //fill updated list
let valuseArr: any = [];
let varcharValue: any = null;
let numbervalue: any = 0;
let dateValue: any = null;
let transNo: number = 1;
let textValue: any;
// if(this.ExtraObj.transactionNo)
// transNo=this.ExtraObj.transactionNo;
for (let i = 0; i < this.eitDffResponse.length; i++) {
varcharValue = null;
numbervalue = null;
dateValue = null;
/*********set transaction No of the updated object ********/
if (this.getPassdirfromNotifiPage) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
}
if (this.eitDffResponse[i].DISPLAY_FLAG != "N") {
if (this.eitDffResponse[i].VALIDATION_TYPE == "N") {
let elem = document.getElementById(
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement;
let elemVal = (document.getElementById(
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
textValue = elemVal;
//let elemVal= (<HTMLInputElement>document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value;
if (
this.eitDffResponse[i].FORMAT_TYPE == "X" &&
this.eitDffResponse[i].DISPLAY_FLAG != "N"
) {
//date
elemVal = this.cs.formatDate(elemVal);
} else if (
this.eitDffResponse[i].FORMAT_TYPE == "Y" &&
this.eitDffResponse[i].DISPLAY_FLAG != "N"
) {
//standard date time
// elemVal = elem.dataset.dtvalue;
// elemVal = this.cs.formatStandardDate(elemVal);
elemVal = this.cs.formatDate(elemVal);
} else if (
this.eitDffResponse[i].FORMAT_TYPE == "I" &&
this.eitDffResponse[i].DISPLAY_FLAG != "N"
) {
//time
if (elemVal.length > 5) {
elemVal = elemVal.substring(11, 16);
} else {
elemVal = elemVal;
}
}
if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
elem.classList.add("requiredClassElm");
//this.common.showRequiredMsg();
return false;
} else {
elem.classList.remove("requiredClassElm");
}
// if (elemVal != 'null'){
varcharValue = elemVal;
//} else{
// elemVal = null;
// }
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
} else {
let x = document.getElementById(
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
) as HTMLSelectElement;
if (this.eitDffResponse[i].READ_ONLY == "Y") {
let text = x.value;
let val = x.dataset.colmText;
varcharValue = val;
textValue = text;
} else {
let val = x.options[x.selectedIndex]
? x.options[x.selectedIndex].value
: null;
let txt = x.options[x.selectedIndex]
? x.options[x.selectedIndex].text
: null;
varcharValue = val;
textValue = txt;
}
if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
x.classList.add("requiredClassElm");
//this.common.showRequiredMsg();
return false;
} else {
x.classList.remove("requiredClassElm");
}
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
} //end else
} else {
let x = document.getElementById(
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
) as HTMLSelectElement;
let val = x.dataset.colmText;
textValue = x.value;
if (this.eitDffResponse[i].REQUIRED_FLAG == "Y" && !val) {
x.classList.add("requiredClassElm");
//this.common.showRequiredMsg();
return false;
} else {
x.classList.remove("requiredClassElm");
}
let staticValueBasicDetail = this.employeeBasicDetails.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
);
if (staticValueBasicDetail) {
if (staticValueBasicDetail.DATATYPE === 'VARCHAR2') {
varcharValue = staticValueBasicDetail.VARCHAR2_VALUE;
} else if (staticValueBasicDetail.DATATYPE === 'DATE') {
dateValue = staticValueBasicDetail.DATE_VALUE;
} else if (staticValueBasicDetail.DATATYPE === 'NUMBER') {
numbervalue = staticValueBasicDetail.NUMBER_VALUE;
} else {
if (val) varcharValue = val;
}
} else {
if (val) varcharValue = val;
}
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.eitDffResponse[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
}
if (this.getPassdirfromNotifiPage) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
y.VARCHAR2_VALUE = varcharValue;
y.NUMBER_VALUE = numbervalue;
y.DATE_VALUE = dateValue;
y.SEGMENT_VALUE_DSP = textValue;
transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
} else {
if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.eitDffResponse[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
y.VARCHAR2_VALUE = varcharValue;
y.NUMBER_VALUE = numbervalue;
y.DATE_VALUE = dateValue;
y.SEGMENT_VALUE_DSP = textValue;
transNo = transNo; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
} else {
let y = {
TRANSACTION_NUMBER: transNo,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue,
SEGMENT_VALUE_DSP: textValue,
APPLICATION_COLUMN_NAME: this.eitDffResponse[i]
.APPLICATION_COLUMN_NAME,
DATATYPE: this.eitDffResponse[i].DATATYPE,
DESC_FLEX_CONTEXT_CODE: this.eitDffResponse[i].DESC_FLEX_CONTEXT_CODE,
DESC_FLEX_NAME: this.eitDffResponse[i].DESC_FLEX_NAME,
DISPLAY_FLAG: this.eitDffResponse[i].DISPLAY_FLAG,
SEGMENT_NAME: this.eitDffResponse[i].SEGMENT_NAME,
SEGMENT_PROMPT: this.eitDffResponse[i].SEGMENT_PROMPT
};
transNo = transNo; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
}
}
} // end for
if (this.getPassdirfromNotifiPage) {
let updatedObj1 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"
);
let updatedObj2 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"
);
let updatedObj3 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"
);
this.updatedValues.push(updatedObj1);
this.updatedValues.push(updatedObj2);
this.updatedValues.push(updatedObj3);
valuseArr = this.fillExtraInformation(
valuseArr,
updatedObj1.VARCHAR2_VALUE,
updatedObj2.NUMBER_VALUE,
updatedObj3.NUMBER_VALUE,
transNo
);
} else {
if (this.eitSubmitAction == EIT_ACTION.ADD) {
this.updatedValues = this.fillExtraValuesUpdated(
this.updatedValues,
"NEW_ROW",
-1,
0,
transNo
);
valuseArr = this.fillExtraInformation(
valuseArr,
"NEW_ROW",
-1,
0,
transNo
);
} else if (this.eitSubmitAction == EIT_ACTION.UPDATE) {
valuseArr = this.fillExtraInformation(
valuseArr,
"UPDATE_ROW",
this.ExtraObj.peiExtraInfoID,
this.ExtraObj.peiObjVer,
transNo
);
} else if (this.eitSubmitAction == EIT_ACTION.DELETE) {
valuseArr = this.fillExtraInformation(
valuseArr,
"DELETE_ROW",
this.ExtraObj.peiExtraInfoID,
this.ExtraObj.peiObjVer,
transNo
);
}
}
return valuseArr;
} // end getElementsValues
fillExtraValuesUpdated(
values: any,
peiAction: string,
@ -1761,20 +2084,35 @@ export class AddUpdateContactComponent implements OnInit {
return list;
}
public handleBasicdetailsResult(result) {
public handledetailsResult(result) {
if (this.cs.validResponse(result)) {
this.cs.sharedService.setSharedData(this.basicRequest, BasicRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(result.SubmitBasicDetTransactionList, 'basic-details-response');
this.cs.sharedService.setSharedData(result.SubmitContactTransactionList, 'contact-details-response');
// this.cs.sharedService.setSharedData({ isResubmit: false },"confirmAddEITData");
this.cs.openConfirmBasicDetailsPage();
this.cs.confirmContact();
}
}
public calcDay() {
public submitBasicDetailsTransaction() {
this.arrValues = this.getElementsValues();
let staticValues = this.getElementsStaticValues();
let allStatisDynamicValues = this.arrValues.concat(staticValues);
}
public submitTransaction() {
var allStatisDynamicValues = [];
if (this.isDelete) {
allStatisDynamicValues.push({
TRANSACTION_NUMBER: 1,
NAME: 'DATE_END',
VARCHAR2_VALUE: null,
NUMBER_VALUE: null,
DATE_VALUE: this.cs.formatDate(this.endDate)
});
} else {
this.arrValues = this.getElementsValues();
var dffvalues = this.getElementsValuesDff();
let staticValues = this.getElementsStaticValues();
allStatisDynamicValues = dffvalues.concat(this.arrValues.concat(staticValues));
}
if (allStatisDynamicValues) {
this.basicRequest = {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
@ -1782,13 +2120,13 @@ export class AddUpdateContactComponent implements OnInit {
P_SELECTED_RESP_ID: this.respID,
P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
EITTransactionTBL: allStatisDynamicValues,
P_CONTACT_RELATIONSHIP_ID: null,
P_ACTION_TYPE: this.employeeBasicDetails.length > 0 ? 'UPDATE' : this.isDelete ? 'REMOVE' : 'ADD'
P_CONTACT_RELATIONSHIP_ID: this.employeeBasicDetails.length > 0 || this.isDelete ? this.selctedContact['CONTACT_RELATIONSHIP_ID'] : null,
P_ACTION: this.employeeBasicDetails.length > 0 ? 'UPDATE' : this.isDelete ? 'DELETE' : 'ADD'
};
console.log(this.basicRequest);
this.profileService.submitContactTransaction(this.basicRequest).subscribe((result: any) => {
this.handleBasicdetailsResult(result);
this.handledetailsResult(result);
});
}
}

@ -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) {
}
}
}

@ -359,7 +359,7 @@
<ion-label><p style="font-weight: bold; font-size: 14px;">{{data.RELATIONSHIP}}</p></ion-label>
</ion-col>
<ion-col [size]='direction === "ltr" ? 5 : 8 ' [offset]='direction === "ltr" ? 3 : 0 '>
<div class='family-member-button' style="height: 32px !important;" (click)='RemoveFunction()'>
<div class='family-member-button' style="height: 32px !important;" (click)='RemoveFunction(data)'>
<ion-icon name="trash" style="width: 20px; height: 20px; color: #CA3332;"></ion-icon>
<p style="color: #CA3332;">{{ts.trPK('userProfile','remove')}}</p>
</div>

@ -451,28 +451,41 @@ export class HomeComponent implements OnInit {
// this.cs.presentAlert(this.ts.trPK('general', 'error-itg'));
this.cs.presentConfirmDialog(this.ts.trPK('userProfile', 'update-msg'),
() => {
this.profileService.getContactDetails({
P_MENU_TYPE: "E",
P_SELECTED_RESP_ID: -999,
P_CONTACT_RELATIONSHIP_ID: contact['CONTACT_RELATIONSHIP_ID']
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
if (this.cs.validResponse(response)) {
this.familyMemberDataDetails = response['GetEmployeeContactDetailsList'];
this.cs.sharedService.setSharedData(this.familyMemberDataDetails, ProfileService.EMP_CONTACT_DETAILS);
this.allowEdit('add-update-contact');
}
})
this.cs.greenToastPK("userProfile", "update-confirm");
this.updateContact(contact);
//this.cs.greenToastPK("userProfile", "update-confirm");
});
}
RemoveFunction() {
RemoveFunction(contact) {
this.cs.sharedService.setSharedData(contact, ProfileService.SELCTED_CONTACT);
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
let selMenu: MenuResponse = new MenuResponse();
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = this.dependentDetails;
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.cs.presentConfirmDialog(this.ts.trPK('userProfile', 'remove-msg'),
() => {
this.cs.redToastPK("userProfile", "remove-confirm");
this.cs.sharedService.setSharedData(true, ProfileService.REMOVE_CONTACT);
this.cs.openAddUpdateContact();
});
}
updateContact(contact) {
this.profileService.getContactDetails({
P_MENU_TYPE: "E",
P_SELECTED_RESP_ID: -999,
P_CONTACT_RELATIONSHIP_ID: contact['CONTACT_RELATIONSHIP_ID']
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
if (this.cs.validResponse(response)) {
this.familyMemberDataDetails = response['GetContactDetailsList'];
this.cs.sharedService.setSharedData(this.familyMemberDataDetails, ProfileService.EMP_CONTACT_DETAILS);
this.cs.sharedService.setSharedData(contact, ProfileService.SELCTED_CONTACT);
this.allowEdit('add-update-contact');
}
})
}
}

@ -8,5 +8,5 @@ export class ContactRequest {
public P_SELECTED_RESP_ID: Number;
public P_CONTACT_RELATIONSHIP_ID: number;
EITTransactionTBL: EitTransactionModel[];
P_ACTION_TYPE: string;
P_ACTION: string;
}

@ -25,6 +25,7 @@ import { SubmitAddressModalComponent } from './submit-eit-modal/submit-address-m
import { ConfirmBasicDetailsComponent } from './confirm-basic-details/confirm-basic-details.component';
import { ConatactComponent } from './contact/contact.component';
import { AddUpdateContactComponent } from './add-update-contact/add-update-contact.component';
import { ConfirmContactComponent } from './confirm-contact/confirm-contact.component';
const routes: Routes = [
{
path: '',
@ -54,6 +55,10 @@ const routes: Routes = [
{
path: 'add-update-contact',
component: AddUpdateContactComponent
},
{
path: 'confirm-contact',
component: ConfirmContactComponent
}
],
},
@ -122,13 +127,14 @@ const routes: Routes = [
EditProfileComponent,
PerformanceEvaluationComponent,
ConfirmAddressComponent,
SubmitAddressModalComponent,
AddBasicDetailsComponent,
ConfirmAddressComponent,
ConfirmBasicDetailsComponent,
ConatactComponent,
AddBasicDetailsComponent,
AddUpdateContactComponent
AddUpdateContactComponent,
ConfirmContactComponent
],
entryComponents: [EditDetailProfileComponent, SubmitAddressModalComponent],

@ -21,6 +21,7 @@ export class ProfileService {
public static startEitProcess = 'Services/ERP.svc/REST/START_ADDRESS_APPROVAL_PROCESS';
public static startPhoneProcess = 'Services/ERP.svc/REST/START_PHONES_APPROVAL_PROCESS';
public static startBasicProcess = 'Services/ERP.svc/REST/START_BASIC_DET_APPR_PROCESS';
public static contactApprovalProcess = 'Services/ERP.svc/REST/START_CONTACT_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';
@ -51,6 +52,8 @@ export class ProfileService {
public static EMP_PHONE = 'emp-phone';
public static EMP_CONTACT_DETAILS = 'emp-CONTACT_DETAILS';
public static EMP_CONTACT = 'emp-CONTACT';
public static SELCTED_CONTACT = 'selcted-CONTACT';
public static REMOVE_CONTACT = 'remove-CONTACT';
constructor(
public con: ConnectorService,
public authService: AuthenticationService
@ -153,6 +156,12 @@ export class ProfileService {
return this.con.post(ProfileService.startBasicProcess, request, onError, errorLabel);
}
public startContactApprovalProcess(contactRequest: any, onError?: any, errorLabel?: string): Observable<any> {
const request = contactRequest;
this.authService.authenticateRequest(request);
return this.con.post(ProfileService.contactApprovalProcess, request, onError, errorLabel);
}
public getObjectValue(request: any, onError?: any, errorLabel?: string): Observable<any> {
this.authService.authenticateRequest(request);

@ -20,6 +20,7 @@
<div #containerDiv id="containerDiv">
</div>
</div>
</ion-content>
<ion-footer>

@ -3,4 +3,12 @@
}
.divider{
height:20px
}
.check-status{
color:rgb(0, 0, 134);
text-decoration: underline;
font-weight: 600;
}
.status{
margin:20px;
}

@ -39,6 +39,7 @@ export class ConcurrentReportComponent implements OnInit {
public selEmp;
public eitRequest;
public ExtraObj;
selMenu: MenuResponse;
public functionName;
@ -93,8 +94,13 @@ export class ConcurrentReportComponent implements OnInit {
const containerId = "containerDiv";
this.eitVALSettoCall = [];
for (let i = 0; i < feildsList.length; i++) {
let defaultVal: string = "";
let defaultValText: string = "";
let defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
: "";
let defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
: "";
if (feildsList[i].DISPLAY_FLAG != "N") {
//check if the field should be displayed
@ -926,26 +932,37 @@ export class ConcurrentReportComponent implements OnInit {
this.reports
.submitTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry'))
.subscribe((result: any) => {
this.cs.stopLoading();
this.handleSubmitAbsence(result);
this.handleSubmit(result);
});
}
private handleSubmitAbsence(result) {
private handleSubmit(result) {
if (this.cs.validResponse(result)) {
if (this.getPassdirfromNotifiPage) {
//this.cs.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.cs.openConfirmAbsece();
//call another API to check the response;
this.checkStatus(result);
} else {
//this.cs.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.cs.openConfirmAbsece();
}
}
}
checkStatus(result) {
var request: any = {};
request.P_USER_NAME = this.selEmp;
request.P_MENU_TYPE = this.selectedMenu.MENU_TYPE;
request.P_SELECTED_RESP_ID = -999;
request.P_FUNCTION_NAME = this.functionName;
request.P_DESC_FLEX_NAME = this.template.CONCURRENT_PROGRAM_NAME;
this.reports.getTransaction(this.eitRequest, {}, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
this.cs.stopLoading();
this.cs.sharedService.setSharedData(result['GetCcpTransactionsList_New'], ReportServiceService.TRANSACTION_LIST);
this.cs.sharedService.setSharedData(this.template, ReportServiceService.TEMPLATE);
this.cs.openConcurrentTransaction();
});
}
public getElementsValues(): any {
this.updatedValues = []; //fill updated list
let valuseArr: any = [];
@ -1276,5 +1293,7 @@ export class ConcurrentReportComponent implements OnInit {
.nativeElement.querySelectorAll('#containerDiv')[0].innerHTML = '';
this.getCppDiffStructure(this.template);
}
refreshStatus() {
}
}

@ -9,7 +9,12 @@ import { ConnectorService } from '../hmg-common/services/connector/connector.ser
export class ReportServiceService {
public static GET_CONCURRENT_PROGRAM = 'Services/ERP.svc/REST/GET_CONCURRENT_PROGRAMS';
public static GET_CPP_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_CCP_DFF_STRUCTURE';
public static SUBMIT_CPP_REQUEST = 'Services/ERP.svc/REST/SUBMIT_CCP_TRANSACTION'
public static SUBMIT_CPP_REQUEST = 'Services/ERP.svc/REST/SUBMIT_CCP_TRANSACTION';
public static SUBMIT_CPP_TRANSACTION = 'Services/ERP.svc/REST/GET_CCP_TRANSACTIONS';
public static GET_CCP_OUTPUT = 'Services/ERP.svc/REST/GET_CCP_OUTPUT';
public static TRANSACTION_LIST = 'transaction-list';
public static TEMPLATE = 'template';
constructor(
public con: ConnectorService,
private authService: AuthenticationService,
@ -46,4 +51,26 @@ export class ReportServiceService {
errorLabel
);
}
getTransaction(request, onError, errorLabel) {
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
return this.con.postNoLoad(
ReportServiceService.SUBMIT_CPP_TRANSACTION,
request,
onError,
errorLabel
);
}
getCppOutput(request, onError, errorLabel) {
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
return this.con.postNoLoad(
ReportServiceService.GET_CCP_OUTPUT,
request,
onError,
errorLabel
);
}
}

@ -9,6 +9,7 @@ import { ReportsPage } from './reports.page';
import { ConcurrentReportComponent } from './concurrent-report/concurrent-report.component';
import { ReportServiceService } from './report-service.service';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { TransactionListComponent } from './transaction-list/transaction-list.component';
const routes: Routes = [
@ -20,7 +21,10 @@ const routes: Routes = [
path: 'concurrent-report',
component: ConcurrentReportComponent
},
{
path: 'transaction-list',
component: TransactionListComponent
},
],
}
];
@ -33,7 +37,7 @@ const routes: Routes = [
RouterModule.forChild(routes),
HmgCommonModule
],
declarations: [ReportsPage, ConcurrentReportComponent],
declarations: [ReportsPage, ConcurrentReportComponent, TransactionListComponent],
providers: [ReportServiceService]
})
export class ReportsPageModule { }

@ -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) {
}
}
}

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
@ -10,8 +11,10 @@ export class TerminationServiceService {
public static GET_TERM_COLS_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_COLS_STRUCTURE';
public static GET_TERM_DIFF_STRUCTURE = 'Services/ERP.svc/REST/GET_TERM_DFF_STRUCTURE';
public static SUBMIT_TRANSACTION = 'Services/ERP.svc/REST/SUBMIT_TERM_TRANSACTION';
public static START_APPORVAL = 'Services/ERP.svc/REST/START_TERM_APPROVAL_PROCESS';
public static TERMINATION_PAGE = 'termination-page';
public static SHARED_DATA = 'termination-submit-data';
constructor(
public con: ConnectorService,
private authService: AuthenticationService,
@ -37,4 +40,24 @@ export class TerminationServiceService {
errorLabel
);
}
submitTransation(request, onError, errorLabel) {
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
return this.con.postNoLoad(
TerminationServiceService.SUBMIT_TRANSACTION,
request,
onError,
errorLabel
);
}
public startApprovalProcess(basicDetailsProcess: any, onError?: any, errorLabel?: string): Observable<any> {
const request = basicDetailsProcess;
this.authService.authenticateRequest(request);
request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
return this.con.post(TerminationServiceService.START_APPORVAL, request, onError, errorLabel);
}
}

@ -7,6 +7,7 @@
<div class="header"></div>
<div class="bottom"></div>
<div #containerDiv id="containerDiv">
<div #containerDivTwo id="containerDivTwo"></div>
</div>
</ion-content>

@ -1,6 +1,9 @@
import { Component, ElementRef, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import * as moment from 'moment';
import { EITTransactionsRequest } from 'src/app/eit/models/EITTransactionsReq';
import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action';
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';
@ -12,6 +15,7 @@ import { NumberInput } from 'src/app/uI-elements/number.input';
import { SelectInput } from 'src/app/uI-elements/select.input';
import { TextInput } from 'src/app/uI-elements/text.input';
import { TimeInput } from 'src/app/uI-elements/time.input';
import { TerminationServiceService } from '../service/termination-service.service';
@ -50,7 +54,15 @@ export class TerminationFormComponent implements OnInit {
getPassdirfromNotifiPage: boolean = false;
private startDate;
private endDate;
constructor(public cs: CommonService, private elementRef: ElementRef, public terminationFormService: TerminationServiceService, public ts: TranslatorService, public eitService: EitService) { }
private targetValue;
public eitSubmitAction;
constructor(public cs: CommonService, private elementRef: ElementRef, public terminationFormService: TerminationServiceService, public ts: TranslatorService, public eitService: EitService, public router: ActivatedRoute) {
this.router.queryParams.subscribe(params => {
this.targetValue = params.targetValue;
console.log(this.targetValue);
});
}
ngOnInit() {
this.getPassdirfromNotifiPage = this.cs.sharedService.getSharedData('dirfromNotificationPage');
@ -58,13 +70,18 @@ export class TerminationFormComponent implements OnInit {
this.getTerminationCol();
this.direction = TranslatorService.getCurrentLanguageName();
this.effectiveDate = new Date();
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.eitSubmitAction = this.cs.sharedService.getSharedData(
EITTransactionsRequest.SUBMIT_EIT_ACTION
);
}
getTerminationCol() {
this.cs.startLoading();
this.terminationFormService.getTerminationColStructure({
P_FUNCTION_NAME: this.selectedMenu.P_FUNCTION_NAME
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
this.termColStructure = response;
console.log(response);
this.termColStructure = response['GetTermColsStructureList'];
this.drawEitFieldsStatic(this.termColStructure);
this.getTermDiffStructure();
})
}
@ -73,15 +90,14 @@ export class TerminationFormComponent implements OnInit {
P_DESC_FLEX_CONTEXT_CODE: null,
P_FUNCTION_NAME: this.selectedMenu.FUNCTION_NAME
}, () => { }, this.ts.trPK('general', 'retry')).subscribe((response) => {
console.log("Diff Structure");
console.log(response);
this.cs.stopLoading();
this.handleDiffStructure(response);
})
}
handleDiffStructure(result) {
if (result.GetCcpDffStructureList != null) {
this.diffStructure = result.GetCcpDffStructureList;
this.drawEitFields(result.GetCcpDffStructureList);
if (result.GetTermDffStructureList != null) {
this.diffStructure = result.GetTermDffStructureList;
this.drawEitFields(result.GetTermDffStructureList);
if (this.isUpdate) {
//this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS);
//this.fillAbsStructure();
@ -859,7 +875,7 @@ export class TerminationFormComponent implements OnInit {
return isSt;
}
validateAbcenseTransaction() {
validateTransaction() {
(this.elementRef.nativeElement.querySelectorAll(
"ion-item"
) as HTMLElement[]).forEach(x => {
@ -867,71 +883,73 @@ export class TerminationFormComponent implements OnInit {
x.classList.remove("ng-untouched");
});
let arrValues = this.getElementsValues();
var arrValues = this.getElementsValues();
let staticValues = this.getElementsStaticValues();
let allStatisDynamicValues = arrValues.concat(staticValues);
if (arrValues) {
if (!this.startDate || !this.endDate) {
//this.common.showRequiredMsg();
return false;
}
let Sdata = moment(this.startDate).format("MM/DD/YYYY");
let Edata = moment(this.endDate).format("MM/DD/YYYY");
this.reportSubmitRequest = {}
// this.reports
// .submitTransaction(this.reportSubmitRequest, {}, this.ts.trPK('general', 'retry'))
// .subscribe((result: any) => {
// this.handleSubmitAbsence(result);
// });
this.reportSubmitRequest = {
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
P_SELECTED_RESP_ID: -999,
P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
EITTransactionTBL: allStatisDynamicValues,
};
this.cs.startLoading();
this.terminationFormService
.submitTransation(this.reportSubmitRequest, {}, this.ts.trPK('general', 'retry'))
.subscribe((result: any) => {
this.handleSubmit(result);
});
}
}
private handleSubmitAbsence(result) {
private handleSubmit(result) {
if (this.cs.validResponse(result)) {
if (this.getPassdirfromNotifiPage) {
//this.cs.sharedService.setSharedData(result.ResubmitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.cs.openConfirmAbsece();
this.cs.sharedService.setSharedData(result['SubmitTermTransactionList'], TerminationServiceService.SHARED_DATA);
this.cs.stopLoading();
this.cs.confirmTermination();
}
}
} else {
//this.cs.sharedService.setSharedData(result.SumbitAbsenceTransactionList.P_TRANSACTION_ID, AbsenceResponse.SHARED_DATA);
this.cs.openConfirmAbsece();
}
}
} getElementsValues() {
//this.updatedValues=[];//fill updated list
public getElementsValues(): any {
this.updatedValues = []; //fill updated list
let valuseArr: any = [];
let varcharValue: any = null;
let numbervalue: any = 0;
let dateValue: any = null;
let textValue = "";
let key: string = "";
let obj: any = {};
let transNo: number = 1;
let textValue: any;
// if(this.ExtraObj.transactionNo)
// transNo=this.ExtraObj.transactionNo;
for (let i = 0; i < this.diffStructure.length; i++) {
varcharValue = null;
numbervalue = null;
dateValue = null;
/*********set transaction No of the updated object ********/
if (this.getPassdirfromNotifiPage) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.diffStructure[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
}
if (this.diffStructure[i].DISPLAY_FLAG != "N") {
if (this.diffStructure[i].VALIDATION_TYPE == "N") {
let elem = document.getElementById(
this.diffStructure[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement;
let elemVal = "";
if (elem.classList.contains('onic-date')) {
elemVal = (document.getElementById(
this.diffStructure[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
if (elemVal) {
elemVal = moment(elemVal).format("YYYY/MM/DD hh:mm:ss");
}
} else {
elemVal = (document.getElementById(
this.diffStructure[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
}
let elemVal = (document.getElementById(
this.diffStructure[i].APPLICATION_COLUMN_NAME
) as HTMLInputElement).value;
textValue = elemVal;
//let elemVal= (<HTMLInputElement>document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value;
if (
this.diffStructure[i].FORMAT_TYPE == "X" &&
this.diffStructure[i].DISPLAY_FLAG != "N"
@ -943,25 +961,39 @@ export class TerminationFormComponent implements OnInit {
this.diffStructure[i].DISPLAY_FLAG != "N"
) {
//standard date time
elemVal = elem.dataset.dtvalue;
// elemVal = this.common.formatStandardDate(elemVal);
// elemVal = elem.dataset.dtvalue;
// elemVal = this.cs.formatStandardDate(elemVal);
elemVal = this.cs.formatDate(elemVal);
} else if (
this.diffStructure[i].FORMAT_TYPE == "I" &&
this.diffStructure[i].DISPLAY_FLAG != "N"
) {
//time
elemVal = elem.dataset.dtvalue;
if (elemVal.length > 5) {
elemVal = elemVal.substring(11, 16);
} else {
elemVal = elemVal;
}
}
if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !elemVal) {
elem.classList.add("requiredClassElm");
//this.common.showRequiredMsg();
return false;
} else {
elem.classList.remove("requiredClassElm");
}
if (elemVal) varcharValue = elemVal;
key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
// obj = {};
obj[key] = varcharValue;
// if (elemVal != 'null'){
varcharValue = elemVal;
//} else{
// elemVal = null;
// }
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
} else {
let x = document.getElementById(
this.diffStructure[i].APPLICATION_COLUMN_NAME
@ -981,20 +1013,21 @@ export class TerminationFormComponent implements OnInit {
varcharValue = val;
textValue = txt;
}
if (
this.diffStructure[i].REQUIRED_FLAG == "Y" &&
!varcharValue
) {
if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) {
x.classList.add("requiredClassElm");
// this.common.showRequiredMsg();
//this.common.showRequiredMsg();
return false;
} else {
x.classList.remove("requiredClassElm");
}
key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
//obj = {};
obj[key] = varcharValue;
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.diffStructure[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
} //end else
} else {
let x = document.getElementById(
@ -1002,23 +1035,427 @@ export class TerminationFormComponent implements OnInit {
) as HTMLSelectElement;
let val = x.dataset.colmText;
textValue = x.value;
if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) {
if (this.diffStructure[i].REQUIRED_FLAG == "Y" && !val) {
x.classList.add("requiredClassElm");
// this.common.showRequiredMsg();
//this.common.showRequiredMsg();
return false;
} else {
x.classList.remove("requiredClassElm");
}
if (val) varcharValue = val;
key = "P_" + this.diffStructure[i].APPLICATION_COLUMN_NAME;
//obj = {};
obj[key] = varcharValue;
}
if (this.getPassdirfromNotifiPage) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.diffStructure[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
y.VARCHAR2_VALUE = varcharValue;
y.NUMBER_VALUE = numbervalue;
y.DATE_VALUE = dateValue;
y.SEGMENT_VALUE_DSP = textValue;
transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
} else {
if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) {
let updatedObj = this.validateEitObj.find(
x =>
x.APPLICATION_COLUMN_NAME ==
this.diffStructure[i].APPLICATION_COLUMN_NAME
);
let y = updatedObj;
y.VARCHAR2_VALUE = varcharValue;
y.NUMBER_VALUE = numbervalue;
y.DATE_VALUE = dateValue;
y.SEGMENT_VALUE_DSP = textValue;
transNo = transNo; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
} else {
let y = {
TRANSACTION_NUMBER: transNo,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue,
SEGMENT_VALUE_DSP: textValue,
APPLICATION_COLUMN_NAME: this.diffStructure[i]
.APPLICATION_COLUMN_NAME,
DATATYPE: this.diffStructure[i].DATATYPE,
DESC_FLEX_CONTEXT_CODE: this.diffStructure[i].DESC_FLEX_CONTEXT_CODE,
DESC_FLEX_NAME: this.diffStructure[i].DESC_FLEX_NAME,
DISPLAY_FLAG: this.diffStructure[i].DISPLAY_FLAG,
SEGMENT_NAME: this.diffStructure[i].SEGMENT_NAME,
SEGMENT_PROMPT: this.diffStructure[i].SEGMENT_PROMPT
};
transNo = transNo; // set the transaction number for all items in the updated loop
this.updatedValues.push(y);
}
}
} // end for
valuseArr.push(obj);
if (this.getPassdirfromNotifiPage) {
let updatedObj1 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"
);
let updatedObj2 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"
);
let updatedObj3 = this.validateEitObj.find(
x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"
);
this.updatedValues.push(updatedObj1);
this.updatedValues.push(updatedObj2);
this.updatedValues.push(updatedObj3);
valuseArr = this.fillExtraInformation(
valuseArr,
updatedObj1.VARCHAR2_VALUE,
updatedObj2.NUMBER_VALUE,
updatedObj3.NUMBER_VALUE,
transNo
);
} else {
if (this.eitSubmitAction == EIT_ACTION.ADD) {
this.updatedValues = this.fillExtraValuesUpdated(
this.updatedValues,
"NEW_ROW",
-1,
0,
transNo
);
valuseArr = this.fillExtraInformation(
valuseArr,
"NEW_ROW",
-1,
0,
transNo
);
} else if (this.eitSubmitAction == EIT_ACTION.UPDATE) {
valuseArr = this.fillExtraInformation(
valuseArr,
"UPDATE_ROW",
this.ExtraObj.peiExtraInfoID,
this.ExtraObj.peiObjVer,
transNo
);
} else if (this.eitSubmitAction == EIT_ACTION.DELETE) {
valuseArr = this.fillExtraInformation(
valuseArr,
"DELETE_ROW",
this.ExtraObj.peiExtraInfoID,
this.ExtraObj.peiObjVer,
transNo
);
}
}
return valuseArr;
} // end getElementsValues
fillExtraValuesUpdated(
values: any,
peiAction: string,
peiExtraInfoID: number,
peiObjVer: number,
transNo: number
): any {
let obj1 = {
TRANSACTION_NUMBER: transNo,
VARCHAR2_VALUE: peiAction,
NUMBER_VALUE: null,
DATE_VALUE: null,
SEGMENT_VALUE_DSP: "",
APPLICATION_COLUMN_NAME: "PEI_ACTION",
DATATYPE: "VARCHAR2",
DESC_FLEX_CONTEXT_CODE: "",
DESC_FLEX_NAME: "",
DISPLAY_FLAG: "N",
SEGMENT_NAME: "",
SEGMENT_PROMPT: ""
};
let obj2 = {
TRANSACTION_NUMBER: 1,
APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER",
VARCHAR2_VALUE: null,
NUMBER_VALUE: peiObjVer,
DATATYPE: "NUMBER",
SEGMENT_VALUE_DSP: "",
DATE_VALUE: null,
DESC_FLEX_CONTEXT_CODE: "",
DESC_FLEX_NAME: "",
DISPLAY_FLAG: "N",
SEGMENT_NAME: "",
SEGMENT_PROMPT: ""
};
let obj3 = {
APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID",
DATATYPE: "NUMBER",
DATE_VALUE: null,
DESC_FLEX_CONTEXT_CODE: "",
DESC_FLEX_NAME: "",
DISPLAY_FLAG: "N",
NUMBER_VALUE: peiExtraInfoID,
SEGMENT_NAME: "",
SEGMENT_PROMPT: "",
SEGMENT_VALUE_DSP: "",
TRANSACTION_NUMBER: transNo,
VARCHAR2_VALUE: null
};
values.push(obj1);
values.push(obj2);
values.push(obj3);
return values;
}
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;
}
fixTransactionNo(transactionTBL: any): any[] {
let list: any = [];
let newIndex: number = 1;
let length: number = transactionTBL.length;
if (length > 0) {
for (let i = 0; i < length; i++) {
// let item :any={};
const item = Object.assign({}, transactionTBL[i]);
let transNo: number = item.TRANSACTION_NUMBER;
let obj: any = item;
if (i == 0) {
obj.TRANSACTION_NUMBER = newIndex;
list.push(obj);
} else {
let prevEl: any = transactionTBL[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;
}
private drawEitFieldsStatic(feildsList) {
const containerId = "containerDivTwo";
this.eitVALSettoCall = [];
for (let i = 0; i < feildsList.length; i++) {
let defaultVal: string = "";
let defaultValText: string = "";
if (feildsList[i].DISPLAY_FLAG != "N") {
//text , date , time
if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList === null) {
// character
this.textInput = new TextInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
defaultVal,
containerId,
defaultValText,
feildsList[i].MOBILE_ENABLED,
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG
);
} else if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList !== null) {
this.selectInput = new SelectInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
defaultVal,
containerId,
feildsList[i].MOBILE_ENABLED,
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG
);
this.fillStaticDropdownList(
feildsList[i].SEGMENT_NAME,
feildsList[i].ObjectValuesList,
feildsList[i].APPLICATION_COLUMN_NAME
);
} else if (feildsList[i].DATATYPE == "NUMBER") {
this.numberInput = new NumberInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
defaultVal,
containerId,
feildsList[i].MOBILE_ENABLED,
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG
);
} else if (feildsList[i].DATATYPE == "DATE") {
this.dateInput = new DateInput(
feildsList[i].SEGMENT_PROMPT,
feildsList[i].APPLICATION_COLUMN_NAME,
"",
containerId,
feildsList[i].MOBILE_ENABLED,
feildsList[i].DISPLAY_FLAG,
feildsList[i].REQUIRED_FLAG,
this.direction
);
}
}
}
}
public fillStaticDropdownList(segmentName, optionList: any = [], elemID: string) {
let eitObj: any;
if (optionList.length > 0) {
let select = document.getElementById(elemID) as HTMLSelectElement;
document.getElementById(elemID).innerHTML = "";
for (let i = 0; i < optionList.length; i++) {
var option = document.createElement("option");
option.text = optionList[i].MEANING;
option.value = optionList[i].CODE;
select.add(option);
}
}
}
public getElementsStaticValues(): any {
this.updatedValues = []; //fill updated list
let valuseArr: any = [];
let varcharValue: any = null;
let numbervalue: any = 0;
let dateValue: any = null;
let transNo: number = 1;
let textValue: any;
for (let i = 0; i < this.termColStructure.length; i++) {
varcharValue = null;
numbervalue = null;
dateValue = null;
if (this.termColStructure[i].DISPLAY_FLAG != "N") {
if (this.termColStructure[i].ObjectValuesList === null) {
let elem = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLInputElement;
let elemVal = elem !== null ? (document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLInputElement).value : '';
textValue = elemVal;
if (this.termColStructure[i].DATATYPE == "VARCHAR2" || this.termColStructure[i].DATATYPE == "NUMBER") {
elemVal = elemVal;
} else if (this.termColStructure[i].DATATYPE == "DATE") {
// date
elemVal = this.cs.formatDate(elemVal);
}
if (this.targetValue === 'new') {
if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !elemVal) {
elem.classList.add("requiredClassElm");
return false;
} else {
elem.classList.remove("requiredClassElm");
}
}
if (this.termColStructure[i].DATATYPE == "DATE") {
dateValue = elemVal;
} else if (this.termColStructure[i].DATATYPE == "NUMBER") {
numbervalue = elemVal;
} else {
varcharValue = elemVal;
}
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
} else {
let x = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
let val = x.options && x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null;
let txt = x.options && x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : null;
varcharValue = val;
textValue = txt;
if (x !== null) {
if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !varcharValue) {
x.classList.add("requiredClassElm");
return false;
} else {
x.classList.remove("requiredClassElm");
}
}
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
}
} else {
let x = document.getElementById(this.termColStructure[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
let val = x !== null ? x.dataset.colmText : '';
textValue = x !== null ? x.value : '';
if (x !== null) {
if (this.termColStructure[i].REQUIRED_FLAG == "Y" && !val) {
x.classList.add("requiredClassElm");
return false;
} else {
x.classList.remove("requiredClassElm");
}
}
varcharValue = val;
valuseArr.push({
TRANSACTION_NUMBER: transNo,
NAME: this.termColStructure[i].APPLICATION_COLUMN_NAME,
VARCHAR2_VALUE: varcharValue,
NUMBER_VALUE: numbervalue,
DATE_VALUE: dateValue
});
}
}
return valuseArr;
}
public customiseDate(date: any) {
let formatedDate = date.slice(0, 9);
let newDate = formatedDate.split("/").reverse();
const tmp = newDate[2];
newDate[2] = newDate[1];
newDate[1] = tmp;
newDate = newDate.join("/");
newDate = newDate + ' 00:00:00';
return newDate;
}
}

@ -9,6 +9,8 @@ import { TerminationPage } from './termination.page';
import { TerminationFormComponent } from './termination-form/termination-form.component';
import { TerminationServiceService } from './service/termination-service.service';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
import { ConfirmTerminationComponent } from './confirm-termination/confirm-termination.component';
import { SubmitAddressModalComponent } from '../profile/submit-eit-modal/submit-address-modal.component';
const routes: Routes = [
@ -20,6 +22,10 @@ const routes: Routes = [
path: 'termination-form',
component: TerminationFormComponent
},
{
path: 'confirm-termination',
component: ConfirmTerminationComponent
},
],
}
@ -33,7 +39,8 @@ const routes: Routes = [
RouterModule.forChild(routes),
HmgCommonModule
],
declarations: [TerminationPage, TerminationFormComponent],
providers: [TerminationServiceService]
declarations: [TerminationPage, TerminationFormComponent, ConfirmTerminationComponent],
providers: [TerminationServiceService],
entryComponents: [SubmitAddressModalComponent]
})
export class TerminationPageModule { }

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

@ -1496,12 +1496,12 @@
"ar": "حذف"
},
"update-msg": {
"en": "Are you sure you want update this member ?",
"en": "Are you sure you want to update this member ?",
"ar": "هل انت متاكد من تعديل هذا العضو؟"
},
"remove-msg": {
"en": "Are you sure you want rmove this member ?",
"ar": "هل انت متاكد من حذف هذا العضو ؟"
"en": "Are you sure you want to remove this member?",
"ar": "هل أنت متأكد أنك تريد إزالة هذا العضو؟"
},
"update-confirm": {
"en": "member updated successfully",
@ -3173,10 +3173,46 @@
}
},
"itemforsale": {
"warning": {
"en": "This ad will be valid for 2 week after approval",
"ar": "هذا الإعلان ساري المفعول لمدة أسبوعين بعد الموافقة"
},
"title": {
"en": "Item for sale",
"ar": "سلعه للبيع"
},
"region": {
"en": "Region",
"ar": "منطقة"
},
"selling-for": {
"en": "Selling for",
"ar": "بيع مقابل"
},
"item-condition": {
"en": "Item condition",
"ar": "حالة السلعة"
},
"new": {
"en": "New",
"ar": "جديد"
},
"used": {
"en": "Used",
"ar": "تستخدم"
},
"item-price": {
"en": "Item Price",
"ar": "سعر السلعة"
},
"item-photos": {
"en": "Item Photos",
"ar": "صور البند"
},
"offering": {
"en": "What are you offering?",
"ar": "ما الذي تعرضه؟"
},
"related-offers": {
"en": "Related offers",
"ar": "العروض ذات الصلة"
@ -3205,6 +3241,10 @@
"en": "Add Details",
"ar": "أضف التفاصيل"
},
"item-info": {
"en": "Item Info",
"ar": "معلومات العنصر"
},
"review-sell": {
"en": "Review & Sell",
"ar": "مراجعة وبيع"
@ -3368,6 +3408,30 @@
"request-type": {
"en": "Request type",
"ar": "نوع الطلب"
},
"request-generated": {
"en": "Your Request for resport has been sent to the server, click below link to check status",
"ar": "تم إرسال طلبك عن التقرير إلى الخادم، انقر فوق الرابط أدناه للتحقق من الحالة"
},
"check-status": {
"en": "Refresh",
"ar": "ينعش"
},
"phase": {
"en": "Phase",
"ar": "مرحلة"
},
"program-name": {
"en": "Program Name",
"ar": "إسم البرنامج"
},
"request-id": {
"en": "Request ID",
"ar": "طلب معرف"
},
"output": {
"en": "Output",
"ar": "انتاج"
}
}
}

@ -1626,3 +1626,8 @@ ion-segment-button {
.top-filter svg {
margin-top: 15px !important;
}
.disabledField{
opacity: .5;
pointer-events: none;
}
Loading…
Cancel
Save