Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-09-18 14:29:29 +02:00
commit 7b70734eb8
2 changed files with 11 additions and 4 deletions

View File

@ -11,7 +11,7 @@ import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters'; import { dateRange } from 'src/filters';
defineProps({ dataKey: { type: String, required: true } }); defineProps({ dataKey: { type: String, required: true } });
const { t } = useI18n(); const { t, te } = useI18n();
const warehouses = ref(); const warehouses = ref();
const groupedStates = ref(); const groupedStates = ref();
@ -26,6 +26,12 @@ const handleScopeDays = (params, days, callback) => {
} }
if (callback) callback(); if (callback) callback();
}; };
const getLocale = (label) => {
const param = label.split('.').at(-1);
const globalLocale = `globals.params.${param}`;
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
};
</script> </script>
<template> <template>
<FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" /> <FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" />
@ -43,10 +49,11 @@ const handleScopeDays = (params, days, callback) => {
:hidden-tags="['from', 'to', 'search']" :hidden-tags="['from', 'to', 'search']"
:custom-tags="['scopeDays']" :custom-tags="['scopeDays']"
:unremovable-params="['from', 'to', 'scopeDays']" :unremovable-params="['from', 'to', 'scopeDays']"
search-url="saleMonitorTickets"
> >
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs"> <div class="q-gutter-x-xs">
<strong v-text="`${t(`params.${tag.label}`)}:`" /> <strong v-text="`${getLocale(tag.label)}:`" />
<span v-text="formatFn(tag.value)" /> <span v-text="formatFn(tag.value)" />
</div> </div>
</template> </template>
@ -110,7 +117,7 @@ const handleScopeDays = (params, days, callback) => {
url="Workers/search" url="Workers/search"
:params="{ departmentCodes: ['VT'] }" :params="{ departmentCodes: ['VT'] }"
is-outlined is-outlined
option-value="code" option-value="id"
option-label="name" option-label="name"
:no-one="true" :no-one="true"
> >

View File

@ -109,7 +109,7 @@ const getEntryQueryParams = (supplier) => {
:subtitle="data.subtitle" :subtitle="data.subtitle"
:filter="filter" :filter="filter"
@on-fetch="setData" @on-fetch="setData"
data-key="supplier" data-key="supplierDescriptor"
:summary="$props.summary" :summary="$props.summary"
> >
<template #body="{ entity }"> <template #body="{ entity }">