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';
|
||||
|
||||
defineProps({ dataKey: { type: String, required: true } });
|
||||
const { t } = useI18n();
|
||||
const { t, te } = useI18n();
|
||||
const warehouses = ref();
|
||||
const groupedStates = ref();
|
||||
|
||||
|
@ -26,6 +26,12 @@ const handleScopeDays = (params, days, 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>
|
||||
<template>
|
||||
<FetchData url="Warehouses" auto-load @on-fetch="(data) => (warehouses = data)" />
|
||||
|
@ -43,10 +49,11 @@ const handleScopeDays = (params, days, callback) => {
|
|||
:hidden-tags="['from', 'to', 'search']"
|
||||
:custom-tags="['scopeDays']"
|
||||
:unremovable-params="['from', 'to', 'scopeDays']"
|
||||
search-url="saleMonitorTickets"
|
||||
>
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<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)" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -110,7 +117,7 @@ const handleScopeDays = (params, days, callback) => {
|
|||
url="Workers/search"
|
||||
:params="{ departmentCodes: ['VT'] }"
|
||||
is-outlined
|
||||
option-value="code"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:no-one="true"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue