From 15487bfbf2dfabbbb845466b70026544d6f06c9c Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 28 Jan 2025 08:42:31 +0100 Subject: [PATCH 1/3] fix: item type translations --- .../Item/ItemType/Card/ItemTypeBasicData.vue | 21 +++++++++++-------- .../Item/ItemType/Card/ItemTypeDescriptor.vue | 8 +++---- src/pages/Item/locale/en.yml | 7 ------- src/pages/Item/locale/es.yml | 7 ------- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue b/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue index 1a4a7c9f3..b4032ff8a 100644 --- a/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue +++ b/src/pages/Item/ItemType/Card/ItemTypeBasicData.vue @@ -48,14 +48,14 @@ const itemPackingTypesOptions = ref([]); > diff --git a/src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue b/src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue index 6d093d91d..09d3dbce5 100644 --- a/src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue +++ b/src/pages/Item/ItemType/Card/ItemTypeDescriptor.vue @@ -50,15 +50,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity @on-fetch="setData" > diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 52722198b..69014222f 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -76,13 +76,6 @@ itemTags: searchbar: label: Search item info: Search by item id -itemType: - shared: - code: Code - name: Name - worker: Worker - category: Category - temperature: Temperature item: params: daysOnward: Days onward diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index 29af8dc5c..48858f2a5 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -76,13 +76,6 @@ itemTags: searchbar: label: Buscar artículo info: Buscar por id de artículo -itemType: - shared: - code: Código - name: Nombre - worker: Trabajador - category: Reino - temperature: Temperatura params: state: asfsdf item: From 879373209ee2f878c0d2f61c4e7fb88ba1978de0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 Jan 2025 10:54:59 +0100 Subject: [PATCH 2/3] refactor: entriesTotals --- src/pages/Travel/Card/TravelSummary.vue | 60 ++++++++++++------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 689711a74..9c5ce8e74 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -179,33 +179,31 @@ const entriesTableRows = computed(() => { return entries.value; }); -const entriesTotalHb = computed(() => - entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0) -); +const entriesTotals = computed(() => { + const totals = { + hb: 0, + freightValue: 0, + packageValue: 0, + cc: 0, + pallet: 0, + m3: 0, + }; -const entriesTotalFreight = computed(() => - toCurrency( - entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0) - ) -); + entriesTableRows.value.forEach((row) => { + for (const key in totals) { + totals[key] += row[key] || 0; + } + }); -const entriesTotalPackageValue = computed(() => - toCurrency( - entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0) - ) -); - -const entriesTotalCc = computed(() => - entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0) -); - -const entriesTotalPallet = computed(() => - entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0) -); - -const entriesTotalM3 = computed(() => - entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0) -); + return { + hb: totals.hb.toFixed(2), + freight: toCurrency(totals.freightValue), + packageValue: toCurrency(totals.packageValue), + cc: totals.cc.toFixed(2), + pallet: totals.pallet.toFixed(2), + m3: totals.m3.toFixed(2), + }; +}); const getTravelEntries = async (id) => { const { data } = await axios.get(`Travels/${id}/getEntries`); @@ -368,12 +366,12 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`; - {{ entriesTotalHb }} - {{ entriesTotalFreight }} - {{ entriesTotalPackageValue }} - {{ entriesTotalCc }} - {{ entriesTotalPallet }} - {{ entriesTotalM3 }} + {{ entriesTotals.hb }} + {{ entriesTotals.freight }} + {{ entriesTotals.packageValue }} + {{ entriesTotals.cc }} + {{ entriesTotals.pallet }} + {{ entriesTotals.m3 }} From 5c761ca11103b07dc25da1504c4755e3daf48b1b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 28 Jan 2025 12:12:00 +0100 Subject: [PATCH 3/3] fix: scroll --- src/components/ui/VnPaginate.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 0111366f5..965f4d5e9 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -166,7 +166,7 @@ function emitStoreData() { async function paginate() { const { page, rowsPerPage, sortBy, descending } = pagination.value; - if (!props.url) return; + if (!arrayData.store.url) return; isLoading.value = true; await arrayData.loadMore();