{{ t('Sort routes') }}
diff --git a/src/pages/Shelving/Card/ShelvingDescriptorMenu.vue b/src/pages/Shelving/Card/ShelvingDescriptorMenu.vue
index 684a46807..16351fdd4 100644
--- a/src/pages/Shelving/Card/ShelvingDescriptorMenu.vue
+++ b/src/pages/Shelving/Card/ShelvingDescriptorMenu.vue
@@ -17,15 +17,14 @@ const quasar = useQuasar();
const { t } = useI18n();
function confirmRemove() {
- quasar
- .dialog({
- component: VnConfirm,
- componentProps: {
- title: t('Confirm deletion'),
- message: t('Are you sure you want to delete this shelving?'),
- promise: remove
- },
- })
+ quasar.dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t('Confirm deletion'),
+ message: t('Are you sure you want to delete this shelving?'),
+ promise: remove,
+ },
+ });
}
async function remove() {
diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue
index 59dd2281c..86c5e586b 100644
--- a/src/pages/Supplier/Card/SupplierConsumption.vue
+++ b/src/pages/Supplier/Card/SupplierConsumption.vue
@@ -195,7 +195,7 @@ onMounted(async () => {
diff --git a/src/pages/Supplier/Card/SupplierContacts.vue b/src/pages/Supplier/Card/SupplierContacts.vue
index 3abe5a9cc..a78c376a9 100644
--- a/src/pages/Supplier/Card/SupplierContacts.vue
+++ b/src/pages/Supplier/Card/SupplierContacts.vue
@@ -117,7 +117,7 @@ onMounted(() => {
diff --git a/src/pages/Supplier/Card/SupplierSummary.vue b/src/pages/Supplier/Card/SupplierSummary.vue
index edc2c742b..9d00ba8f7 100644
--- a/src/pages/Supplier/Card/SupplierSummary.vue
+++ b/src/pages/Supplier/Card/SupplierSummary.vue
@@ -8,6 +8,7 @@ import { getUrl } from 'src/composables/getUrl';
import { useRole } from 'src/composables/useRole';
import { dashIfEmpty } from 'src/filters';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
+import VnTitle from 'src/components/common/VnTitle.vue';
onUpdated(() => summaryRef.value.fetch());
diff --git a/src/pages/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue
index f0ded019b..dfbcfc106 100644
--- a/src/pages/Ticket/Card/TicketDescriptor.vue
+++ b/src/pages/Ticket/Card/TicketDescriptor.vue
@@ -98,7 +98,10 @@ const setData = (entity) =>
-
+
{{ entity.ticketState.state.name }}
diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
index 95f6a94d9..c7784bc2a 100644
--- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue
+++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue
@@ -3,7 +3,7 @@ import axios from 'axios';
import { ref } from 'vue';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
-import { useRouter, useRoute } from 'vue-router';
+import { useRouter } from 'vue-router';
import { usePrintService } from 'composables/usePrintService';
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
import VnConfirm from 'components/ui/VnConfirm.vue';
@@ -17,13 +17,49 @@ const props = defineProps({
},
});
-const router = useRouter();
-const route = useRoute();
-const quasar = useQuasar();
+const { push, currentRoute } = useRouter();
+const { dialog, notify } = useQuasar();
const { t } = useI18n();
const { openReport, sendEmail } = usePrintService();
const ticket = ref(props.ticket);
+const ticketId = currentRoute.value.params.id;
+const actions = {
+ clone: async () => {
+ const opts = { message: t('Ticket cloned'), type: 'positive' };
+ let clonedTicketId;
+
+ try {
+ const { data } = await axios.post(`Tickets/${ticketId}/clone`, {
+ shipped: ticket.value.shipped,
+ });
+ clonedTicketId = data;
+ } catch (e) {
+ opts.message = t('It was not able to clone the ticket');
+ opts.type = 'negative';
+ } finally {
+ notify(opts);
+
+ if (clonedTicketId)
+ push({ name: 'TicketSummary', params: { id: clonedTicketId } });
+ }
+ },
+ remove: async () => {
+ try {
+ await axios.post(`Tickets/${ticketId}/setDeleted`);
+
+ notify({ message: t('Ticket deleted'), type: 'positive' });
+ notify({
+ message: t('You can undo this action within the first hour'),
+ icon: 'info',
+ });
+
+ push({ name: 'TicketList' });
+ } catch (e) {
+ notify({ message: e.message, type: 'negative' });
+ }
+ },
+};
function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
const path = `Tickets/${ticket.value.id}/delivery-note-${documentType}`;
@@ -35,7 +71,7 @@ function openDeliveryNote(type = 'deliveryNote', documentType = 'pdf') {
function sendDeliveryNoteConfirmation(type = 'deliveryNote', documentType = 'pdf') {
const customer = ticket.value.client;
- quasar.dialog({
+ dialog({
component: SendEmailDialog,
componentProps: {
data: {
@@ -67,7 +103,7 @@ function showSmsDialog(template, customData) {
const address = ticket.value.address;
const client = ticket.value.client;
const phone =
- route.params.phone ||
+ currentRoute.value.params.phone ||
address.mobile ||
address.phone ||
client.mobile ||
@@ -82,7 +118,7 @@ function showSmsDialog(template, customData) {
Object.assign(data, customData);
}
- quasar.dialog({
+ dialog({
component: VnSmsDialog,
componentProps: {
phone: phone,
@@ -95,42 +131,26 @@ function showSmsDialog(template, customData) {
}
async function showSmsDialogWithChanges() {
- const query = `TicketLogs/${route.params.id}/getChanges`;
+ const query = `TicketLogs/${ticketId}/getChanges`;
const response = await axios.get(query);
showSmsDialog('orderChanges', { changes: response.data });
}
async function sendSms(body) {
- await axios.post(`Tickets/${route.params.id}/sendSms`, body);
- quasar.notify({
+ await axios.post(`Tickets/${ticketId}/sendSms`, body);
+ notify({
message: 'Notification sent',
type: 'positive',
});
}
-function confirmDelete() {
- quasar
- .dialog({
- component: VnConfirm,
- componentProps: {
- promise: remove,
- },
- })
- .onOk(async () => await router.push({ name: 'TicketList' }));
-}
-
-async function remove() {
- const id = route.params.id;
- await axios.post(`Tickets/${id}/setDeleted`);
-
- quasar.notify({
- message: t('Ticket deleted'),
- type: 'positive',
- });
- quasar.notify({
- message: t('You can undo this action within the first hour'),
- icon: 'info',
+function openConfirmDialog(callback) {
+ dialog({
+ component: VnConfirm,
+ componentProps: {
+ promise: actions[callback],
+ },
});
}
@@ -227,9 +247,15 @@ async function remove() {
+
+
+
+
+ {{ t('To clone ticket') }}
+
-
+
@@ -253,4 +279,7 @@ es:
Order changes: Cambios del pedido
Ticket deleted: Ticket eliminado
You can undo this action within the first hour: Puedes deshacer esta acción dentro de la primera hora
+ To clone ticket: Clonar ticket
+ Ticket cloned: Ticked clonado
+ It was not able to clone the ticket: No se pudo clonar el ticket
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index fbca21086..85d98f353 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -12,6 +12,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { getUrl } from 'src/composables/getUrl';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
+import VnTitle from 'src/components/common/VnTitle.vue';
onUpdated(() => summaryRef.value.fetch());
@@ -74,7 +75,7 @@ async function changeState(value) {
code: value,
};
- await axios.post(`TicketTrackings/changeState`, formData);
+ await axios.post(`Tickets/state`, formData);
router.go(route.fullPath);
}
@@ -102,8 +103,8 @@ async function changeState(value) {
@@ -147,10 +148,10 @@ async function changeState(value) {
-
+
@@ -193,10 +194,10 @@ async function changeState(value) {
/>
-
+
-
+
-
+
@@ -396,10 +397,7 @@ async function changeState(value) {
class="vn-max"
v-if="ticket.packagings.length > 0 || ticket.services.length > 0"
>
-
+
@@ -416,11 +414,10 @@ async function changeState(value) {
-
-
+
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 72c2da57c..c5d25fed2 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -89,6 +89,7 @@ function navigate(id) {
-
+
{
/>