feat: create export pdf in rekapitulasi gangguan rating per posko
This commit is contained in:
@ -1,7 +1,14 @@
|
||||
<template>
|
||||
<Filters @run-search="() => filterData(filters)" :report-button="true" class="mb-4">
|
||||
<Filters
|
||||
@run-report="() => exportToPDF(reportMeta, data, true)"
|
||||
@reset-form="data = []"
|
||||
@run-search="() => filterData(filters)"
|
||||
:report-button="true"
|
||||
class="mb-4"
|
||||
>
|
||||
<Type1 @update:filters="(value) => (filters = value)" :showPosko="false" />
|
||||
</Filters>
|
||||
|
||||
<div id="data">
|
||||
<DxDataGrid
|
||||
ref="dataGridRef"
|
||||
@ -633,6 +640,7 @@ import InputText from '@/components/InputText.vue'
|
||||
import vue3starRatings from 'vue3-star-ratings'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_RatingPerPosko'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -647,6 +655,11 @@ const dataSubSelected = ref<any>()
|
||||
const dialogDetail = ref(false)
|
||||
const loadingData = ref(false)
|
||||
const loadingSubData = ref(false)
|
||||
const reportMeta = ref({
|
||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const getDetail = () => {
|
||||
loadingSubData.value = true
|
||||
@ -707,15 +720,7 @@ const closeDialog = () => {
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
const doc = new jsPDF()
|
||||
|
||||
exportToPdf({
|
||||
jsPDFDocument: doc,
|
||||
component: e.component,
|
||||
indent: 5
|
||||
}).then(() => {
|
||||
doc.save(`.pdf`)
|
||||
})
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
} else {
|
||||
const workbook = new Workbook()
|
||||
const worksheet = workbook.addWorksheet('Employees')
|
||||
@ -790,6 +795,8 @@ const filterData = (params: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
|
Reference in New Issue
Block a user