Merge remote-tracking branch 'origin/master'
This commit is contained in:
2
ui/dist/spa/index.html
vendored
2
ui/dist/spa/index.html
vendored
@@ -1 +1 @@
|
|||||||
<!DOCTYPE html><html><head><title>Baggi SS</title><meta charset=utf-8><meta name=description content="A Quasar Project"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=/icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=/icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=/icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/icons/favicon-16x16.png><link rel=icon type=image/ico href=/favicon.ico><script defer src=/js/vendor.1e1ff7a5.js></script><script defer src=/js/app.f6769585.js></script><link href=/css/vendor.724dcfab.css rel=stylesheet><link href=/css/app.53116624.css rel=stylesheet></head><body><div id=q-app></div></body></html>
|
<!DOCTYPE html><html><head><title>Baggi SS</title><meta charset=utf-8><meta name=description content="A Quasar Project"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=/icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=/icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=/icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/icons/favicon-16x16.png><link rel=icon type=image/ico href=/favicon.ico><script defer src=/js/vendor.1e1ff7a5.js></script><script defer src=/js/app.f764c69c.js></script><link href=/css/vendor.724dcfab.css rel=stylesheet><link href=/css/app.53116624.css rel=stylesheet></head><body><div id=q-app></div></body></html>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// src/stores/downloadstHeadStore.js
|
// src/stores/downloadstHeadStore.js
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { download, extractApiErrorDetail } from 'src/services/api'
|
import { download, extractApiErrorDetail } from 'src/services/api'
|
||||||
|
|
||||||
export const useDownloadstHeadStore = defineStore('downloadstHead', {
|
export const useDownloadstHeadStore = defineStore('downloadstHead', {
|
||||||
actions: {
|
actions: {
|
||||||
// 📄 Statement Header PDF indir / aç
|
// 📄 Statement Header PDF indir / aç
|
||||||
async handlestHeadDownload (
|
async handlestHeadDownload (
|
||||||
accountCode,
|
accountCode,
|
||||||
startDate,
|
startDate,
|
||||||
@@ -12,7 +12,7 @@ export const useDownloadstHeadStore = defineStore('downloadstHead', {
|
|||||||
parislemler
|
parislemler
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
// ✅ Params (axios paramsSerializer array=repeat destekliyor)
|
// ✅ Params (axios paramsSerializer array=repeat destekliyor)
|
||||||
const params = {
|
const params = {
|
||||||
accountcode: accountCode,
|
accountcode: accountCode,
|
||||||
startdate: startDate,
|
startdate: startDate,
|
||||||
@@ -25,7 +25,7 @@ export const useDownloadstHeadStore = defineStore('downloadstHead', {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔥 API CALL (TOKEN + BLOB + ERROR HANDLING OTOMATİK)
|
// 🔥 API CALL (TOKEN + BLOB + ERROR HANDLING OTOMATİK)
|
||||||
const blob = await download(
|
const blob = await download(
|
||||||
'/exportstamentheaderreport-pdf',
|
'/exportstamentheaderreport-pdf',
|
||||||
params
|
params
|
||||||
@@ -34,17 +34,17 @@ export const useDownloadstHeadStore = defineStore('downloadstHead', {
|
|||||||
const pdfUrl = window.URL.createObjectURL(blob)
|
const pdfUrl = window.URL.createObjectURL(blob)
|
||||||
window.open(pdfUrl, '_blank')
|
window.open(pdfUrl, '_blank')
|
||||||
|
|
||||||
return { ok: true, message: '📄 PDF hazırlandı' }
|
return { ok: true, message: '📄 PDF hazırlandı' }
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const detail = await extractApiErrorDetail(err)
|
const detail = await extractApiErrorDetail(err)
|
||||||
const status = err?.status || err?.response?.status || '-'
|
const status = err?.status || err?.response?.status || '-'
|
||||||
console.error(`❌ PDF açma hatası [${status}] /exportstamentheaderreport-pdf: ${detail}`)
|
console.error(`? PDF a<EFBFBD>ma hatas<EFBFBD> [${status}] /exportstamentheaderreport-pdf: ${detail}`)
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
message:
|
message:
|
||||||
detail ||
|
detail ||
|
||||||
'PDF açma hatası'
|
'PDF a<EFBFBD>ma hatas<EFBFBD>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// src/stores/downloadstpdfStore.js
|
// src/stores/downloadstpdfStore.js
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { download, extractApiErrorDetail } from 'src/services/api'
|
import { download, extractApiErrorDetail } from 'src/services/api'
|
||||||
|
|
||||||
export const useDownloadstpdfStore = defineStore('downloadstpdf', {
|
export const useDownloadstpdfStore = defineStore('downloadstpdf', {
|
||||||
actions: {
|
actions: {
|
||||||
/* ==========================================================
|
/* ==========================================================
|
||||||
📄 PDF İNDİR / AÇ
|
📄 PDF İNDİR / AÇ
|
||||||
========================================================== */
|
========================================================== */
|
||||||
async downloadPDF(accountCode, startDate, endDate, parislemler = []) {
|
async downloadPDF(accountCode, startDate, endDate, parislemler = []) {
|
||||||
try {
|
try {
|
||||||
// 🔹 Query params
|
// 🔹 Query params
|
||||||
const params = {
|
const params = {
|
||||||
accountcode: accountCode,
|
accountcode: accountCode,
|
||||||
startdate: startDate,
|
startdate: startDate,
|
||||||
@@ -22,30 +22,30 @@ export const useDownloadstpdfStore = defineStore('downloadstpdf', {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔥 MERKEZİ API — BLOB
|
// 🔥 MERKEZİ API — BLOB
|
||||||
const blob = await download('/export-pdf', params)
|
const blob = await download('/export-pdf', params)
|
||||||
|
|
||||||
// 🔹 Blob → URL
|
// 🔹 Blob → URL
|
||||||
const pdfUrl = window.URL.createObjectURL(
|
const pdfUrl = window.URL.createObjectURL(
|
||||||
new Blob([blob], { type: 'application/pdf' })
|
new Blob([blob], { type: 'application/pdf' })
|
||||||
)
|
)
|
||||||
|
|
||||||
// 🔹 Yeni sekmede aç
|
// 🔹 Yeni sekmede aç
|
||||||
window.open(pdfUrl, '_blank')
|
window.open(pdfUrl, '_blank')
|
||||||
|
|
||||||
console.log('✅ PDF yeni sekmede açıldı')
|
console.log('✅ PDF yeni sekmede açıldı')
|
||||||
return { ok: true, message: '📄 PDF hazırlandı' }
|
return { ok: true, message: '📄 PDF hazırlandı' }
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const detail = await extractApiErrorDetail(err)
|
const detail = await extractApiErrorDetail(err)
|
||||||
const status = err?.status || err?.response?.status || '-'
|
const status = err?.status || err?.response?.status || '-'
|
||||||
console.error(`❌ PDF açma hatası [${status}] /export-pdf: ${detail}`)
|
console.error(`? PDF a<EFBFBD>ma hatas<EFBFBD> [${status}] /export-pdf: ${detail}`)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
message:
|
message:
|
||||||
detail ||
|
detail ||
|
||||||
'PDF alınamadı'
|
'PDF al<EFBFBD>namad<EFBFBD>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user