roster assignment type addition
This commit is contained in:
parent
f418e7ab3d
commit
6e8a28a477
|
@ -13,7 +13,7 @@ export class ApiService {
|
||||||
|
|
||||||
public isSSO = false;
|
public isSSO = false;
|
||||||
public versionDeployement = 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 static BASE_URL = '';
|
||||||
public base_url = '';
|
public base_url = '';
|
||||||
// public currentLink = '';
|
// public currentLink = '';
|
||||||
|
|
|
@ -11,13 +11,25 @@
|
||||||
<app-employee-picker [MultiSelect]="true"
|
<app-employee-picker [MultiSelect]="true"
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
||||||
</div>
|
</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">
|
<div class="rosterAssignmentControls">
|
||||||
<strong>
|
<strong>
|
||||||
<label>Roster: </label>
|
<label>Roster: </label>
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="rosterAssignmentControls">
|
<div class="rosterAssignmentControls">
|
||||||
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupList"
|
<kendo-dropdownlist [(ngModel)]="selectedWorkPlanID" [data]="workPlanGroupListByType"
|
||||||
[defaultItem]="{ name: 'Select..', value: null }" [textField]="'name'" [valueField]="'id'"
|
[defaultItem]="{ name: 'Select..', value: null }" [textField]="'name'" [valueField]="'id'"
|
||||||
(valueChange)="populateEmpWorkPlanByWorkGroup($event)" [valuePrimitive]="true"
|
(valueChange)="populateEmpWorkPlanByWorkGroup($event)" [valuePrimitive]="true"
|
||||||
class="form-control form-control-sm input-sm" formControlName="group">
|
class="form-control form-control-sm input-sm" formControlName="group">
|
||||||
|
|
|
@ -31,16 +31,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
workPlanGroupName = '';
|
workPlanGroupName = '';
|
||||||
workPlanGroupInitialShift = '';
|
workPlanGroupInitialShift = '';
|
||||||
workPlanGroupList: WorkPlanGroup[];
|
workPlanGroupList: WorkPlanGroup[];
|
||||||
|
workPlanGroupListByType: WorkPlanGroup[] = [];
|
||||||
selectedEmployees: SearchEmployee[];
|
selectedEmployees: SearchEmployee[];
|
||||||
employees: Employee[];
|
employees: Employee[];
|
||||||
empIds: number[] = [];
|
empIds: number[] = [];
|
||||||
exportExcelFileName: string = '';
|
exportExcelFileName: string = '';
|
||||||
|
|
||||||
|
selectedWorkPlanTypeIsFixed: boolean;
|
||||||
selectedWorkPlanID: number;
|
selectedWorkPlanID: number;
|
||||||
fixedWorkPlan: boolean = true;
|
fixedWorkPlan: boolean = true;
|
||||||
startDate: Date;
|
startDate: Date;
|
||||||
holidayDayOfWeekArray = Object.values(HolidayDayOfWeek);
|
holidayDayOfWeekArray = Object.values(HolidayDayOfWeek);
|
||||||
|
|
||||||
|
workPlanTypes: { text: string, value: boolean| null }[] = [
|
||||||
|
{ text: 'Fixed', value: true },
|
||||||
|
{ text: 'Counter Clock', value: false }
|
||||||
|
]
|
||||||
|
|
||||||
constructor(public employeeService: EmployeeServices,
|
constructor(public employeeService: EmployeeServices,
|
||||||
public attendanceServices: AttendanceServices,
|
public attendanceServices: AttendanceServices,
|
||||||
public apiService: ApiService,
|
public apiService: ApiService,
|
||||||
|
@ -85,6 +92,7 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
|
|
||||||
createForm() {
|
createForm() {
|
||||||
this.rosterAssignmentForm = new FormBuilder().group({
|
this.rosterAssignmentForm = new FormBuilder().group({
|
||||||
|
type: ['', Validators.required],
|
||||||
group: ['', Validators.required],
|
group: ['', Validators.required],
|
||||||
startDate: [''],
|
startDate: [''],
|
||||||
});
|
});
|
||||||
|
@ -202,13 +210,13 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
this.loadingPanel.ShowLoadingPanel = true;
|
this.loadingPanel.ShowLoadingPanel = true;
|
||||||
this.empWorkPlanSetupList = [];
|
this.empWorkPlanSetupList = [];
|
||||||
debugger;
|
debugger;
|
||||||
if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
|
// if (workPlanGroup.type != EnumWorkPlanGroup.Fixed &&
|
||||||
(workPlanGroup.type != undefined || workPlanGroup.type != null)) {
|
// (workPlanGroup.type != undefined || workPlanGroup.type != null)) {
|
||||||
this.fixedWorkPlan = false;
|
// this.fixedWorkPlan = false;
|
||||||
this.startDate = new Date();
|
// this.startDate = new Date();
|
||||||
} else {
|
// } else {
|
||||||
this.fixedWorkPlan = true;
|
// this.fixedWorkPlan = true;
|
||||||
}
|
// }
|
||||||
this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe(
|
this.attendanceServices.getEmployeeWorkPlanSetupByWPGroupID(workPlanGroup.id).subscribe(
|
||||||
(resp) => {
|
(resp) => {
|
||||||
this.empWorkPlanSetupList = resp;
|
this.empWorkPlanSetupList = resp;
|
||||||
|
@ -331,7 +339,7 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getHolidayDayOfWeek( day: number): string {
|
public getHolidayDayOfWeek(day: number): string {
|
||||||
debugger;
|
debugger;
|
||||||
day = day + 1;
|
day = day + 1;
|
||||||
switch (day) {
|
switch (day) {
|
||||||
|
@ -365,4 +373,23 @@ export class EchotexRosterAssignmentComponent implements OnInit {
|
||||||
// return dayIndex as EnumDayOfWeek;
|
// 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user