This commit is contained in:
parent
7e66fc38ac
commit
546a5150ae
|
@ -86,9 +86,7 @@ async function search() {
|
||||||
store.filter.skip = 0;
|
store.filter.skip = 0;
|
||||||
store.skip = 0;
|
store.skip = 0;
|
||||||
const { params: newParams } = await arrayData.addFilter({ params });
|
const { params: newParams } = await arrayData.addFilter({ params });
|
||||||
console.log('params: ', params);
|
|
||||||
userParams.value = newParams;
|
userParams.value = newParams;
|
||||||
console.log('userParams: ', userParams);
|
|
||||||
|
|
||||||
if (!props.showAll && !Object.values(params).length) store.data = [];
|
if (!props.showAll && !Object.values(params).length) store.data = [];
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,16 @@ import { useArrayData } from 'composables/useArrayData';
|
||||||
const invoiceOutGlobalStore = useInvoiceOutGlobalStore();
|
const invoiceOutGlobalStore = useInvoiceOutGlobalStore();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const { t } = useI18n();
|
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) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -30,34 +38,15 @@ function exprBuilder(param, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
const defaultParams = {
|
await arrayData.fetch({ append: false });
|
||||||
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);
|
|
||||||
|
|
||||||
stateStore.rightDrawer = true;
|
stateStore.rightDrawer = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const componentIsRendered = ref(false);
|
const componentIsRendered = ref(false);
|
||||||
console.log('componentIsRendered: ', componentIsRendered);
|
|
||||||
|
|
||||||
onMounted(() =>
|
onMounted(() => nextTick(() => (componentIsRendered.value = true)));
|
||||||
nextTick(async () => {
|
|
||||||
componentIsRendered.value = true;
|
|
||||||
await arrayData.value.fetch();
|
|
||||||
console.log('3ntra');
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const rows = computed(() => arrayData.value.store.data);
|
const rows = computed(() => arrayData.store.data);
|
||||||
console.log('rows: ', rows);
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
|
@ -142,8 +131,8 @@ const downloadCSV = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
await invoiceOutGlobalStore.getNegativeBasesCsv(
|
await invoiceOutGlobalStore.getNegativeBasesCsv(
|
||||||
arrayData.value.store.userParams.from,
|
arrayData.store.userParams.from,
|
||||||
arrayData.value.store.userParams.to,
|
arrayData.store.userParams.to,
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue