diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index a29a2c8b2..dac028965 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -86,9 +86,7 @@ async function search() { store.filter.skip = 0; store.skip = 0; const { params: newParams } = await arrayData.addFilter({ params }); - console.log('params: ', params); userParams.value = newParams; - console.log('userParams: ', userParams); if (!props.showAll && !Object.values(params).length) store.data = []; diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index 688d5c3b3..1d05728a7 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -16,8 +16,16 @@ import { useArrayData } from 'composables/useArrayData'; const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); const stateStore = useStateStore(); const { t } = useI18n(); +const defaultParams = { + from: '2024-04-30T22:00:00.000Z', + to: '2024-05-30T22:00:00.000Z', +}; -const arrayData = ref(null); +const arrayData = useArrayData('InvoiceOutNegative', { + url: 'InvoiceOuts/negativeBases', + userParams: defaultParams, + exprBuilder: exprBuilder, +}); function exprBuilder(param, value) { switch (param) { @@ -30,34 +38,15 @@ function exprBuilder(param, value) { } onBeforeMount(async () => { - const defaultParams = { - from: Date.vnFirstDayOfMonth().toISOString(), - to: Date.vnLastDayOfMonth().toISOString(), - }; - arrayData.value = useArrayData('InvoiceOutNegative', { - url: 'InvoiceOuts/negativeBases', - userParams: defaultParams, - exprBuilder: exprBuilder, - }); - const test = await arrayData.value.fetch({ append: false }); - console.log('test: ', test); - + await arrayData.fetch({ append: false }); stateStore.rightDrawer = true; }); const componentIsRendered = ref(false); -console.log('componentIsRendered: ', componentIsRendered); -onMounted(() => - nextTick(async () => { - componentIsRendered.value = true; - await arrayData.value.fetch(); - console.log('3ntra'); - }) -); +onMounted(() => nextTick(() => (componentIsRendered.value = true))); -const rows = computed(() => arrayData.value.store.data); -console.log('rows: ', rows); +const rows = computed(() => arrayData.store.data); const columns = computed(() => [ { @@ -142,8 +131,8 @@ const downloadCSV = async () => { } await invoiceOutGlobalStore.getNegativeBasesCsv( - arrayData.value.store.userParams.from, - arrayData.value.store.userParams.to, + arrayData.store.userParams.from, + arrayData.store.userParams.to, params ); };