refs #6842 isFreelance #348

Merged
carlossa merged 4 commits from 6842-errorCalendar into dev 2024-05-08 10:21:28 +00:00
1 changed files with 14 additions and 2 deletions
Showing only changes of commit 710b45f43a - Show all commits

View File

@ -13,7 +13,7 @@ import axios from 'axios';
const stateStore = useStateStore();
carlossa marked this conversation as resolved
Review

Habéis duplicado esta linea @jsegarra

Habéis duplicado esta linea @jsegarra
const route = useRoute();
carlossa marked this conversation as resolved
Review

Habéis duplicado esta linea @jsegarra

Habéis duplicado esta linea @jsegarra
Review

mmm, creo que no.
Hemos añadido useRouter y lo que habia es useRoute
useRouter!==useRoute

mmm, creo que no. Hemos añadido useRouter y lo que habia es useRoute useRouter!==useRoute
const { t } = useI18n();
const workerIsFreelance = ref();
carlossa marked this conversation as resolved
Review

Habéis duplicado esta linea @jsegarra

Habéis duplicado esta linea @jsegarra
Review

mmm, creo que no.
Hemos añadido useRouter y lo que habia es useRoute
useRouter!==useRoute

mmm, creo que no. Hemos añadido useRouter y lo que habia es useRoute useRouter!==useRoute
const workerCalendarFilterRef = ref(null);
const workerCalendarRef = ref(null);
const absenceType = ref(null);
@ -32,6 +32,12 @@ const onFetchActiveContract = (data) => {
hasWorkCenter.value = Boolean(data?.workCenterFk);
};
carlossa marked this conversation as resolved
Review

Entonces esta variable ya no se usa

Entonces esta variable ya no se usa
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];
@ -128,6 +134,7 @@ const refreshData = () => {
updateYearHolidays();
updateContractHolidays();
getAbsences();
isFreelance();
};
const onDeletedEvent = (timestamp) => {
@ -151,6 +158,11 @@ watch([year, businessFk], () => refreshData());
@on-fetch="(data) => (isSubordinate = data)"
auto-load
/>
<FetchData
:url="`Workers/${route.params.id}`"
@on-fetch="(data) => (workerIsFreelance = data.isFreelance)"
auto-load
/>
<template v-if="stateStore.isHeaderMounted()">
<Teleport to="#actions-append">
<div class="row q-gutter-x-sm">
@ -181,7 +193,7 @@ watch([year, businessFk], () => refreshData());
</QScrollArea>
</QDrawer>
<QPage class="column items-center">
<QCard v-if="!hasWorkCenter">
<QCard v-if="workerIsFreelance">
<QCardSection class="text-center">
{{ t('Autonomous worker') }}
</QCardSection>