Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -62,6 +62,15 @@
|
||||
:disable="store.loading || store.filteredOrders.length === 0"
|
||||
@click="exportExcel"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
label="PDF Yazdır"
|
||||
icon="picture_as_pdf"
|
||||
color="red"
|
||||
outline
|
||||
:disable="store.loading || store.filteredOrders.length === 0"
|
||||
@click="exportListPdf"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="ol-filter-total">
|
||||
@@ -102,8 +111,21 @@
|
||||
:rows-per-page-options="[0]"
|
||||
hide-bottom
|
||||
>
|
||||
<template #body-cell-IsCreditableConfirmed="props">
|
||||
<q-td :props="props" class="text-center q-gutter-sm">
|
||||
<template #body-cell-IsCreditableConfirmed="props">
|
||||
<q-td :props="props" class="text-center">
|
||||
<q-icon
|
||||
:name="props.row.IsCreditableConfirmed ? 'check_circle' : 'cancel'"
|
||||
:color="props.row.IsCreditableConfirmed ? 'green' : 'red'"
|
||||
size="20px"
|
||||
>
|
||||
<q-tooltip>
|
||||
{{ props.row.IsCreditableConfirmed ? 'Onaylı' : 'Onaysız' }}
|
||||
</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
</template>
|
||||
<template #body-cell-pdf="props">
|
||||
<q-td :props="props" class="text-center">
|
||||
<q-btn
|
||||
icon="picture_as_pdf"
|
||||
color="red"
|
||||
@@ -114,16 +136,6 @@
|
||||
>
|
||||
<q-tooltip>Siparişi PDF olarak aç</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-icon
|
||||
:name="props.row.IsCreditableConfirmed ? 'check_circle' : 'cancel'"
|
||||
:color="props.row.IsCreditableConfirmed ? 'green' : 'red'"
|
||||
size="20px"
|
||||
>
|
||||
<q-tooltip>
|
||||
{{ props.row.IsCreditableConfirmed ? 'Onaylı' : 'Onaysız' }}
|
||||
</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
</template>
|
||||
<template #body-cell-HasUretimUrunu="props">
|
||||
@@ -140,6 +152,12 @@
|
||||
</q-td>
|
||||
</template>
|
||||
|
||||
<template #body-cell-TerminTarihi="props">
|
||||
<q-td :props="props" class="text-center">
|
||||
{{ formatDate(props.row.TerminTarihi) }}
|
||||
</q-td>
|
||||
</template>
|
||||
|
||||
<template #body-cell-CreditableConfirmedDate="props">
|
||||
<q-td :props="props" class="text-center">
|
||||
{{ formatDate(props.row.CreditableConfirmedDate) }}
|
||||
@@ -240,7 +258,7 @@ import { useQuasar } from 'quasar'
|
||||
import { useOrderListStore } from 'src/stores/OrdernewListStore'
|
||||
import { useAuthStore } from 'src/stores/authStore'
|
||||
import { usePermission } from 'src/composables/usePermission'
|
||||
import api, { extractApiErrorDetail } from 'src/services/api'
|
||||
import api, { download, extractApiErrorDetail } from 'src/services/api'
|
||||
|
||||
const { canRead } = usePermission()
|
||||
const canReadOrder = canRead('order')
|
||||
@@ -296,6 +314,28 @@ function exportExcel () {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function exportListPdf () {
|
||||
try {
|
||||
const blob = await download('/orders/export-pdf', {
|
||||
search: store.filters.search || '',
|
||||
CurrAccCode: store.filters.CurrAccCode || '',
|
||||
OrderDate: store.filters.OrderDate || ''
|
||||
})
|
||||
|
||||
const blobUrl = URL.createObjectURL(blob)
|
||||
window.open(blobUrl, '_blank', 'noopener,noreferrer')
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 15000)
|
||||
} catch (err) {
|
||||
const detail = err?.message || 'PDF alınamadı'
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: detail,
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate (s) {
|
||||
if (!s) return ''
|
||||
const [y, m, d] = String(s).split('-')
|
||||
@@ -314,6 +354,7 @@ const columns = [
|
||||
{ name: 'select', label: '', field: 'select', align: 'center', sortable: false },
|
||||
{ name: 'OrderNumber', label: 'Sipariş No', field: 'OrderNumber', align: 'left', sortable: true, style: 'min-width:108px;white-space:nowrap', headerStyle: 'min-width:108px;white-space:nowrap' },
|
||||
{ name: 'OrderDate', label: 'Tarih', field: 'OrderDate', align: 'center', sortable: true, style: 'min-width:82px;white-space:nowrap', headerStyle: 'min-width:82px;white-space:nowrap' },
|
||||
{ name: 'TerminTarihi', label: 'Termin Tarihi', field: 'TerminTarihi', align: 'center', sortable: true, style: 'min-width:95px;white-space:nowrap', headerStyle: 'min-width:95px;white-space:nowrap' },
|
||||
{ name: 'CurrAccCode', label: 'Cari Kod', field: 'CurrAccCode', align: 'left', sortable: true, style: 'min-width:82px;white-space:nowrap', headerStyle: 'min-width:82px;white-space:nowrap' },
|
||||
{ name: 'CurrAccDescription', label: 'Cari Adı', field: 'CurrAccDescription', align: 'left', sortable: true, classes: 'ol-col-cari', headerClasses: 'ol-col-cari', style: 'width:160px;max-width:160px', headerStyle: 'width:160px;max-width:160px' },
|
||||
{ name: 'MusteriTemsilcisi', label: 'Temsilci', field: 'MusteriTemsilcisi', align: 'left', sortable: true, classes: 'ol-col-short', headerClasses: 'ol-col-short', style: 'width:88px;max-width:88px', headerStyle: 'width:88px;max-width:88px' },
|
||||
@@ -570,3 +611,4 @@ onMounted(() => {
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user