0
0
Fork 0

feat: VnTable SalesTicketTable

This commit is contained in:
Javier Segarra 2024-07-10 12:19:17 +02:00
parent 167ba2aed0
commit 5ad317df65
1 changed files with 52 additions and 42 deletions

View File

@ -104,8 +104,9 @@ const columns = computed(() => [
align: 'left',
sortable: true,
columnFilter: false,
style: { 'max-width': '75px' },
attrs: {
style: 'max-width: 50px',
dense: true,
},
},
{
@ -114,9 +115,11 @@ const columns = computed(() => [
field: 'id',
align: 'left',
sortable: true,
style: { 'max-width': '75px' },
columnFilter: {
component: 'input',
name: 'id',
attrs: {
dense: true,
},
@ -130,6 +133,7 @@ const columns = computed(() => [
sortable: true,
columnFilter: {
component: 'input',
name: 'nickname',
attrs: {
dense: true,
},
@ -139,14 +143,12 @@ const columns = computed(() => [
label: t('salesTicketsTable.salesPerson'),
name: 'salesPerson',
field: 'userName',
style: { 'max-width': '125px' },
align: 'left',
sortable: true,
columnFilter: {
component: 'select',
filterParamKey: 'salesPersonFk',
type: 'select',
filterValue: null,
event: getInputEvents,
name: 'salesPersonFk',
attrs: {
options: workersActiveOptions.value,
'option-value': 'id',
@ -158,14 +160,12 @@ const columns = computed(() => [
{
label: t('salesTicketsTable.date'),
name: 'date',
style: { 'max-width': '100px' },
align: 'left',
sortable: true,
columnFilter: {
component: 'date',
filterParamKey: 'shippedDate',
filterValue: null,
event: getInputEvents,
name: 'shippedDate',
attrs: {
dense: true,
},
@ -175,18 +175,28 @@ const columns = computed(() => [
label: t('salesTicketsTable.theoretical'),
name: 'theoretical',
field: 'zoneLanding',
style: { 'max-width': '75px' },
align: 'left',
sortable: true,
format: (val) => toTimeFormat(val),
columnFilter: {
component: 'input',
name: 'theoreticalHour',
attrs: {
dense: true,
},
},
},
{
label: t('salesTicketsTable.practical'),
name: 'practical',
field: 'practicalHour',
align: 'left',
style: { 'max-width': '75px' },
sortable: true,
columnFilter: {
component: 'input',
name: 'practicalHour',
attrs: {
dense: true,
},
@ -197,8 +207,16 @@ const columns = computed(() => [
name: 'preparation',
field: 'shipped',
align: 'left',
style: { 'max-width': '75px' },
sortable: true,
format: (val) => toTimeFormat(val),
columnFilter: {
component: 'input',
name: 'shippedDate',
attrs: {
dense: true,
},
},
},
{
@ -206,13 +224,11 @@ const columns = computed(() => [
name: 'province',
field: 'province',
align: 'left',
style: { 'max-width': '100px' },
sortable: true,
columnFilter: {
component: 'select',
filterParamKey: 'provinceFk',
type: 'select',
filterValue: null,
event: getInputEvents,
name: 'provinceFk',
attrs: {
options: provincesOptions.value,
'option-value': 'id',
@ -225,13 +241,11 @@ const columns = computed(() => [
label: t('salesTicketsTable.state'),
name: 'state',
align: 'left',
style: { 'max-width': '100px' },
sortable: true,
columnFilter: {
component: 'select',
filterParamKey: 'stateFk',
type: 'select',
filterValue: null,
event: getInputEvents,
name: 'stateFk',
attrs: {
options: statesOptions.value,
'option-value': 'id',
@ -244,16 +258,17 @@ const columns = computed(() => [
label: t('salesTicketsTable.isFragile'),
name: 'isFragile',
field: 'isFragile',
style: { 'max-width': '75px' },
align: 'left',
sortable: true,
columnFilter: {
component: 'input',
type: 'text',
filterValue: null,
event: getInputEvents,
attrs: {
dense: true,
inWhere: true,
},
attrs: {
'checked-icon': 'local_bar',
'unchecked-icon': 'local_bar',
'false-value': 0,
'true-value': 1,
},
},
{
@ -263,10 +278,7 @@ const columns = computed(() => [
sortable: true,
columnFilter: {
component: 'select',
filterParamKey: 'zoneFk',
type: 'select',
filterValue: null,
event: getInputEvents,
name: 'zoneFk',
attrs: {
options: zonesOptions.value,
'option-value': 'id',
@ -280,12 +292,11 @@ const columns = computed(() => [
name: 'total',
field: 'totalWithVat',
align: 'left',
style: { 'max-width': '75px' },
sortable: true,
columnFilter: {
component: 'input',
type: 'text',
filterValue: null,
event: getInputEvents,
name: 'totalWithVat',
attrs: {
dense: true,
},
@ -423,7 +434,6 @@ const redirectToSales = (id) => {
@on-fetch="(data) => (zonesOptions = data)"
/>
<VnTable
class="column flex-center fit"
ref="paginateRef"
data-key="SalesMonitorTickets"
url="SalesMonitors/salesFilter"
@ -453,7 +463,7 @@ const redirectToSales = (id) => {
/>
</template>
<template #column-problems="{ row }">
<QTd class="q-gutter-x-sm" style="max-width: 50px">
<QTd class="no-padding" style="max-width: 50px">
<QIcon
v-if="row.isTaxDataChecked === 0"
name="vn:no036"
@ -508,7 +518,7 @@ const redirectToSales = (id) => {
</QTd>
</template>
<template #column-identifier="{ row }">
<QTd>
<QTd class="no-padding">
<span class="link" @click.stop.prevent>
{{ row.id }}
<TicketDescriptorProxy :id="row.id" />
@ -516,19 +526,19 @@ const redirectToSales = (id) => {
</QTd>
</template>
<template #column-client="{ row }">
<QTd @click.stop.prevent>
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.nickname }}</span>
<CustomerDescriptorProxy :id="row.clientFk" />
</QTd>
</template>
<template #column-salesPerson="{ row }">
<QTd @click.stop.prevent>
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.userName }}</span>
<WorkerDescriptorProxy :id="row.salesPersonFk" />
</QTd>
</template>
<template #column-date="{ row }">
<QTd>
<QTd class="no-padding">
<QBadge
v-bind="getBadgeAttrs(row.shippedDate)"
class="q-pa-sm"
@ -539,7 +549,7 @@ const redirectToSales = (id) => {
</QTd>
</template>
<template #column-state="{ row }">
<QTd @click.stop.prevent>
<QTd class="no-padding" @click.stop.prevent>
<div v-if="row.refFk">
<span class="link">{{ row.refFk }}</span>
<InvoiceOutDescriptorProxy :id="row.invoiceOutId" />
@ -556,20 +566,20 @@ const redirectToSales = (id) => {
</QTd>
</template>
<template #column-isFragile="{ row }">
<QTd>
<QTd class="no-padding">
<QIcon v-if="row.isFragile" name="local_bar" color="primary" size="sm">
<QTooltip>{{ t('salesTicketsTable.isFragile') }}</QTooltip>
</QIcon>
</QTd>
</template>
<template #column-zone="{ row }">
<QTd @click.stop.prevent>
<QTd class="no-padding" @click.stop.prevent>
<span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" />
</QTd>
</template>
<template #column-total="{ row }">
<QTd>
<QTd class="no-padding">
<QBadge
:color="totalPriceColor(row) || 'transparent'"
:text-color="totalPriceColor(row) ? 'black' : 'white'"