employee profile issues

This commit is contained in:
mashfiq 2025-02-12 11:12:32 +06:00
parent 6e8a28a477
commit 083ae15e1e
6 changed files with 22 additions and 4 deletions

View File

@ -27,7 +27,9 @@
<p-tabView [scrollable]="true">
<p-tabPanel header="General" leftIcon="pi pi-user">
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo" (defaultNationalityHandler)="defaultNationalityHandler($event)"></app-general>
<app-general [isActive]="!newEmployee" [employeeNo]="this.employeeService.hrEmployee.employeeNo"
(defaultNationalityHandler)="defaultNationalityHandler($event)"
(defaultEmployeeTypeHandler)="defaultEmployeeTypeHandler($event)"></app-general>
</p-tabPanel>
<p-tabPanel header="Contacts" leftIcon="pi pi-phone">
<app-contact (saveContact)="saveContact($event)"></app-contact>

View File

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

View File

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

View File

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

View File

@ -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<Nationality>();
@Output() defaultEmployeeTypeHandler = new EventEmitter<Category>();
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;

View File

@ -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) {