feat: refs #7553 added transferClient function
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
23e5072d38
commit
574a2efc92
|
@ -89,7 +89,6 @@ const filter = {
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
|
|
||||||
function ticketFilter(ticket) {
|
function ticketFilter(ticket) {
|
||||||
console.log('ticket: ', ticket);
|
|
||||||
return JSON.stringify({ clientFk: ticket.clientFk });
|
return JSON.stringify({ clientFk: ticket.clientFk });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -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 FormPopup from 'components/FormPopup.vue';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
ticket: {
|
ticket: {
|
||||||
|
@ -24,7 +26,9 @@ const { openReport, sendEmail } = usePrintService();
|
||||||
|
|
||||||
const ticket = ref(props.ticket);
|
const ticket = ref(props.ticket);
|
||||||
const ticketId = currentRoute.value.params.id;
|
const ticketId = currentRoute.value.params.id;
|
||||||
const showWeightDialog = ref(false);
|
const client = ref();
|
||||||
|
const showTransferDialog = ref(false);
|
||||||
|
const dialogRef = 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' };
|
||||||
|
@ -182,16 +186,54 @@ async function createPdfInvoice() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWeightToTicket(weight) {
|
async function transferClient(client) {
|
||||||
console.log('weight: ', weight);
|
const params = {
|
||||||
const { data } = axios.patch(`Tickets/${ticketId}`, {
|
clientFk: client,
|
||||||
weight: weight,
|
};
|
||||||
});
|
|
||||||
console.log('data: ', data);
|
const { data } = await axios.patch(`Tickets/${ticketId}/transferClient`, params);
|
||||||
|
|
||||||
if (data) window.location.reload();
|
if (data) window.location.reload();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<QItem @click="showTransferDialog = !showTransferDialog" v-ripple clickable>
|
||||||
|
<QItemSection avatar>
|
||||||
|
<QIcon name="content_paste" />
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>{{ t('Transfer client') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QDialog ref="dialogRef" v-model="showTransferDialog">
|
||||||
|
<FormPopup
|
||||||
|
@on-submit="transferClient(client)"
|
||||||
|
:title="t('Transfer client')"
|
||||||
|
:custom-submit-button-label="t('Transfer client')"
|
||||||
|
:default-cancel-button="false"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnSelect
|
||||||
|
url="Clients"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
v-model="client"
|
||||||
|
:label="t('Client')"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ `#${scope.opt.id} - ` }}
|
||||||
|
{{ scope.opt.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
||||||
|
</FormPopup>
|
||||||
|
</QDialog>
|
||||||
<QItem v-ripple clickable>
|
<QItem v-ripple clickable>
|
||||||
<QItemSection avatar>
|
<QItemSection avatar>
|
||||||
<QIcon name="picture_as_pdf" />
|
<QIcon name="picture_as_pdf" />
|
||||||
|
@ -296,30 +338,6 @@ function setWeightToTicket(weight) {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
<QItemSection>{{ t('To clone ticket') }}</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem @click="showWeightDialog = !showWeightDialog" v-ripple clickable>
|
|
||||||
<QItemSection avatar>
|
|
||||||
<QIcon name="content_paste" />
|
|
||||||
</QItemSection>
|
|
||||||
<QItemSection>{{ t('Set ticket weight') }}</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QDialog v-model="showWeightDialog" transition-show="scale" transition-hide="scale">
|
|
||||||
<QCard>
|
|
||||||
<QCardSection>
|
|
||||||
<QInput
|
|
||||||
v-model="weight"
|
|
||||||
type="number"
|
|
||||||
:label="t('Weight')"
|
|
||||||
@update:model-value="setWeightToTicket"
|
|
||||||
/>
|
|
||||||
<QBtn flat v-close-popup class="text-primary">
|
|
||||||
{{ t('Close') }}
|
|
||||||
</QBtn>
|
|
||||||
<QBTn flat @click="setWeightToTicket" class="text-primary">
|
|
||||||
{{ t('Save') }}
|
|
||||||
</QBTn>
|
|
||||||
</QCardSection>
|
|
||||||
</QCard>
|
|
||||||
</QDialog>
|
|
||||||
<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>
|
||||||
|
@ -343,7 +361,7 @@ es:
|
||||||
Send CSV: Enviar CSV
|
Send CSV: Enviar CSV
|
||||||
Show Proforma: Ver proforma
|
Show Proforma: Ver proforma
|
||||||
Delete ticket: Eliminar ticket
|
Delete ticket: Eliminar ticket
|
||||||
Send SMS...: Enviar SMS
|
Send SMS...: Enviar SMS...
|
||||||
Pending payment: Pago pendiente
|
Pending payment: Pago pendiente
|
||||||
Minimum import: Importe mínimo
|
Minimum import: Importe mínimo
|
||||||
Notify changes: Notificar cambios
|
Notify changes: Notificar cambios
|
||||||
|
@ -354,5 +372,6 @@ es:
|
||||||
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
|
||||||
Regenerate PDF invoice: Regenerar PDF factura
|
Regenerate PDF invoice: Regenerar PDF factura
|
||||||
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
||||||
Set ticket weight: Establecer peso al ticket
|
Transfer client: Transferir cliente
|
||||||
|
Client: Cliente
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
Loading…
Reference in New Issue