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
|
||||
:to="{
|
||||
name: 'TicketList',
|
||||
query: { table: JSON.stringify({ clientFk: entity.id }) },
|
||||
query: {
|
||||
from: undefined,
|
||||
to: undefined,
|
||||
table: JSON.stringify({
|
||||
clientFk: entity.id,
|
||||
}),
|
||||
},
|
||||
}"
|
||||
size="md"
|
||||
icon="vn:ticket"
|
||||
|
|
|
@ -162,8 +162,9 @@ async function changeState(value) {
|
|||
:value="ticket.warehouse?.name"
|
||||
/>
|
||||
<VnLv
|
||||
v-if="ticket?.ticketCollections?.length > 0"
|
||||
:label="t('ticket.summary.collection')"
|
||||
:value="ticket.ticketCollections[0]?.collectionFk"
|
||||
:value="ticket?.ticketCollections[0]?.collectionFk"
|
||||
>
|
||||
<template #value>
|
||||
<a
|
||||
|
|
|
@ -14,6 +14,8 @@ import VnRow from 'src/components/ui/VnRow.vue';
|
|||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import TicketFilter from './TicketFilter.vue';
|
||||
|
||||
import { useRoute } from 'vue-router';
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref();
|
||||
|
@ -27,8 +29,17 @@ const to = Date.vnNew();
|
|||
to.setDate(to.getDate() + 1);
|
||||
|
||||
const userParams = {
|
||||
from: from.toISOString(),
|
||||
to: to.toISOString(),
|
||||
from: null,
|
||||
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(() => [
|
||||
|
@ -200,7 +211,10 @@ const getColor = (row) => {
|
|||
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
||||
};
|
||||
|
||||
onMounted(() => (stateStore.rightDrawer = true));
|
||||
onMounted(() => {
|
||||
initializeFromQuery();
|
||||
stateStore.rightDrawer = true;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Reference in New Issue