refactor: refs #8316 used VnSection and VnCardBeta
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jose Antonio Tubau 2024-12-27 14:19:35 +01:00
parent 93047ab179
commit acdbc638e0
5 changed files with 129 additions and 110 deletions

View File

@ -550,6 +550,8 @@ shelving:
newShelving: New Shelving
summary:
recyclable: Recyclable
search: Search shelving
searchInfo: You can search by shelving reference
parking:
pickingOrder: Picking order
sector: Sector

View File

@ -575,6 +575,8 @@ shelving:
newShelving: Nuevo Carro
summary:
recyclable: Reciclable
search: Buscar carro
searchInfo: Puedes buscar por referencia del carro
parking:
pickingOrder: Orden de recogida
row: Fila

View File

@ -1,19 +1,12 @@
<script setup>
import VnCard from 'components/common/VnCard.vue';
import VnCardBeta from 'components/common/VnCardBeta.vue';
import ShelvingDescriptor from 'pages/Shelving/Card/ShelvingDescriptor.vue';
import ShelvingFilter from './ShelvingFilter.vue';
import ShelvingSearchbar from './ShelvingSearchbar.vue';
</script>
<template>
<VnCard
<VnCardBeta
data-key="Shelving"
base-url="Shelvings"
:descriptor="ShelvingDescriptor"
:filter-panel="ShelvingFilter"
search-data-key="ShelvingList"
>
<template #searchbar>
<ShelvingSearchbar />
</template>
</VnCard>
/>
</template>

View File

@ -6,13 +6,14 @@ import VnLv from 'components/ui/VnLv.vue';
import { useRouter } from 'vue-router';
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
import ShelvingSummary from 'pages/Shelving/Card/ShelvingSummary.vue';
import ShelvingSearchbar from 'pages/Shelving/Card/ShelvingSearchbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnSection from 'src/components/common/VnSection.vue';
const router = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ShelvingList';
const filter = {
include: [{ relation: 'parking' }],
};
@ -34,58 +35,66 @@ function exprBuilder(param, value) {
</script>
<template>
<ShelvingSearchbar />
<RightMenu>
<template #right-panel>
<VnSection
:data-key="dataKey"
prefix="shelving"
:array-data-props="{
url: 'Shelvings',
order: ['code'],
exprBuilder,
}"
>
<template #rightMenu>
<ShelvingFilter data-key="ShelvingList" />
</template>
</RightMenu>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate
data-key="ShelvingList"
url="Shelvings"
:filter="filter"
:expr-builder="exprBuilder"
:limit="20"
>
<template #body="{ rows }">
<CardList
v-for="row of rows"
:key="row.id"
:id="row.id"
:title="row.code"
@click="navigate(row.id)"
<template #body>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate
:data-key="dataKey"
:filter="filter"
:expr-builder="exprBuilder"
:limit="20"
>
<template #list-items>
<VnLv
:label="t('shelving.list.parking')"
:title-label="t('shelving.list.parking')"
:value="row.parking?.code"
/>
<VnLv
:label="t('shelving.list.priority')"
:value="row?.priority"
/>
<template #body="{ rows }">
<CardList
v-for="row of rows"
:key="row.id"
:id="row.id"
:title="row.code"
@click="navigate(row.id)"
>
<template #list-items>
<VnLv
:label="t('shelving.list.parking')"
:title-label="t('shelving.list.parking')"
:value="row.parking?.code"
/>
<VnLv
:label="t('shelving.list.priority')"
:value="row?.priority"
/>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ShelvingSummary)"
color="primary"
/>
</template>
</CardList>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ShelvingSummary)"
color="primary"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
<QPageSticky :offset="[20, 20]">
<RouterLink :to="{ name: 'ShelvingCreate' }">
<QBtn fab icon="add" color="primary" shortcut="+" />
<QTooltip>
{{ t('shelving.list.newShelving') }}
</QTooltip>
</RouterLink>
</QPageSticky>
</QPage>
</VnPaginate>
</div>
<QPageSticky :offset="[20, 20]">
<RouterLink :to="{ name: 'ShelvingCreate' }">
<QBtn fab icon="add" color="primary" shortcut="+" />
<QTooltip>
{{ t('shelving.list.newShelving') }}
</QTooltip>
</RouterLink>
</QPageSticky>
</QPage>
</template>
</VnSection>
</template>

View File

@ -1,34 +1,81 @@
import { RouterView } from 'vue-router';
const shelvingCard = {
name: 'ShelvingCard',
path: ':id',
component: () => import('src/pages/Shelving/Card/ShelvingCard.vue'),
redirect: { name: 'ShelvingSummary' },
meta: {
menu: [
'ShelvingBasicData',
'ShelvingLog',
],
},
children: [
{
path: 'summary',
name: 'ShelvingSummary',
meta: {
title: 'summary',
icon: 'launch',
},
component: () => import('src/pages/Shelving/Card/ShelvingSummary.vue'),
},
{
path: 'basic-data',
name: 'ShelvingBasicData',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
},
{
path: 'log',
name: 'ShelvingLog',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/Shelving/Card/ShelvingLog.vue'),
},
],
};
export default {
path: '/shelving',
name: 'Shelving',
path: '/shelving',
meta: {
title: 'shelving',
icon: 'vn:inventory',
moduleName: 'Shelving',
menu: ['ShelvingList', 'ParkingList'],
},
component: RouterView,
redirect: { name: 'ShelvingMain' },
menus: {
main: ['ShelvingList', 'ParkingList'],
card: ['ShelvingBasicData', 'ShelvingLog'],
},
children: [
{
path: '',
name: 'ShelvingMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
redirect: { name: 'ShelvingList' },
redirect: { name: 'ShelvingIndexMain' },
children: [
{
path: 'list',
name: 'ShelvingList',
meta: {
title: 'list',
icon: 'view_list',
},
path: '',
name: 'ShelvingIndexMain',
redirect: { name: 'ShelvingList' },
component: () => import('src/pages/Shelving/ShelvingList.vue'),
children: [
{
name: 'ShelvingList',
path: 'list',
meta: {
title: 'list',
icon: 'view_list',
},
},
shelvingCard,
],
},
{
path: 'create',
@ -56,39 +103,5 @@ export default {
},
],
},
{
name: 'ShelvingLayout',
path: ':id',
component: () => import('pages/Shelving/Card/ShelvingCard.vue'),
redirect: { name: 'ShelvingSummary' },
children: [
{
name: 'ShelvingSummary',
path: 'summary',
meta: {
title: 'summary',
},
component: () => import('pages/Shelving/Card/ShelvingSummary.vue'),
},
{
name: 'ShelvingBasicData',
path: 'basic-data',
meta: {
title: 'basicData',
icon: 'vn:settings',
},
component: () => import('pages/Shelving/Card/ShelvingForm.vue'),
},
{
name: 'ShelvingLog',
path: 'log',
meta: {
title: 'log',
icon: 'history',
},
component: () => import('src/pages/Shelving/Card/ShelvingLog.vue'),
},
],
},
],
};