0
0
Fork 0

fix: refs #7274 fix duplicate rows

This commit is contained in:
Jorge Penadés 2024-05-15 10:39:59 +02:00
parent 7e66fc38ac
commit 546a5150ae
2 changed files with 14 additions and 27 deletions

View File

@ -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 = [];

View File

@ -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
);
};