0
0
Fork 0

Refetch descriptor data when exit EntryBasicData view

This commit is contained in:
William Buezas 2024-02-23 11:50:38 -03:00
parent 46e5503a79
commit 913bc7d870
1 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { ref, computed } from 'vue'; import { ref, computed, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -27,6 +27,7 @@ const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const { openReport } = usePrintService(); const { openReport } = usePrintService();
const state = useState(); const state = useState();
const entryDescriptorRef = ref(null);
const entryFilter = { const entryFilter = {
include: [ include: [
@ -96,13 +97,27 @@ const getEntryRedirectionFilter = (entry) => {
}); });
}; };
const refetchEntryDescriptorData = async () => {
await entryDescriptorRef.value.getData();
};
watch(
() => route.name,
async (_, from) => {
if (from === 'EntryBasicData') await refetchEntryDescriptorData();
}
);
const showEntryReport = () => { const showEntryReport = () => {
openReport(`Entries/${route.params.id}/entry-order-pdf`); openReport(`Entries/${route.params.id}/entry-order-pdf`);
}; };
watch;
</script> </script>
<template> <template>
<CardDescriptor <CardDescriptor
ref="entryDescriptorRef"
module="Entry" module="Entry"
:url="`Entries/${entityId}`" :url="`Entries/${entityId}`"
:filter="entryFilter" :filter="entryFilter"
@ -130,7 +145,7 @@ const showEntryReport = () => {
:value="entity.travel?.warehouseOut?.name" :value="entity.travel?.warehouseOut?.name"
/> />
</template> </template>
<template v-if="currentEntry" #icons> <template #icons>
<QCardActions class="q-gutter-x-md"> <QCardActions class="q-gutter-x-md">
<QIcon <QIcon
v-if="currentEntry.isExcludedFromAvailable" v-if="currentEntry.isExcludedFromAvailable"