0
0
Fork 0

Travel termographs WIP

This commit is contained in:
William Buezas 2024-01-19 09:24:57 -03:00
parent d4a89895b4
commit 1c689ce966
3 changed files with 148 additions and 2 deletions

View File

@ -886,7 +886,7 @@ export default {
RouteList: 'List',
create: 'Create',
basicData: 'Basic Data',
summary: 'Summary'
summary: 'Summary',
},
cmr: {
list: {
@ -1067,6 +1067,13 @@ export default {
delivered: 'Delivered',
received: 'Received',
},
termographs: {
code: 'Code',
temperature: 'Temperature',
state: 'State',
destination: 'Destination',
created: 'Created',
},
},
components: {
topbar: {},

View File

@ -1067,6 +1067,13 @@ export default {
delivered: 'Enviada',
received: 'Recibida',
},
termographs: {
code: 'Código',
temperature: 'Temperatura',
state: 'Estado',
destination: 'Destino',
created: 'Fecha creación',
},
},
components: {
topbar: {},

View File

@ -1 +1,133 @@
<template>Travel termographs</template>
<script setup>
import { ref, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnPaginate from 'src/components/ui/VnPaginate.vue';
import axios from 'axios';
// import useNotify from 'src/composables/useNotify.js';
import { toDate } from 'src/filters';
const route = useRoute();
// const router = useRouter();
const { t } = useI18n();
// const { notify } = useNotify();
const termographFilter = {
include: {
relation: 'warehouse',
scope: {
fields: ['id', 'name'],
},
},
};
const TableColumns = computed(() => {
return [
{
label: t('travel.termographs.code'),
field: 'thermographFk',
name: 'thermographFk',
align: 'left',
},
{
label: t('travel.termographs.temperature'),
field: 'temperatureFk',
name: 'temperatureFk',
align: 'left',
},
{
label: t('travel.termographs.state'),
field: 'result',
name: 'result',
align: 'left',
},
{
label: t('travel.termographs.destination'),
// field: (row) => row.warehouse.name,
field: 'warehouseFk',
name: 'destination',
align: 'left',
},
{
label: t('travel.termographs.created'),
field: 'created',
name: 'created',
align: 'left',
format: (val) => toDate(val),
},
];
});
const saveChange = async (rowData) => {
await axios.patch(`Buys/${rowData.id}`, rowData);
};
const openRemoveDialog = async () => {
// quasar
// .dialog({
// component: VnConfirm,
// componentProps: {
// title: t('Confirm deletion'),
// message:
// rowsSelected.value.length > 1
// ? t('Are you sure you want to delete this buys?')
// : t('Are you sure you want to delete this buy?'),
// data: rowsSelected.value,
// },
// })
// .onOk(async () => {
// try {
// await deleteBuys();
// const notifyMessage =
// rowsSelected.value.length > 1 ? t('Buys deleted') : t('Buy deleted');
// notify(notifyMessage, 'positive');
// } catch (err) {
// console.error('Error deleting buys');
// }
// });
};
const deleteTermograph = async () => {
// await axios.post('Buys/deleteBuys', { buys: rowsSelected.value });
// entryBuysPaginateRef.value.fetch();
};
const redirectToCreateView = () => {
// router.push({ name: 'EntryBuysImport' });
};
</script>
<template>
<VnPaginate
data-key="TravelTermograph"
url="TravelThermographs"
:filter="termographFilter"
:params="{ travelFk: route.params.id }"
auto-load
>
<template #body="{ rows }">
<QTable
:rows="rows"
:columns="TableColumns"
row-key="id"
hide-bottom
class="full-width q-mt-md"
>
</QTable>
</template>
</VnPaginate>
<QPageSticky :offset="[20, 20]">
<QBtn fab icon="add" color="primary" @click="redirectToCreateView()" />
<QTooltip>
{{ t('Add termograph') }}
</QTooltip>
</QPageSticky>
</template>
<i18n>
es:
Add termograph: Añadir termógrafo
</i18n>