#7553 modified TicketExpedition & changes in ticket section #571

Merged
jon merged 79 commits from 7553_FixTicketExpedition into dev 2024-09-25 05:51:16 +00:00
8 changed files with 241 additions and 71 deletions
Showing only changes of commit 45d9322892 - Show all commits

View File

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

View File

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

View File

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

View File

@ -615,7 +615,7 @@ async function save(item) {
</QIcon>
<QIcon
v-if="row.hasComponentLack"
class="link"
color="primary"
name="vn:components"
jon marked this conversation as resolved Outdated

Podemos hacer que la columna articulo sea mas ancho para que quepan mas registros por filas?
Por ejemplo hay campos numéricos que tienen mucho ancho

Podemos hacer que la columna articulo sea mas ancho para que quepan mas registros por filas? Por ejemplo hay campos numéricos que tienen mucho ancho
size="xs"
>

View File

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

View File

@ -17,6 +17,9 @@ import RightMenu from 'src/components/common/RightMenu.vue';
import TicketFilter from './TicketFilter.vue';
import VnInput from 'src/components/common/VnInput.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 { viewSummary } = useSummaryDialog();
@ -47,16 +50,9 @@ const amountToReturn = ref();
const columns = computed(() => [
{
align: 'left',
name: 'stateFk',
label: t('ticketList.state'),
columnFilter: {
name: 'stateFk',
component: 'select',
attrs: {
url: 'States',
fields: ['id', 'name'],
},
},
name: 'statusIcons',
hidden: true,
format: () => '',
},
{
align: 'left',
@ -67,40 +63,6 @@ const columns = computed(() => [
},
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',
label: t('ticketList.salesPerson'),
@ -118,6 +80,77 @@ const columns = computed(() => [
},
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',
name: 'totalWithVat',
@ -133,15 +166,27 @@ const columns = computed(() => [
align: 'right',
name: 'tableActions',
actions: [
{
title: t('ticketList.toLines'),
icon: 'list',
isPrimary: true,
action: (row) => redirectToLines(row.id),
},
{
title: t('ticketList.summary'),
icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary),
},
],
},
]);
function redirectToLines(id) {
const url = `#/ticket/${id}/sale`;
window.open(url, '_blank');
}
const onClientSelected = async (formData) => {
await fetchClient(formData);
await fetchAddresses(formData);
@ -213,6 +258,21 @@ const getColor = (row) => {
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));
async function makeInvoice(ticket) {
@ -387,7 +447,7 @@ function setReference(data) {
formInitialData: {},
}"
default-mode="table"
order="shipped DESC"
:order="['shippedDate DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id']"
:columns="columns"
:user-params="userParams"
:right-search="false"
@ -399,6 +459,101 @@ function setReference(data) {
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 }">
<VnRow>
jon marked this conversation as resolved Outdated

falta añadir toDate, porque sigue mostrándolo mal a pesar de dar format en la declaraciones de columnas

falta añadir toDate, porque sigue mostrándolo mal a pesar de dar format en la declaraciones de columnas
<VnSelect
@ -490,11 +645,6 @@ function setReference(data) {
</div>
</VnRow>
</template>
<template #column-stateFk="{ row }">
<QChip :class="getColor(row)" dense square>
{{ row.state }}
</QChip>
</template>
</VnTable>
<QPageSticky :offset="[20, 80]" style="z-index: 2">
<QBtn
@ -633,4 +783,5 @@ es:
You can search by ticket id or alias: Puedes buscar por id o alias del ticket
Zone: Zona
New ticket: Nuevo ticket
Component lack: Faltan componentes
</i18n>

View File

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

View File

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