Merge pull request 'fix: refs #7353 sales person filter and locale' (!724) from 7353-hotfix-fixFilter into master
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #724 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
aa33e42701
|
@ -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"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue