forked from verdnatura/salix-front
Reviewed-on: verdnatura/salix-front#762 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
5c5393db6d
|
@ -6,7 +6,7 @@ import { useRoute, useRouter } from 'vue-router';
|
|||
import { date } from 'quasar';
|
||||
import { toDateFormat } from 'src/filters/date.js';
|
||||
|
||||
import { toCurrency } from 'src/filters';
|
||||
import { dashIfEmpty, toCurrency } from 'src/filters';
|
||||
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
|
||||
|
@ -32,6 +32,16 @@ const filter = {
|
|||
},
|
||||
{ relation: 'invoiceOut', scope: { fields: ['id'] } },
|
||||
{ relation: 'agencyMode', scope: { fields: ['name'] } },
|
||||
{
|
||||
relation: 'ticketSales',
|
||||
scope: {
|
||||
fields: ['id', 'concept', 'itemFk'],
|
||||
include: { relation: 'item' },
|
||||
scope: {
|
||||
fields: ['id', 'name', 'itemPackingTypeFk'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
where: { clientFk: route.params.id },
|
||||
order: ['shipped DESC', 'id'],
|
||||
|
@ -87,7 +97,12 @@ const columns = computed(() => [
|
|||
label: t('Total'),
|
||||
name: 'total',
|
||||
},
|
||||
|
||||
{
|
||||
align: 'left',
|
||||
name: 'itemPackingTypeFk',
|
||||
label: t('ticketSale.packaging'),
|
||||
format: (row) => getItemPackagingType(row),
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
label: '',
|
||||
|
@ -135,6 +150,15 @@ const setShippedColor = (date) => {
|
|||
if (difference == 0) return 'warning';
|
||||
if (difference < 0) return 'success';
|
||||
};
|
||||
|
||||
const getItemPackagingType = (row) => {
|
||||
const packagingType = row?.ticketSales
|
||||
.map((sale) => sale.item?.itemPackingTypeFk || '-')
|
||||
.filter((value) => value !== '-')
|
||||
.join(', ');
|
||||
|
||||
return dashIfEmpty(packagingType);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -95,6 +95,7 @@ const columns = computed(() => [
|
|||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
columnClass: 'expand',
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
|
||||
},
|
||||
{
|
||||
|
@ -153,11 +154,6 @@ const columns = computed(() => [
|
|||
},
|
||||
columnClass: 'expand',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'refFk',
|
||||
label: t('ticketList.ref'),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'zoneFk',
|
||||
|
@ -191,6 +187,12 @@ const columns = computed(() => [
|
|||
},
|
||||
format: (row) => toCurrency(row.totalWithVat),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'packing',
|
||||
label: t('ticketSale.packaging'),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.packing),
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
|
@ -548,7 +550,7 @@ function setReference(data) {
|
|||
</template>
|
||||
<template #column-salesPersonFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.salesPerson }}
|
||||
{{ dashIfEmpty(row.salesPerson) }}
|
||||
<CustomerDescriptorProxy :id="row.salesPersonFk" />
|
||||
</span>
|
||||
</template>
|
||||
|
@ -577,16 +579,16 @@ function setReference(data) {
|
|||
{{ row.state }}
|
||||
</QChip>
|
||||
</span>
|
||||
<span v-else-if="row.state === 'Entregado'">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.refFk }}
|
||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ row.state }}
|
||||
</span>
|
||||
</template>
|
||||
<template #column-refFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ dashIfEmpty(row.refFk) }}
|
||||
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-zoneFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ dashIfEmpty(row.zoneName) }}
|
||||
|
|
Loading…
Reference in New Issue