From 083ae15e1e7e8df2179c5f43b190169ebffffa3c Mon Sep 17 00:00:00 2001 From: mashfiq Date: Wed, 12 Feb 2025 11:12:32 +0600 Subject: [PATCH] employee profile issues --- .../employee-profile.component.html | 4 +++- .../employee-profile/employee-profile.component.ts | 6 ++++++ .../children-list/children-list.component.ts | 1 + .../spouse/spouse-list/spouse-list.component.ts | 1 + .../employee-profile/general/general.component.ts | 13 ++++++++++--- .../nominee/nominee-list/nominee-list.component.ts | 1 + 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html index a8aa423..ed3b9cd 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.html @@ -27,7 +27,9 @@ - + diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts index c9e8038..f93da83 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/employee-profile.component.ts @@ -12,6 +12,7 @@ import { loadingPanelService } from '../../hrm-loding panel/loding.panel.service import { HRMNotificationService } from '../../app.notification.service'; import { DomSanitizer } from '@angular/platform-browser'; import { Nationality } from '../nationality/nationality'; +import { Category } from 'src/app/_models/Basic/category'; @Component({ selector: 'app-employee-profile', @@ -32,6 +33,7 @@ export class EmployeeProfileComponent implements OnInit { fileType = ''; isDisplay = false; defaultNationality: Nationality; + defaultEmployeeType: Category; constructor(private fb: FormBuilder, public employeeService: EmployeeServices, public basicService: BasicService, @@ -267,6 +269,7 @@ export class EmployeeProfileComponent implements OnInit { this.hrEmployeeProfile.birthDate = new Date(); this.hrEmployeeProfile.joiningDate = new Date(); this.hrEmployeeProfile.nationalityID = this.defaultNationality != null ? this.defaultNationality.id : null; + this.hrEmployeeProfile.categoryID = this.defaultEmployeeType != null ? this.defaultEmployeeType.id : null; } this.employeeService.Employee_Get_Completed.next(this.hrEmployeeProfile); } @@ -319,5 +322,8 @@ export class EmployeeProfileComponent implements OnInit { defaultNationalityHandler(dataItem: Nationality) { this.defaultNationality = dataItem; } + defaultEmployeeTypeHandler(dataItem: Category) { + this.defaultEmployeeType = dataItem; + } } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts index 5dbe1a0..c338f7d 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/children/children-list/children-list.component.ts @@ -67,6 +67,7 @@ export class ChildrenListComponent implements OnInit { addNew() { this.editIndex = -1; this.empChildren = new EmpChildren(); + this.empChildren.birthDate = new Date(); this.isDisplay = true; } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts index 0e43d2f..27400e7 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/family/spouse/spouse-list/spouse-list.component.ts @@ -68,6 +68,7 @@ export class SpouseListComponent implements OnInit { addNew() { this.editIndex = -1; this.empSpouse = new EmpSpouse(); + this.empSpouse.marriageDate = new Date(); this.isDisplay = true; } diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts index 4b25e67..0c16708 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/general/general.component.ts @@ -115,6 +115,7 @@ export class GeneralComponent implements OnInit { pickerEmployee: SearchEmployee; nationalities: Nationality[]; defaultNationality: Nationality; + defaultEmployeeType: Category; nameBangla: string = 'asasas'; defaultPhoto = "assets/photos/profile-default.jpg"; photoPath = "Documents/EMPPHOTO"; @@ -127,6 +128,7 @@ export class GeneralComponent implements OnInit { isAccessCard: boolean = false; @Output() defaultNationalityHandler = new EventEmitter(); + @Output() defaultEmployeeTypeHandler = new EventEmitter(); constructor(public employeeService: EmployeeServices, public basicService: BasicService, public notificationService: HRMNotificationService, @@ -157,6 +159,11 @@ export class GeneralComponent implements OnInit { }, () => { + this.defaultEmployeeType = this.employeeTypes.find(x => x.name.toLowerCase() == "worker"); + if (this.defaultEmployeeType != undefined) { + // this.hrEmployee.categoryID = this.defaultEmployeeType.id; + this.defaultEmployeeTypeHandler.emit(this.defaultEmployeeType); + } } ); @@ -179,8 +186,8 @@ export class GeneralComponent implements OnInit { () => { this.defaultNationality = this.nationalities.find(x => x.description.toLowerCase() == "bangladeshi"); if (this.defaultNationality) { - this.hrEmployee.nationalityID = this.defaultNationality.id; - this.defaultNationalityHandler.emit(this.defaultNationality); + // this.hrEmployee.nationalityID = this.defaultNationality.id; + this.defaultNationalityHandler.emit(this.defaultNationality); } } ); @@ -462,7 +469,7 @@ export class GeneralComponent implements OnInit { // } this.employeeService.saveHrPersonalInfo(this.hrEmployee).subscribe( (resp: HrEmployee) => { - if(resp != undefined){ + if (resp != undefined) { this.hrEmployee.id = resp.id; if (this.active == false) { this.hrEmployee.employeeNo = resp.employeeNo; diff --git a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts index df3fc12..b7039fe 100644 --- a/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts +++ b/HRM.UI/ClientApp/src/app/core-hr/employee-profile/nominee/nominee-list/nominee-list.component.ts @@ -86,6 +86,7 @@ export class NomineeListComponent implements OnInit { this.editIndex = -1; this.nominee = new EmpNominee(); this.nominee.employeeID = this.employeeService.hrEmployee.id; + this.nominee.percentage = 100; this.isDisplay = true; } public editHandler(rowIndex: any) {