Rekapitulasi Gangguan Berdasarkan Media
This commit is contained in:
@ -242,35 +242,43 @@ const closeDetail = () => {
|
||||
showDetail.value = false
|
||||
}
|
||||
const onExporting = (e: any) => {
|
||||
|
||||
if (e.format === 'pdf') {
|
||||
const doc = new jsPDF({
|
||||
orientation: 'landscape',
|
||||
unit: 'mm',
|
||||
format: 'a4',
|
||||
|
||||
format: 'F4',
|
||||
})
|
||||
// Add title on each page
|
||||
const title = "Daftar Gangguan Dialihkan Ke Posko Lain";
|
||||
|
||||
// autoTable(doc, {
|
||||
|
||||
// margin: { top: 20 }, // Adjust top margin as needed
|
||||
// styles: {
|
||||
// fontSize: 8,
|
||||
// overflow: 'linebreak', // Enable linebreaks to fit content
|
||||
// },
|
||||
// startY: 10, // Adjust startY position as needed
|
||||
// head: [['No Laporan', 'Pembuat Laporan', 'Tgl Lapor', 'Tgl Dialihkan', 'Tgl Response', 'Tgl Recovery', 'Durasi Response Time', 'Durasi Recovery Time', 'Posko Awal', 'Posko Tujuan', 'Status', 'IDPEL/NO METER', 'Nama Pelapor', 'Alamat Pelapor', 'No Telp Pelapor', 'Keterangan Pelapor', 'Sumber Lapor', 'Posko']],
|
||||
// body: data.value.map((item) =>
|
||||
// [item.no_laporan, item.pembuat_laporan, item.waktu_lapor, item.waktu_dialihkan, item.waktu_response, item.waktu_recovery, item.durasi_response_time, item.durasi_recovery_time, item.nama_posko_lama, item.nama_posko_baru, item.status_akhir, item.idpel_nometer, item.nama_pelapor, item.alamat_pelapor, item.no_telp_pelapor, item.keterangan_pelapor, item.media, item.posko])
|
||||
// Initialize page number
|
||||
const pageNumber = ref(1);
|
||||
autoTable(doc, {
|
||||
head: [['No Laporan', 'Pembuat Laporan', 'Tgl Lapor', 'Tgl Dialihkan', 'Tgl Response', 'Tgl Recovery', 'Durasi Response Time', 'Durasi Recovery Time', 'Posko Awal', 'Posko Tujuan', 'Status', 'IDPEL/NO METER', 'Nama Pelapor', 'Alamat Pelapor', 'No Telp Pelapor', 'Keterangan Pelapor', 'Sumber Lapor', 'Posko']],
|
||||
startY: 10,
|
||||
body: data.value.map((item) =>
|
||||
[item.no_laporan, item.pembuat_laporan, item.waktu_lapor, item.waktu_dialihkan, item.waktu_response, item.waktu_recovery, item.durasi_response_time, item.durasi_recovery_time, item.nama_posko_lama, item.nama_posko_baru, item.status_akhir, item.idpel_nometer, item.nama_pelapor, item.alamat_pelapor, item.no_telp_pelapor, item.keterangan_pelapor, item.media, item.posko]),
|
||||
styles: {
|
||||
fontSize: 6,
|
||||
cellWidth: 'wrap'
|
||||
},
|
||||
|
||||
|
||||
})
|
||||
doc.setProperties({
|
||||
title: 'Daftar Gangguan Dialihkan Ke Posko Lain',
|
||||
subject: 'Daftar Gangguan Dialihkan Ke Posko Lain',
|
||||
});
|
||||
|
||||
pageNumber.value++; // Increment the pageNumber
|
||||
doc.save(`Daftar Gangguan Dialihkan Ke Posko Lain.pdf`)
|
||||
|
||||
// exportToPdf({
|
||||
// jsPDFDocument: doc,
|
||||
// component: e.component,
|
||||
// }).then(() => {
|
||||
// })
|
||||
|
||||
|
||||
exportToPdf({
|
||||
jsPDFDocument: doc,
|
||||
component: e.component,
|
||||
}).then(() => {
|
||||
doc.save(`Daftar Gangguan Dialihkan Ke Posko Lain.pdf`)
|
||||
})
|
||||
} else {
|
||||
const workbook = new Workbook()
|
||||
const worksheet = workbook.addWorksheet('Daftar Gangguan Dialihkan Ke Posko Lain')
|
||||
@ -332,15 +340,7 @@ const filterData = (params: any) => {
|
||||
})
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
queryResult.data.daftarGangguanDialihkanKePoskoLain.forEach((item: any) => {
|
||||
data.value = [
|
||||
...data.value,
|
||||
{
|
||||
...item,
|
||||
posko: item.nama_posko_baru
|
||||
}
|
||||
]
|
||||
})
|
||||
data.value = queryResult.data.daftarGangguanDialihkanKePoskoLain
|
||||
}
|
||||
console.log(queryResult.data)
|
||||
console.log(queryResult.loading)
|
||||
|
Reference in New Issue
Block a user