-
+
{{'vacation-rule, next-label' | translate}}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss
index 9b59e3d3..a6dbf815 100644
--- a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss
@@ -37,4 +37,9 @@
width: 80% !important;
color: white!important;
border-radius: 16px !important;
+ }
+
+ .country{
+ margin-top: 10px;
+ padding: 10px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts
index 5592e376..ab5a7aa5 100644
--- a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts
@@ -22,6 +22,8 @@ import { EIT_ACTION } from "../models/submit.eit.action";
import { AddEitResponse } from "../models/add.eit.response";
import { element } from '@angular/core/src/render3';
import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
+import { ActivatedRoute } from '@angular/router';
+
@Component({
selector: 'app-add-basic-details',
templateUrl: './add-basic-details.component.html',
@@ -29,14 +31,13 @@ import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
})
export class AddBasicDetailsComponent implements OnInit {
@ViewChild("containerDiv") containerDiv: ElementRef;
+ @ViewChild("containerDivTwo") containerDivTwo: ElementRef;
+
- ////*new add*/////
getPassNotificationDetails: any;
getPassdirfromNotifiPage: boolean = false;
functionName: string = "";
menuType: any;
- /////////////////
-
private textArea: TextAreaInput;
private numberInput: NumberInput;
private textInput: TextInput;
@@ -47,7 +48,8 @@ export class AddBasicDetailsComponent implements OnInit {
private buttonInput: ButtonInput;
private hiddenInput: HiddenInput;
private eitResponse: any;
-
+ private eitColResponse: any;
+
private eitVALSettoCall: any = [];
private comtransNo: number = 0;
getPassMnuEntryObj: MenuEntry;
@@ -64,6 +66,9 @@ export class AddBasicDetailsComponent implements OnInit {
private updatedValues: any = [];
addEITData: any;
direction:string;
+ public targetValue: any;
+ public employeeBasicDetails: any = [];
+ public mutualBasicDetailsArray: any = [];
constructor(
@@ -71,8 +76,18 @@ export class AddBasicDetailsComponent implements OnInit {
public cs: CommonService,
private ts: TranslatorService,
private profileService: ProfileService,
- public datePicker: DatePicker
+ public datePicker: DatePicker,
+ public router: ActivatedRoute
) {
+
+ this.router.queryParams.subscribe(params => {
+ this.targetValue = params.targetValue;
+ console.log(this.targetValue);
+ });
+
+ this.employeeBasicDetails = this.cs.sharedService.getSharedData('employeeDetails', false);
+ console.log(this.employeeBasicDetails);
+
this.direction = TranslatorService.getCurrentLanguageName();
this.selEmp = this.cs.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
@@ -89,7 +104,6 @@ export class AddBasicDetailsComponent implements OnInit {
);
this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false);
console.log("addEITData: " + this.addEITData);
- // console.log("dirfromNotificationPage: " + this.addEITData.dirfromNotificationPage);
this.basicRequest = new BasicRequest();
@@ -122,9 +136,7 @@ export class AddBasicDetailsComponent implements OnInit {
ngOnInit() {}
ngAfterViewInit() {
- // this.getEitDffStructure();
- this.getColumnStructure();
-
+ this.getEitDffStructure();
}
public getColumnStructure() {
@@ -153,18 +165,180 @@ export class AddBasicDetailsComponent implements OnInit {
public handleBasicColStructureResult(result) {
if (result.GetBasicDetColsStructureList != null) {
- this.eitResponse = result.GetBasicDetColsStructureList;
- this.drawEitFields(result.GetBasicDetColsStructureList);
+ this.eitColResponse = result.GetBasicDetColsStructureList;
+ this.drawEitFieldsStatic(result.GetBasicDetColsStructureList);
}
}
public handleBasicDffStructureResult(result) {
if (result.GetBasicDetDffStructureList != null) {
+ this.getColumnStructure();
this.eitResponse = result.GetBasicDetDffStructureList;
this.drawEitFields(result.GetBasicDetDffStructureList);
}
}
+ 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.targetValue === 'new') {
+ 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
+ );
+
+ }
+ }
+ }
+ this.fillBasicDetailsStructure();
+ }
+
+ 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 = this.comtransNo;
+ let textValue : any;
+
+ for (let i = 0; i < this.eitColResponse.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+
+ if (this.eitColResponse[i].DISPLAY_FLAG != "N") {
+ if (this.eitColResponse[i].ObjectValuesList === null) {
+ let elem = document.getElementById( this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement;
+ let elemVal = elem !== null ? (document.getElementById( this.eitColResponse[i].APPLICATION_COLUMN_NAME ) as HTMLInputElement).value : '';
+ textValue = elemVal;
+
+ if ((this.eitColResponse[i].DATATYPE == "VARCHAR2" || this.eitColResponse[i].DATATYPE == "NUMBER") && this.eitColResponse[i].ObjectValuesList === null) {
+ elemVal = elemVal;
+ } else if (this.eitColResponse[i].DATATYPE == "DATE" && this.targetValue === 'new') {
+ // date
+ elemVal = this.cs.formatDate(elemVal);
+ }
+
+ if (this.targetValue === 'new') {
+ if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ }
+
+ varcharValue = elemVal;
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } else {
+ let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
+
+ 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 (x !== null) {
+ if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+ } else {
+ let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
+ let val = x !== null ? x.dataset.colmText : '';
+ textValue = x !== null ? x.value : '';
+
+ if (x !== null) {
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) {
+ x.classList.add("requiredClassElm");
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ }
+
+ if (val) varcharValue = val;
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+ }
+ return valuseArr;
+ }
+
private drawEitFields(feildsList) {
const containerId = "containerDiv";
this.eitVALSettoCall = [];
@@ -375,7 +549,6 @@ export class AddBasicDetailsComponent implements OnInit {
}
closeModal() {
- console.log("closeModal");
this.updatedValues = [];
this.modalController.dismiss();
}
@@ -407,6 +580,7 @@ export class AddBasicDetailsComponent implements OnInit {
err => console.log("Error occurred while getting date: ", err)
);
}
+
public showTimePicker(elemID, maxSize) {
let elem = document.getElementById(elemID) as HTMLDivElement;
let date: any;
@@ -480,6 +654,21 @@ export class AddBasicDetailsComponent implements OnInit {
}
}
+ 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);
+ }
+ }
+ }
+
bindHtmlElemEvents(id, obj) {
const elem = document.getElementById(id);
console.log(elem);
@@ -949,6 +1138,7 @@ export class AddBasicDetailsComponent implements OnInit {
}
return isSt;
}
+
isStandardDateTime(obj: any): boolean {
let isSt: boolean = false;
if (obj.FORMAT_TYPE == "Y") {
@@ -965,6 +1155,7 @@ export class AddBasicDetailsComponent implements OnInit {
}
return isSt;
}
+
isStandardTime(obj: any): boolean {
let isSt: boolean = false;
if (obj.FORMAT_TYPE == "I") {
@@ -992,6 +1183,7 @@ export class AddBasicDetailsComponent implements OnInit {
}
return isSt;
}
+
isStandardDateTimeVal(obj: any): boolean {
let isSt: boolean = false;
if (obj.FORMAT_TYPE == "Y") {
@@ -1002,6 +1194,7 @@ export class AddBasicDetailsComponent implements OnInit {
}
return isSt;
}
+
isStandardTimeVal(obj: any): boolean {
let isSt: boolean = false;
if (obj.FORMAT_TYPE == "I") {
@@ -1013,6 +1206,58 @@ export class AddBasicDetailsComponent implements OnInit {
return isSt;
}
+ public customiseDate(date: any) {
+ let formatedDate = date.replace(/\//g, '/');
+ formatedDate = formatedDate.replace(/ 00:00:00/g, '');
+ 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;
+ }
+
+
+ public fillBasicDetailsStructure() {
+ console.log(this.eitResponse);
+ console.log(this.eitColResponse);
+ this.mutualBasicDetailsArray = this.mutualBasicDetailsArray.concat(this.eitResponse, this.eitColResponse);
+ console.log(this.mutualBasicDetailsArray);
+ 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);
+ this.employeeBasicDetails[i].DATE_VALUE
+ else if (this.employeeBasicDetails[i].NUMBER_VALUE)
+ val = this.employeeBasicDetails[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.mutualBasicDetailsArray.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ }
+ }
+ }
+ }
+
fillEITStructure() {
var obj = { peiObjVer: null, peiExtraInfoID: null };
for (let i = 0; i < this.validateEitObj.length; i++) {
@@ -1384,6 +1629,7 @@ export class AddBasicDetailsComponent implements OnInit {
values.push(obj3);
return values;
}
+
fillExtraInformation(
values: any,
peiAction: string,
@@ -1453,6 +1699,7 @@ export class AddBasicDetailsComponent implements OnInit {
}
return list;
}
+
handleSubmitEitResult(result) {
if (this.cs.validResponse(result)) {
this.cs.sharedService.setSharedData(
@@ -1477,27 +1724,30 @@ export class AddBasicDetailsComponent implements OnInit {
}
}
- // validateEITTransaction() {
- // // let EITTransactionValues:any= [];
-
- // this.arrValues = this.getElementsValues();
- // if (this.arrValues) {
- // this.basicRequest = {
- // P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
- // P_MENU_TYPE: this.menuType,
- // P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999,
- // P_FUNCTION_NAME: this.functionName,
- // P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE,
- // EITTransactionTBL: this.arrValues
- // };
-
- // this.eitService
- // .validateEITTransaction(this.eitRequest)
- // .subscribe((result: any) => {
- // this.handleEITValidateTr(result);
- // });
- // }
- // }
+ public submitBasicDetailsTransaction() {
+ // let EITTransactionValues:any= [];
+
+ this.arrValues = this.getElementsValues();
+ let staticValues = this.getElementsStaticValues();
+ let allStatisDynamicValues = this.arrValues.concat(staticValues);
+ if (allStatisDynamicValues) {
+ this.basicRequest = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
+ P_SELECTED_RESP_ID: this.respID,
+ P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
+ EITTransactionTBL: allStatisDynamicValues,
+ // P_EFFECTIVE_DATE: moment(this.effectiveDate).format('DD-MMM-YYYY'),
+ P_ACTION: this.targetValue === 'correct' ? 'CORRECT' : 'CHANGE'
+ };
+
+ // this.eitService
+ // .validateEITTransaction(this.eitRequest)
+ // .subscribe((result: any) => {
+ // this.handleEITValidateTr(result);
+ // });
+ }
+ }
// private handleEITValidateTr(result) {
// let data: any = { eitRequest: {}, updated: [] };
// if (this.cs.validResponse(result)) {
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index ccef838c..962a1fdb 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -196,8 +196,7 @@