Merge pull request '#7566 fixed summary cards and table' (!444) from 7566-FixCustomerSummary into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #444
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Jon Elias 2024-06-19 07:55:58 +00:00
commit 97c4130b05
3 changed files with 66 additions and 66 deletions

View File

@ -159,9 +159,9 @@ function existSummary(routes) {
margin-top: 2px; margin-top: 2px;
.label { .label {
color: var(--vn-label-color); color: var(--vn-label-color);
width: 8em; width: 9em;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: wrap;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-right: 10px; margin-right: 10px;
flex-grow: 0; flex-grow: 0;

View File

@ -306,10 +306,8 @@ const creditWarning = computed(() => {
:value="entity.recommendedCredit" :value="entity.recommendedCredit"
/> />
</QCard> </QCard>
<QCard> <QCard class="vn-one">
<div class="header"> <VnTitle :text="t('Latest tickets')" />
{{ t('Latest tickets') }}
</div>
<CustomerSummaryTable /> <CustomerSummaryTable />
</QCard> </QCard>
</template> </template>

View File

@ -162,6 +162,7 @@ const navigateToticketSummary = (id) => {
params: { id }, params: { id },
}); });
}; };
const commonColumns = (col) => ['date', 'state', 'total'].includes(col);
</script> </script>
<template> <template>
@ -171,67 +172,68 @@ const navigateToticketSummary = (id) => {
auto-load auto-load
url="Tickets" url="Tickets"
/> />
<QTable <QCard class="vn-one q-py-sm flex justify-between">
:columns="columns" <QTable
:pagination="{ rowsPerPage: 12 }" :columns="columns"
:rows="rows" :pagination="{ rowsPerPage: 12 }"
class="full-width q-mt-md" :rows="rows"
row-key="id" class="full-width"
v-if="rows?.length" row-key="id"
> >
<template #body-cell="props"> <template #body-cell="props">
<QTd :props="props" @click="navigateToticketSummary(props.row.id)"> <QTd :props="props" @click="navigateToticketSummary(props.row.id)">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">
<component <component
:is="tableColumnComponents[props.col.name].component" :is="tableColumnComponents[props.col.name].component"
@click="tableColumnComponents[props.col.name].event(props)" @click="tableColumnComponents[props.col.name].event(props)"
class="rounded-borders q-pa-sm" class="rounded-borders"
v-bind="tableColumnComponents[props.col.name].props(props)" v-bind="tableColumnComponents[props.col.name].props(props)"
>
<template
v-if="
props.col.name === 'id' ||
props.col.name === 'nickname' ||
props.col.name === 'agency' ||
props.col.name === 'route' ||
props.col.name === 'packages'
"
> >
{{ props.value }} <template v-if="!commonColumns(props.col.name)">
</template> <span
<template v-if="props.col.name === 'date'"> :class="{
<QBadge class="q-pa-sm" color="warning"> link:
{{ props.value }} props.col.name === 'route' ||
</QBadge> props.col.name === 'nickname',
</template> }"
<template v-if="props.col.name === 'state'"> >
<QBadge :color="setStateColor(props.row)" class="q-pa-sm"> {{ props.value }}
{{ props.value }} </span>
</QBadge> </template>
</template> <template v-if="props.col.name === 'date'">
<template v-if="props.col.name === 'total'"> <QBadge class="q-pa-sm" color="warning">
<QBadge {{ props.value }}
:color="setTotalPriceColor(props.row)" </QBadge>
class="q-pa-sm" </template>
v-if="setTotalPriceColor(props.row)" <template v-if="props.col.name === 'state'">
> <QBadge :color="setStateColor(props.row)" class="q-pa-sm">
{{ toCurrency(props.value) }} {{ props.value }}
</QBadge> </QBadge>
<div v-else>{{ toCurrency(props.value) }}</div> </template>
</template> <template v-if="props.col.name === 'total'">
<CustomerDescriptorProxy <QBadge
:id="props.row.clientFk" :color="setTotalPriceColor(props.row)"
v-if="props.col.name === 'nickname'" class="q-pa-sm"
/> v-if="setTotalPriceColor(props.row)"
<RouteDescriptorProxy >
:id="props.row.routeFk" {{ toCurrency(props.value) }}
v-if="props.col.name === 'route'" </QBadge>
/> <div v-else>{{ toCurrency(props.value) }}</div>
</component> </template>
</QTr> <CustomerDescriptorProxy
</QTd> :id="props.row.clientFk"
</template> v-if="props.col.name === 'nickname'"
</QTable> />
<RouteDescriptorProxy
:id="props.row.routeFk"
v-if="props.col.name === 'route'"
/>
</component>
</QTr>
</QTd>
</template>
</QTable>
</QCard>
</template> </template>
<i18n> <i18n>