refs #6842 pr changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-05-07 10:20:26 +02:00
parent 743faef956
commit ac0993aa11
1 changed files with 3 additions and 7 deletions

View File

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