8381-thermographTravel #1244
|
@ -19,16 +19,8 @@ const quasar = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const { store: travelStore, fetch: fetchTravel } = useArrayData('SingleTravel', {
|
|
||||||
url: 'Travels',
|
const travel = computed(() => useArrayData('Travel1').store.data);
|
||||||
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 thermographPaginateRef = ref();
|
const thermographPaginateRef = ref();
|
||||||
const warehouses = ref([]);
|
const warehouses = ref([]);
|
||||||
|
|
||||||
|
@ -142,7 +134,7 @@ const redirectToThermographForm = (action, id) => {
|
||||||
if (action === 'edit' && id) {
|
if (action === 'edit' && id) {
|
||||||
routeDetails.query = { travelThermographFk: id };
|
routeDetails.query = { travelThermographFk: id };
|
||||||
} else if (action === 'create') {
|
} else if (action === 'create') {
|
||||||
routeDetails.query = { agencyModeFk: travelItem.value?.agencyModeFk };
|
routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk };
|
||||||
}
|
}
|
||||||
router.push(routeDetails);
|
router.push(routeDetails);
|
||||||
};
|
};
|
||||||
|
@ -152,9 +144,6 @@ const removeThermograph = async (id) => {
|
||||||
await thermographPaginateRef.value.fetch();
|
await thermographPaginateRef.value.fetch();
|
||||||
notify(t('Thermograph removed'), 'positive');
|
notify(t('Thermograph removed'), 'positive');
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
|
||||||
fetchTravel({});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue