+
+
+ {{ts.trPK('submitAbsence','endDate')}}
+
+
-
+
{{'vacation-rule, next-label' | translate}}
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss
index e69de29b..764fe8af 100644
--- a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss
+++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.scss
@@ -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
+}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts
index ac441f89..0005fcd2 100644
--- a/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts
+++ b/Mohem/src/app/profile/add-update-contact/add-update-contact.component.ts
@@ -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= (
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);
});
}
}
diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html
new file mode 100644
index 00000000..0505227b
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.html
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+ {{'general, addAttach' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, notAttch' | translate}}
+
+
+
+ 0">
+
+
+
+
+ {{attachList.AttachmentID +1 }} .
+
+
+
+
+ {{attachList.P_FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
+
+
+
+
+
+ {{attachRes.FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'confirmAddEit, comment' | translate}}
+
+
+
+
+
+
+ {{'confirmAddEit, approverList' | translate}}
+
+
{{ 'general, empty' | translate}}
+
+ 0">
+
+
+
+
+
+
+
+
+
+
+
+ {{employee.APPROVER}}
+
+
+ {{employee.POSITION_TITLE}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, submit' | translate }}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss
new file mode 100644
index 00000000..2ed98379
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.scss
@@ -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;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts
new file mode 100644
index 00000000..6a25647a
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.spec.ts
@@ -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;
+
+ 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();
+ });
+});
diff --git a/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts
new file mode 100644
index 00000000..688e3443
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-contact/confirm-contact.component.ts
@@ -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) {
+ }
+ }
+
+}
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index 49d292bc..4eb7d608 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -359,7 +359,7 @@
{{data.RELATIONSHIP}}
-
+
diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts
index d9f61f5b..1a82b12a 100644
--- a/Mohem/src/app/profile/home/home.component.ts
+++ b/Mohem/src/app/profile/home/home.component.ts
@@ -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');
+
+ }
+ })
+ }
}
diff --git a/Mohem/src/app/profile/models/contact.request.ts b/Mohem/src/app/profile/models/contact.request.ts
index 7646184e..3a62ce32 100644
--- a/Mohem/src/app/profile/models/contact.request.ts
+++ b/Mohem/src/app/profile/models/contact.request.ts
@@ -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;
}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/profile.module.ts b/Mohem/src/app/profile/profile.module.ts
index 2ae8004b..46faa498 100644
--- a/Mohem/src/app/profile/profile.module.ts
+++ b/Mohem/src/app/profile/profile.module.ts
@@ -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],
diff --git a/Mohem/src/app/profile/service/profile.service.ts b/Mohem/src/app/profile/service/profile.service.ts
index d298bbc7..141d8e04 100644
--- a/Mohem/src/app/profile/service/profile.service.ts
+++ b/Mohem/src/app/profile/service/profile.service.ts
@@ -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
{
+ 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 {
this.authService.authenticateRequest(request);
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html
index c622715f..d44a33ba 100644
--- a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.html
@@ -20,6 +20,7 @@
+
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss
index 71cba989..168df521 100644
--- a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.scss
@@ -3,4 +3,12 @@
}
.divider{
height:20px
+}
+.check-status{
+ color:rgb(0, 0, 134);
+ text-decoration: underline;
+ font-weight: 600;
+}
+.status{
+ margin:20px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts
index 7e6d9844..e42896c1 100644
--- a/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts
+++ b/Mohem/src/app/reports/concurrent-report/concurrent-report.component.ts
@@ -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() {
+ }
}
diff --git a/Mohem/src/app/reports/report-service.service.ts b/Mohem/src/app/reports/report-service.service.ts
index d8356223..9196cb2c 100644
--- a/Mohem/src/app/reports/report-service.service.ts
+++ b/Mohem/src/app/reports/report-service.service.ts
@@ -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
+ );
+ }
+
}
diff --git a/Mohem/src/app/reports/reports.module.ts b/Mohem/src/app/reports/reports.module.ts
index 41be692b..0fc1953d 100644
--- a/Mohem/src/app/reports/reports.module.ts
+++ b/Mohem/src/app/reports/reports.module.ts
@@ -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 { }
diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.html b/Mohem/src/app/reports/transaction-list/transaction-list.component.html
new file mode 100644
index 00000000..af807b32
--- /dev/null
+++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.html
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
0" class="transaction-list">
+
+ {{getDate(transaction.REQUEST_DATE)}}
+
+
+
+
{{'transaction, request-id' | translate}}
+
+ {{transaction.REQUEST_ID}}
+
+
+ {{'transaction, phase' | translate}}
+ {{transaction.CCP_PHASE}}
+
+
+
+
+
{{'transaction,program-name' | translate}}
+
{{transaction.CONCURRENT_PROGRAM_NAME}}
+
+
+
+
+
+
{{'transaction,output' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.scss b/Mohem/src/app/reports/transaction-list/transaction-list.component.scss
new file mode 100644
index 00000000..0f29d1fd
--- /dev/null
+++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.scss
@@ -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;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts
new file mode 100644
index 00000000..9a3a75e7
--- /dev/null
+++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.spec.ts
@@ -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;
+
+ 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();
+ });
+});
diff --git a/Mohem/src/app/reports/transaction-list/transaction-list.component.ts b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts
new file mode 100644
index 00000000..56d0aa06
--- /dev/null
+++ b/Mohem/src/app/reports/transaction-list/transaction-list.component.ts
@@ -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'];
+ });
+ }
+}
diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html
new file mode 100644
index 00000000..d7e4b690
--- /dev/null
+++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+ {{'general, addAttach' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, notAttch' | translate}}
+
+
+
+ 0">
+
+
+
+
+ {{attachList.AttachmentID +1 }} .
+
+
+
+
+ {{attachList.P_FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
+
+
+
+
+
+ {{attachRes.FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'confirmAddEit, comment' | translate}}
+
+
+
+
+
+
+ {{'confirmAddEit, approverList' | translate}}
+
+
{{ 'general, empty' | translate}}
+
+ 0">
+
+
+
+
+
+
+
+
+
+
+
+ {{employee.APPROVER}}
+
+
+ {{employee.POSITION_TITLE}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, submit' | translate }}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss
new file mode 100644
index 00000000..2ed98379
--- /dev/null
+++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.scss
@@ -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;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts
new file mode 100644
index 00000000..c9818fc1
--- /dev/null
+++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.spec.ts
@@ -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;
+
+ 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();
+ });
+});
diff --git a/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts
new file mode 100644
index 00000000..be177d0f
--- /dev/null
+++ b/Mohem/src/app/termination/confirm-termination/confirm-termination.component.ts
@@ -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) {
+ }
+ }
+
+
+}
diff --git a/Mohem/src/app/termination/service/termination-service.service.ts b/Mohem/src/app/termination/service/termination-service.service.ts
index d980c9d3..5f2d94e1 100644
--- a/Mohem/src/app/termination/service/termination-service.service.ts
+++ b/Mohem/src/app/termination/service/termination-service.service.ts
@@ -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 {
+ const request = basicDetailsProcess;
+ this.authService.authenticateRequest(request);
+ request.P_SELECTED_EMPLOYEE_NUMBER = request.UserName;
+ return this.con.post(TerminationServiceService.START_APPORVAL, request, onError, errorLabel);
+ }
+
+
+
+
}
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.html b/Mohem/src/app/termination/termination-form/termination-form.component.html
index f8fa6523..11071910 100644
--- a/Mohem/src/app/termination/termination-form/termination-form.component.html
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.html
@@ -7,6 +7,7 @@
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.scss b/Mohem/src/app/termination/termination-form/termination-form.component.scss
index e69de29b..746e3d4f 100644
--- a/Mohem/src/app/termination/termination-form/termination-form.component.scss
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.scss
@@ -0,0 +1,3 @@
+#containerDiv{
+ margin:15px;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/termination/termination-form/termination-form.component.ts b/Mohem/src/app/termination/termination-form/termination-form.component.ts
index f175165a..a7082c9c 100644
--- a/Mohem/src/app/termination/termination-form/termination-form.component.ts
+++ b/Mohem/src/app/termination/termination-form/termination-form.component.ts
@@ -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= (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;
+ }
}
diff --git a/Mohem/src/app/termination/termination.module.ts b/Mohem/src/app/termination/termination.module.ts
index aadbde53..7302cb97 100644
--- a/Mohem/src/app/termination/termination.module.ts
+++ b/Mohem/src/app/termination/termination.module.ts
@@ -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 { }
diff --git a/Mohem/src/assets/imgs/hr-request.png b/Mohem/src/assets/imgs/hr-request.png
new file mode 100644
index 00000000..c905603b
Binary files /dev/null and b/Mohem/src/assets/imgs/hr-request.png differ
diff --git a/Mohem/src/assets/imgs/my-request.png b/Mohem/src/assets/imgs/my-request.png
new file mode 100644
index 00000000..7fdc5539
Binary files /dev/null and b/Mohem/src/assets/imgs/my-request.png differ
diff --git a/Mohem/src/assets/imgs/pending-transaction.png b/Mohem/src/assets/imgs/pending-transaction.png
new file mode 100644
index 00000000..d252ad43
Binary files /dev/null and b/Mohem/src/assets/imgs/pending-transaction.png differ
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json
index 89df168a..6d68cc24 100644
--- a/Mohem/src/assets/localization/i18n.json
+++ b/Mohem/src/assets/localization/i18n.json
@@ -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": "انتاج"
}
}
}
\ No newline at end of file
diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss
index 73c0b0a2..b6e1b729 100644
--- a/Mohem/src/theme/styles.scss
+++ b/Mohem/src/theme/styles.scss
@@ -1626,3 +1626,8 @@ ion-segment-button {
.top-filter svg {
margin-top: 15px !important;
}
+
+.disabledField{
+ opacity: .5;
+ pointer-events: none;
+}
\ No newline at end of file