feat:TicketLackTable updates

This commit is contained in:
Javier Segarra 2024-09-11 14:25:10 +02:00
parent 5e89bbe19e
commit 373ca0b3f1
3 changed files with 93 additions and 36 deletions

View File

@ -12,6 +12,8 @@ import { useDialogPluginComponent } from 'quasar';
import ZoneDescriptorProxy from 'pages/Zone/Card/ZoneDescriptorProxy.vue'; import ZoneDescriptorProxy from 'pages/Zone/Card/ZoneDescriptorProxy.vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import TicketDescriptorProxy from '../Card/TicketDescriptorProxy.vue';
const rowsSelected = ref([]);
const { t } = useI18n(); const { t } = useI18n();
const URL_KEY = 'Tickets/ItemLack'; const URL_KEY = 'Tickets/ItemLack';
@ -65,13 +67,27 @@ const columns = computed(() => [
align: 'left', align: 'left',
sortable: false, sortable: false,
columnClass: 'expand', columnClass: 'expand',
columnFilter: false,
},
{
name: 'saleFk',
label: t('negative.detail.saleFk'),
align: 'left',
sortable: true,
columnFilter: {
component: 'number',
},
columnClass: 'shrink',
}, },
{ {
name: 'ticketFk', name: 'ticketFk',
label: t('negative.detail.ticketFk'), label: t('negative.detail.ticketFk'),
field: 'ticketFk',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnFilter: {
component: 'number',
},
columnClass: 'shrink',
}, },
{ {
name: 'shipped', name: 'shipped',
@ -80,21 +96,43 @@ const columns = computed(() => [
align: 'left', align: 'left',
format: ({ shipped }) => toDate(shipped), format: ({ shipped }) => toDate(shipped),
sortable: true, sortable: true,
columnFilter: {
component: 'date',
columnClass: 'shrink',
},
}, },
{ {
name: 'theoreticalhour', name: 'theoreticalhour',
label: t('negative.detail.theoreticalhour'), label: t('negative.detail.theoreticalhour'),
field: 'theoreticalhour', field: 'theoreticalhour',
align: 'left', align: 'left',
sortable: true,
format: ({ theoreticalhour }) => toHour(theoreticalhour), format: ({ theoreticalhour }) => toHour(theoreticalhour),
sortable: true,
columnFilter: {
component: 'time',
columnClass: 'shrink',
},
}, },
{ {
name: 'state', name: 'alertLevelCode',
label: t('negative.detail.state'), label: t('negative.detail.state'),
field: 'code', field: 'code',
align: 'left', align: 'left',
sortable: true, sortable: true,
columnField: {
component: null,
},
columnFilter: {
component: 'select',
attrs: {
url: 'AlertLevels',
fields: ['id', 'code'],
'sort-by': 'code ASC',
'option-value': 'id',
'option-label': 'code',
dense: true,
},
},
}, },
{ {
name: 'zoneName', name: 'zoneName',
@ -116,7 +154,10 @@ const columns = computed(() => [
field: 'quantity', field: 'quantity',
align: 'left', align: 'left',
sortable: true, sortable: true,
style: 'width: 100px', columnFilter: {
component: 'number',
columnClass: 'shrink',
},
}, },
]); ]);
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection', 'close']); const emit = defineEmits([...useDialogPluginComponent.emits, 'selection', 'close']);
@ -172,17 +213,29 @@ const tableRef = ref(null);
:url="`${URL_KEY}/${entityId}`" :url="`${URL_KEY}/${entityId}`"
:columns="columns" :columns="columns"
:without-header="true" :without-header="true"
:right-search="false"
auto-load auto-load
:create="false" :create="false"
:create-as-dialog="false"
:use-model="true"
:filter="routeFilter"
:table="{
'row-key': 'id',
selection: 'multiple',
}"
dense
:is-editable="true"
:row-click="false"
:right-search="false"
v-model:selected="rowsSelected"
> >
<!-- <!--
<template #body="props"> <template #body="props">
{{ props }} {{ props }}
</template> --> </template> -->
<template #column-status="props"> <template #column-status="{ row }">
<QTd style="width: 150px">
<QIcon <QIcon
v-if="props.row.isRookie" v-if="row.isRookie"
name="vn:person" name="vn:person"
size="xs" size="xs"
color="primary" color="primary"
@ -191,7 +244,7 @@ const tableRef = ref(null);
<QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip> <QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="props.row.peticionCompra" v-if="row.peticionCompra"
name="vn:buyrequest" name="vn:buyrequest"
size="xs" size="xs"
color="primary" color="primary"
@ -200,20 +253,22 @@ const tableRef = ref(null);
<QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip> <QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
v-if="props.row.turno" v-if="row.turno"
name="vn:calendar" name="vn:calendar"
size="xs" size="xs"
color="primary" color="primary"
class="cursor-pointer" class="cursor-pointer"
> >
<QTooltip>{{ t('negative.detail.turno') }}</QTooltip> <QTooltip>{{ t('negative.detail.turno') }}</QTooltip>
</QIcon> </QIcon></QTd
>
</template> </template>
<template #column-ticketFk="{ col }" <template #column-ticketFk="{ row }"
>{{ col.value }} <ItemDescriptorProxy :id="$props.entityId" ><span class="link">{{ row.ticketFk }}</span>
<TicketDescriptorProxy :id="row.ticketFk"
/></template> /></template>
<template #column-zoneName="{ row, col }"> <template #column-zoneName="{ row }">
{{ col.value }} <span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" /> <ZoneDescriptorProxy :id="row.zoneFk" />
</template> </template>
</VnTable> </VnTable>

View File

@ -278,6 +278,7 @@ negative:
title: Confirm split selected title: Confirm split selected
question: 'Select a state to update' question: 'Select a state to update'
detail: detail:
saleFk: 'Sale'
itemFk: 'Article' itemFk: 'Article'
ticketFk: 'Ticket' ticketFk: 'Ticket'
code: 'Code' code: 'Code'

View File

@ -281,6 +281,7 @@ negative:
title: Confirmar acción de split title: Confirmar acción de split
question: 'Selecciona un estado' question: 'Selecciona un estado'
detail: detail:
saleFk: 'Línea'
itemFk: 'Artículo' itemFk: 'Artículo'
ticketFk: 'Ticket' ticketFk: 'Ticket'
code: 'code' code: 'code'