forked from verdnatura/salix-front
fix: refs #7717 fix volume and lines redirect
This commit is contained in:
parent
4cad7cbced
commit
4d7fe0fd86
|
@ -1,8 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import { toCurrency, toDate } from 'src/filters';
|
import { toCurrency, toDate } from 'src/filters';
|
||||||
|
@ -14,6 +15,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
import FetchedTags from 'src/components/ui/FetchedTags.vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -194,6 +196,15 @@ async function confirmOrder() {
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
() => {
|
||||||
|
lineFilter.value.where.orderFk = router.currentRoute.value.params.id;
|
||||||
|
|
||||||
|
tableLinesRef.value.reload();
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import axios from 'axios';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { ref } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import VnPaginate from 'components/ui/VnPaginate.vue';
|
import VnPaginate from 'components/ui/VnPaginate.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -10,11 +12,20 @@ import CardList from 'components/ui/CardList.vue';
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
|
|
||||||
import { dashIfEmpty } from 'src/filters';
|
import { dashIfEmpty } from 'src/filters';
|
||||||
import axios from 'axios';
|
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const volumeSummary = ref(null);
|
const volumeSummary = ref(null);
|
||||||
|
const volumeRef = ref();
|
||||||
|
const volumeFilter = ref({
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'item',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
where: { orderFk: route.params.id },
|
||||||
|
});
|
||||||
|
|
||||||
const loadVolumes = async (rows) => {
|
const loadVolumes = async (rows) => {
|
||||||
const { data } = await axios.get(`Orders/${route.params.id}/getVolumes`);
|
const { data } = await axios.get(`Orders/${route.params.id}/getVolumes`);
|
||||||
|
@ -26,6 +37,15 @@ const loadVolumes = async (rows) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
() => {
|
||||||
|
volumeFilter.value.where.orderFk = router.currentRoute.value.params.id;
|
||||||
|
|
||||||
|
volumeRef.value.fetch();
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -54,15 +74,11 @@ const loadVolumes = async (rows) => {
|
||||||
</QCard>
|
</QCard>
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
data-key="OrderCatalogVolume"
|
data-key="OrderCatalogVolume"
|
||||||
|
ref="volumeRef"
|
||||||
url="OrderRows"
|
url="OrderRows"
|
||||||
:limit="20"
|
:limit="20"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="{
|
:user-filter="volumeFilter"
|
||||||
include: {
|
|
||||||
relation: 'item',
|
|
||||||
},
|
|
||||||
where: { orderFk: route.params.id },
|
|
||||||
}"
|
|
||||||
order="itemFk"
|
order="itemFk"
|
||||||
@on-fetch="(data) => loadVolumes(data)"
|
@on-fetch="(data) => loadVolumes(data)"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue