feat: download report
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s

This commit is contained in:
Methapon2001 2025-03-06 11:11:17 +07:00
parent 7522c967d9
commit e6f2a8df4e
3 changed files with 106 additions and 9 deletions

View file

@ -24,6 +24,7 @@ import useFlowStore from 'src/stores/flow';
import { useReportStore } from 'src/stores/report';
import BadgeComponent from 'src/components/BadgeComponent.vue';
import Expansion from 'src/components/14_report/Expansion.vue';
import { SaveButton } from 'src/components/button';
// NOTE: Variable
const navigatorStore = useNavigator();
@ -166,7 +167,17 @@ watch([() => pageState.currentTab], async () => {
<!-- Quotatio -->
<Expansion default-opened>
<template #header>{{ $t('quotation.title') }}</template>
<template #header>
<div class="flex full-width items-center">
{{ $t('quotation.title') }}
<SaveButton
style="margin-left: auto"
:icon="'material-symbols:download'"
:label="$t('general.download')"
@click.stop="reportStore.downloadReportQuotation()"
/>
</div>
</template>
<template #main>
<TableReport
@ -185,7 +196,17 @@ watch([() => pageState.currentTab], async () => {
<!-- Invoice -->
<Expansion default-opened>
<template #header>{{ $t('invoice.title') }}</template>
<template #header>
<div class="flex full-width items-center">
{{ $t('invoice.title') }}
<SaveButton
style="margin-left: auto"
:icon="'material-symbols:download'"
:label="$t('general.download')"
@click.stop="reportStore.downloadReportInvoice()"
/>
</div>
</template>
<template #main>
<TableReport :row="dataReportInvoice" :columns="colReport">
<template #status="{ item }">
@ -200,7 +221,17 @@ watch([() => pageState.currentTab], async () => {
<!-- Receipt -->
<Expansion default-opened>
<template #header>{{ $t('receipt.title') }}</template>
<template #header>
<div class="flex full-width items-center">
{{ $t('receipt.title') }}
<SaveButton
style="margin-left: auto"
:icon="'material-symbols:download'"
:label="$t('general.download')"
@click.stop="reportStore.downloadReportReceipt()"
/>
</div>
</template>
<template #main>
<TableReport :row="dataReportReceipt" :columns="colReport">
<template #status="{ item }">
@ -217,7 +248,17 @@ watch([() => pageState.currentTab], async () => {
<template v-if="pageState.currentTab === ViewMode.Invoice">
<Expansion default-opened>
<template #header>{{ $t('invoice.title') }}</template>
<template #header>
<div class="flex full-width items-center">
{{ $t('invoice.title') }}
<SaveButton
style="margin-left: auto"
:icon="'material-symbols:download'"
:label="$t('general.download')"
@click.stop="reportStore.downloadReportInvoice()"
/>
</div>
</template>
<template #main>
<TableReport :row="dataReportInvoice" :columns="colReport">
<template #status="{ item }">
@ -233,7 +274,17 @@ watch([() => pageState.currentTab], async () => {
<template v-if="pageState.currentTab === ViewMode.Product">
<Expansion default-opened>
<template #header>{{ $t('productService.title') }}</template>
<template #header>
<div class="flex full-width items-center">
{{ $t('productService.title') }}
<SaveButton
style="margin-left: auto"
:icon="'material-symbols:download'"
:label="$t('general.download')"
@click.stop="reportStore.downloadReportInvoice()"
/>
</div>
</template>
<template #main>
<TableReport
:row="dataReportProduct"