Implement orders no results

This commit is contained in:
Kevin Martinez 2023-12-27 08:08:19 -04:00
parent e3fd9bf54b
commit 4de1b52c30
5 changed files with 43 additions and 8 deletions

View File

@ -63,6 +63,7 @@ export default {
selectRows: 'Select all { numberRows } row(s)', selectRows: 'Select all { numberRows } row(s)',
allRows: 'All { numberRows } row(s)', allRows: 'All { numberRows } row(s)',
markAll: 'Mark all', markAll: 'Mark all',
noResults: 'No results'
}, },
errors: { errors: {
statusUnauthorized: 'Access denied', statusUnauthorized: 'Access denied',

View File

@ -63,6 +63,7 @@ export default {
selectRows: 'Seleccionar las { numberRows } filas(s)', selectRows: 'Seleccionar las { numberRows } filas(s)',
allRows: 'Todo { numberRows } filas(s)', allRows: 'Todo { numberRows } filas(s)',
markAll: 'Marcar todo', markAll: 'Marcar todo',
noResults: 'Sin resultados'
}, },
errors: { errors: {
statusUnauthorized: 'Acceso denegado', statusUnauthorized: 'Acceso denegado',

View File

@ -70,6 +70,9 @@ function exprBuilder(param, value) {
> >
<template #body="{ rows }"> <template #body="{ rows }">
<div class="catalog-list"> <div class="catalog-list">
<div v-if="rows && !rows?.length" class="no-result">
{{ t('globals.noResults') }}
</div>
<OrderCatalogItem v-for="row in rows" :key="row.id" :item="row" /> <OrderCatalogItem v-for="row in rows" :key="row.id" :item="row" />
</div> </div>
</template> </template>
@ -78,7 +81,7 @@ function exprBuilder(param, value) {
</QPage> </QPage>
</template> </template>
<style lang="scss"> <style lang="scss" scoped>
.card-list { .card-list {
width: 100%; width: 100%;
} }
@ -90,4 +93,11 @@ function exprBuilder(param, value) {
justify-content: center; justify-content: center;
gap: 16px; gap: 16px;
} }
.no-result {
font-size: 24px;
font-weight: bold;
color: var(--vn-label);
text-align: center;
}
</style> </style>

View File

@ -75,7 +75,10 @@ async function confirmOrder() {
/> />
<QPage :key="componentKey" class="column items-center q-pa-md"> <QPage :key="componentKey" class="column items-center q-pa-md">
<div class="card-list"> <div class="card-list">
<QCard class="order-lines-summary q-pa-lg"> <div v-if="!orderSummary.total" class="no-result">
{{ t('globals.noResults') }}
</div>
<QCard v-else class="order-lines-summary q-pa-lg">
<p class="header text-right block"> <p class="header text-right block">
{{ t('summary') }} {{ t('summary') }}
</p> </p>
@ -159,7 +162,10 @@ async function confirmOrder() {
:label="t('shipped')" :label="t('shipped')"
:value="toDate(row.shipped)" :value="toDate(row.shipped)"
/> />
<VnLv :label="t('quantity')" :value="String(row.quantity)" /> <VnLv
:label="t('quantity')"
:value="String(row.quantity)"
/>
<VnLv <VnLv
:label="t('price')" :label="t('price')"
:value="toCurrency(row.price)" :value="toCurrency(row.price)"
@ -238,6 +244,13 @@ async function confirmOrder() {
.subname { .subname {
color: var(--vn-label); color: var(--vn-label);
} }
.no-result {
font-size: 24px;
font-weight: bold;
color: var(--vn-label);
text-align: center;
}
</style> </style>
<i18n> <i18n>
en: en:

View File

@ -34,14 +34,17 @@ const loadVolumes = async (rows) => {
/> />
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<div class="card-list"> <div class="card-list">
<QCard class="order-volume-summary q-pa-lg"> <div
v-if="!volumeSummary?.totalVolume && !volumeSummary?.totalBoxes"
class="no-result"
>
{{ t('globals.noResults') }}
</div>
<QCard v-else class="order-volume-summary q-pa-lg">
<p class="header text-right block"> <p class="header text-right block">
{{ t('summary') }} {{ t('summary') }}
</p> </p>
<VnLv <VnLv :label="t('total')" :value="`${volumeSummary?.totalVolume} m³`" />
:label="t('total')"
:value="`${volumeSummary?.totalVolume} m³`"
/>
<VnLv <VnLv
:label="t('boxes')" :label="t('boxes')"
:value="`${dashIfEmpty(volumeSummary?.totalBoxes)} U`" :value="`${dashIfEmpty(volumeSummary?.totalBoxes)} U`"
@ -128,6 +131,13 @@ const loadVolumes = async (rows) => {
font-size: 20px; font-size: 20px;
display: inline-block; display: inline-block;
} }
.no-result {
font-size: 24px;
font-weight: bold;
color: var(--vn-label);
text-align: center;
}
</style> </style>
<i18n> <i18n>
en: en: