forked from verdnatura/salix-front
Refetch descriptor data when exit EntryBasicData view
This commit is contained in:
parent
46e5503a79
commit
913bc7d870
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
|
@ -27,6 +27,7 @@ const route = useRoute();
|
|||
const { t } = useI18n();
|
||||
const { openReport } = usePrintService();
|
||||
const state = useState();
|
||||
const entryDescriptorRef = ref(null);
|
||||
|
||||
const entryFilter = {
|
||||
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 = () => {
|
||||
openReport(`Entries/${route.params.id}/entry-order-pdf`);
|
||||
};
|
||||
|
||||
watch;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CardDescriptor
|
||||
ref="entryDescriptorRef"
|
||||
module="Entry"
|
||||
:url="`Entries/${entityId}`"
|
||||
:filter="entryFilter"
|
||||
|
@ -130,7 +145,7 @@ const showEntryReport = () => {
|
|||
:value="entity.travel?.warehouseOut?.name"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="currentEntry" #icons>
|
||||
<template #icons>
|
||||
<QCardActions class="q-gutter-x-md">
|
||||
<QIcon
|
||||
v-if="currentEntry.isExcludedFromAvailable"
|
||||
|
|
Loading…
Reference in New Issue