fix: file name when lihat laporan
This commit is contained in:
@@ -89,10 +89,14 @@ const formatData = (rawData: any) => {
|
||||
data[id_fasilitas][i].sub_kelompok,
|
||||
formatNumber(data[id_fasilitas][i].total),
|
||||
formatNumber(data[id_fasilitas][i].total_selesai),
|
||||
formatPercentage((data[id_fasilitas][i].total_selesai / data[id_fasilitas][i].total) * 100),
|
||||
formatPercentage(
|
||||
!data[id_fasilitas][i].total_selesai || !data[id_fasilitas][i].total
|
||||
? '0%'
|
||||
: (data[id_fasilitas][i].total_selesai / data[id_fasilitas][i].total) * 100
|
||||
),
|
||||
formatNumber(data[id_fasilitas][i].total_inproses),
|
||||
formatPercentage(
|
||||
data[id_fasilitas][i].total_inproses == null || data[id_fasilitas][i].total == null
|
||||
!data[id_fasilitas][i].total_inproses || !data[id_fasilitas][i].total
|
||||
? '0%'
|
||||
: (data[id_fasilitas][i].total_inproses / data[id_fasilitas][i].total) * 100
|
||||
),
|
||||
@@ -147,9 +151,17 @@ const formatData = (rawData: any) => {
|
||||
{ content: 'TOTAL', colSpan: 3, styles: { fontStyle: 'bold' } },
|
||||
formatNumber(total.total_laporan),
|
||||
formatNumber(total.total_laporan_sudah_selesai),
|
||||
formatPercentage((total.total_laporan_sudah_selesai / total.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!total.total_laporan_sudah_selesai || !total.total_laporan
|
||||
? '0%'
|
||||
: (total.total_laporan_sudah_selesai / total.total_laporan) * 100
|
||||
),
|
||||
formatNumber(total.total_laporan_belum_selesai),
|
||||
formatPercentage((total.total_laporan_belum_selesai / total.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!total.total_laporan_belum_selesai || !total.total_laporan
|
||||
? '0%'
|
||||
: (total.total_laporan_belum_selesai / total.total_laporan) * 100
|
||||
),
|
||||
formatNumber(total.total_response_time_total),
|
||||
formatNumber(
|
||||
total.total_response_time_rata_rata.length
|
||||
@@ -179,9 +191,17 @@ const formatData = (rawData: any) => {
|
||||
{ content: 'GRAND TOTAL', colSpan: 3, styles: { fontStyle: 'bold' } },
|
||||
formatNumber(grandTotal.total_laporan),
|
||||
formatNumber(grandTotal.total_laporan_sudah_selesai),
|
||||
formatPercentage((grandTotal.total_laporan_sudah_selesai / grandTotal.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!grandTotal.total_laporan_sudah_selesai || !grandTotal.total_laporan
|
||||
? '0%'
|
||||
: (grandTotal.total_laporan_sudah_selesai / grandTotal.total_laporan) * 100
|
||||
),
|
||||
formatNumber(grandTotal.total_laporan_belum_selesai),
|
||||
formatPercentage((grandTotal.total_laporan_belum_selesai / grandTotal.total_laporan) * 100),
|
||||
formatPercentage(
|
||||
!grandTotal.total_laporan_belum_selesai || !grandTotal.total_laporan
|
||||
? '0%'
|
||||
: (grandTotal.total_laporan_belum_selesai / grandTotal.total_laporan) * 100
|
||||
),
|
||||
formatNumber(grandTotal.total_response_time_total),
|
||||
formatNumber(
|
||||
grandTotal.total_response_time_rata_rata.length
|
||||
@@ -435,6 +455,9 @@ const exportToPDF = (reportMeta: any, rawData: any, preview: boolean = false) =>
|
||||
})
|
||||
|
||||
if (preview) {
|
||||
doc.setProperties({
|
||||
title: `${reportName}`
|
||||
})
|
||||
window.open(doc.output('bloburl'))
|
||||
} else {
|
||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
||||
|
Reference in New Issue
Block a user