0
0
Fork 0

Merge with dev

This commit is contained in:
William Buezas 2024-04-12 16:55:51 -03:00
commit 9c7c98d64d
20 changed files with 2525 additions and 2696 deletions

View File

@ -93,13 +93,11 @@ module.exports = configure(function (/* ctx */) {
[
VueI18nPlugin({
runtimeOnly: false,
include: [
path.resolve(__dirname, './src/i18n/locale/**'),
path.resolve(__dirname, './src/pages/**/locale/**'),
],
}),
{
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
// you need to set i18n resource including paths !
include: path.resolve(__dirname, './src/i18n/**'),
},
],
],
},

View File

@ -1,6 +1,7 @@
import { boot } from 'quasar/wrappers';
import { createI18n } from 'vue-i18n';
import messages from 'src/i18n';
import { locales } from 'src/i18n/handle';
const i18n = createI18n({
locale: navigator.language || navigator.userLanguage,
@ -12,8 +13,9 @@ const i18n = createI18n({
legacy: false,
});
export default boot(({ app }) => {
export default boot(async ({ app }) => {
// Set i18n instance on app
await locales();
app.use(i18n);
});

View File

@ -1,17 +1,17 @@
<template>
<div id="row" class="q-gutter-md q-mb-md">
<div class="vn-row q-gutter-md q-mb-md">
<slot></slot>
</div>
</template>
<style lang="scss" scopped>
#row {
.vn-row {
display: flex;
> * {
flex: 1;
}
}
@media screen and (max-width: 800px) {
#row {
.vn-row {
flex-direction: column;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

17
src/i18n/handle.js Normal file
View File

@ -0,0 +1,17 @@
const modules = import.meta.glob(`../pages/**/locale/**.yml`);
import translations from './index';
const LOCALE_EXTENSION = '.yml';
export async function locales() {
for await (const module of Object.keys(modules)) {
const splittedFile = module.split('/');
const lang = splittedFile.pop().split(LOCALE_EXTENSION)[0];
const moduleFiles = splittedFile.join('/') + '/' + lang + LOCALE_EXTENSION;
import(moduleFiles).then((t) => {
Object.assign(translations[lang], t.default);
});
}
return translations;
}
export default translations;

View File

@ -1,9 +1,15 @@
import en from './en';
import es from './es';
export const localeEquivalence = {
'en':'en-GB'
const files = import.meta.glob(`./locale/*.yml`);
const translations = {};
for (const file in files) {
const lang = file.split('/').at(2).split('.')[0];
import(file).then((t) => {
translations[lang] = t.default;
});
}
export default {
en: en,
es: es,
export const localeEquivalence = {
en: 'en-GB',
};
export default translations;

1164
src/i18n/locale/en.yml Normal file

File diff suppressed because it is too large Load Diff

1161
src/i18n/locale/es.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -48,13 +48,17 @@ const zones = ref();
</QItem>
<QItem class="q-mb-sm">
<QItemSection>
<VnInput :label="t('Name')" v-model="params.name" is-outlined />
<VnInput
:label="t('customerFilter.filter.name')"
v-model="params.name"
is-outlined
/>
</QItemSection>
</QItem>
<QItem class="q-mb-sm">
<QItemSection>
<VnInput
:label="t('Social Name')"
:label="t('customerFilter.filter.socialName')"
v-model="params.socialName"
is-outlined
/>
@ -170,8 +174,6 @@ en:
params:
search: Contains
fi: FI
name: Name
socialName: Social Name
salesPersonFk: Salesperson
provinceFk: Province
city: City
@ -183,8 +185,6 @@ es:
params:
search: Contiene
fi: NIF
name: Nombre
socialName: Razón Social
salesPersonFk: Comercial
provinceFk: Provincia
city: Ciudad
@ -193,8 +193,6 @@ es:
zoneFk: Zona
postcode: CP
FI: NIF
Name: Nombre
Social Name: Razón social
Salesperson: Comercial
Province: Provincia
City: Ciudad

View File

@ -0,0 +1,4 @@
customerFilter:
filter:
name: Name
socialName: Social name

View File

@ -0,0 +1,4 @@
customerFilter:
filter:
name: Nombre
socialName: Razón Social

View File

@ -1,19 +1,19 @@
<script setup>
import { ref, onMounted } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import CrudModel from 'components/CrudModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
const route = useRoute();
const { params } = useRoute();
const { t } = useI18n();
const entryObservationsRef = ref(null);
const entryObservationsOptions = ref([]);
const selected = ref([]);
const sortEntryObservationOptions = (data) => {
entryObservationsOptions.value = [...data].sort((a, b) =>
@ -24,6 +24,29 @@ const sortEntryObservationOptions = (data) => {
onMounted(() => {
if (entryObservationsRef.value) entryObservationsRef.value.reload();
});
const columns = computed(() => [
{
name: 'observationType',
label: t('entry.notes.observationType'),
field: (row) => row.observationTypeFk,
sortable: true,
options: entryObservationsOptions.value,
required: true,
model: 'observationTypeFk',
optionValue: 'id',
optionLabel: 'description',
tabIndex: 1,
align: 'left',
},
{
name: 'description',
label: t('globals.description'),
field: (row) => row.description,
tabIndex: 2,
align: 'left',
},
]);
</script>
<template>
<FetchData
@ -37,65 +60,90 @@ onMounted(() => {
model="EntryAccount"
:filter="{
fields: ['id', 'entryFk', 'observationTypeFk', 'description'],
where: { entryFk: route.params.id },
where: { entryFk: params.id },
}"
ref="entryObservationsRef"
:default-remove="false"
:data-required="{ entryFk: route.params.id }"
:data-required="{ entryFk: params.id }"
v-model:selected="selected"
>
<template #body="{ rows, validate }">
<QCard class="q-pa-md">
<VnRow
v-for="(row, index) in rows"
:key="index"
class="row q-gutter-md q-mb-md"
>
<VnSelectFilter
:label="t('entry.notes.observationType')"
v-model="row.observationTypeFk"
:options="entryObservationsOptions"
:disable="!!row.id"
option-label="description"
option-value="id"
hide-selected
/>
<VnInput
:label="t('globals.description')"
v-model="row.description"
:rules="validate('EntryObservation.description')"
/>
<div class="row justify-center items-center">
<QIcon
name="delete"
size="sm"
class="cursor-pointer"
color="primary"
@click="entryObservationsRef.remove([row])"
>
<QTooltip>
{{ t('Remove note') }}
</QTooltip>
</QIcon>
<QTable
v-model:selected="selected"
:columns="columns"
:rows="rows"
:pagination="{ rowsPerPage: 0 }"
row-key="$index"
selection="multiple"
hide-pagination
:grid="$q.screen.lt.md"
table-header-class="text-left"
>
<template #body-cell-observationType="{ row, col }">
<QTd>
<VnSelectFilter
v-model="row[col.model]"
:options="col.options"
:option-value="col.optionValue"
:option-label="col.optionLabel"
:autofocus="col.tabIndex == 1"
input-debounce="0"
hide-selected
:required="true"
/>
</QTd>
</template>
<template #body-cell-description="{ row, col }">
<QTd>
<VnInput
:label="t('globals.description')"
v-model="row[col.name]"
:rules="validate('EntryObservation.description')"
/>
</QTd>
</template>
<template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 grid-style-transition">
<QCard bordered flat>
<QCardSection>
<QCheckbox v-model="props.selected" dense />
</QCardSection>
<QSeparator />
<QList dense>
<QItem>
<QItemSection>
<VnSelectFilter
v-model="props.row.observationTypeFk"
:options="entryObservationsOptions"
option-value="id"
option-label="description"
input-debounce="0"
hide-selected
:required="true"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('globals.description')"
v-model="props.row.description"
:rules="
validate('EntryObservation.description')
"
/>
</QItemSection>
</QItem>
</QList>
</QCard>
</div>
</VnRow>
<QIcon
name="add"
size="sm"
class="cursor-pointer"
color="primary"
@click="entryObservationsRef.insert()"
>
<QTooltip>
{{ t('Add note') }}
</QTooltip>
</QIcon>
</QCard>
</template>
</QTable>
</template>
</CrudModel>
<QPageSticky position="bottom-right" :offset="[25, 25]">
<QBtn fab color="primary" icon="add" @click="entryObservationsRef.insert()" />
</QPageSticky>
</template>
<i18n>
es:
Add note: Añadir nota

View File

@ -1,6 +1,8 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { onMounted } from 'vue';
import { useStateStore } from 'stores/useStateStore';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
@ -19,6 +21,11 @@ const props = defineProps({
const currenciesOptions = ref([]);
const companiesOptions = ref([]);
const suppliersOptions = ref([]);
const stateStore = useStateStore();
onMounted(async () => {
stateStore.rightDrawer = true;
});
</script>
<template>
@ -58,7 +65,7 @@ const suppliersOptions = ref([]);
<QItemSection>
<VnInput
v-model="params.search"
:label="t('params.search')"
:label="t('entryFilter.filter.search')"
is-outlined
/>
</QItemSection>
@ -67,7 +74,7 @@ const suppliersOptions = ref([]);
<QItemSection>
<VnInput
v-model="params.reference"
:label="t('params.reference')"
:label="t('entryFilter.filter.reference')"
is-outlined
/>
</QItemSection>
@ -210,8 +217,7 @@ const suppliersOptions = ref([]);
<i18n>
en:
params:
search: General search
reference: Reference
invoiceNumber: Invoice number
travelFk: Travel
companyFk: Company
@ -225,8 +231,7 @@ en:
isOrdered: Ordered
es:
params:
search: Búsqueda general
reference: Referencia
invoiceNumber: Núm. factura
travelFk: Envío
companyFk: Empresa

View File

@ -0,0 +1,8 @@
entryList:
list:
inventoryEntry: 'Inventory entry'
virtualEntry: 'Virtual entry'
entryFilter:
filter:
search: 'General search'
reference: 'Reference'

View File

@ -0,0 +1,8 @@
entryList:
list:
inventoryEntry: 'Es inventario'
virtualEntry: 'Es una redada'
entryFilter:
filter:
search: 'Búsqueda general'
reference: 'Referencia'

View File

@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
@ -63,7 +62,7 @@ const decrement = (paramsObj, key) => {
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.agencyModeFk')"
:label="t('travelFilter.filter.agencyModeFk')"
v-model="params.agencyModeFk"
@update:model-value="searchFn()"
:options="agenciesOptions"
@ -79,7 +78,7 @@ const decrement = (paramsObj, key) => {
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.warehouseOutFk')"
:label="t('travelFilter.filter.warehouseOutFk')"
v-model="params.warehouseOutFk"
@update:model-value="searchFn()"
:options="warehousesOptions"
@ -95,7 +94,7 @@ const decrement = (paramsObj, key) => {
<QItem>
<QItemSection>
<VnSelectFilter
:label="t('params.warehouseInFk')"
:label="t('travelFilter.filter.warehouseInFk')"
v-model="params.warehouseInFk"
@update:model-value="searchFn()"
:options="warehousesOptions"
@ -113,7 +112,7 @@ const decrement = (paramsObj, key) => {
<QInput
v-model="params.scopeDays"
type="number"
:label="t('params.scopeDays')"
:label="t('travelFilter.filter.scopeDays')"
dense
outlined
rounded
@ -211,10 +210,6 @@ const decrement = (paramsObj, key) => {
en:
params:
search: Id/Reference
agencyModeFk: Agency
warehouseInFk: Warehouse In
warehouseOutFk: Warehouse Out
scopeDays: Days onward
landedFrom: Landed from
landedTo: Landed to
continent: Continent out
@ -222,10 +217,6 @@ en:
es:
params:
search: Id/Referencia
agencyModeFk: Agencia
warehouseInFk: Alm. entrada
warehouseOutFk: Alm. salida
scopeDays: Días adelante
landedFrom: Llegada desde
landedTo: Llegada hasta
continent: Cont. Salida

View File

@ -0,0 +1,6 @@
travelFilter:
filter:
warehouseOutFk: 'Warehouse Out'
warehouseInFk: 'Warehouse In'
agencyModeFk: 'Agency'
scopeDays: 'Days onward'

View File

@ -0,0 +1,6 @@
travelFilter:
filter:
warehouseInFk: 'Alm. entrada'
warehouseOutFk: 'Alm. salida'
agencyModeFk: 'Agencia'
scopeDays: 'Días adelante'

View File

@ -19,7 +19,7 @@ export default defineConfig({
plugins: [
vue({
template: {
transformAssetUrls
transformAssetUrls,
},
}),
quasar({