Merge branch 'dev-bagus' of https://github.com/defuj/eis into dev-defuj

This commit is contained in:
Dede Fuji Abdul
2024-03-25 09:40:20 +07:00
5 changed files with 546 additions and 28 deletions

View File

@ -4,6 +4,7 @@
<Filters
@reset-form="data = []"
:report-button="true"
@run-report="() => exportToPDF(reportMeta, data, true)"
@run-search="() => filterData(filters)"
class="mb-4"
>
@ -794,6 +795,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)
@ -808,6 +810,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
@ -815,15 +823,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')
@ -865,6 +865,8 @@ const filterData = (params: any) => {
if (queryResult.data != undefined) {
data.value = queryResult.data.rekapitulasiJenisGangguanSE004
}
reportMeta.value = filters.value
})
onError((queryError) => {