0
0
Fork 0

feat: refs #7553 added icons, descriptors and missing columns in TicketList and minor changes

This commit is contained in:
Jon Elias 2024-09-02 11:24:06 +02:00
parent b8dea8551d
commit 45d9322892
8 changed files with 241 additions and 71 deletions

View File

@ -618,6 +618,7 @@ ticket:
landed: Landed landed: Landed
consigneePhone: Consignee phone consigneePhone: Consignee phone
consigneeMobile: Consignee mobile consigneeMobile: Consignee mobile
consigneeAddress: Consignee address
clientPhone: Client phone clientPhone: Client phone
clientMobile: Client mobile clientMobile: Client mobile
consignee: Consignee consignee: Consignee

View File

@ -624,6 +624,7 @@ ticket:
landed: Entregado landed: Entregado
consigneePhone: Tel. consignatario consigneePhone: Tel. consignatario
consigneeMobile: Móv. consignatario consigneeMobile: Móv. consignatario
consigneeAddress: Dir. consignatario
clientPhone: Tel. cliente clientPhone: Tel. cliente
clientMobile: Móv. cliente clientMobile: Móv. cliente
consignee: Consignatario consignee: Consignatario

View File

@ -493,7 +493,6 @@ async function handleInvoiceOutData() {
<QDialog ref="dialogRef" v-model="showChangeTimeDialog"> <QDialog ref="dialogRef" v-model="showChangeTimeDialog">
<FormPopup @on-submit="changeShippedHour(time)" :title="t('Change shipped hour')"> <FormPopup @on-submit="changeShippedHour(time)" :title="t('Change shipped hour')">
<template #form-inputs> <template #form-inputs>
<!--TODO: pone el año a 1970, esperar corrección componente VnInputTime-->
<VnInputTime v-model="time" :label="t('Shipped hour')" clearable /> <VnInputTime v-model="time" :label="t('Shipped hour')" clearable />
</template> </template>
</FormPopup> </FormPopup>

View File

@ -615,7 +615,7 @@ async function save(item) {
</QIcon> </QIcon>
<QIcon <QIcon
v-if="row.hasComponentLack" v-if="row.hasComponentLack"
class="link" color="primary"
name="vn:components" name="vn:components"
size="xs" size="xs"
> >

View File

@ -243,6 +243,15 @@ async function changeState(value) {
</VnLv> </VnLv>
<VnLv <VnLv
:label="t('ticket.summary.consignee')" :label="t('ticket.summary.consignee')"
:value="
ticket.client.salesPersonUser.nickname +
' #' +
ticket.client.salesPersonUser.id
"
>
</VnLv>
<VnLv
:label="t('ticket.summary.consigneeAddress')"
:value="formattedAddress()" :value="formattedAddress()"
/> />
</QCard> </QCard>
@ -316,7 +325,7 @@ async function changeState(value) {
round round
icon="vn:claims" icon="vn:claims"
v-if="props.row.claim" v-if="props.row.claim"
class="link" color="primary"
:to="{ :to="{
name: 'ClaimCard', name: 'ClaimCard',
params: { params: {
@ -324,17 +333,17 @@ async function changeState(value) {
}, },
}" }"
> >
<QTooltip <QTooltip>
>{{ t('ticket.summary.claim') }}: {{ t('ticket.summary.claim') }}:
{{ props.row.claim.claimFk }}</QTooltip {{ props.row.claim.claimFk }}
> </QTooltip>
</QBtn> </QBtn>
<QBtn <QBtn
flat flat
round round
icon="vn:claims" icon="vn:claims"
v-if="props.row.claimBeginning" v-if="props.row.claimBeginning"
class="link" color="primary"
:to="{ :to="{
name: 'ClaimCard', name: 'ClaimCard',
params: { params: {
@ -342,25 +351,25 @@ async function changeState(value) {
}, },
}" }"
> >
<QTooltip <QTooltip>
>{{ t('ticket.summary.claim') }}: {{ t('ticket.summary.claim') }}:
{{ props.row.claimBeginning.claimFk }}</QTooltip {{ props.row.claimBeginning.claimFk }}
> </QTooltip>
</QBtn> </QBtn>
<QIcon <QIcon
name="warning" name="warning"
v-show="props.row.visible < 0" v-show="props.row.visible < 0"
class="link" color="primary"
> >
<QTooltip <QTooltip>
>{{ t('ticket.summary.visible') }}: {{ t('ticket.summary.visible') }}:
{{ props.row.visible }}</QTooltip {{ props.row.visible }}
> </QTooltip>
</QIcon> </QIcon>
<QIcon <QIcon
name="vn:reserva" name="vn:reserva"
v-show="props.row.reserved" v-show="props.row.reserved"
class="link" color="primary"
> >
<QTooltip> <QTooltip>
{{ t('ticket.summary.reserved') }} {{ t('ticket.summary.reserved') }}
@ -369,7 +378,7 @@ async function changeState(value) {
<QIcon <QIcon
name="vn:unavailable" name="vn:unavailable"
v-show="props.row.itemShortage" v-show="props.row.itemShortage"
class="link" color="primary"
> >
<QTooltip> <QTooltip>
{{ t('ticket.summary.itemShortage') }} {{ t('ticket.summary.itemShortage') }}
@ -378,10 +387,9 @@ async function changeState(value) {
<QIcon <QIcon
name="vn:components" name="vn:components"
v-show="props.row.hasComponentLack" v-show="props.row.hasComponentLack"
class="link" color="primary"
> >
<QTooltip> <QTooltip>
{{ props.row }}
{{ t('ticket.summary.hasComponentLack') }} {{ t('ticket.summary.hasComponentLack') }}
</QTooltip> </QTooltip>
</QIcon> </QIcon>

View File

@ -17,6 +17,9 @@ import RightMenu from 'src/components/common/RightMenu.vue';
import TicketFilter from './TicketFilter.vue'; import TicketFilter from './TicketFilter.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
import { toTimeFormat } from 'src/filters/date';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -47,16 +50,9 @@ const amountToReturn = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
name: 'stateFk', name: 'statusIcons',
label: t('ticketList.state'), hidden: true,
columnFilter: { format: () => '',
name: 'stateFk',
component: 'select',
attrs: {
url: 'States',
fields: ['id', 'name'],
},
},
}, },
{ {
align: 'left', align: 'left',
@ -67,40 +63,6 @@ const columns = computed(() => [
}, },
isId: true, isId: true,
}, },
{
align: 'left',
name: 'nickname',
label: t('ticketList.nickname'),
isTitle: true,
},
{
align: 'left',
name: 'shipped',
cardVisible: true,
label: t('ticketList.shipped'),
columnFilter: {
component: 'date',
alias: 't',
inWhere: true,
},
format: ({ shipped }) => toDate(shipped),
},
{
align: 'left',
name: 'zoneFk',
label: t('ticketList.zone'),
columnFilter: {
component: 'select',
attrs: {
url: 'Zones',
fields: ['id', 'name'],
},
alias: 't',
inWhere: true,
},
format: (row, dashIfEmpty) => dashIfEmpty(row.zoneName),
},
{ {
align: 'left', align: 'left',
label: t('ticketList.salesPerson'), label: t('ticketList.salesPerson'),
@ -118,6 +80,77 @@ const columns = computed(() => [
}, },
format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson), format: (row, dashIfEmpty) => dashIfEmpty(row.salesPerson),
}, },
{
align: 'left',
name: 'shippedDate',
cardVisible: true,
label: t('ticketList.shipped'),
columnFilter: {
component: 'date',
alias: 't',
inWhere: true,
},
format: ({ shippedDate }) => toDate(shippedDate),
},
{
align: 'left',
name: 'shipped',
label: t('ticketList.hour'),
format: (row) => toTimeFormat(row.shipped),
},
{
align: 'left',
name: 'zoneLanding',
label: t('ticketList.closure'),
format: (row, dashIfEmpty) => dashIfEmpty(toTimeFormat(row.zoneLanding)),
},
{
align: 'left',
name: 'nickname',
label: t('ticketList.nickname'),
},
{
align: 'left',
name: 'province',
label: t('ticketList.province'),
columnClass: 'expand',
},
{
align: 'left',
name: 'stateFk',
label: t('ticketList.state'),
columnFilter: {
name: 'stateFk',
component: 'select',
attrs: {
url: 'States',
fields: ['id', 'name'],
},
},
columnClass: 'expand',
},
{
align: 'left',
name: 'zoneFk',
label: t('ticketList.zone'),
columnFilter: {
component: 'select',
attrs: {
url: 'Zones',
fields: ['id', 'name'],
},
alias: 't',
inWhere: true,
},
columnClass: 'expand',
format: (row, dashIfEmpty) => dashIfEmpty(row.zoneName),
},
{
align: 'left',
name: 'warehouse',
label: t('ticketList.warehouse'),
columnClass: 'expand',
},
{ {
align: 'left', align: 'left',
name: 'totalWithVat', name: 'totalWithVat',
@ -133,15 +166,27 @@ const columns = computed(() => [
align: 'right', align: 'right',
name: 'tableActions', name: 'tableActions',
actions: [ actions: [
{
title: t('ticketList.toLines'),
icon: 'list',
isPrimary: true,
action: (row) => redirectToLines(row.id),
},
{ {
title: t('ticketList.summary'), title: t('ticketList.summary'),
icon: 'preview', icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary), action: (row) => viewSummary(row.id, TicketSummary),
}, },
], ],
}, },
]); ]);
function redirectToLines(id) {
const url = `#/ticket/${id}/sale`;
window.open(url, '_blank');
}
const onClientSelected = async (formData) => { const onClientSelected = async (formData) => {
await fetchClient(formData); await fetchClient(formData);
await fetchAddresses(formData); await fetchAddresses(formData);
@ -213,6 +258,21 @@ const getColor = (row) => {
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange'; return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
}; };
const getDateColor = (date) => {
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0);
const comparation = today - timeTicket;
return comparation < 0 ? 'bg-success' : 'bg-warning';
};
const getTotalColor = () => {
// const total = row.totalWithVat;
// return total > 0 && total < 50 ? 'bg-warning' : '';
return 'bg-warning';
};
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));
async function makeInvoice(ticket) { async function makeInvoice(ticket) {
@ -387,7 +447,7 @@ function setReference(data) {
formInitialData: {}, formInitialData: {},
}" }"
default-mode="table" default-mode="table"
order="shipped DESC" :order="['shippedDate DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id']"
:columns="columns" :columns="columns"
:user-params="userParams" :user-params="userParams"
:right-search="false" :right-search="false"
@ -399,6 +459,101 @@ function setReference(data) {
selection: 'multiple', selection: 'multiple',
}" }"
> >
<template #column-statusIcons="{ row }">
<QIcon
v-if="row.isTaxDataChecked === 0"
color="primary"
name="vn:no036"
size="xs"
>
<QTooltip>
{{ t('No verified data') }}
</QTooltip>
</QIcon>
<QIcon v-if="row.hasTicketRequest" color="primary" name="vn:claims" size="xs">
<QTooltip>
{{ t('Purchase request') }}
</QTooltip>
</QIcon>
<QIcon
v-if="row.itemShortage"
color="primary"
name="vn:unavailable"
size="xs"
>
<QTooltip>
{{ t('Not visible') }}
</QTooltip>
</QIcon>
<QIcon v-if="row.isFreezed" color="primary" name="vn:frozen" size="xs">
<QTooltip>
{{ t('Client frozen') }}
</QTooltip>
</QIcon>
<QIcon v-if="row.risk" color="primary" name="vn:risk" size="xs">
<QTooltip>
{{ t('Risk') }}
</QTooltip>
</QIcon>
<QIcon
v-if="row.hasComponentLack"
color="primary"
name="vn:components"
size="xs"
>
<QTooltip>
{{ t('Component lack') }}
</QTooltip>
</QIcon>
<QIcon
v-if="row.hasRounding"
color="primary"
name="vn:sync_problem"
size="xs"
>
<QTooltip>
{{ t('Rounding') }}
</QTooltip>
</QIcon>
</template>
<template #column-salesPersonFk="{ row }">
<span class="link" @click.stop>
{{ row.salesPerson }}
<CustomerDescriptorProxy :id="row.salesPersonFk" />
</span>
</template>
<template #column-shippedDate="{ row }">
<QChip :class="getDateColor(row.shipped)" dense square>
{{ row.shippedDate }}
</QChip>
</template>
<template #column-nickname="{ row }">
<span class="link" @click.stop>
{{ row.nickname }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template>
<template #column-stateFk="{ row }">
<QChip :class="getColor(row)" dense square>
{{ row.state }}
</QChip>
</template>
<template #column-zoneFk="{ row }">
<span class="link" @click.stop>
{{ row.zoneName }}
<ZoneDescriptorProxy :id="row.zoneFk" />
</span>
</template>
<template #column-totalWithVat="{ row }">
<QChip
v-if="row.totalWithVat > 0 && row.totalWithVat < 50"
:class="getTotalColor()"
dense
square
>
{{ row.totalWithVat }}
</QChip>
</template>
<template #more-create-dialog="{ data }"> <template #more-create-dialog="{ data }">
<VnRow> <VnRow>
<VnSelect <VnSelect
@ -490,11 +645,6 @@ function setReference(data) {
</div> </div>
</VnRow> </VnRow>
</template> </template>
<template #column-stateFk="{ row }">
<QChip :class="getColor(row)" dense square>
{{ row.state }}
</QChip>
</template>
</VnTable> </VnTable>
<QPageSticky :offset="[20, 80]" style="z-index: 2"> <QPageSticky :offset="[20, 80]" style="z-index: 2">
<QBtn <QBtn
@ -633,4 +783,5 @@ es:
You can search by ticket id or alias: Puedes buscar por id o alias del ticket You can search by ticket id or alias: Puedes buscar por id o alias del ticket
Zone: Zona Zone: Zona
New ticket: Nuevo ticket New ticket: Nuevo ticket
Component lack: Faltan componentes
</i18n> </i18n>

View File

@ -258,3 +258,8 @@ ticketList:
compensation: Compensation compensation: Compensation
creditCard: Credit card creditCard: Credit card
transfers: Transfers transfers: Transfers
province: Province
warehouse: Warehouse
hour: Hour
closure: Closure
toLines: Go to lines

View File

@ -261,3 +261,8 @@ ticketList:
compensation: Compensación compensation: Compensación
creditCard: Tarjeta de crédito creditCard: Tarjeta de crédito
transfers: Transferencias transfers: Transferencias
province: Provincia
warehouse: Almacén
hour: Hora
closure: Cierre
toLines: Ir a lineas