feat: newsection and i18n
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Javier Segarra 2024-07-01 12:18:58 +02:00
parent 379d90d4c9
commit 71900b15a6
8 changed files with 171 additions and 68 deletions

View File

@ -314,6 +314,7 @@ entry:
pageTitles:
entries: Entries
list: List
eti: Labeler
summary: Summary
basicData: Basic data
buys: Buys

View File

@ -312,6 +312,7 @@ entry:
pageTitles:
entries: Entradas
list: Listado
eti: Etiquetar
summary: Resumen
basicData: Datos básicos
buys: Compras

View File

@ -38,15 +38,15 @@ const entityId = computed(() => $props.id || route.params.id);
const entriesTableColumns = computed(() => [
{
align: 'left',
name: 'item',
label: t('entry.summary.item'),
field: (row) => row.item.name,
name: 'itemFk',
field: 'itemFk',
label: t('globals.id'),
},
{
align: 'left',
name: 'quantity',
label: t('entry.summary.quantity'),
field: 'quantity',
name: 'item',
label: t('entry.summary.item'),
field: (row) => row.item.name,
},
{
align: 'left',
@ -60,18 +60,6 @@ const entriesTableColumns = computed(() => [
label: t('entry.summary.stickers'),
field: 'stickers',
},
{
align: 'left',
name: 'printedStickers',
label: t('entry.buys.printedStickers'),
field: 'printedStickers',
},
{
align: 'left',
name: 'weight',
label: t('entry.summary.weight'),
field: 'weight',
},
{
align: 'left',
name: 'packing',
@ -84,36 +72,12 @@ const entriesTableColumns = computed(() => [
label: t('entry.summary.grouping'),
field: 'grouping',
},
{
align: 'left',
name: 'buyingValue',
label: t('entry.summary.buyingValue'),
field: ({ buyingValue }) => toCurrency(buyingValue),
},
{
align: 'left',
name: 'price2',
label: t('entry.buys.groupingPrice'),
field: 'price2',
},
{
align: 'left',
name: 'price3',
label: t('entry.buys.packingPrice'),
field: 'price3',
},
{
align: 'left',
name: 'import',
label: t('entry.summary.import'),
field: (row) => toCurrency(row.buyingValue * row.quantity),
},
]);
</script>
<template>
<QDialog ref="dialogRef" full-width>
<QCard>
<QDialog ref="dialogRef">
<QCard style="min-width: 800px">
<QCardSection class="row items-center q-pb-none">
<QAvatar
:icon="icon"

View File

@ -12,8 +12,6 @@ import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters/index';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
// import { useVnConfirm } from 'composables/useVnConfirm';
// const { openConfirmationModal } = useVnConfirm();
const stateStore = useStateStore();
const router = useRouter();
@ -31,21 +29,6 @@ const redirectToCreateView = () => {
onMounted(async () => {
stateStore.rightDrawer = true;
});
import { useQuasar } from 'quasar';
// import EntryBuys from './Card/EntryBuys.vue';
import EntryBuysTableDialog from './EntryBuysTableDialog.vue';
const quasar = useQuasar();
const printBuys = (rowId) => {
// router.push({ path: `/entry/${rowId}/buys` });
quasar.dialog({
component: EntryBuysTableDialog,
componentProps: {
id: rowId,
},
});
};
</script>
<template>
<VnSearchbar
@ -124,12 +107,6 @@ const printBuys = (rowId) => {
color="primary"
type="submit"
/>
<QBtn
:label="t('Print buys')"
@click.stop="printBuys(row.id)"
color="primary"
type="submit"
/>
</template>
</CardList>
</template>

View File

@ -0,0 +1,149 @@
<script setup>
import { onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import CardList from 'src/components/ui/CardList.vue';
import EntrySummary from './Card/EntrySummary.vue';
import EntryFilter from './EntryFilter.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDate } from 'src/filters/index';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
import { useQuasar } from 'quasar';
import EntryBuysTableDialog from './EntryBuysTableDialog.vue';
const stateStore = useStateStore();
const router = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const quasar = useQuasar();
function navigate(id) {
router.push({ path: `/entry/${id}` });
}
const redirectToCreateView = () => {
router.push({ name: 'EntryCreate' });
};
onMounted(async () => {
stateStore.rightDrawer = true;
});
const printBuys = (rowId) => {
quasar.dialog({
component: EntryBuysTableDialog,
componentProps: {
id: rowId,
},
});
};
</script>
<template>
<VnSearchbar
data-key="EntryList"
url="Entries/filter"
:label="t('Search entries')"
:info="t('You can search by entry reference')"
/>
<RightMenu>
<template #right-panel>
<EntryFilter data-key="EntryList" />
</template>
</RightMenu>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate
data-key="EntryList"
url="Entries/filter"
:order="['landed DESC', 'id DESC']"
auto-load
>
<template #body="{ rows }">
<CardList
v-for="row of rows"
:key="row.id"
:title="row.reference"
@click="navigate(row.id)"
:id="row.id"
:has-info-icons="!!row.isExcludedFromAvailable || !!row.isRaid"
>
<template #info-icons>
<QIcon
v-if="row.isExcludedFromAvailable"
name="vn:inventory"
color="primary"
size="xs"
>
<QTooltip>{{ t('Inventory entry') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.isRaid"
name="vn:net"
color="primary"
size="xs"
>
<QTooltip>{{ t('Virtual entry') }}</QTooltip>
</QIcon>
</template>
<template #list-items>
<VnLv :label="t('landed')" :value="toDate(row.landed)" />
<VnLv
:label="t('entry.list.booked')"
:value="!!row.isBooked"
/>
<VnLv
:label="t('entry.list.invoiceNumber')"
:value="row.invoiceNumber"
/>
<VnLv
:label="t('entry.list.confirmed')"
:value="!!row.isConfirmed"
/>
<VnLv
:label="t('entry.list.supplier')"
:value="row.supplierName"
/>
<VnLv
:label="t('entry.list.ordered')"
:value="!!row.isOrdered"
/>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, EntrySummary)"
color="primary"
type="submit"
/>
<QBtn
:label="t('Print buys')"
@click.stop="printBuys(row.id)"
color="primary"
type="submit"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
</QPage>
<QPageSticky :offset="[20, 20]">
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
<QTooltip>
{{ t('entry.list.newEntry') }}
</QTooltip>
</QPageSticky>
</template>
<i18n>
es:
Print buys: Imprimir compras
Inventory entry: Es inventario
Virtual entry: Es una redada
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
</i18n>

View File

@ -1,4 +1,5 @@
entryList:
eti: eti
list:
inventoryEntry: Inventory entry
virtualEntry: Virtual entry

View File

@ -1,6 +1,7 @@
Search entries: Buscar entradas
You can search by entry reference: Puedes buscar por referencia de la entrada
entryList:
eti: Etiquetas
list:
inventoryEntry: Es inventario
virtualEntry: Es una redada

View File

@ -11,7 +11,7 @@ export default {
component: RouterView,
redirect: { name: 'EntryMain' },
menus: {
main: ['EntryList', 'EntryLatestBuys'],
main: ['EntryList', 'MyEntries', 'EntryLatestBuys'],
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
},
children: [
@ -30,6 +30,15 @@ export default {
},
component: () => import('src/pages/Entry/EntryList.vue'),
},
{
path: 'list',
name: 'MyEntries',
meta: {
title: 'eti',
icon: 'sell',
},
component: () => import('src/pages/Entry/MyEntries.vue'),
},
{
path: 'create',
name: 'EntryCreate',