Vistas sección pedidos #77

Merged
jsegarra merged 14 commits from wbuezas/hedera-web-mindshore:feature/Pedidos into 4922-vueMigration 2024-08-16 06:52:22 +00:00
3 changed files with 82 additions and 62 deletions
Showing only changes of commit f36eb1bd88 - Show all commits

View File

@ -0,0 +1,39 @@
<script setup>
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
noDataLabel: {
type: String,
default: ''
},
hideBottom: {
type: Boolean,
default: true
},
rowsPerPageOptions: {
type: Array,
default: () => [0]
}
});
</script>
<template>
<QTable
v-bind="$attrs"
:no-data-label="props.noDataLabel || t('noInvoicesFound')"
:hide-bottom="props.hideBottom"
:rows-per-page-options="props.rowsPerPageOptions"
table-header-class="vnTable-header-default"
>
<slot />
</QTable>
</template>
<style lang="scss">
.vnTable-header-default {
background-color: $accent !important;
color: white;
}
</style>

View File

@ -2,6 +2,8 @@
import { ref, inject, onMounted, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import VnTable from 'src/components/ui/VnTable.vue';
const jApi = inject('jApi');
const { t } = useI18n();
@ -53,32 +55,15 @@ onMounted(() => getPackages());
<template>
<QPage class="flex justify-center q-pa-md">
<QTable
<VnTable
:columns="columns"
:rows="packages"
:loading="loading"
class="q-mt-lg"
style="max-width: 100%; height: max-content"
table-header-class="packages-table-header"
hide-bottom
>
<template #body-cell-id="{ row }">
<QTd auto-width @click.stop>
<QBtn flat color="blue">{{ row.id }}</QBtn>
<ItemDescriptorProxy :id="row.id" />
</QTd>
</template>
</QTable>
style="height: max-content; max-width: 100%"
/>
</QPage>
</template>
<style lang="scss">
.packages-table-header {
background-color: $accent !important;
color: white;
}
</style>
<i18n lang="yaml">
en-US:
agency: Agency

View File

@ -2,6 +2,8 @@
import { ref, onMounted, inject, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import VnTable from 'src/components/ui/VnTable.vue';
import { currency } from 'src/lib/filters.js';
import { date as qdate } from 'quasar';
import { userStore as useUserStore } from 'stores/user';
@ -80,49 +82,43 @@ onMounted(async () => {
/>
</Teleport>
<div class="vn-w-sm">
<QCard>
<!-- -->
<QTable
:columns="columns"
:rows="invoices"
:no-data-label="t('noInvoicesFound')"
row-key="id"
:hide-header="!invoices.length"
:rows-per-page-options="[0]"
>
<template #body-cell-hasPdf="{ row }">
<QTd
auto-width
@click.stop
class="flex full-width justify-center items-center"
<VnTable

Podemos aplicar el estilo de la tabla de Agencias?

Podemos aplicar el estilo de la tabla de Agencias?

Cree el componente VnTable y lo aplique en las vistas PackagesView e InvoicesView.

Commit: f36eb1bd88

Cree el componente `VnTable` y lo aplique en las vistas `PackagesView` e `InvoicesView`. Commit: https://gitea.verdnatura.es/verdnatura/hedera-web/commit/f36eb1bd88c019265f9c789f1f1db3ae369b5891

Ok,
TODO: para la próxima PR añadir la función de ordenar la columna en InvoicesView porque para packages si que está

Ok, TODO: para la próxima PR añadir la función de ordenar la columna en InvoicesView porque para packages si que está
:columns="columns"
:rows="invoices"
:hide-header="!invoices.length"
>
<template #body-cell-hasPdf="{ row }">
<QTd
auto-width
@click.stop
class="flex full-width justify-center items-center"
>
<QBtn
v-if="row.hasPdf"
icon="download"
:href="getInvoiceUrl(row.id)"
target="_blank"
flat
round
>
<QBtn
v-if="row.hasPdf"
icon="download"
:href="getInvoiceUrl(row.id)"
target="_blank"
flat
round
>
<QTooltip>
{{ t('downloadInvoicePdf') }}
</QTooltip>
</QBtn>
<QIcon
v-else
name="warning"
:title="t('notDownloadable')"
color="warning"
size="sm"
>
<QTooltip>
{{ t('requestTheInvoiceToComercial') }}
</QTooltip>
</QIcon>
</QTd>
</template>
</QTable>
</QCard>
<QTooltip>
{{ t('downloadInvoicePdf') }}
</QTooltip>
</QBtn>
<QIcon
v-else
name="warning"
:title="t('notDownloadable')"
color="warning"
size="sm"
>
<QTooltip>
{{ t('requestTheInvoiceToComercial') }}
</QTooltip>
</QIcon>
</QTd>
</template>
</VnTable>
</div>
</template>