| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <script setup>
- import { reportTable } from './config'
- import AppDateRangeFilter from '@/components/AppDateRangeFilter.vue'
- import AppButtonLink from '@/components/AppButtonLink.vue'
- import AppPagination from '@/components/AppPagination.vue'
- import DashboardLayout from '@/layouts/Dashboard/DashboardLayout.vue'
- import AppResetFilter from '@/components/AppResetFilter.vue'
-
- defineProps({
- initialFilters: Object,
- sales: {
- type: Object,
- default: {
- data: [],
- links: [],
- total: 0,
- },
- },
- })
-
- const exportExcel = () => {
- return '/sales/report/excel' + location.search
- }
- </script>
-
- <template>
- <DashboardLayout title="Laporan Penjualan">
- <DataTable
- responsive-layout="scroll"
- column-resize-mode="expand"
- :value="sales.data"
- :rowHover="true"
- :stripedRows="true"
- >
- <template #header>
- <h1>Laporan Penjualan</h1>
-
- <div class="grid">
- <div class="col-12 sm:col-6 lg:col-4">
- <AppDateRangeFilter
- placeholder="filter waktu..."
- :name-param="['start_date', 'end_date']"
- :initial-date-rage="initialFilters"
- />
- </div>
-
- <div class="col-12 sm:col-6 lg:col-4">
- <AppResetFilter :url="route('sales.report')" />
- </div>
-
- <div class="col-12 flex flex-column sm:flex-row">
- <AppButtonLink
- v-if="sales.total"
- label="Export excel"
- class-button="p-button-outlined md:w-16rem"
- icon="pi pi-file-excel"
- :inertia-link="false"
- :href="exportExcel()"
- />
- </div>
- </div>
- </template>
-
- <Column
- v-for="value in reportTable"
- :field="value.field"
- :header="value.header"
- :key="value.field"
- />
- </DataTable>
-
- <AppPagination :links="sales.links" />
- </DashboardLayout>
- </template>
|