From 087d22e77d65a05e32138be426df485303a32bfd Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 29 Jan 2024 16:33:39 -0300 Subject: [PATCH] Mejoras y cosas faltantes --- src/i18n/en/index.js | 2 + src/i18n/es/index.js | 2 + src/pages/Travel/Card/TravelDescriptor.vue | 31 +- .../Travel/Card/TravelDescriptorMenuItems.vue | 108 +++++++ src/pages/Travel/Card/TravelSummary.vue | 268 +++++++++++------- src/pages/Travel/ExtraCommunity.vue | 12 +- src/services/travel.service.js | 23 -- 7 files changed, 323 insertions(+), 123 deletions(-) create mode 100644 src/pages/Travel/Card/TravelDescriptorMenuItems.vue delete mode 100644 src/services/travel.service.js diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 6a075378e..814bf0c22 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -1090,7 +1090,9 @@ export default { entries: 'Entries', cloneShipping: 'Clone travel', CloneTravelAndEntries: 'Clone travel and his entries', + deleteTravel: 'Delete travel', AddEntry: 'Add entry', + thermographs: 'Thermographs', }, variables: { search: 'Id/Reference', diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index b3169d0a9..6b5b3ad7c 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -1090,7 +1090,9 @@ export default { entries: 'Entradas', cloneShipping: 'Clonar envío', CloneTravelAndEntries: 'Clonar travel y sus entradas', + deleteTravel: 'Eliminar envío', AddEntry: 'Añadir entrada', + thermographs: 'Termógrafos', }, variables: { search: 'Id/Referencia', diff --git a/src/pages/Travel/Card/TravelDescriptor.vue b/src/pages/Travel/Card/TravelDescriptor.vue index c696d9577..c7501b1d4 100644 --- a/src/pages/Travel/Card/TravelDescriptor.vue +++ b/src/pages/Travel/Card/TravelDescriptor.vue @@ -2,10 +2,13 @@ import { ref, computed } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; -import { toDate } from 'src/filters'; + import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; +import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue'; + import useCardDescription from 'src/composables/useCardDescription'; +import { toDate } from 'src/filters'; const $props = defineProps({ id: { @@ -28,6 +31,7 @@ const filter = { 'warehouseInFk', 'warehouseOutFk', 'cargoSupplierFk', + 'agencyModeFk', ], include: [ { @@ -82,6 +86,9 @@ const setData = (entity) => { + + es: Go to module index: Ir al índice del módulo + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + All travels with current agency: Todos los envíos con la agencia actual diff --git a/src/pages/Travel/Card/TravelDescriptorMenuItems.vue b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue new file mode 100644 index 000000000..17b9333ca --- /dev/null +++ b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue @@ -0,0 +1,108 @@ + + + + + +es: + The travel will be deleted: El envío será eliminado + Do you want to delete this travel?: ¿Quieres eliminar este envío? + diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index d809f9142..3b025096f 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -1,23 +1,20 @@ diff --git a/src/pages/Travel/ExtraCommunity.vue b/src/pages/Travel/ExtraCommunity.vue index 2dcd4bb51..f08cc64cb 100644 --- a/src/pages/Travel/ExtraCommunity.vue +++ b/src/pages/Travel/ExtraCommunity.vue @@ -16,8 +16,8 @@ import { toCurrency } from 'src/filters'; import { useArrayData } from 'composables/useArrayData'; import { toDate } from 'src/filters'; import { usePrintService } from 'composables/usePrintService'; -import travelService from 'src/services/travel.service'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; +import axios from 'axios'; const router = useRouter(); const stateStore = useStateStore(); @@ -223,9 +223,13 @@ const openReportPdf = () => { }; const saveFieldValue = async (val, field, index) => { - const id = rows.value[index].id; - const params = { [field]: val }; - await travelService.updateTravel(id, params); + try { + const id = rows.value[index].id; + const params = { [field]: val }; + await axios.patch(`Travels/${id}`, params); + } catch (err) { + console.error('Error updating travel'); + } }; const navigateToTravelId = (id) => { diff --git a/src/services/travel.service.js b/src/services/travel.service.js deleted file mode 100644 index 469b8b237..000000000 --- a/src/services/travel.service.js +++ /dev/null @@ -1,23 +0,0 @@ -import axios from 'axios'; - -const travelService = { - getTravelEntries: async (param) => { - try { - return await axios.get(`Travels/${param}/getEntries`); - } catch (err) { - console.error(`Error fetching travel entries`, err); - return err.response; - } - }, - - updateTravel: async (id, params) => { - try { - return await axios.patch(`Travels/${id}`, params); - } catch (err) { - console.error(`Error updating travel`, err); - return err.response; - } - }, -}; - -export default travelService;