|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { Component, OnInit, NgZone } from '@angular/core';
|
|
|
|
|
import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
|
|
|
|
|
import { EitRequest } from 'src/app/eit/models/eit.request';
|
|
|
|
|
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
|
|
|
|
|
@ -20,7 +20,7 @@ export class ConatactComponent implements OnInit {
|
|
|
|
|
respID: any;
|
|
|
|
|
selMenu: any;
|
|
|
|
|
submitrequest: any;
|
|
|
|
|
constructor(public cs: CommonService, public ts: TranslatorService, public profileService: ProfileService,) {
|
|
|
|
|
constructor(public cs: CommonService, public ts: TranslatorService, public profileService: ProfileService, public ngzone: NgZone) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.selEmp = this.cs.sharedService.getSharedData(
|
|
|
|
|
MenuResponse.SHARED_SEL_EMP,
|
|
|
|
|
@ -40,10 +40,13 @@ export class ConatactComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
this.phoneNumbers = this.cs.sharedService.getSharedData(ProfileService.EMP_PHONE, false);
|
|
|
|
|
this.setIsUpdated();
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.getObjectValue();
|
|
|
|
|
this.ngzone.run(() => {
|
|
|
|
|
this.phoneNumbers = [];
|
|
|
|
|
this.phoneNumbers = this.cs.sharedService.getSharedData(ProfileService.EMP_PHONE, false);
|
|
|
|
|
this.setIsUpdated();
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.getObjectValue();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
setIsUpdated() {
|
|
|
|
|
this.phoneNumbers.forEach(element => {
|
|
|
|
|
@ -93,6 +96,14 @@ export class ConatactComponent implements OnInit {
|
|
|
|
|
addNewRow() {
|
|
|
|
|
this.phoneNumbers.push({ 'PHONE_NUMBER': '', 'PHONE_TYPE': '', 'ACTION': 'NEW_ROW', 'OBJECT_VERSION_NUMBER': null, 'PHONE_ID': null })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ionViewDidLeave() {
|
|
|
|
|
this.phoneNumbers = this.phoneNumbers.filter(function( obj ) {
|
|
|
|
|
return obj.ACTION !== 'NEW_ROW';
|
|
|
|
|
});
|
|
|
|
|
this.cs.sharedService.setSharedData(this.phoneNumbers, ProfileService.EMP_PHONE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
deleteRow(row) {
|
|
|
|
|
row['DELETE_ROW'] = true;
|
|
|
|
|
// this.phoneNumbers =
|
|
|
|
|
|