feat: implement server side in daftar keluhan selesai cc
This commit is contained in:
parent
1b94c0ba74
commit
fddc43581d
@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
||||
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||
<Type3 @update:filters="(value) => (filters = value)" />
|
||||
</Filters>
|
||||
|
||||
<div id="data">
|
||||
<DxDataGrid
|
||||
ref="dataGridRef"
|
||||
@option-changed="handleRequestChange"
|
||||
:allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)] mb-10"
|
||||
:data-source="data"
|
||||
v-if="loading == false"
|
||||
:remote-operations="true"
|
||||
:show-column-lines="true"
|
||||
:show-row-lines="false"
|
||||
:show-borders="true"
|
||||
@ -22,6 +23,7 @@
|
||||
column-resizing-mode="widget"
|
||||
:word-wrap-enabled="false"
|
||||
>
|
||||
<DxLoadPanel :enabled="true" />
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :page-size="20" :enabled="true" />
|
||||
<DxPager
|
||||
@ -41,13 +43,13 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
css-class="custom-table-column !align-top"
|
||||
:allow-sorting="false"
|
||||
css-class="custom-table-column !text-right"
|
||||
:width="50"
|
||||
alignment="center"
|
||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
||||
data-type="number"
|
||||
data-field="no"
|
||||
caption="No"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="170"
|
||||
@ -294,7 +296,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</DetailDialog>
|
||||
<BufferDialog v-if="loading" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -302,7 +303,9 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||
import InputText from '@/components/InputText.vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import CustomStore from 'devextreme/data/custom_store'
|
||||
|
||||
import { reactive, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -317,48 +320,20 @@ import {
|
||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_SelesaiCC'
|
||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||
|
||||
const position = { of: '#data' }
|
||||
const showIndicator = ref(true)
|
||||
const shading = ref(true)
|
||||
const showPane = ref(true)
|
||||
import type { IRequestOptions } from '@/types/requestParams'
|
||||
|
||||
const requestOptions = reactive<IRequestOptions>({
|
||||
skip: 0,
|
||||
take: 20,
|
||||
requireTotalCount: true,
|
||||
sort: null,
|
||||
filter: null
|
||||
})
|
||||
const dataSelected = ref<any>()
|
||||
const dialogDetail = ref(false)
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogDetail.value = false
|
||||
}
|
||||
|
||||
const reportData: any = ref(null)
|
||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||
const clearSelection = () => {
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
dataGrid.clearSelection()
|
||||
}
|
||||
const showDetail = () => {
|
||||
clearSelection()
|
||||
dialogDetail.value = true
|
||||
}
|
||||
|
||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
if (selectedRowsData[0] != undefined) {
|
||||
dataSelected.value = selectedRowsData[0]
|
||||
showDetail()
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta, data)
|
||||
} else if (e.format === 'xlsx') {
|
||||
exportToXLSX(reportMeta, e)
|
||||
} else {
|
||||
exportToDOCX(reportMeta, data)
|
||||
}
|
||||
}
|
||||
|
||||
const data = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const filters = ref()
|
||||
const reportMeta = ref({
|
||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
@ -367,16 +342,135 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const allowTableRequest = ref(false)
|
||||
const data = new CustomStore({
|
||||
load: async (loadOptions: any) => {
|
||||
if (allowTableRequest.value) {
|
||||
loadOptions.requireTotalCount = true
|
||||
|
||||
const query = {
|
||||
skip: loadOptions.skip,
|
||||
take: loadOptions.take,
|
||||
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||
requireTotalCount: loadOptions.requireTotalCount,
|
||||
...createQuery(filters.value)
|
||||
}
|
||||
|
||||
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanDiselesaikanCC123, query)
|
||||
.then((result) => {
|
||||
const response = result.data.data.ssdaftarKeluhanDiselesaikanCC123
|
||||
|
||||
let no = query.skip ?? 0
|
||||
|
||||
for (const data of response.data) {
|
||||
data.no = ++no
|
||||
}
|
||||
|
||||
return {
|
||||
data: response.data,
|
||||
totalCount: response.totalCount
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
throw Error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
} else {
|
||||
return new Promise(function (resolve) {
|
||||
resolve({
|
||||
data: [],
|
||||
totalCount: 0
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
allowTableRequest.value = false
|
||||
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
const dataGridDataSource = dataGrid.getDataSource()
|
||||
|
||||
dataGridDataSource.reload()
|
||||
}
|
||||
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const handleRequestChange = (e: any) => {
|
||||
if (e.name === 'searchPanel') {
|
||||
if (e.value !== '') {
|
||||
requestOptions.filter = createSearchOptions(e.value)
|
||||
} else {
|
||||
requestOptions.filter = null
|
||||
}
|
||||
}
|
||||
|
||||
if (e.name === 'paging') {
|
||||
requestOptions.take = e.value
|
||||
}
|
||||
|
||||
if (e.name === 'columns') {
|
||||
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||
|
||||
requestOptions.sort = [
|
||||
{
|
||||
selector: columnDataField,
|
||||
desc: e.value === 'desc'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
const createSearchOptions = (keyword: string) => {
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
const columns = dataGrid.getVisibleColumns()
|
||||
|
||||
const searchOptions = []
|
||||
|
||||
for (const column of columns) {
|
||||
if (column.dataField === 'no' || !column.dataField) {
|
||||
continue
|
||||
}
|
||||
|
||||
searchOptions.push({
|
||||
field: column.dataField,
|
||||
value: keyword
|
||||
})
|
||||
}
|
||||
|
||||
return searchOptions
|
||||
}
|
||||
|
||||
const mapSearchOptions = (searchOptions: any) => {
|
||||
const result = searchOptions.map((option: any) => {
|
||||
if (Array.isArray(option) && option[0] !== 'no') {
|
||||
return {
|
||||
field: option[0],
|
||||
value: option[2]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return result.filter((item: any) => item)
|
||||
}
|
||||
|
||||
const filterData = () => {
|
||||
allowTableRequest.value = true
|
||||
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
const dataGridDataSource = dataGrid.getDataSource()
|
||||
|
||||
dataGridDataSource.reload()
|
||||
}
|
||||
|
||||
const createQuery = (params: any) => {
|
||||
const dateValue = params.periode.split(' s/d ')
|
||||
const { ulp, uid, up3 } = params
|
||||
|
||||
const query = {
|
||||
return {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
@ -388,147 +482,52 @@ const filterData = async (params: any) => {
|
||||
idUp3: up3 ? up3.id : 0,
|
||||
media: ''
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
await requestGraphQl(queries.keluhan.daftar.keluhanDiselesaikanCC123, query)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
data.value = result.data.data.daftarKeluhanDiselesaikanCC123
|
||||
} else {
|
||||
data.value = []
|
||||
}
|
||||
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (import.meta.env.DEV) {
|
||||
data.value = [
|
||||
{
|
||||
no_laporan: 'K5123020100019',
|
||||
id_uid: 2,
|
||||
nama_uid: 'DISTRIBUSI JAKARTA RAYA',
|
||||
id_up3: 13,
|
||||
nama_up3: 'UP3 TANJUNG PRIOK',
|
||||
id_ulp: 54510,
|
||||
nama_ulp: 'UP3 TANJUNG PRIOK',
|
||||
idpel_nometer: '',
|
||||
nama_pelapor: 'BP AHMAD',
|
||||
alamat_pelapor:
|
||||
'JL BENTENGAN TIMUR NO31 RT11/03, SUNTER JAYA, TANJUNG PRIOK, KOTA ADM. JAKARTA UTARA, DKI JAKARTA',
|
||||
no_telp_pelapor: '082320000152',
|
||||
keterangan_pelapor:
|
||||
'MOHON BANTUAN PEMBATALAN PERMOHONAN PB NO AGENDA 545109912301319203 DIKARENAKAN PELANGGAN INGIN KE DAYA 2200 VA, PELANGGAN SUDAH MELAKUKAN PEMBAYARAN MELALAUI GOPAY TANGGAL 31/01/2023 PUKUL 18:49 WIB, NAMUN PEMBAYARAN BELUM MASUK, MOHON KONFRIMASI KE PELANGGAN, TERIMA KASIH. ',
|
||||
status_akhir: 'Selesai',
|
||||
pembuat_laporan: 'CC.51.NUGROHO',
|
||||
waktu_lapor: '01/02/2023 01:59:02',
|
||||
waktu_recovery: '01/02/2023 08:33:38',
|
||||
jumlah_lapor: 1,
|
||||
media: 'Call PLN 123',
|
||||
nama_issuetype: 'Informasi',
|
||||
nama_subissuetype: 'PB '
|
||||
},
|
||||
{
|
||||
no_laporan: 'K5123020100021',
|
||||
id_uid: 427,
|
||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
||||
id_up3: 547,
|
||||
nama_up3: 'UP3 CIKARANG',
|
||||
id_ulp: 53702,
|
||||
nama_ulp: 'ULP CIBITUNG',
|
||||
idpel_nometer: '',
|
||||
nama_pelapor: 'IBU TITIN ',
|
||||
alamat_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
||||
no_telp_pelapor: '087786974290',
|
||||
keterangan_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
||||
status_akhir: 'Selesai',
|
||||
pembuat_laporan: 'CC.51.BARIQI',
|
||||
waktu_lapor: '01/02/2023 02:04:04',
|
||||
waktu_recovery: '01/02/2023 02:34:06',
|
||||
jumlah_lapor: 1,
|
||||
media: 'Call PLN 123',
|
||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
||||
nama_subissuetype: 'Tidak bisa beli Token '
|
||||
},
|
||||
{
|
||||
no_laporan: 'K1423020100022',
|
||||
id_uid: 427,
|
||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
||||
id_up3: 532,
|
||||
nama_up3: 'UP3 BEKASI',
|
||||
id_ulp: 53741,
|
||||
nama_ulp: 'ULP BANTARGEBANG',
|
||||
idpel_nometer: '000000000000000001820788',
|
||||
nama_pelapor: 'IBU IRFI ',
|
||||
alamat_pelapor:
|
||||
'JL NIAGA 7 PERUM KEMANG BLOK F NO 23 KEC RAWA LUMBU KEL SEPANJANG JAYA KOTA BEKASI ACUAN LOKASI DEKAT RUMAH YATIM ',
|
||||
no_telp_pelapor: '62816922683',
|
||||
keterangan_pelapor:
|
||||
'TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43 (PTL TIDAK PADAM) \\nDENGAN NO METER 56700750112 DAN SISA KWH 15.1',
|
||||
status_akhir: 'Selesai',
|
||||
pembuat_laporan: 'CC.14.ANDI',
|
||||
waktu_lapor: '01/02/2023 03:13:25',
|
||||
waktu_recovery: '01/02/2023 07:03:37',
|
||||
jumlah_lapor: 1,
|
||||
media: 'Call PLN 123',
|
||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
||||
nama_subissuetype: 'Gagal Input Token'
|
||||
},
|
||||
{
|
||||
no_laporan: 'K5223020100106',
|
||||
id_uid: 427,
|
||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
||||
id_up3: 537,
|
||||
nama_up3: 'UP3 CIREBON',
|
||||
id_ulp: 53331,
|
||||
nama_ulp: 'ULP SUMBER',
|
||||
idpel_nometer: '000000000000000000943441',
|
||||
nama_pelapor: 'IBU MELLY KURNIASIH',
|
||||
alamat_pelapor: 'PERUMAHAN CEMPAKA ARUM JL. FLAMBOYAN 5 NO 191 CIREBON',
|
||||
no_telp_pelapor: '08889353988',
|
||||
keterangan_pelapor:
|
||||
'LEBIH TAGIH. ST AK REK FEB 2023 (28/01/2023) = 4608, ST APP TGL 26/01/2023 = 4496. REK BELUM DILUNASI. (RUMAH TIDAK DIHUNI NAMUN PAGAR TIDAK TERKUNCI, PETUGAS TIDAK DIKETAHUI DATANG KE LOKASI). PELANGGAN MENGINGINKAN AGAR HAL TERSEBUT TIDAK TERULANG KEMBALI.',
|
||||
status_akhir: 'Selesai',
|
||||
pembuat_laporan: 'CC.52.YORDAN.LC',
|
||||
waktu_lapor: '01/02/2023 03:45:58',
|
||||
waktu_recovery: '01/02/2023 06:28:11',
|
||||
jumlah_lapor: 1,
|
||||
media: 'Live Chat PLN Mobile',
|
||||
nama_issuetype: 'Cater',
|
||||
nama_subissuetype: 'Keakuratan hasil catat meter '
|
||||
},
|
||||
{
|
||||
no_laporan: 'K5223020100112',
|
||||
id_uid: 101,
|
||||
nama_uid: 'DISTRIBUSI JAWA TENGAH & DIY',
|
||||
id_up3: 52100,
|
||||
nama_up3: 'UP3 YOGYAKARTA',
|
||||
id_ulp: 52104,
|
||||
nama_ulp: 'ULP SEDAYU',
|
||||
idpel_nometer: '',
|
||||
nama_pelapor: 'BP HENDRIYANTO',
|
||||
alamat_pelapor:
|
||||
'JL.PALEM HIJAU, COKROKONTENG, RT.04 RW.2. KEL SIDOARUM. KEC GODEAN KAB SLEMAN PROV DIY',
|
||||
no_telp_pelapor: '085921182228',
|
||||
keterangan_pelapor:
|
||||
'PELANGGAN TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43. (BELUM ADA) PETUGAS YANG MELAKUKAN PENGATURAN. SISA KWH: 385.41. PTL (HAMPIR PADAM). PELANGGAN PERNAH LAPOR DENGAN NO: K5223013102183, STATUS SELESAI, PELANGGAN TIDAK DIKONFIRMASI s.d 1X6 JAM. LAPOR KEMBALI CC.54.JULIANA TGL 01/02/23 12FZUS3 08.46 085921182228',
|
||||
status_akhir: 'Selesai',
|
||||
pembuat_laporan: 'CC.52.YORDAN.LC',
|
||||
waktu_lapor: '01/02/2023 04:16:48',
|
||||
waktu_recovery: '01/02/2023 12:02:23',
|
||||
jumlah_lapor: 1,
|
||||
media: 'Live Chat PLN Mobile',
|
||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
||||
nama_subissuetype: 'Gagal Input Token'
|
||||
}
|
||||
]
|
||||
const clearSelection = () => {
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
dataGrid.clearSelection()
|
||||
}
|
||||
|
||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
if (selectedRowsData[0] != undefined) {
|
||||
dataSelected.value = selectedRowsData[0]
|
||||
showDetail()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogDetail.value = false
|
||||
}
|
||||
|
||||
const showDetail = () => {
|
||||
clearSelection()
|
||||
dialogDetail.value = true
|
||||
}
|
||||
|
||||
const onExporting = async (e: any) => {
|
||||
const dataGrid = dataGridRef.value!.instance!
|
||||
|
||||
if (e.format === 'pdf' || e.format === 'document') {
|
||||
reportData.value = await data.load()
|
||||
}
|
||||
|
||||
if (e.format === 'pdf' && reportData.value) {
|
||||
dataGrid.beginCustomLoading('')
|
||||
const pdf = await exportToPDF(reportMeta, reportData)
|
||||
|
||||
if (pdf) {
|
||||
dataGrid.endCustomLoading()
|
||||
}
|
||||
} else if (e.format === 'xlsx') {
|
||||
exportToXLSX(reportMeta, e)
|
||||
} else if (e.format === 'document' && reportData.value) {
|
||||
dataGrid.beginCustomLoading('')
|
||||
const doc = await exportToDOCX(reportMeta, reportData)
|
||||
|
||||
if (doc) {
|
||||
dataGrid.endCustomLoading()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
||||
return { dateFromFormat, dateToFormat, dayTo }
|
||||
}
|
||||
|
||||
const exportToPDF = (reportMeta: any, data: any) => {
|
||||
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||
const meta = formatMetaData(reportMeta)
|
||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||
const date = new Date().getDate()
|
||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||
const year = new Date().getFullYear()
|
||||
const resultData = data.value.data
|
||||
const doc = new jsPDF({
|
||||
orientation: 'landscape'
|
||||
})
|
||||
@ -131,7 +132,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
||||
'Sub Issue Type'
|
||||
]
|
||||
],
|
||||
body: data.value.map((item: any, i: any) => [
|
||||
body: resultData.map((item: any, i: any) => [
|
||||
{ content: ++i, styles: { halign: 'right' } },
|
||||
item.no_laporan,
|
||||
item.nama_ulp,
|
||||
@ -200,12 +201,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
||||
margin: { left: 230 }
|
||||
})
|
||||
|
||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
||||
console.log('pdf berhasil disimpan')
|
||||
})
|
||||
await doc
|
||||
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||
.then(() => {
|
||||
console.log('PDF Exported')
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error while exporting PDF', error)
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
||||
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||
const meta = formatMetaData(reportMeta)
|
||||
const workbook = new Workbook()
|
||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||
@ -258,11 +266,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
||||
worksheet.mergeCells('A6:Q6')
|
||||
worksheet.mergeCells('A7:Q7')
|
||||
|
||||
exportToExcel({
|
||||
await exportToExcel({
|
||||
component: e.component,
|
||||
worksheet,
|
||||
autoFilterEnabled: true,
|
||||
topLeftCell: { row: 9, column: 1 }
|
||||
topLeftCell: { row: 10, column: 1 }
|
||||
}).then(() => {
|
||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||
@ -272,15 +280,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
||||
e.cancel = true
|
||||
}
|
||||
|
||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
||||
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||
const date = new Date().getDate()
|
||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||
const year = new Date().getFullYear()
|
||||
const meta = formatMetaData(reportMeta)
|
||||
const resultData = data.value.data
|
||||
|
||||
const generateRows = () => {
|
||||
return data.value.map((item: any, i: any) => {
|
||||
return resultData.map((item: any, i: any) => {
|
||||
return new TableRow({
|
||||
children: [
|
||||
{ text: `${++i}`, field: 'no' },
|
||||
@ -509,10 +518,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
||||
]
|
||||
})
|
||||
|
||||
Packer.toBlob(doc).then((blob) => {
|
||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||
console.log('Document created successfully')
|
||||
})
|
||||
await Packer.toBlob(doc)
|
||||
.then((blob) => {
|
||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||
|
||||
console.log('DOCX Exported')
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error while exporting DOCX', error)
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||
|
@ -84,6 +84,59 @@ export const queries = {
|
||||
}
|
||||
}
|
||||
`,
|
||||
ssdaftarKeluhanDiselesaikanCC123: gql`
|
||||
query ssdaftarKeluhanDiselesaikanCC123(
|
||||
$dateFrom: Date!
|
||||
$dateTo: Date!
|
||||
$idUlp: Int!
|
||||
$idUid: Int!
|
||||
$idUp3: Int!
|
||||
$media: String!
|
||||
$skip: Int
|
||||
$take: Int
|
||||
$requireTotalCount: Boolean
|
||||
$sort: [SortInput]
|
||||
$filter: [FilterInput]
|
||||
) {
|
||||
ssdaftarKeluhanDiselesaikanCC123(
|
||||
dateFrom: $dateFrom
|
||||
dateTo: $dateTo
|
||||
idUlp: $idUlp
|
||||
idUid: $idUid
|
||||
idUp3: $idUp3
|
||||
media: $media
|
||||
skip: $skip
|
||||
take: $take
|
||||
requireTotalCount: $requireTotalCount
|
||||
sort: $sort
|
||||
filter: $filter
|
||||
) {
|
||||
totalCount
|
||||
data {
|
||||
no_laporan
|
||||
id_uid
|
||||
nama_uid
|
||||
id_up3
|
||||
nama_up3
|
||||
id_ulp
|
||||
nama_ulp
|
||||
idpel_nometer
|
||||
nama_pelapor
|
||||
alamat_pelapor
|
||||
no_telp_pelapor
|
||||
keterangan_pelapor
|
||||
status_akhir
|
||||
pembuat_laporan
|
||||
waktu_lapor
|
||||
waktu_recovery
|
||||
jumlah_lapor
|
||||
media
|
||||
nama_issuetype
|
||||
nama_subissuetype
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
keluhanDiselesaikanCC123: gql`
|
||||
query daftarKeluhanDiselesaikanCC123(
|
||||
$dateFrom: Date!
|
||||
|
Loading…
x
Reference in New Issue
Block a user