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 { useRoute } from 'vue-router';
import VnTable from 'src/components/VnTable/VnTable.vue';
import TicketDescriptorProxy from '../Card/TicketDescriptorProxy.vue';
const rowsSelected = ref([]);
const { t } = useI18n();
const URL_KEY = 'Tickets/ItemLack';
@ -65,13 +67,27 @@ const columns = computed(() => [
align: 'left',
sortable: false,
columnClass: 'expand',
columnFilter: false,
},
{
name: 'saleFk',
label: t('negative.detail.saleFk'),
align: 'left',
sortable: true,
columnFilter: {
component: 'number',
},
columnClass: 'shrink',
},
{
name: 'ticketFk',
label: t('negative.detail.ticketFk'),
field: 'ticketFk',
align: 'left',
sortable: true,
columnFilter: {
component: 'number',
},
columnClass: 'shrink',
},
{
name: 'shipped',
@ -80,21 +96,43 @@ const columns = computed(() => [
align: 'left',
format: ({ shipped }) => toDate(shipped),
sortable: true,
columnFilter: {
component: 'date',
columnClass: 'shrink',
},
},
{
name: 'theoreticalhour',
label: t('negative.detail.theoreticalhour'),
field: 'theoreticalhour',
align: 'left',
sortable: true,
format: ({ theoreticalhour }) => toHour(theoreticalhour),
sortable: true,
columnFilter: {
component: 'time',
columnClass: 'shrink',
},
},
{
name: 'state',
name: 'alertLevelCode',
label: t('negative.detail.state'),
field: 'code',
align: 'left',
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',
@ -116,7 +154,10 @@ const columns = computed(() => [
field: 'quantity',
align: 'left',
sortable: true,
style: 'width: 100px',
columnFilter: {
component: 'number',
columnClass: 'shrink',
},
},
]);
const emit = defineEmits([...useDialogPluginComponent.emits, 'selection', 'close']);
@ -172,48 +213,62 @@ const tableRef = ref(null);
:url="`${URL_KEY}/${entityId}`"
:columns="columns"
:without-header="true"
:right-search="false"
auto-load
: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">
{{ props }}
</template> -->
<template #column-status="props">
<QIcon
v-if="props.row.isRookie"
name="vn:person"
size="xs"
color="primary"
class="cursor-pointer"
<template #column-status="{ row }">
<QTd style="width: 150px">
<QIcon
v-if="row.isRookie"
name="vn:person"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.peticionCompra"
name="vn:buyrequest"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip>
</QIcon>
<QIcon
v-if="row.turno"
name="vn:calendar"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip>{{ t('negative.detail.turno') }}</QTooltip>
</QIcon></QTd
>
<QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip>
</QIcon>
<QIcon
v-if="props.row.peticionCompra"
name="vn:buyrequest"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip>
</QIcon>
<QIcon
v-if="props.row.turno"
name="vn:calendar"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip>{{ t('negative.detail.turno') }}</QTooltip>
</QIcon>
</template>
<template #column-ticketFk="{ col }"
>{{ col.value }} <ItemDescriptorProxy :id="$props.entityId"
<template #column-ticketFk="{ row }"
><span class="link">{{ row.ticketFk }}</span>
<TicketDescriptorProxy :id="row.ticketFk"
/></template>
<template #column-zoneName="{ row, col }">
{{ col.value }}
<template #column-zoneName="{ row }">
<span class="link">{{ row.zoneName }}</span>
<ZoneDescriptorProxy :id="row.zoneFk" />
</template>
</VnTable>

View File

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

View File

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