forked from verdnatura/salix-front
fix: customerSummaryToTicketList button
This commit is contained in:
parent
52883dfb52
commit
0314ca8397
|
@ -152,7 +152,13 @@ const setData = (entity) => (data.value = useCardDescription(entity?.name, entit
|
||||||
<QBtn
|
<QBtn
|
||||||
:to="{
|
:to="{
|
||||||
name: 'TicketList',
|
name: 'TicketList',
|
||||||
query: { table: JSON.stringify({ clientFk: entity.id }) },
|
query: {
|
||||||
|
from: undefined,
|
||||||
|
to: undefined,
|
||||||
|
table: JSON.stringify({
|
||||||
|
clientFk: entity.id,
|
||||||
|
}),
|
||||||
|
},
|
||||||
}"
|
}"
|
||||||
size="md"
|
size="md"
|
||||||
icon="vn:ticket"
|
icon="vn:ticket"
|
||||||
|
|
|
@ -162,8 +162,9 @@ async function changeState(value) {
|
||||||
:value="ticket.warehouse?.name"
|
:value="ticket.warehouse?.name"
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
|
v-if="ticket?.ticketCollections?.length > 0"
|
||||||
:label="t('ticket.summary.collection')"
|
:label="t('ticket.summary.collection')"
|
||||||
:value="ticket.ticketCollections[0]?.collectionFk"
|
:value="ticket?.ticketCollections[0]?.collectionFk"
|
||||||
>
|
>
|
||||||
<template #value>
|
<template #value>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -14,6 +14,8 @@ import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import TicketFilter from './TicketFilter.vue';
|
import TicketFilter from './TicketFilter.vue';
|
||||||
|
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -27,8 +29,17 @@ const to = Date.vnNew();
|
||||||
to.setDate(to.getDate() + 1);
|
to.setDate(to.getDate() + 1);
|
||||||
|
|
||||||
const userParams = {
|
const userParams = {
|
||||||
from: from.toISOString(),
|
from: null,
|
||||||
to: to.toISOString(),
|
to: null,
|
||||||
|
};
|
||||||
|
// Método para inicializar las variables desde la query string
|
||||||
|
const initializeFromQuery = () => {
|
||||||
|
const query = route.query.table ? JSON.parse(route.query.table) : {};
|
||||||
|
|
||||||
|
// Asigna los valores a las variables correspondientes
|
||||||
|
from.value = query.from || from.toISOString();
|
||||||
|
to.value = query.to || to.toISOString();
|
||||||
|
Object.assign(userParams, { from, to });
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -200,7 +211,10 @@ const getColor = (row) => {
|
||||||
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => (stateStore.rightDrawer = true));
|
onMounted(() => {
|
||||||
|
initializeFromQuery();
|
||||||
|
stateStore.rightDrawer = true;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in New Issue