This commit is contained in:
parent
743faef956
commit
ac0993aa11
|
@ -16,6 +16,7 @@ const stateStore = useStateStore();
|
|||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const workerIsFreelance = ref();
|
||||
const WorkerFreelanceRef = ref();
|
||||
const workerCalendarFilterRef = ref(null);
|
||||
const workerCalendarRef = ref(null);
|
||||
const absenceType = ref(null);
|
||||
|
@ -34,12 +35,6 @@ const onFetchActiveContract = (data) => {
|
|||
hasWorkCenter.value = Boolean(data?.workCenterFk);
|
||||
};
|
||||
|
||||
const isFreelance = async () => {
|
||||
const { data } = await axios.get(`Workers/${route.params.id}`);
|
||||
|
||||
workerIsFreelance.value = data.isFreelance;
|
||||
};
|
||||
|
||||
const addEvent = (day, newEvent, isFestive = false) => {
|
||||
const timestamp = new Date(day).getTime();
|
||||
let event = eventsMap.value[timestamp];
|
||||
|
@ -136,7 +131,7 @@ const refreshData = () => {
|
|||
updateYearHolidays();
|
||||
updateContractHolidays();
|
||||
getAbsences();
|
||||
isFreelance();
|
||||
WorkerFreelanceRef.value.fetch();
|
||||
};
|
||||
|
||||
const onDeletedEvent = (timestamp) => {
|
||||
|
@ -172,6 +167,7 @@ watch([year, businessFk], () => refreshData());
|
|||
<FetchData
|
||||
:url="`Workers/${route.params.id}`"
|
||||
@on-fetch="(data) => (workerIsFreelance = data.isFreelance)"
|
||||
ref="WorkerFreelanceRef"
|
||||
auto-load
|
||||
/>
|
||||
<template v-if="stateStore.isHeaderMounted()">
|
||||
|
|
Loading…
Reference in New Issue