8381-thermographTravel #1244
|
@ -19,16 +19,8 @@ const quasar = useQuasar();
|
|||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
const { store: travelStore, fetch: fetchTravel } = useArrayData('SingleTravel', {
|
||||
url: 'Travels',
|
||||
limit: 1,
|
||||
filter: {
|
||||
fields: ['id', 'agencyModeFk'],
|
||||
where: { id: route.params.id },
|
||||
},
|
||||
// Si quisieras guardar en la URL, podrías usar searchUrl: 'travelSearch'
|
||||
});
|
||||
const travelItem = computed(() => travelStore.data?.[0] ?? null);
|
||||
|
||||
const travel = computed(() => useArrayData('Travel1').store.data);
|
||||
const thermographPaginateRef = ref();
|
||||
const warehouses = ref([]);
|
||||
|
||||
|
@ -142,7 +134,7 @@ const redirectToThermographForm = (action, id) => {
|
|||
if (action === 'edit' && id) {
|
||||
routeDetails.query = { travelThermographFk: id };
|
||||
} else if (action === 'create') {
|
||||
routeDetails.query = { agencyModeFk: travelItem.value?.agencyModeFk };
|
||||
routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk };
|
||||
}
|
||||
router.push(routeDetails);
|
||||
};
|
||||
|
@ -152,9 +144,6 @@ const removeThermograph = async (id) => {
|
|||
await thermographPaginateRef.value.fetch();
|
||||
notify(t('Thermograph removed'), 'positive');
|
||||
};
|
||||
onMounted(() => {
|
||||
fetchTravel({});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Reference in New Issue