refs #6842 isFreelance #348
|
@ -13,7 +13,7 @@ import axios from 'axios';
|
|||
const stateStore = useStateStore();
|
||||
carlossa marked this conversation as resolved
|
||||
const route = useRoute();
|
||||
carlossa marked this conversation as resolved
alexm
commented
Habéis duplicado esta linea @jsegarra Habéis duplicado esta linea @jsegarra
jsegarra
commented
mmm, creo que no. 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
alexm
commented
Habéis duplicado esta linea @jsegarra Habéis duplicado esta linea @jsegarra
jsegarra
commented
mmm, creo que no. 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
alexm
commented
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>
|
||||
|
|
Loading…
Reference in New Issue
Habéis duplicado esta linea @jsegarra