refactor: use docuware in ticket descriptor menu
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
2dd3e09928
commit
d416a34560
|
@ -41,6 +41,8 @@ const isEditable = ref();
|
||||||
const hasInvoicing = useAcl('invoicing');
|
const hasInvoicing = useAcl('invoicing');
|
||||||
const hasPdf = ref();
|
const hasPdf = ref();
|
||||||
const weight = ref();
|
const weight = ref();
|
||||||
|
const hasDocuwareFile = ref();
|
||||||
|
const quasar = useQuasar();
|
||||||
const actions = {
|
const actions = {
|
||||||
clone: async () => {
|
clone: async () => {
|
||||||
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
const opts = { message: t('Ticket cloned'), type: 'positive' };
|
||||||
|
@ -332,6 +334,41 @@ async function handleInvoiceOutData() {
|
||||||
});
|
});
|
||||||
hasPdf.value = data[0]?.hasPdf;
|
hasPdf.value = data[0]?.hasPdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function docuwareDownload() {
|
||||||
|
await axios.get(`Tickets/${ticketId}/docuwareDownload`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function hasDocuware() {
|
||||||
|
const { data } = await axios.post(`Docuwares/${ticketId}/checkFile`, {
|
||||||
|
fileCabinet: 'deliveryNote',
|
||||||
|
signed: true,
|
||||||
|
});
|
||||||
|
hasDocuwareFile.value = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function uploadDocuware(force) {
|
||||||
|
console.log('force: ', force);
|
||||||
|
if (!force)
|
||||||
|
return quasar
|
||||||
|
.dialog({
|
||||||
|
component: VnConfirm,
|
||||||
|
componentProps: {
|
||||||
|
title: t('Send PDF to tablet'),
|
||||||
|
message: t('Are you sure you want to replace this delivery note?'),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.onOk(async () => {
|
||||||
|
uploadDocuware(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
const { data } = await axios.post(`Docuwares/upload`, {
|
||||||
|
fileCabinet: 'deliveryNote',
|
||||||
|
ticketIds: [parseInt(ticketId)],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (data) notify({ message: t('PDF sent!'), type: 'positive' });
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -457,7 +494,13 @@ async function handleInvoiceOutData() {
|
||||||
<QItemSection side>
|
<QItemSection side>
|
||||||
<QIcon name="keyboard_arrow_right" />
|
<QIcon name="keyboard_arrow_right" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QMenu anchor="top end" self="top start" auto-close bordered>
|
<QMenu
|
||||||
|
anchor="top end"
|
||||||
|
self="top start"
|
||||||
|
auto-close
|
||||||
|
bordered
|
||||||
|
@click="hasDocuware()"
|
||||||
|
>
|
||||||
<QList>
|
<QList>
|
||||||
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('deliveryNote')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('as PDF') }}</QItemSection>
|
<QItemSection>{{ t('as PDF') }}</QItemSection>
|
||||||
|
@ -465,6 +508,14 @@ async function handleInvoiceOutData() {
|
||||||
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
<QItem @click="openDeliveryNote('withoutPrices')" v-ripple clickable>
|
||||||
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
|
<QItemSection>{{ t('as PDF without prices') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="hasDocuwareFile"
|
||||||
|
@click="docuwareDownload()"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('as PDF signed') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
@click="openDeliveryNote('deliveryNote', 'csv')"
|
@click="openDeliveryNote('deliveryNote', 'csv')"
|
||||||
v-ripple
|
v-ripple
|
||||||
|
@ -483,7 +534,7 @@ async function handleInvoiceOutData() {
|
||||||
<QItemSection side>
|
<QItemSection side>
|
||||||
<QIcon name="keyboard_arrow_right" />
|
<QIcon name="keyboard_arrow_right" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QMenu anchor="top end" self="top start" auto-close>
|
<QMenu anchor="top end" self="top start" auto-close @click="hasDocuware()">
|
||||||
<QList>
|
<QList>
|
||||||
<QItem
|
<QItem
|
||||||
@click="sendDeliveryNoteConfirmation('deliveryNote')"
|
@click="sendDeliveryNoteConfirmation('deliveryNote')"
|
||||||
|
@ -492,11 +543,7 @@ async function handleInvoiceOutData() {
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem @click="uploadDocuware(!hasDocuwareFile)" v-ripple clickable>
|
||||||
@click="sendDeliveryNoteConfirmation('withoutPrices')"
|
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
>
|
|
||||||
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
|
<QItemSection>{{ t('Send PDF to tablet') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
<QItem
|
||||||
|
@ -700,4 +747,6 @@ es:
|
||||||
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||||
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
||||||
You are going to delete this ticket: Vas a eliminar este ticket
|
You are going to delete this ticket: Vas a eliminar este ticket
|
||||||
|
as PDF signed: como PDF firmado
|
||||||
|
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán?
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
Loading…
Reference in New Issue