Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
This commit is contained in:
commit
621d98b32b
|
@ -113,8 +113,15 @@ const $props = defineProps({
|
|||
});
|
||||
|
||||
const mixinRules = [requiredFieldRule, ...($attrs.rules ?? [])];
|
||||
const { optionLabel, optionValue, optionFilter, optionFilterValue, options, modelValue } =
|
||||
toRefs($props);
|
||||
const {
|
||||
optionLabel,
|
||||
optionValue,
|
||||
optionCaption,
|
||||
optionFilter,
|
||||
optionFilterValue,
|
||||
options,
|
||||
modelValue,
|
||||
} = toRefs($props);
|
||||
const myOptions = ref([]);
|
||||
const myOptionsOriginal = ref([]);
|
||||
const vnSelectRef = ref();
|
||||
|
@ -321,6 +328,11 @@ function handleKeyDown(event) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getCaption(opt) {
|
||||
if (optionCaption.value === false) return;
|
||||
return opt[optionCaption.value] || opt[optionValue.value];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -391,8 +403,8 @@ function handleKeyDown(event) {
|
|||
<QItemLabel>
|
||||
{{ opt[optionLabel] }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption v-if="optionCaption !== false">
|
||||
{{ `#${opt[optionCaption] || opt[optionValue]}` }}
|
||||
<QItemLabel caption v-if="getCaption(opt)">
|
||||
{{ `#${getCaption(opt)}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -208,13 +208,30 @@ const getWorkedHours = async (from, to) => {
|
|||
};
|
||||
|
||||
const getAbsences = async () => {
|
||||
const params = {
|
||||
workerFk: route.params.id,
|
||||
businessFk: null,
|
||||
year: startOfWeek.value.getFullYear(),
|
||||
const startYear = startOfWeek.value.getFullYear();
|
||||
const endYear = endOfWeek.value.getFullYear();
|
||||
const defaultParams = { workerFk: route.params.id, businessFk: null };
|
||||
|
||||
const startData = (
|
||||
await axios.get('Calendars/absences', {
|
||||
params: { ...defaultParams, year: startYear },
|
||||
})
|
||||
).data;
|
||||
|
||||
let endData;
|
||||
if (startYear !== endYear) {
|
||||
endData = (
|
||||
await axios.get('Calendars/absences', {
|
||||
params: { ...defaultParams, year: endYear },
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
const data = {
|
||||
holidays: [...(startData?.holidays || []), ...(endData?.holidays || [])],
|
||||
absences: [...(startData?.absences || []), ...(endData?.absences || [])],
|
||||
};
|
||||
|
||||
const { data } = await axios.get('Calendars/absences', { params });
|
||||
if (data) addEvents(data);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue