|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
|
|
|
|
import { DatePicker } from '@ionic-native/date-picker/ngx';
|
|
|
|
|
import { ModalController } from '@ionic/angular';
|
|
|
|
|
import { ModalController, Platform } from '@ionic/angular';
|
|
|
|
|
import * as moment from 'moment';
|
|
|
|
|
import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
|
|
|
|
|
import { EitAddressRequest } from 'src/app/eit/models/eit-address.request';
|
|
|
|
|
@ -76,7 +76,8 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
private eitService: EitService,
|
|
|
|
|
public datePicker: DatePicker,
|
|
|
|
|
public profileService: ProfileService
|
|
|
|
|
public profileService: ProfileService,
|
|
|
|
|
public platform: Platform
|
|
|
|
|
) {
|
|
|
|
|
this.direction = TranslatorService.getCurrentLanguageName();
|
|
|
|
|
this.selEmp = this.cs.sharedService.getSharedData(
|
|
|
|
|
@ -457,6 +458,7 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bindHtmlElemEvents(id, obj) {
|
|
|
|
|
const isIOS = this.platform.is('ios');
|
|
|
|
|
const elem = document.getElementById(id);
|
|
|
|
|
console.log(elem);
|
|
|
|
|
console.log(obj);
|
|
|
|
|
@ -466,7 +468,21 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
if (elemType == "SELECT") changeEvent = "change";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (isIOS && (obj.FORMAT_TYPE == "N" || obj.FORMAT_TYPE == "C")) {
|
|
|
|
|
elem.addEventListener("ionFocus", event => {
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
console.log(event.target as Element);
|
|
|
|
|
var e = event.target as Element;
|
|
|
|
|
e.scrollIntoView(true);
|
|
|
|
|
},1000)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
elem.addEventListener(changeEvent, e => {
|
|
|
|
|
if (obj.FORMAT_TYPE == "N") {
|
|
|
|
|
const maxSize = obj.MAXIMUM_SIZE;
|
|
|
|
|
const value = (document.getElementById(obj.APPLICATION_COLUMN_NAME) as HTMLInputElement).value;
|
|
|
|
|
(document.getElementById(obj.APPLICATION_COLUMN_NAME) as HTMLInputElement).value = value.length > maxSize ? value.substring(0, maxSize) : value;
|
|
|
|
|
}
|
|
|
|
|
elem.classList.remove("requiredClassElm");
|
|
|
|
|
if (
|
|
|
|
|
obj.CHILD_SEGMENTS_VS_Splited &&
|
|
|
|
|
@ -1124,6 +1140,7 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
|
|
|
|
|
elem.classList.add("requiredClassElm");
|
|
|
|
|
this.cs.redToastPK("eit", "required-text");
|
|
|
|
|
//this.common.showRequiredMsg();
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
@ -1162,6 +1179,7 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
|
|
|
|
|
x.classList.add("requiredClassElm");
|
|
|
|
|
this.cs.redToastPK("eit", "required-text");
|
|
|
|
|
//this.common.showRequiredMsg();
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
@ -1184,6 +1202,7 @@ export class AddAddressComponent implements OnInit {
|
|
|
|
|
textValue = x.value;
|
|
|
|
|
if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) {
|
|
|
|
|
x.classList.add("requiredClassElm");
|
|
|
|
|
this.cs.redToastPK("eit", "required-text");
|
|
|
|
|
//this.common.showRequiredMsg();
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
|