feat: create pdf export in rekapitulasi gangguan per jenis gangguan SE004
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
<Filters
|
||||
@reset-form="data = []"
|
||||
:report-button="true"
|
||||
@run-report="() => exportToPDF(reportMeta, data, true)"
|
||||
@run-search="() => filterData(filters)"
|
||||
class="mb-4"
|
||||
>
|
||||
@ -788,6 +789,7 @@ import InputText from '@/components/InputText.vue'
|
||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_JenisGangguanSE'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -802,6 +804,12 @@ const dataSubSelected = ref<any>(null)
|
||||
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' },
|
||||
posko: { id: 0, name: 'Semua Posko' },
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogDetail.value = false
|
||||
@ -809,15 +817,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')
|
||||
@ -860,6 +860,8 @@ const filterData = (params: any) => {
|
||||
data.value = queryResult.data.rekapitulasiJenisGangguanSE004
|
||||
console.log(queryResult.data.rekapitulasiJenisGangguanSE004)
|
||||
}
|
||||
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
|
||||
onError((queryError) => {
|
||||
|
Reference in New Issue
Block a user