feat: add download report sale
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 9s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 9s
This commit is contained in:
parent
cd231513ee
commit
5278f4952e
2 changed files with 45 additions and 3 deletions
|
|
@ -296,7 +296,19 @@ watch([() => pageState.currentTab], async () => {
|
||||||
<template v-if="pageState.currentTab === ViewMode.Sale">
|
<template v-if="pageState.currentTab === ViewMode.Sale">
|
||||||
<div class="q-gutter-y-md">
|
<div class="q-gutter-y-md">
|
||||||
<Expansion default-opened>
|
<Expansion default-opened>
|
||||||
<template #header>{{ $t('report.sale.byCustomer') }}</template>
|
<template #header>
|
||||||
|
<div class="flex full-width items-center">
|
||||||
|
{{ $t('report.sale.byCustomer') }}
|
||||||
|
<SaveButton
|
||||||
|
style="margin-left: auto"
|
||||||
|
:icon="'material-symbols:download'"
|
||||||
|
:label="$t('general.download')"
|
||||||
|
@click.stop="
|
||||||
|
reportStore.downloadReportSale('by-customer')
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<TableReport
|
<TableReport
|
||||||
:row="
|
:row="
|
||||||
|
|
@ -324,7 +336,17 @@ watch([() => pageState.currentTab], async () => {
|
||||||
</Expansion>
|
</Expansion>
|
||||||
<Expansion default-opened>
|
<Expansion default-opened>
|
||||||
<template #header>
|
<template #header>
|
||||||
{{ $t('report.sale.byProductGroup') }}
|
<div class="flex full-width items-center">
|
||||||
|
{{ $t('report.sale.byProductGroup') }}
|
||||||
|
<SaveButton
|
||||||
|
style="margin-left: auto"
|
||||||
|
:icon="'material-symbols:download'"
|
||||||
|
:label="$t('general.download')"
|
||||||
|
@click.stop="
|
||||||
|
reportStore.downloadReportSale('by-product-group')
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<TableReport
|
<TableReport
|
||||||
|
|
@ -346,7 +368,17 @@ watch([() => pageState.currentTab], async () => {
|
||||||
</template>
|
</template>
|
||||||
</Expansion>
|
</Expansion>
|
||||||
<Expansion default-opened>
|
<Expansion default-opened>
|
||||||
<template #header>{{ $t('report.sale.bySale') }}</template>
|
<template #header>
|
||||||
|
<div class="flex full-width items-center">
|
||||||
|
{{ $t('report.sale.bySale') }}
|
||||||
|
<SaveButton
|
||||||
|
style="margin-left: auto"
|
||||||
|
:icon="'material-symbols:download'"
|
||||||
|
:label="$t('general.download')"
|
||||||
|
@click.stop="reportStore.downloadReportSale('by-sale')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template #main>
|
<template #main>
|
||||||
<TableReport
|
<TableReport
|
||||||
:row="
|
:row="
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,15 @@ export async function getReportReceipt() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function downloadReportSale(
|
||||||
|
category: 'by-product-group' | 'by-sale' | 'by-customer',
|
||||||
|
) {
|
||||||
|
await _download(
|
||||||
|
baseUrl + '/' + ENDPOINT + '/sale/' + category + '/download',
|
||||||
|
'sale-' + category + '-report',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export async function getReportSale() {
|
export async function getReportSale() {
|
||||||
const res = await api.get<ReportSale>(`/${ENDPOINT}/sale`);
|
const res = await api.get<ReportSale>(`/${ENDPOINT}/sale`);
|
||||||
|
|
||||||
|
|
@ -133,6 +142,7 @@ export const useReportStore = defineStore('report-store', () => {
|
||||||
getReportInvoice,
|
getReportInvoice,
|
||||||
downloadReportReceipt,
|
downloadReportReceipt,
|
||||||
getReportReceipt,
|
getReportReceipt,
|
||||||
|
downloadReportSale,
|
||||||
getReportSale,
|
getReportSale,
|
||||||
downloadReportProduct,
|
downloadReportProduct,
|
||||||
getReportProduct,
|
getReportProduct,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue