|
|
|
@ -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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|