fixed structure issues

MOHEMM-SFH-COLORS
umasoodch 4 years ago
parent 86f8a25bee
commit 5ae2c2f170

@ -8,7 +8,8 @@ export class EitAddressRequest {
public P_FUNCTION_NAME: string; public P_FUNCTION_NAME: string;
public P_SELECTED_RESP_ID: Number; public P_SELECTED_RESP_ID: Number;
P_DESC_FLEX_CONTEXT_CODE: string; P_DESC_FLEX_CONTEXT_CODE: string;
EITTransactionTBL: EitTransactionModel[]; P_TRANSACTION_VALUES_TBL: EitTransactionModel[];
P_COUNTRY_CODE: string P_COUNTRY_CODE: string;
P_EFFECTIVE_DATE: string P_EFFECTIVE_DATE: string;
P_ACTION: string;
} }

@ -125,7 +125,7 @@ export class AddAddressComponent implements OnInit {
// this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; // this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
// this.menuType = this.selMenu.List_Menu.MENU_TYPE; // this.menuType = this.selMenu.List_Menu.MENU_TYPE;
// this.validateEitObj = this.addEITData.submitEITObjList; // this.validateEitObj = this.addEITData.submitEITObjList;
// this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
// this.eitSubmitAction = this.cs.sharedService.getSharedData( // this.eitSubmitAction = this.cs.sharedService.getSharedData(
// EITTransactionsRequest.SUBMIT_EIT_ACTION // EITTransactionsRequest.SUBMIT_EIT_ACTION
// ); // );
@ -1506,8 +1506,8 @@ export class AddAddressComponent implements OnInit {
} }
submitEit() { submitEit() {
let list = this.eitRequest.EITTransactionTBL; // let list = this.eitRequest.EITTransactionTBL;
this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list); // this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list);
this.eitService this.eitService
.submitEit(this.eitRequest) .submitEit(this.eitRequest)
@ -1582,11 +1582,12 @@ export class AddAddressComponent implements OnInit {
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE, P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999, P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999,
P_FUNCTION_NAME: this.functionName, P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE, P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE,
EITTransactionTBL: this.arrValues, P_TRANSACTION_VALUES_TBL: this.arrValues,
P_COUNTRY_CODE: this.country, P_COUNTRY_CODE: this.country,
P_EFFECTIVE_DATE: '28-June-2021' P_EFFECTIVE_DATE: '28-June-2021',
P_ACTION: 'NEW'
}; };
this.profileService this.profileService

@ -151,10 +151,13 @@
</ion-label> </ion-label>
</ion-col> </ion-col>
<ion-col size="2"> <ion-col size="2" *ngIf="basicDetailsSubMenu && basicDetailsSubMenu.UPDATE_BUTTON === 'Y'">
<img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png" <img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png"
(click)="allowEdit('basic')"> (click)="allowEdit('basic')">
</ion-col> </ion-col>
<ion-col size="2" *ngIf="basicDetailsSubMenu && basicDetailsSubMenu.ADD_BUTTON === 'Y'">
<ion-icon class="add-icon-styling" name="add"></ion-icon>
</ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<br> <br>
@ -182,7 +185,7 @@
</ion-card> </ion-card>
<ion-card *ngIf="addressSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' "> <ion-card *ngIf="addressSegment" [ngClass]="direction === 'ltr'? 'card-size-info-en': 'card-size-info-ar' ">
<!-- <ion-card-content *ngIf="!editAddress"> <ion-card-content *ngIf="!editAddress && employeeAdress">
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col size="10"> <ion-col size="10">
@ -191,42 +194,45 @@
</ion-label> </ion-label>
</ion-col> </ion-col>
<ion-col size="2"> <ion-col size="2" *ngIf="addressSubMenu && addressSubMenu.UPDATE_BUTTON === 'Y'" (click)="allowEdit('address')">
<img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png" <img style="width: 70%;" src="../assets/imgs/profile-icons/editing@2x.png"
(click)="allowEdit('address')"> (click)="allowEdit('address')">
</ion-col> </ion-col>
<ion-col size="2" *ngIf="addressSubMenu && addressSubMenu.ADD_BUTTON === 'Y'" (click)="allowEdit('address')">
<ion-icon class="add-icon-styling" name="add"></ion-icon>
</ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','address')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','address')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">Riyadh</h3> <h3 class="result-label-text-form">{{address}}</h3>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','street')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','street')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">-</h3> <h3 class="result-label-text-form">{{street}}</h3>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','area')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','area')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">-</h3> <h3 class="result-label-text-form">{{area}}</h3>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','p-o-box')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','p-o-box')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">22617</h3> <h3 class="result-label-text-form">{{poBox}}</h3>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','city')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','city')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">Riyadh</h3> <h3 class="result-label-text-form">{{city}}</h3>
<br> <br>
<ion-label> <ion-label>
<h3 class="type-label-text-form">{{ts.trPK('general','postal-code')}}</h3> <h3 class="type-label-text-form">{{ts.trPK('userProfile','postal-code')}}</h3>
</ion-label> </ion-label>
<h3 class="result-label-text-form">11416</h3> <h3 class="result-label-text-form">{{postalCode}}</h3>
<br> <br>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>
@ -245,11 +251,11 @@
</ion-grid> </ion-grid>
</ion-footer> --> </ion-footer> -->
<ion-card-content> <!-- <ion-card-content>
<ion-grid> <ion-grid>
<ion-row> <ion-row>
<ion-col> <!-- Add condition employeeAdress here --> <ion-col>
<ion-button (click)="presentModal()" class="add" >Update <ion-button (click)="presentModal()" class="add" >Update
</ion-button> </ion-button>
</ion-col> </ion-col>
@ -258,7 +264,6 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
</ion-card-content> </ion-card-content> -->
</ion-card>
</ion-content> </ion-content>

@ -1075,4 +1075,11 @@ $actionBtnSize: 36px;
} }
.add{ .add{
--background: #00bcd4; background: white; width: 100%; --background: #00bcd4; background: white; width: 100%;
}
.add-icon-styling {
background-color: #191814;
width: 35px;
height: 35px;
color: white;
border-radius: 50%;
} }

@ -41,7 +41,13 @@ export class HomeComponent implements OnInit {
public menuEntries: any; public menuEntries: any;
public basicDetailsSubMenu: any; public basicDetailsSubMenu: any;
public addressSubMenu: any; public addressSubMenu: any;
transactionNo = 0; public transactionNo = 0;
public address: any;
public street: any;
public area: any;
public poBox: any;
public city: any;
public postalCode: any;
public employeeAdress: any = []; public employeeAdress: any = [];
constructor( constructor(
@ -65,12 +71,20 @@ export class HomeComponent implements OnInit {
this.targetValue = params.targetValue; this.targetValue = params.targetValue;
if (this.targetValue === 'sideMenu') { if (this.targetValue === 'sideMenu') {
this.personalInfoSegment = true; this.personalInfoSegment = true;
this.basicDetailsSegment = false;
this.addressSegment = false;
} else if (this.targetValue === 'basicDetails') { } else if (this.targetValue === 'basicDetails') {
this.personalInfoSegment = false;
this.basicDetailsSegment = true; this.basicDetailsSegment = true;
this.addressSegment = false;
} else if (this.targetValue === 'address') { } else if (this.targetValue === 'address') {
this.personalInfoSegment = false;
this.basicDetailsSegment = false;
this.addressSegment = true; this.addressSegment = true;
} else { } else {
this.personalInfoSegment = true; this.personalInfoSegment = true;
this.basicDetailsSegment = false;
this.addressSegment = false;
} }
}); });
} }
@ -106,7 +120,27 @@ export class HomeComponent implements OnInit {
} }
console.log(this.basicDetailsSubMenu); console.log(this.basicDetailsSubMenu);
console.log(this.addressSubMenu); console.log(this.addressSubMenu);
}
public getProfile() {
console.log('getProfile');
this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
console.log(user);
this.personalInfo = user;
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {
this.user_image = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: '../assets/imgs/profile.png';
}
this.getBasicDetails();
this.getAddress();
}
});
} }
public getBasicDetails() { public getBasicDetails() {
@ -119,7 +153,6 @@ export class HomeComponent implements OnInit {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.employeeBasicDetails = result.GetEmployeeBasicDetailsList; this.employeeBasicDetails = result.GetEmployeeBasicDetailsList;
console.log(this.employeeBasicDetails); console.log(this.employeeBasicDetails);
this.getAddress();
for (let i = 0; i < this.employeeBasicDetails.length; i++) { for (let i = 0; i < this.employeeBasicDetails.length; i++) {
if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'FULL_NAME') { if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'FULL_NAME') {
this.fullName = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP; this.fullName = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP;
@ -135,24 +168,31 @@ export class HomeComponent implements OnInit {
}); });
} }
public getProfile() { public getAddress() {
console.log('getProfile'); const body = {
this.authService P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER,
.loadAuthenticatedUser() P_MENU_TYPE: "E",
.subscribe((user: AuthenticatedUser) => { P_SELECTED_RESP_ID: -999
if (user) { };
console.log(user); this.profileService.getEmployeeAddress(body).subscribe((result) => {
this.personalInfo = user; console.log(result);
if (this.cs.getUpdateImage().status) { this.employeeAdress = result.GetEmployeeAddressList;
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img); for (let i = 0; i < this.employeeAdress.length; i++) {
} else { if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'ADDRESS_LINE1') {
this.user_image = user.EMPLOYEE_IMAGE this.address = this.employeeAdress[i].SEGMENT_VALUE_DSP;
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE } else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'REGION_1') {
: '../assets/imgs/profile.png'; this.street = this.employeeAdress[i].SEGMENT_VALUE_DSP;
} } else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'REGION_2') {
this.getBasicDetails(); this.area = this.employeeAdress[i].SEGMENT_VALUE_DSP;
} else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'REGION_3') {
this.poBox = this.employeeAdress[i].SEGMENT_VALUE_DSP;
} else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'TOWN_OR_CITY') {
this.city = this.employeeAdress[i].SEGMENT_VALUE_DSP;
} else if (this.employeeAdress[i].APPLICATION_COLUMN_NAME === 'POSTAL_CODE') {
this.postalCode = this.employeeAdress[i].SEGMENT_VALUE_DSP;
} }
}); }
})
} }
public openEditprofile() { public openEditprofile() {
@ -228,7 +268,7 @@ export class HomeComponent implements OnInit {
this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData'); this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: undefined, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddBasicDetails(); this.cs.openAddBasicDetails();
} else { } else {
// this.cs.openProfile('address'); this.cs.openAddAddress();
} }
} }
@ -251,21 +291,11 @@ export class HomeComponent implements OnInit {
return await modal.present(); return await modal.present();
} }
updateImageProfile() { public updateImageProfile() {
this.cs.openChangeImagePage(); this.cs.openChangeImagePage();
} }
getAddress() {
const body = { public openAddAddress() {
P_SELECTED_EMPLOYEE_NUMBER: this.personalInfo.EMPLOYEE_NUMBER,
P_MENU_TYPE: "E",
P_SELECTED_RESP_ID: -999
};
this.profileService.getEmployeeAddress(body).subscribe((result) => {
console.log(result);
this.employeeAdress = result.GetEmployeeAddressList;
})
}
openAddAddress() {
this.cs.openAddAddress(); this.cs.openAddAddress();
} }
} }

Loading…
Cancel
Save