forked from verdnatura/salix-front
Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6943_fix_customerSummaryTable
This commit is contained in:
commit
c3108b4335
|
@ -31,6 +31,7 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||||
|
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
|
||||||
|
|
||||||
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
||||||
|
|
||||||
|
@ -68,8 +69,10 @@ async function confirm() {
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
|
<QBtn icon="close" :disable="isLoading" flat round dense v-close-popup />
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="row items-center">
|
<QCardSection class="q-pb-none">
|
||||||
<span v-if="message !== false" v-html="message" />
|
<span v-if="message !== false" v-html="message" />
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection class="row items-center q-pt-none">
|
||||||
<slot name="customHTML"></slot>
|
<slot name="customHTML"></slot>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardActions align="right">
|
<QCardActions align="right">
|
||||||
|
|
|
@ -102,6 +102,7 @@ globals:
|
||||||
item: Item
|
item: Item
|
||||||
ticket: Ticket
|
ticket: Ticket
|
||||||
campaign: Campaign
|
campaign: Campaign
|
||||||
|
weight: Weight
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
summary: Summary
|
summary: Summary
|
||||||
|
|
|
@ -104,6 +104,7 @@ globals:
|
||||||
item: Artículo
|
item: Artículo
|
||||||
ticket: Ticket
|
ticket: Ticket
|
||||||
campaign: Campaña
|
campaign: Campaña
|
||||||
|
weight: Peso
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
summary: Resumen
|
summary: Resumen
|
||||||
|
|
|
@ -9,6 +9,8 @@ import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import VnSmsDialog from 'components/common/VnSmsDialog.vue';
|
import VnSmsDialog from 'components/common/VnSmsDialog.vue';
|
||||||
import toDate from 'filters/toDate';
|
import toDate from 'filters/toDate';
|
||||||
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
ticket: {
|
ticket: {
|
||||||
|
@ -21,9 +23,10 @@ const { push, currentRoute } = useRouter();
|
||||||
const { dialog, notify } = useQuasar();
|
const { dialog, notify } = useQuasar();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { openReport, sendEmail } = usePrintService();
|
const { openReport, sendEmail } = usePrintService();
|
||||||
|
const ticketSummary = useArrayData('TicketSummary');
|
||||||
const ticket = ref(props.ticket);
|
const ticket = ref(props.ticket);
|
||||||
const ticketId = currentRoute.value.params.id;
|
const ticketId = currentRoute.value.params.id;
|
||||||
|
const weight = ref();
|
||||||
const actions = {
|
const actions = {
|
||||||
clone: async () => {
|
clone: async () => {
|
||||||
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
||||||
|
@ -46,6 +49,25 @@ const actions = {
|
||||||
push({ name: 'TicketSummary', params: { id: clonedTicketId } });
|
push({ name: 'TicketSummary', params: { id: clonedTicketId } });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
setWeight: async () => {
|
||||||
|
try {
|
||||||
|
const invoiceIds = (
|
||||||
|
await axios.post(`Tickets/${ticketId}/setWeight`, {
|
||||||
|
weight: weight.value,
|
||||||
|
})
|
||||||
|
).data;
|
||||||
|
|
||||||
|
notify({ message: t('Weight set'), type: 'positive' });
|
||||||
|
if (invoiceIds.length)
|
||||||
|
notify({
|
||||||
|
message: t('invoiceIds', { invoiceIds: invoiceIds.join() }),
|
||||||
|
type: 'positive',
|
||||||
|
});
|
||||||
|
await ticketSummary.fetch({ updateRouter: false });
|
||||||
|
} catch (e) {
|
||||||
|
notify({ message: e.message, type: 'negative' });
|
||||||
|
}
|
||||||
|
},
|
||||||
remove: async () => {
|
remove: async () => {
|
||||||
try {
|
try {
|
||||||
await axios.post(`Tickets/${ticketId}/setDeleted`);
|
await axios.post(`Tickets/${ticketId}/setDeleted`);
|
||||||
|
@ -255,6 +277,12 @@ function openConfirmDialog(callback) {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem @click="$refs.weightDialog.show()" v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="weight" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Set weight') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<template v-if="!ticket.isDeleted">
|
<template v-if="!ticket.isDeleted">
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QItem @click="openConfirmDialog('remove')" v-ripple clickable>
|
<QItem @click="openConfirmDialog('remove')" v-ripple clickable>
|
||||||
|
@ -264,9 +292,25 @@ function openConfirmDialog(callback) {
|
||||||
<QItemSection>{{ t('Delete ticket') }}</QItemSection>
|
<QItemSection>{{ t('Delete ticket') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
|
<VnConfirm
|
||||||
|
ref="weightDialog"
|
||||||
|
:title="t('Set weight')"
|
||||||
|
:message="t('This ticket may be invoiced, do you want to continue?')"
|
||||||
|
:promise="actions.setWeight"
|
||||||
|
>
|
||||||
|
<template #customHTML>
|
||||||
|
<VnInputNumber
|
||||||
|
:label="t('globals.weight')"
|
||||||
|
v-model="weight"
|
||||||
|
class="full-width"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</VnConfirm>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
en:
|
||||||
|
invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}"
|
||||||
|
|
||||||
es:
|
es:
|
||||||
Open Delivery Note...: Abrir albarán...
|
Open Delivery Note...: Abrir albarán...
|
||||||
Send Delivery Note...: Enviar albarán...
|
Send Delivery Note...: Enviar albarán...
|
||||||
|
@ -284,4 +328,8 @@ es:
|
||||||
To clone ticket: Clonar ticket
|
To clone ticket: Clonar ticket
|
||||||
Ticket cloned: Ticked clonado
|
Ticket cloned: Ticked clonado
|
||||||
It was not able to clone the ticket: No se pudo clonar el ticket
|
It was not able to clone the ticket: No se pudo clonar el ticket
|
||||||
|
Set weight: Establecer peso
|
||||||
|
Weight set: Peso establecido
|
||||||
|
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
||||||
|
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -31,8 +31,7 @@ const $props = defineProps({
|
||||||
const entityId = computed(() => $props.id || route.params.id);
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
const summaryRef = ref();
|
const summaryRef = ref();
|
||||||
const ticket = ref();
|
const ticket = computed(() => summaryRef.value?.entity);
|
||||||
const salesLines = ref(null);
|
|
||||||
const editableStates = ref([]);
|
const editableStates = ref([]);
|
||||||
const ticketUrl = ref();
|
const ticketUrl = ref();
|
||||||
const grafanaUrl = 'https://grafana.verdnatura.es';
|
const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||||
|
@ -40,12 +39,6 @@ const grafanaUrl = 'https://grafana.verdnatura.es';
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
||||||
});
|
});
|
||||||
async function setData(data) {
|
|
||||||
if (data) {
|
|
||||||
ticket.value = data;
|
|
||||||
salesLines.value = data.sales;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function formattedAddress() {
|
function formattedAddress() {
|
||||||
if (!ticket.value) return '';
|
if (!ticket.value) return '';
|
||||||
|
@ -89,7 +82,6 @@ async function changeState(value) {
|
||||||
<CardSummary
|
<CardSummary
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
@on-fetch="(data) => setData(data)"
|
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
>
|
>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
|
@ -131,7 +123,7 @@ async function changeState(value) {
|
||||||
</QList>
|
</QList>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
</template>
|
</template>
|
||||||
<template #body>
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="ticketUrl + 'basic-data/step-one'"
|
:url="ticketUrl + 'basic-data/step-one'"
|
||||||
|
@ -139,27 +131,27 @@ async function changeState(value) {
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('ticket.summary.state')">
|
<VnLv :label="t('ticket.summary.state')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<QChip :color="ticket.ticketState?.state?.classColor ?? 'dark'">
|
<QChip :color="entity.ticketState?.state?.classColor ?? 'dark'">
|
||||||
{{ ticket.ticketState?.state?.name }}
|
{{ entity.ticketState?.state?.name }}
|
||||||
</QChip>
|
</QChip>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.salesPerson')">
|
<VnLv :label="t('ticket.summary.salesPerson')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<VnUserLink
|
<VnUserLink
|
||||||
:name="ticket.client?.salesPersonUser?.name"
|
:name="entity.client?.salesPersonUser?.name"
|
||||||
:worker-id="ticket.client?.salesPersonFk"
|
:worker-id="entity.client?.salesPersonFk"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.agency')"
|
:label="t('ticket.summary.agency')"
|
||||||
:value="ticket.agencyMode?.name"
|
:value="entity.agencyMode?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('ticket.summary.zone')" :value="ticket?.zone?.name" />
|
<VnLv :label="t('ticket.summary.zone')" :value="entity?.zone?.name" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.warehouse')"
|
:label="t('ticket.summary.warehouse')"
|
||||||
:value="ticket.warehouse?.name"
|
:value="entity.warehouse?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
v-if="ticket?.ticketCollections?.length > 0"
|
v-if="ticket?.ticketCollections?.length > 0"
|
||||||
|
@ -168,29 +160,29 @@ async function changeState(value) {
|
||||||
>
|
>
|
||||||
<template #value>
|
<template #value>
|
||||||
<a
|
<a
|
||||||
:href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${ticket.ticketCollections[0]?.collectionFk}`"
|
:href="`${grafanaUrl}/d/d552ab74-85b4-4e7f-a279-fab7cd9c6124/control-de-expediciones?orgId=1&var-collectionFk=${entity.ticketCollections[0]?.collectionFk}`"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="grafana"
|
class="grafana"
|
||||||
>
|
>
|
||||||
{{ ticket.ticketCollections[0]?.collectionFk }}
|
{{ entity.ticketCollections[0]?.collectionFk }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :label="t('ticket.summary.route')" :value="ticket.routeFk" />
|
<VnLv :label="t('ticket.summary.route')" :value="entity.routeFk" />
|
||||||
<VnLv :label="t('ticket.summary.invoice')">
|
<VnLv :label="t('ticket.summary.invoice')">
|
||||||
<template #value>
|
<template #value>
|
||||||
<span :class="{ link: ticket.refFk }">
|
<span :class="{ link: entity.refFk }">
|
||||||
{{ dashIfEmpty(ticket.refFk) }}
|
{{ dashIfEmpty(entity.refFk) }}
|
||||||
<InvoiceOutDescriptorProxy
|
<InvoiceOutDescriptorProxy
|
||||||
:id="ticket.invoiceOut.id"
|
:id="entity.invoiceOut.id"
|
||||||
v-if="ticket.refFk"
|
v-if="entity.refFk"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.weight')"
|
:label="t('ticket.summary.weight')"
|
||||||
:value="dashIfEmpty(ticket.weight)"
|
:value="dashIfEmpty(entity.weight)"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
|
@ -200,35 +192,35 @@ async function changeState(value) {
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.shipped')"
|
:label="t('ticket.summary.shipped')"
|
||||||
:value="toDate(ticket.shipped)"
|
:value="toDate(entity.shipped)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.landed')"
|
:label="t('ticket.summary.landed')"
|
||||||
:value="toDate(ticket.landed)"
|
:value="toDate(entity.landed)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('globals.packages')" :value="ticket.packages" />
|
<VnLv :label="t('globals.packages')" :value="entity.packages" />
|
||||||
<VnLv :value="ticket.address.phone">
|
<VnLv :value="entity.address.phone">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('ticket.summary.consigneePhone') }}
|
{{ t('ticket.summary.consigneePhone') }}
|
||||||
<VnLinkPhone :phone-number="ticket.address.phone" />
|
<VnLinkPhone :phone-number="entity.address.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="ticket.address.mobile">
|
<VnLv :value="entity.address.mobile">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('ticket.summary.consigneeMobile') }}
|
{{ t('ticket.summary.consigneeMobile') }}
|
||||||
<VnLinkPhone :phone-number="ticket.address.mobile" />
|
<VnLinkPhone :phone-number="entity.address.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="ticket.client.phone">
|
<VnLv :value="entity.client.phone">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('ticket.summary.clientPhone') }}
|
{{ t('ticket.summary.clientPhone') }}
|
||||||
<VnLinkPhone :phone-number="ticket.client.phone" />
|
<VnLinkPhone :phone-number="entity.client.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="ticket.client.mobile">
|
<VnLv :value="entity.client.mobile">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('ticket.summary.clientMobile') }}
|
{{ t('ticket.summary.clientMobile') }}
|
||||||
<VnLinkPhone :phone-number="ticket.client.mobile" />
|
<VnLinkPhone :phone-number="entity.client.mobile" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
@ -236,13 +228,13 @@ async function changeState(value) {
|
||||||
:value="formattedAddress()"
|
:value="formattedAddress()"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="ticket.notes.length">
|
<QCard class="vn-one" v-if="entity.notes.length">
|
||||||
<VnTitle
|
<VnTitle
|
||||||
:url="ticketUrl + 'observation'"
|
:url="ticketUrl + 'observation'"
|
||||||
:text="t('ticket.pageTitles.notes')"
|
:text="t('ticket.pageTitles.notes')"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
v-for="note in ticket.notes"
|
v-for="note in entity.notes"
|
||||||
:key="note.id"
|
:key="note.id"
|
||||||
:label="note.observationType.description"
|
:label="note.observationType.description"
|
||||||
:value="note.description"
|
:value="note.description"
|
||||||
|
@ -263,15 +255,15 @@ async function changeState(value) {
|
||||||
<div class="bodyCard">
|
<div class="bodyCard">
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.subtotal')"
|
:label="t('ticket.summary.subtotal')"
|
||||||
:value="toCurrency(ticket.totalWithoutVat)"
|
:value="toCurrency(entity.totalWithoutVat)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.vat')"
|
:label="t('ticket.summary.vat')"
|
||||||
:value="toCurrency(ticket.totalWithVat - ticket.totalWithoutVat)"
|
:value="toCurrency(entity.totalWithVat - entity.totalWithoutVat)"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.total')"
|
:label="t('ticket.summary.total')"
|
||||||
:value="toCurrency(ticket.totalWithVat)"
|
:value="toCurrency(entity.totalWithVat)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
@ -280,7 +272,7 @@ async function changeState(value) {
|
||||||
:url="ticketUrl + 'sale'"
|
:url="ticketUrl + 'sale'"
|
||||||
:text="t('ticket.summary.saleLines')"
|
:text="t('ticket.summary.saleLines')"
|
||||||
/>
|
/>
|
||||||
<QTable :rows="ticket.sales" style="text-align: center">
|
<QTable :rows="entity.sales" style="text-align: center">
|
||||||
<template #body-cell="{ value }">
|
<template #body-cell="{ value }">
|
||||||
<QTd>{{ value }}</QTd>
|
<QTd>{{ value }}</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
@ -424,10 +416,10 @@ async function changeState(value) {
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard
|
<QCard
|
||||||
class="vn-max"
|
class="vn-max"
|
||||||
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
|
v-if="entity.packagings.length || entity.services.length"
|
||||||
>
|
>
|
||||||
<VnTitle :url="ticketUrl + 'package'" :text="t('globals.packages')" />
|
<VnTitle :url="ticketUrl + 'package'" :text="t('globals.packages')" />
|
||||||
<QTable :rows="ticket.packagings" flat>
|
<QTable :rows="entity.packagings" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
<QTh auto-width>{{ t('ticket.summary.created') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.created') }}</QTh>
|
||||||
|
@ -447,7 +439,7 @@ async function changeState(value) {
|
||||||
:url="ticketUrl + 'service'"
|
:url="ticketUrl + 'service'"
|
||||||
:text="t('ticket.summary.service')"
|
:text="t('ticket.summary.service')"
|
||||||
/>
|
/>
|
||||||
<QTable :rows="ticket.services" flat>
|
<QTable :rows="entity.services" flat>
|
||||||
<template #header="props">
|
<template #header="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
<QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh>
|
<QTh auto-width>{{ t('ticket.summary.quantity') }}</QTh>
|
||||||
|
|
|
@ -133,6 +133,14 @@ const ticketColumns = computed(() => [
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: null,
|
columnFilter: null,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('advanceTickets.preparation'),
|
||||||
|
name: 'preparation',
|
||||||
|
field: 'preparation',
|
||||||
|
align: 'left',
|
||||||
|
sortable: true,
|
||||||
|
columnFilter: null,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: t('advanceTickets.liters'),
|
label: t('advanceTickets.liters'),
|
||||||
name: 'liters',
|
name: 'liters',
|
||||||
|
@ -624,6 +632,7 @@ onMounted(async () => {
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #body-cell-ticketId="{ row }">
|
<template #body-cell-ticketId="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn flat class="link">
|
<QBtn flat class="link">
|
||||||
|
@ -635,6 +644,7 @@ onMounted(async () => {
|
||||||
<template #body-cell-state="{ row }">
|
<template #body-cell-state="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBadge
|
<QBadge
|
||||||
|
v-if="row.state"
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="row.classColor"
|
:color="row.classColor"
|
||||||
class="q-ma-none"
|
class="q-ma-none"
|
||||||
|
@ -642,6 +652,7 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
{{ row.state }}
|
{{ row.state }}
|
||||||
</QBadge>
|
</QBadge>
|
||||||
|
<span v-else> {{ dashIfEmpty(row.state) }}</span>
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-import="{ row }">
|
<template #body-cell-import="{ row }">
|
||||||
|
|
|
@ -55,7 +55,7 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:search-button="true"
|
:search-button="true"
|
||||||
:hidden-tags="['search']"
|
:hidden-tags="['search']"
|
||||||
:un-removable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']"
|
:unremovable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
@ -119,10 +119,9 @@ onMounted(async () => await getItemPackingTypes());
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.itemPackingTypes')"
|
:label="t('params.isFullMovable')"
|
||||||
v-model="params.itemPackingTypes"
|
v-model="params.isFullMovable"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
:false-value="null"
|
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -155,7 +154,7 @@ en:
|
||||||
dateToAdvance: Destination date
|
dateToAdvance: Destination date
|
||||||
futureIpt: Origin IPT
|
futureIpt: Origin IPT
|
||||||
ipt: Destination IPT
|
ipt: Destination IPT
|
||||||
itemPackingTypes: 100% movable
|
isFullMovable: 100% movable
|
||||||
warehouseFk: Warehouse
|
warehouseFk: Warehouse
|
||||||
es:
|
es:
|
||||||
Horizontal: Horizontal
|
Horizontal: Horizontal
|
||||||
|
@ -166,6 +165,6 @@ es:
|
||||||
dateToAdvance: Fecha destino
|
dateToAdvance: Fecha destino
|
||||||
futureIpt: IPT Origen
|
futureIpt: IPT Origen
|
||||||
ipt: IPT destino
|
ipt: IPT destino
|
||||||
itemPackingTypes: 100% movible
|
isFullMovable: 100% movible
|
||||||
warehouseFk: Almacén
|
warehouseFk: Almacén
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -49,8 +49,8 @@ const exprBuilder = (param, value) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const userParams = reactive({
|
const userParams = reactive({
|
||||||
futureDated: Date.vnNew().toISOString(),
|
futureScopeDays: Date.vnNew().toISOString(),
|
||||||
originDated: Date.vnNew().toISOString(),
|
originScopeDays: Date.vnNew().toISOString(),
|
||||||
warehouseFk: user.value.warehouseFk,
|
warehouseFk: user.value.warehouseFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -62,8 +62,8 @@ const arrayData = useArrayData('FutureTickets', {
|
||||||
const { store } = arrayData;
|
const { store } = arrayData;
|
||||||
|
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
futureDated: Date.vnNew(),
|
futureScopeDays: Date.vnNew(),
|
||||||
originDated: Date.vnNew(),
|
originScopeDays: Date.vnNew(),
|
||||||
warehouseFk: user.value.warehouseFk,
|
warehouseFk: user.value.warehouseFk,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ const ticketColumns = computed(() => [
|
||||||
label: t('futureTickets.availableLines'),
|
label: t('futureTickets.availableLines'),
|
||||||
name: 'lines',
|
name: 'lines',
|
||||||
field: 'lines',
|
field: 'lines',
|
||||||
align: 'left',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: VnInput,
|
component: VnInput,
|
||||||
|
@ -234,7 +234,7 @@ const ticketColumns = computed(() => [
|
||||||
{
|
{
|
||||||
label: t('futureTickets.futureState'),
|
label: t('futureTickets.futureState'),
|
||||||
name: 'futureState',
|
name: 'futureState',
|
||||||
align: 'left',
|
align: 'right',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
columnFilter: null,
|
columnFilter: null,
|
||||||
format: (val) => dashIfEmpty(val),
|
format: (val) => dashIfEmpty(val),
|
||||||
|
@ -458,7 +458,7 @@ onMounted(async () => {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-shipped="{ row }">
|
<template #body-cell-shipped="{ row }">
|
||||||
<QTd>
|
<QTd class="shipped">
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="getDateQBadgeColor(row.shipped)"
|
:color="getDateQBadgeColor(row.shipped)"
|
||||||
|
@ -505,7 +505,7 @@ onMounted(async () => {
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-futureShipped="{ row }">
|
<template #body-cell-futureShipped="{ row }">
|
||||||
<QTd>
|
<QTd class="shipped">
|
||||||
<QBadge
|
<QBadge
|
||||||
text-color="black"
|
text-color="black"
|
||||||
:color="getDateQBadgeColor(row.futureShipped)"
|
:color="getDateQBadgeColor(row.futureShipped)"
|
||||||
|
@ -532,6 +532,9 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.shipped {
|
||||||
|
min-width: 132px;
|
||||||
|
}
|
||||||
.vertical-separator {
|
.vertical-separator {
|
||||||
border-left: 4px solid white !important;
|
border-left: 4px solid white !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ onMounted(async () => {
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:hidden-tags="['search']"
|
:hidden-tags="['search']"
|
||||||
:un-removable-params="['warehouseFk', 'originDated', 'futureDated']"
|
:un-removable-params="['warehouseFk', 'originScopeDays ', 'futureScopeDays']"
|
||||||
>
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
@ -80,8 +80,8 @@ onMounted(async () => {
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-model="params.originDated"
|
v-model="params.originScopeDays"
|
||||||
:label="t('params.originDated')"
|
:label="t('params.originScopeDays')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -89,8 +89,8 @@ onMounted(async () => {
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate
|
<VnInputDate
|
||||||
v-model="params.futureDated"
|
v-model="params.futureScopeDays"
|
||||||
:label="t('params.futureDated')"
|
:label="t('params.futureScopeDays')"
|
||||||
is-outlined
|
is-outlined
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
|
@ -214,8 +214,8 @@ onMounted(async () => {
|
||||||
en:
|
en:
|
||||||
iptInfo: IPT
|
iptInfo: IPT
|
||||||
params:
|
params:
|
||||||
originDated: Origin date
|
originScopeDays: Origin date
|
||||||
futureDated: Destination date
|
futureScopeDays: Destination date
|
||||||
futureIpt: Destination IPT
|
futureIpt: Destination IPT
|
||||||
ipt: Origin IPT
|
ipt: Origin IPT
|
||||||
warehouseFk: Warehouse
|
warehouseFk: Warehouse
|
||||||
|
@ -229,8 +229,8 @@ es:
|
||||||
Vertical: Vertical
|
Vertical: Vertical
|
||||||
iptInfo: Encajado
|
iptInfo: Encajado
|
||||||
params:
|
params:
|
||||||
originDated: Fecha origen
|
originScopeDays: Fecha origen
|
||||||
futureDated: Fecha destino
|
futureScopeDays: Fecha destino
|
||||||
futureIpt: IPT destino
|
futureIpt: IPT destino
|
||||||
ipt: IPT Origen
|
ipt: IPT Origen
|
||||||
warehouseFk: Almacén
|
warehouseFk: Almacén
|
||||||
|
|
|
@ -105,7 +105,7 @@ advanceTickets:
|
||||||
futureLines: Líneas
|
futureLines: Líneas
|
||||||
futureImport: Importe
|
futureImport: Importe
|
||||||
advanceTickets: Adelantar tickets con negativos
|
advanceTickets: Adelantar tickets con negativos
|
||||||
advanceTicketTitle: Advance tickets
|
advanceTicketTitle: Adelantar tickets
|
||||||
advanceTitleSubtitle: '¿Desea adelantar {selectedTickets} tickets?'
|
advanceTitleSubtitle: '¿Desea adelantar {selectedTickets} tickets?'
|
||||||
noDeliveryZone: No hay una zona de reparto disponible para la fecha de envío seleccionada
|
noDeliveryZone: No hay una zona de reparto disponible para la fecha de envío seleccionada
|
||||||
moveTicketSuccess: 'Tickets movidos correctamente {ticketsNumber}'
|
moveTicketSuccess: 'Tickets movidos correctamente {ticketsNumber}'
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('Ticket descriptor', () => {
|
describe('Ticket descriptor', () => {
|
||||||
const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
|
const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
|
||||||
|
const setWeightOpt = '[role="menu"] .q-list > :nth-child(6)';
|
||||||
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
||||||
const summaryHeader = '.summaryHeader > div';
|
const summaryHeader = '.summaryHeader > div';
|
||||||
|
const weight = 25;
|
||||||
|
const weightValue = ':nth-child(10) > .value > span';
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const ticketId = 1;
|
|
||||||
|
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/ticket/${ticketId}/summary`);
|
cy.viewport(1920, 1080);
|
||||||
cy.waitForElement('.q-page', 7000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should clone the ticket without warehouse', () => {
|
it('should clone the ticket without warehouse', () => {
|
||||||
cy.openLeftMenu();
|
cy.visit('/#/ticket/1/summary');
|
||||||
cy.openActionsDescriptor();
|
cy.openActionsDescriptor();
|
||||||
cy.get(toCloneOpt).click();
|
cy.get(toCloneOpt).click();
|
||||||
cy.clickConfirm();
|
cy.clickConfirm();
|
||||||
|
@ -25,4 +24,15 @@ describe('Ticket descriptor', () => {
|
||||||
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
|
cy.wrap(owner.trim()).should('eq', 'Bruce Wayne (1101)');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should set the weight of the ticket', () => {
|
||||||
|
cy.visit('/#/ticket/10/summary');
|
||||||
|
cy.openActionsDescriptor();
|
||||||
|
cy.get(setWeightOpt).click();
|
||||||
|
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
|
||||||
|
cy.get('.q-dialog input').type(weight);
|
||||||
|
cy.clickConfirm();
|
||||||
|
cy.wait('@weight');
|
||||||
|
cy.get(weightValue).contains(weight);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue