From 9757fdf70af1f3863caebc533ac4e22bdda4058e Mon Sep 17 00:00:00 2001 From: wbuezas Date: Sat, 27 Jan 2024 16:08:02 -0300 Subject: [PATCH] Travel termographs and general improvements --- src/components/FormModel.vue | 4 +- src/i18n/en/index.js | 1 + src/i18n/es/index.js | 1 + src/pages/Travel/Card/TravelSummary.vue | 18 +++--- src/pages/Travel/Card/TravelThermographs.vue | 31 ++++++++-- .../Travel/Card/TravelThermographsForm.vue | 62 +++++++++++++++++-- src/pages/Travel/TravelCreate.vue | 59 ++---------------- src/router/modules/travel.js | 2 +- 8 files changed, 101 insertions(+), 77 deletions(-) diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 4ad566bf8..ba0bf0a3d 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -128,14 +128,14 @@ async function save() { try { const body = $props.mapper ? $props.mapper(formData.value) : formData.value; - let response + let response; if ($props.urlCreate) { response = await axios.post($props.urlCreate, body); notify('globals.dataCreated', 'positive'); } else { response = await axios.patch($props.urlUpdate || $props.url, body); } - emit('onDataSaved', formData.value, response); + emit('onDataSaved', formData.value, response.data); originalData.value = JSON.parse(JSON.stringify(formData.value)); hasChanges.value = false; } catch (err) { diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 9788eedf6..a76de1f3a 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1080,6 +1080,7 @@ export default { warehouse: 'Warehouse', travelFileDescription: 'Travel id { travelId }', file: 'File', + description: 'Description', }, }, components: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 89efef79e..19e877fb7 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -1080,6 +1080,7 @@ export default { warehouse: 'Almacén', travelFileDescription: 'Id envío { travelId }', file: 'Fichero', + description: 'Descripción', }, }, components: { diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index ccef57b0e..b2380fe6b 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -170,11 +170,10 @@ const redirectToCreateView = (queryParams) => { /> @@ -187,11 +186,10 @@ const redirectToCreateView = (queryParams) => { /> diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 33160f2b5..f4fa23100 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -1,11 +1,12 @@ -