forked from verdnatura/salix-front
fix: refs #6101 fix TicketList
This commit is contained in:
parent
968de67393
commit
c5f2075148
|
@ -1,6 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref, onMounted } from 'vue';
|
||||||
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { toDate, toCurrency } from 'src/filters/index';
|
import { toDate, toCurrency } from 'src/filters/index';
|
||||||
import TicketSummary from './Card/TicketSummary.vue';
|
import TicketSummary from './Card/TicketSummary.vue';
|
||||||
|
@ -10,6 +11,8 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
|
import TicketFilter from './TicketFilter.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -18,6 +21,15 @@ const clientsOptions = ref([]);
|
||||||
const addressesOptions = ref([]);
|
const addressesOptions = ref([]);
|
||||||
const agenciesOptions = ref([]);
|
const agenciesOptions = ref([]);
|
||||||
const selectedClient = ref();
|
const selectedClient = ref();
|
||||||
|
const stateStore = useStateStore();
|
||||||
|
const from = Date.vnNew();
|
||||||
|
const to = Date.vnNew();
|
||||||
|
to.setDate(to.getDate() + 1);
|
||||||
|
|
||||||
|
const userParams = {
|
||||||
|
from: from.toISOString(),
|
||||||
|
to: to.toISOString(),
|
||||||
|
};
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -187,6 +199,8 @@ const fetchAddresses = async (formData) => {
|
||||||
const getColor = (row) => {
|
const getColor = (row) => {
|
||||||
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
return row?.classColor ? `bg-${row.classColor}` : 'bg-orange';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => (stateStore.rightDrawer = true));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -195,6 +209,11 @@ const getColor = (row) => {
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
/>
|
/>
|
||||||
|
<RightMenu>
|
||||||
|
<template #right-panel>
|
||||||
|
<TicketFilter data-key="Tickets" />
|
||||||
|
</template>
|
||||||
|
</RightMenu>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="Tickets"
|
data-key="Tickets"
|
||||||
|
@ -206,7 +225,10 @@ const getColor = (row) => {
|
||||||
formInitialData: {},
|
formInitialData: {},
|
||||||
}"
|
}"
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
:user-params="userParams"
|
||||||
|
:right-search="false"
|
||||||
redirect="ticket"
|
redirect="ticket"
|
||||||
auto-load
|
auto-load
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue