small improvements
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
William Buezas 2024-02-06 15:00:25 -03:00
parent 087d22e77d
commit 018f251f3d
4 changed files with 44 additions and 21 deletions

View File

@ -1093,6 +1093,7 @@ export default {
deleteTravel: 'Delete travel',
AddEntry: 'Add entry',
thermographs: 'Thermographs',
hb: 'HB',
},
variables: {
search: 'Id/Reference',

View File

@ -1093,6 +1093,7 @@ export default {
deleteTravel: 'Eliminar envío',
AddEntry: 'Añadir entrada',
thermographs: 'Termógrafos',
hb: 'HB',
},
variables: {
search: 'Id/Referencia',

View File

@ -44,14 +44,14 @@ const entriesTableColumns = computed(() => {
label: t('travel.summary.confirmed'),
field: 'isConfirmed',
name: 'isConfirmed',
align: 'center',
align: 'left',
showValue: false,
},
{
label: t('travel.summary.entryId'),
field: 'id',
name: 'id',
align: 'center',
align: 'left',
showValue: false,
},
{
@ -68,6 +68,13 @@ const entriesTableColumns = computed(() => {
align: 'left',
showValue: true,
},
{
label: t('travel.summary.hb'),
field: 'hb',
name: 'hb',
align: 'left',
showValue: true,
},
{
label: t('travel.summary.freight'),
field: 'freightValue',
@ -151,27 +158,33 @@ const entriesTableRows = computed(() => {
return entries.value;
});
const entriesTotalHb = computed(() => {
return entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0);
});
const entriesTotalHb = computed(() =>
entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0)
);
const entriesTotalFreight = computed(() => {
return toCurrency(
const entriesTotalFreight = computed(() =>
toCurrency(
entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0)
);
});
)
);
const entriesTotalCc = computed(() => {
return entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0);
});
const entriesTotalPackageValue = computed(() =>
toCurrency(
entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0)
)
);
const entriesTotalPallet = computed(() => {
return entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0);
});
const entriesTotalCc = computed(() =>
entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0)
);
const entriesTotalM3 = computed(() => {
return entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0);
});
const entriesTotalPallet = computed(() =>
entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0)
);
const entriesTotalM3 = computed(() =>
entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0)
);
const getTravelEntries = async (id) => {
try {
@ -320,7 +333,7 @@ async function setTravelData(travelData) {
</template>
<template #body-cell-id="{ col, value }">
<QTd>
<QBtn v-if="col.name === 'id'" flat color="blue" dense>
<QBtn v-if="col.name === 'id'" flat color="blue">
{{ value }}
<EntryDescriptorProxy :id="value" />
</QBtn>
@ -340,6 +353,7 @@ async function setTravelData(travelData) {
<QTd></QTd>
<QTd class="text-bold">{{ entriesTotalHb }}</QTd>
<QTd class="text-bold">{{ entriesTotalFreight }}</QTd>
<QTd class="text-bold">{{ entriesTotalPackageValue }}</QTd>
<QTd class="text-bold">{{ entriesTotalCc }}</QTd>
<QTd class="text-bold">{{ entriesTotalPallet }}</QTd>
<QTd class="text-bold">{{ entriesTotalM3 }}</QTd>

View File

@ -19,6 +19,7 @@ const router = useRouter();
const { t } = useI18n();
const { notify } = useNotify();
const thermographPaginateRef = ref(null);
const warehouses = ref([]);
const thermographFilter = {
@ -58,7 +59,7 @@ const TableColumns = computed(() => {
name: 'destination',
align: 'left',
format: (val) =>
warehouses.value.find((warehouse) => warehouse.id === val).name,
warehouses.value.find((warehouse) => warehouse.id === val)?.name,
},
{
label: t('travel.thermographs.created'),
@ -114,7 +115,12 @@ const redirectToThermographForm = (action, { id = null }) => {
};
const removeThermograph = async (id) => {
await axios.delete('Travels/deleteThermograph', { id });
try {
await axios.delete(`Travels/deleteThermograph?id=${id}`);
await thermographPaginateRef.value.fetch();
} catch (err) {
console.error('Error removing termograph');
}
};
</script>
@ -127,6 +133,7 @@ const removeThermograph = async (id) => {
auto-load
/>
<VnPaginate
ref="thermographPaginateRef"
data-key="TravelThermographs"
url="TravelThermographs"
:filter="thermographFilter"