0
0
Fork 0

fix: refs #7553 fixed details in summary and data-key in TicketList

This commit is contained in:
Jon Elias 2024-09-04 08:02:28 +02:00
parent f35e33cf10
commit cb7d729b0f
2 changed files with 88 additions and 15 deletions

View File

@ -15,6 +15,7 @@ import { getUrl } from 'src/composables/getUrl';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
const route = useRoute();
const router = useRouter();
@ -79,6 +80,29 @@ async function changeState(value) {
await axios.post(`Tickets/state`, formData);
router.go(route.fullPath);
}
function getNoteValue(description) {
switch (description) {
case 'ItemPicker':
return t('ItemPicker');
case 'Packager':
return t('Packager');
case 'Delivery':
return t('Delivery');
case 'SalesPerson':
return t('SalesPerson');
case 'Administrative':
return t('Administrative');
case 'Weight':
return t('Weight');
case 'InvoiceOut':
return t('InvoiceOut');
case 'DropOff':
return t('DropOff');
case 'Sustitución':
return t('Sustitución');
}
}
</script>
<template>
@ -160,7 +184,14 @@ async function changeState(value) {
:label="t('ticket.summary.agency')"
:value="ticket.agencyMode?.name"
/>
<VnLv :label="t('ticket.summary.zone')" :value="ticket?.zone?.name" />
<VnLv :label="t('ticket.summary.zone')">
<template #value>
<span class="link" @click.stop>
{{ ticket?.zone?.name }}
<ZoneDescriptorProxy :id="ticket.zoneFk" />
</span>
</template>
</VnLv>
<VnLv
:label="t('ticket.summary.warehouse')"
:value="ticket.warehouse?.name"
@ -263,7 +294,7 @@ async function changeState(value) {
<VnLv
v-for="note in ticket.notes"
:key="note.id"
:label="note.observationType.description"
:label="getNoteValue(note.observationType.description)"
:value="note.description"
>
<template #value>
@ -291,6 +322,7 @@ async function changeState(value) {
<VnLv
:label="t('ticket.summary.total')"
:value="toCurrency(ticket.totalWithVat)"
style="font-weight: bold"
/>
</div>
</QCard>
@ -400,7 +432,17 @@ async function changeState(value) {
<ItemDescriptorProxy :id="props.row.itemFk" />
</QBtn>
</QTd>
<QTd>{{ props.row.visible }}</QTd>
<QTd>
<QChip
dense
rounded
v-if="props.row.visible < 0"
:color="'negative'"
>
{{ props.row.visible }}
{{ console.log(props.row) }}
</QChip>
</QTd>
<QTd>{{ props.row.available }}</QTd>
<QTd>{{ props.row.quantity }}</QTd>
<QTd class="description-cell">
@ -432,12 +474,9 @@ async function changeState(value) {
</template>
</QTable>
</QCard>
<QCard
class="vn-max"
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
>
<QCard class="vn-max" v-if="ticket.packagings.length != 0">
<VnTitle :url="ticketUrl + 'package'" :text="t('globals.packages')" />
<QTable :rows="ticket.packagings" flat>
<QTable :rows="ticket.packagings" flat style="text-align: center">
<template #header="props">
<QTr class="tr-header" :props="props">
<QTh auto-width>{{ t('ticket.summary.created') }}</QTh>
@ -453,11 +492,13 @@ async function changeState(value) {
</QTr>
</template>
</QTable>
</QCard>
<QCard class="vn-max" v-if="ticket.services.length != 0">
<VnTitle
:url="ticketUrl + 'service'"
:text="t('ticket.summary.service')"
/>
<QTable :rows="ticket.services" flat>
<QTable :rows="ticket.services" flat style="text-align: center">
<template #header="props">
<QTr class="tr-header" :props="props">
<QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh>
@ -480,12 +521,12 @@ async function changeState(value) {
</template>
</QTable>
</QCard>
<QCard class="vn-max" v-if="ticket.requests.length > 0">
<QCard class="vn-max" v-if="ticket.requests.length != 0">
<VnTitle
:url="ticketUrl + 'request'"
:text="t('ticket.summary.purchaseRequest')"
/>
<QTable :rows="ticket.requests" flat>
<QTable :rows="ticket.requests" flat style="text-align: center">
<template #header="props">
<QTr class="tr-header" :props="props">
<QTh auto-width>{{ t('ticket.summary.description') }}</QTh>
@ -517,7 +558,14 @@ async function changeState(value) {
v-model="props.row.isOk"
disable
:toggle-indeterminate="false"
/>
>
<QTooltip v-if="props.row.isOk">
{{ t('Accepted') }}
</QTooltip>
<QTooltip v-else>
{{ t('Denied') }}
</QTooltip>
</QCheckbox>
</QTd>
</QTr>
</template>
@ -564,3 +612,28 @@ async function changeState(value) {
color: $primary-light;
}
</style>
<i18n>
en:
ItemPicker: Item Picker
Packager: Packager
Delivery: Delivery
SalesPerson: Sales Person
Administrative: Administrative
Weight: Weight
InvoiceOut: Invoice Out
DropOff: Drop Off
Sustitución: Sustitution
es:
ItemPicker: Items
Packager: Encajador
Delivery: Envío
SalesPerson: Comercial
Administrative: Administrativa
Weight: Peso
InvoiceOut: Facturas
DropOff: Despacho
Sustitución: Sustitución
Accepted: Aceptado
Denied: Denegado
</i18n>

View File

@ -426,18 +426,18 @@ function setReference(data) {
auto-load
/>
<VnSearchbar
data-key="Tickets"
data-key="Ticket"
:label="t('Search ticket')"
:info="t('You can search by ticket id or alias')"
/>
<RightMenu>
<template #right-panel>
<TicketFilter data-key="Tickets" />
<TicketFilter data-key="Ticket" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="Tickets"
data-key="Ticket"
url="Tickets/filter"
:create="{
urlCreate: 'Tickets/new',