roster assignment type addition

This commit is contained in:
mashfiq 2025-02-05 15:02:49 +06:00
parent f418e7ab3d
commit 6e8a28a477
3 changed files with 49 additions and 10 deletions

View File

@ -13,7 +13,7 @@ export class ApiService {
public isSSO = false;
public versionDeployement = false;
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 0, 16))}-`+"01";
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 5))}-`+"01";
public static BASE_URL = '';
public base_url = '';
// public currentLink = '';

View File

@ -11,13 +11,25 @@
<app-employee-picker [MultiSelect]="true"
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
</div>
<div class="rosterAssignmentControls">
<strong>
<label>Roster Type: </label>
</strong>
</div>
<div class="rosterAssignmentControls">
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanTypeIsFixed" [data]="workPlanTypes"
[defaultItem]="{ text: 'Select Roster Type..', value: null }" [textField]="'text'" [valueField]="'value'"
(valueChange)="onChangeWorkPlanType($event)" [valuePrimitive]="true"
class="form-control form-control-sm input-sm" formControlName="type">
</kendo-dropdownlist>
</div>
<div class="rosterAssignmentControls">
<strong>
<label>Roster: </label>
</strong>
</div>
<div class="rosterAssignmentControls">
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupList"
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupListByType"
[defaultItem]="{ name: 'Select..', value: null }" [textField]="'name'" [valueField]="'id'"
(valueChange)="populateEmpWorkPlanByWorkGroup($event)" [valuePrimitive]="true"
class="form-control form-control-sm input-sm" formControlName="group">

View File

@ -31,16 +31,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
workPlanGroupName = '';
workPlanGroupInitialShift = '';
workPlanGroupList: WorkPlanGroup[];
workPlanGroupListByType: WorkPlanGroup[] = [];
selectedEmployees: SearchEmployee[];
employees: Employee[];
empIds: number[] = [];
exportExcelFileName: string = '';
selectedWorkPlanTypeIsFixed: boolean;
selectedWorkPlanID: number;
fixedWorkPlan: boolean = true;
startDate: Date;
holidayDayOfWeekArray = Object.values(HolidayDayOfWeek);
workPlanTypes: { text: string, value: boolean| null }[] = [
{ text: 'Fixed', value: true },
{ text: 'Counter Clock', value: false }
]
constructor(public employeeService: EmployeeServices,
public attendanceServices: AttendanceServices,
public apiService: ApiService,
@ -85,6 +92,7 @@ export class EchotexRosterAssignmentComponent implements OnInit {
createForm() {
this.rosterAssignmentForm = new FormBuilder().group({
type: ['', Validators.required],
group: ['', Validators.required],
startDate: [''],
});
@ -202,13 +210,13 @@ export class EchotexRosterAssignmentComponent implements OnInit {
this.loadingPanel.ShowLoadingPanel = true;
this.empWorkPlanSetupList = [];
debugger;
if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
(workPlanGroup.type != undefined || workPlanGroup.type != null)) {
this.fixedWorkPlan = false;
this.startDate = new Date();
} else {
this.fixedWorkPlan = true;
}
// if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
// (workPlanGroup.type != undefined || workPlanGroup.type != null)) {
// this.fixedWorkPlan = false;
// this.startDate = new Date();
// } else {
// this.fixedWorkPlan = true;
// }
this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe(
(resp) => {
this.empWorkPlanSetupList = resp;
@ -365,4 +373,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
// return dayIndex as EnumDayOfWeek;
// }
onChangeWorkPlanType(type: any) {
this.empWorkPlanSetupList = [];
this.workPlanGroupListByType = [];
this.selectedWorkPlanID = null;
this.fixedWorkPlan = true;
if (type == undefined || type == null) {
return;
}
else if (type){
this.workPlanGroupListByType = this.workPlanGroupList.filter(y => y.type == EnumWorkPlanGroup.Fixed);
}
else {
this.workPlanGroupListByType = this.workPlanGroupList.filter(y => y.type != EnumWorkPlanGroup.Fixed);
this.fixedWorkPlan = false;
this.startDate = new Date();
}
}
}