fix(employee-management): can now set last work day of employee to null properly

This commit is contained in:
Nicolas Drolet 2025-12-04 11:47:24 -05:00
parent 2affa8470b
commit fa62fb5ba1
3 changed files with 15 additions and 7 deletions

View File

@ -9,6 +9,13 @@
const last_work_day = computed(() => employee_store.employee.last_work_day ?? '---'); const last_work_day = computed(() => employee_store.employee.last_work_day ?? '---');
const is_first_day_picker_open = ref(false); const is_first_day_picker_open = ref(false);
const is_last_day_picker_open = ref(false); const is_last_day_picker_open = ref(false);
const setLastWorkDay = (date: string | number | null) => {
if (typeof date === 'string' && date.length > 0) {
employee_store.employee.last_work_day = date;
}
employee_store.employee.last_work_day = null;
}
</script> </script>
<template> <template>
@ -224,6 +231,7 @@
label-slot label-slot
mask="####-##-##" mask="####-##-##"
class="col q-mx-md" class="col q-mx-md"
@update:model-value="setLastWorkDay"
> >
<template #label> <template #label>
<span <span

View File

@ -30,7 +30,7 @@
@show="Object.assign(initial_employee_profile, employee_store.employee)" @show="Object.assign(initial_employee_profile, employee_store.employee)"
> >
<div <div
class="column bg-secondary rounded-10" class="column bg-secondary rounded-10 no-wrap"
:class="$q.dark.isActive ? 'shadow-24' : 'shadow-10'" :class="$q.dark.isActive ? 'shadow-24' : 'shadow-10'"
:style="($q.screen.lt.md ? ' ' : 'max-width: 60vw !important; height: 60vh') + :style="($q.screen.lt.md ? ' ' : 'max-width: 60vw !important; height: 60vh') +
($q.dark.isActive ? 'border: 2px solid var(--q-accent)' : '')" ($q.dark.isActive ? 'border: 2px solid var(--q-accent)' : '')"
@ -50,25 +50,25 @@
<q-slide-transition> <q-slide-transition>
<div <div
v-if="current_step === 'access'" v-if="current_step === 'access'"
class="col-12 row flex-center q-px-sm q-py-xs bg-accent" class="col-12 row flex-center q-px-sm q-py-xs bg-accent no-wrap"
> >
<q-icon <q-icon
name="info_outline" name="info_outline"
color="white" color="white"
size="sm" size="sm"
class="self-end q-mr-sm" class="col-auto q-mr-sm"
/> />
<q-item-label <q-item-label
caption caption
class="text-white text-weight-medium" class="col text-white"
>{{ $t('employee_management.module_access.usage_description') }}</q-item-label> >{{ $t('employee_management.module_access.usage_description') }}</q-item-label>
</div> </div>
</q-slide-transition> </q-slide-transition>
</div> </div>
<div class="col column q-pa-md"> <div class="col column q-pa-md no-wrap">
<div class="col"> <div class="col">
<transition <transition
:enter-active-class="'animated ' + transition_in_animation" :enter-active-class="'animated ' + transition_in_animation"

View File

@ -13,7 +13,7 @@ export class EmployeeProfile {
email: string; email: string;
phone_number: string; phone_number: string;
first_work_day: string; first_work_day: string;
last_work_day: string; last_work_day?: string | null;
external_payroll_id: number; external_payroll_id: number;
residence: string; residence: string;
birth_date: string; birth_date: string;
@ -28,7 +28,7 @@ export class EmployeeProfile {
this.email = ''; this.email = '';
this.phone_number = ''; this.phone_number = '';
this.first_work_day = ''; this.first_work_day = '';
this.last_work_day = ''; this.last_work_day = null;
this.residence = ''; this.residence = '';
this.birth_date = ''; this.birth_date = '';
this.external_payroll_id = -1; this.external_payroll_id = -1;