diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index bf001c9ba..f1599de50 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -570,6 +570,8 @@ shelving: newShelving: New Shelving summary: recyclable: Recyclable + search: Search shelving + searchInfo: You can search by shelving reference parking: pickingOrder: Picking order sector: Sector diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 2c95f936c..d29c6cc45 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -593,6 +593,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 diff --git a/src/pages/Shelving/Card/ShelvingCard.vue b/src/pages/Shelving/Card/ShelvingCard.vue index a501a7a99..41a0db33c 100644 --- a/src/pages/Shelving/Card/ShelvingCard.vue +++ b/src/pages/Shelving/Card/ShelvingCard.vue @@ -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> diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index cd7c4bcf9..a29b755f9 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -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,64 @@ function exprBuilder(param, value) { </script> <template> - <ShelvingSearchbar /> - <RightMenu> - <template #right-panel> + <VnSection + :data-key="dataKey" + prefix="shelving" + :array-data-props="{ + url: 'Shelvings', + order: ['code'], + userFilter: filter, + 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" > - <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> diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js index 9cc6bcef1..f08cab738 100644 --- a/src/router/modules/shelving.js +++ b/src/router/modules/shelving.js @@ -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'), - }, - ], - }, ], };