From ad2265fe7c6d4db98c02653b3d3be9eaf49653a1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 3 Jul 2024 08:43:23 +0200 Subject: [PATCH] refs #7366 fix travel migration --- src/composables/useArrayData.js | 1 - src/pages/Travel/Card/TravelCard.vue | 6 +++++- src/pages/Travel/Card/TravelSummary.vue | 2 -- src/pages/Travel/TravelList.vue | 27 ++++++++++++++++++++----- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index f6f476f87..cdf965417 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -21,7 +21,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { onMounted(() => { setOptions(); store.skip = 0; - const query = route.query; const searchUrl = store.searchUrl; if (query[searchUrl]) { diff --git a/src/pages/Travel/Card/TravelCard.vue b/src/pages/Travel/Card/TravelCard.vue index bf7e6d57a..a3c1430e9 100644 --- a/src/pages/Travel/Card/TravelCard.vue +++ b/src/pages/Travel/Card/TravelCard.vue @@ -33,8 +33,12 @@ const filter = { diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 88ddee9a2..7900688cb 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -12,8 +12,6 @@ import FetchData from 'src/components/FetchData.vue'; import { toDate, toCurrency } from 'src/filters'; import axios from 'axios'; -onUpdated(() => summaryRef.value.fetch()); - const $props = defineProps({ id: { type: Number, diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index 980840b46..78844d4b6 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -2,17 +2,27 @@ import { onMounted, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; +import { useRoute } from 'vue-router'; import { useStateStore } from 'stores/useStateStore'; import VnTable from 'components/VnTable/VnTable.vue'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { computed } from 'vue'; import TravelSummary from './Card/TravelSummary.vue'; +import VnSearchbar from 'components/ui/VnSearchbar.vue'; import { dashIfEmpty, toDate } from 'src/filters'; const { viewSummary } = useSummaryDialog(); const router = useRouter(); const { t } = useI18n(); const stateStore = useStateStore(); - +const route = useRoute(); +const tableRef = ref(); +const $props = defineProps({ + id: { + type: Number, + default: 0, + }, +}); +const entityId = computed(() => $props.id || route.params.id); const cloneTravel = (travelData) => { const stringifiedTravelData = JSON.stringify(travelData); redirectToCreateView(stringifiedTravelData); @@ -164,16 +174,21 @@ const columns = computed(() => [