From 94c0fa2aa7ed875d1898ffa80606f23a04dbaa8a Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 17 Jan 2025 14:59:52 +0100 Subject: [PATCH] feat: refs #8381 add carrier field to travel thermographs and update localization --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Travel/Card/TravelSummary.vue | 26 +++++++++--- src/pages/Travel/Card/TravelThermographs.vue | 42 +++++++++++++++---- .../Travel/Card/TravelThermographsForm.vue | 31 +++++++++++--- 5 files changed, 82 insertions(+), 19 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index e1ec62175..84a79404f 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -799,6 +799,7 @@ travel: destination: Destination thermograph: Thermograph travelFileDescription: 'Travel id { travelId }' + carrier: Carrier item: descriptor: buyer: Buyer diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 4b4f6f552..01396e9ce 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -795,6 +795,7 @@ travel: destination: Destino thermograph: Termógrafo travelFileDescription: 'Id envío { travelId }' + carrier: Transportista item: descriptor: buyer: Comprador diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 9deb22808..9a0a66f57 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -122,6 +122,12 @@ const thermographsTableColumns = computed(() => { name: 'temperatureFk', align: 'left', }, + { + label: t('travel.thermographs.carrier'), + field: (row) => row.agencyMode?.name, + name: 'agencyModeFk', + align: 'left', + }, { label: t('globals.maxTemperature'), field: 'maxTemperature', @@ -200,17 +206,25 @@ const getTravelEntries = async (id) => { const getTravelThermographs = async (id) => { const filter = { - include: { - relation: 'warehouse', - scope: { - fields: ['id', 'name'], + include: [ + { + relation: 'agencyMode', + scope: { + fields: ['id', 'name'], + }, }, - }, + { + relation: 'warehouse', + scope: { + fields: ['id', 'name'], + }, + }, + ], where: { travelFk: id }, }; const { data } = await axios.get('TravelThermographs', { - params: { filter: JSON.parse(JSON.stringify(filter)) }, + params: { filter }, }); thermographs.value = data; }; diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 2bf3293a6..b78c93334 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -1,5 +1,5 @@