ilk
This commit is contained in:
103
ui/src/pages/StatementHeaderReport.vue
Normal file
103
ui/src/pages/StatementHeaderReport.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<!-- src/pages/StatementHeaderReport.vue -->
|
||||
<template>
|
||||
<q-page class="q-pa-md page-col">
|
||||
<!-- Başlık ve PDF butonu -->
|
||||
<div class="row justify-between items-center q-mb-md">
|
||||
<div class="text-h6">📄 Cari Hesap Raporu</div>
|
||||
<q-btn
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
label="PDF Yazdır"
|
||||
push
|
||||
glossy
|
||||
@click="handlestHeadDownload"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-separator spaced />
|
||||
|
||||
<!-- Cari ve tarih seçim alanı -->
|
||||
<q-card flat bordered class="q-pa-md q-mt-md">
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="col-12 col-sm-4">
|
||||
<q-input v-model="accountCode" label="Cari Kod" filled dense clearable />
|
||||
</div>
|
||||
<div class="col-12 col-sm-4">
|
||||
<q-input v-model="startDate" label="Başlangıç Tarihi" filled dense />
|
||||
</div>
|
||||
<div class="col-12 col-sm-4">
|
||||
<q-input v-model="endDate" label="Bitiş Tarihi" filled dense />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-mt-md">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
v-model="selectedMonType"
|
||||
:options="monetaryTypeOptions"
|
||||
label="Parasal İşlem Tipi"
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useDownloadstHeadStore } from 'src/stores/downloadstHeadStore'
|
||||
import dayjs from 'dayjs'
|
||||
import { usePermission } from 'src/composables/usePermission'
|
||||
|
||||
const { canRead, canWrite, canUpdate } = usePermission()
|
||||
|
||||
const canReadOrder = canRead('order')
|
||||
const canWriteOrder = canWrite('order')
|
||||
const canUpdateOrder = canUpdate('order')
|
||||
|
||||
const $q = useQuasar()
|
||||
const downloadstHeadStore = useDownloadstHeadStore()
|
||||
|
||||
// form değerleri
|
||||
const accountCode = ref('')
|
||||
const startDate = ref(dayjs().startOf('month').format('YYYY-MM-DD'))
|
||||
const endDate = ref(dayjs().format('YYYY-MM-DD'))
|
||||
|
||||
// parasal işlem tipleri
|
||||
const monetaryTypeOptions = [
|
||||
{ label: '1-2 hesap', value: ['1', '2'] },
|
||||
{ label: '1-3 hesap', value: ['1', '3'] }
|
||||
]
|
||||
const selectedMonType = ref(monetaryTypeOptions[0].value)
|
||||
|
||||
// indirme butonu
|
||||
async function handlestHeadDownload() {
|
||||
console.log("▶️ [DEBUG] handlestHeadDownload:", accountCode.value, startDate.value, endDate.value, selectedMonType.value)
|
||||
|
||||
if (!accountCode.value || !startDate.value || !endDate.value) {
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: '⚠️ Cari ve tarih seçmeden PDF alınamaz!',
|
||||
position: 'top-right'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const result = await downloadstHeadStore.handlestHeadDownload(
|
||||
accountCode.value,
|
||||
startDate.value,
|
||||
endDate.value,
|
||||
selectedMonType.value
|
||||
)
|
||||
|
||||
$q.notify({
|
||||
type: result.ok ? 'positive' : 'negative',
|
||||
message: result.message,
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user