Merge branch 'dev-defuj' of https://github.com/defuj/eis into dev-eko
This commit is contained in:
@ -5,31 +5,40 @@
|
||||
</Filters>
|
||||
|
||||
<div id="data">
|
||||
<DxDataGrid ref="dataGridRef" :allow-column-reordering="true" class="max-h-[calc(100vh-140px)] mb-10"
|
||||
:data-source="data" :show-column-lines="true" :show-row-lines="false" :show-borders="true"
|
||||
:row-alternation-enabled="true" :hover-state-enabled="true" @cell-click="handleCellClick"
|
||||
@row-click="handleRowClick" @selection-changed="onDataSelectionChanged" @exporting="onExporting"
|
||||
:allow-column-resizing="true" column-resizing-mode="widget">
|
||||
<DxDataGrid
|
||||
@cell-click="onCellClicked"
|
||||
ref="dataGridRef"
|
||||
:allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)] mb-10"
|
||||
:data-source="data"
|
||||
:show-column-lines="true"
|
||||
:show-row-lines="false"
|
||||
:show-borders="true"
|
||||
:row-alternation-enabled="true"
|
||||
:hover-state-enabled="true"
|
||||
@selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting"
|
||||
:allow-column-resizing="true"
|
||||
column-resizing-mode="widget"
|
||||
>
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" />
|
||||
<DxSelection mode="single" />
|
||||
<!-- <DxPaging :page-size="40" :enabled="true" />
|
||||
<DxPager
|
||||
:visible="true"
|
||||
:allowed-page-sizes="[20, 40, 60]"
|
||||
display-mode="full"
|
||||
:show-page-size-selector="true"
|
||||
:show-info="true"
|
||||
:show-navigation-buttons="true"
|
||||
/> -->
|
||||
<DxLoadPanel shading-color="rgba(0,0,0,0.4)" :position="position" :show-indicator="showIndicator"
|
||||
:show-pane="showPane" :shading="shading" v-model:visible="loadingData" :enabled="true" />
|
||||
<DxLoadPanel
|
||||
shading-color="rgba(0,0,0,0.4)"
|
||||
:position="position"
|
||||
:show-indicator="showIndicator"
|
||||
:show-pane="showPane"
|
||||
:shading="shading"
|
||||
v-model:visible="loadingData"
|
||||
:enabled="true"
|
||||
/>
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
<!-- <DxColumn
|
||||
css-class="custom-table-column"
|
||||
:width="50"
|
||||
alignment="center"
|
||||
:calculateCellValue="(item: any) => data.findIndex((i) => i == item) + 1"
|
||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
||||
data-type="number"
|
||||
caption="No"
|
||||
cell-template="formatNumber"
|
||||
@ -232,10 +241,21 @@
|
||||
<DetailDialog :open="dialogDetail" title="Detail Gangguan All" @on-close="closedialogDetail" :full-width="true">
|
||||
<div class="w-full mb-4 lg:w-[70%] lg:float-left">
|
||||
<div class="p-4 bg-white rounded-xl lg:mr-4">
|
||||
<DxDataGrid :allow-column-reordering="true" class="max-h-[calc(100vh-140px)]" :data-source="dataSub"
|
||||
:show-column-lines="true" :show-row-lines="false" :show-borders="true" :row-alternation-enabled="true"
|
||||
:hover-state-enabled="true" @selection-changed="onDataSubSelectionChanged" :column-width="100"
|
||||
@exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget">
|
||||
<DxDataGrid
|
||||
:allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)]"
|
||||
:data-source="dataSub"
|
||||
:show-column-lines="true"
|
||||
:show-row-lines="false"
|
||||
:show-borders="true"
|
||||
:row-alternation-enabled="true"
|
||||
:hover-state-enabled="true"
|
||||
@selection-changed="onDataSubSelectionChanged"
|
||||
:column-width="100"
|
||||
@exporting="onExportingDetail"
|
||||
:allow-column-resizing="true"
|
||||
column-resizing-mode="widget"
|
||||
>
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :page-size="20" :enabled="true" />
|
||||
<DxPager :visible="true" :allowed-page-sizes="[20, 50, 100]" display-mode="full"
|
||||
@ -245,57 +265,228 @@
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
|
||||
<DxColumn css-class="custom-table-column" :width="50" alignment="center"
|
||||
:calculateCellValue="(item: any) => dataSub.findIndex((i: any) => i == item) + 1" data-type="number"
|
||||
caption="No" cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="nama_posko" caption="Posko"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="no_laporan" caption="No Lapor"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_lapor" caption="Tgl/Jam Lapor"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_response" caption="Tgl/Jam Datang"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="waktu_recovery" caption="Tgl/Jam Nyala"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="durasi_response_time" caption="Durasi Response Time"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="durasi_recovery_time" caption="Durasi Recovery Time"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Penugasan Regu"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="" caption="Durasi Perjalanan Regu"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatTime" />
|
||||
<DxColumn :width="150" alignment="center" data-field="jarak_closing" caption="Jarak Closing (m)"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="dispatch_oleh" caption="Dispatch Oleh"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="idpel_nometer" caption="IDPEL/NO METER"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="nama_pelapor" caption="Nama Pelapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="200" alignment="center" data-field="alamat_pelapor" caption="Alamat Pelapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="no_telp_pelapor" caption="No Telp Pelapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="200" alignment="center" data-field="keterangan_pelapor" caption="Keterangan Pelapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="pembuat_laporan" caption="Sumber Lapor"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="diselesaikan_oleh" caption="Diselesaikan Oleh"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="status_akhir" caption="Status" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="referensi_marking" caption="Referensi Marking"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="kode_gangguan" caption="Kode Gangguan"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="jenis_gangguan" caption="Jenis Gangguan"
|
||||
:allow-resizing="false" css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="penyebab" caption="Penyebab" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn :width="150" alignment="center" data-field="tindakan" caption="Tindakan" :allow-resizing="false"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn
|
||||
css-class="custom-table-column"
|
||||
:width="50"
|
||||
alignment="center"
|
||||
:calculate-display-value="(item: any) => dataSub.findIndex((i: any) => i == item) + 1"
|
||||
data-type="number"
|
||||
caption="No"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="no_laporan"
|
||||
caption="No Lapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="waktu_lapor"
|
||||
caption="Tgl/Jam Lapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="waktu_response"
|
||||
caption="Tgl/Jam Datang"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="waktu_recovery"
|
||||
caption="Tgl/Jam Nyala"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
caption="Durasi Penugasan Regu"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
caption="Durasi Perjalanan Regu"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="jarak_closing"
|
||||
caption="Jarak Closing (m)"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="dispatch_oleh"
|
||||
caption="Dispatch Oleh"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="idpel_nometer"
|
||||
caption="IDPEL/NO METER"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="nama_pelapor"
|
||||
caption="Nama Pelapor"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="200"
|
||||
alignment="center"
|
||||
data-field="alamat_pelapor"
|
||||
caption="Alamat Pelapor"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="no_telp_pelapor"
|
||||
caption="No Telp Pelapor"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="200"
|
||||
alignment="center"
|
||||
data-field="keterangan_pelapor"
|
||||
caption="Keterangan Pelapor"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="pembuat_laporan"
|
||||
caption="Sumber Lapor"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="diselesaikan_oleh"
|
||||
caption="Diselesaikan Oleh"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="status_akhir"
|
||||
caption="Status"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="referensi_marking"
|
||||
caption="Referensi Marking"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="kode_gangguan"
|
||||
caption="Kode Gangguan"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="jenis_gangguan"
|
||||
caption="Jenis Gangguan"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="penyebab"
|
||||
caption="Penyebab"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="tindakan"
|
||||
caption="Tindakan"
|
||||
:allow-resizing="false"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
|
||||
<template #formatText="{ data }">
|
||||
<p class="text-left cursor-pointer">
|
||||
@ -483,7 +674,13 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||
import InputText from '@/components/InputText.vue'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import { exportToPDF } from '@/report/Gangguan/Rekap/RGangguan_ALL'
|
||||
import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportDetailToPDF,
|
||||
exportDetailToXLSX
|
||||
} from '@/report/Gangguan/Rekap/RGangguan_ALL'
|
||||
import { getDataRowGroup } from '@/utils/data'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -501,6 +698,9 @@ const loadingData = ref(false)
|
||||
const loadingSubData = ref(false)
|
||||
const agreeToShowDialog = ref(false)
|
||||
const progressSelected = ref(0)
|
||||
const groupIndex = ref(0)
|
||||
const groupDialog = ref(false)
|
||||
const groupData = ref<any>(null)
|
||||
const reportMeta = ref({
|
||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||
@ -508,9 +708,50 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const setAgreementDialog = (column: string) => {
|
||||
console.log('column', column)
|
||||
const onCellClicked = (e: any) => {
|
||||
if (e.rowType == 'group') {
|
||||
groupDialog.value = true
|
||||
groupIndex.value = e.row.groupIndex
|
||||
|
||||
setAgreementDialog(e.column.caption)
|
||||
const data = getDataRowGroup(e.data)
|
||||
console.table(data)
|
||||
groupData.value = data
|
||||
showDetail()
|
||||
// if (e.row.groupIndex == 0) {
|
||||
// //
|
||||
// } else if (e.row.groupIndex == 1) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0].collapsedItems[0].items[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0].items[0].items[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// } else if (e.row.groupIndex == 2) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0].collapsedItems[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0].items[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// } else if (e.row.groupIndex == 3) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// }
|
||||
// showDetail()
|
||||
} else {
|
||||
groupDialog.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const setAgreementDialog = (column: string) => {
|
||||
if (column == 'Total' || column == 'Selesai' || column == 'In Progress') {
|
||||
agreeToShowDialog.value = true
|
||||
if (column == 'Total') {
|
||||
@ -551,13 +792,12 @@ const resetData = () => {
|
||||
dataSubSelected.value = null
|
||||
}
|
||||
|
||||
const filterData = (params: any) => {
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
loadingData.value = true
|
||||
const { posko, uid, up3 } = params
|
||||
const dateValue = params.periode.split(' s/d ')
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.gangguanAll, {
|
||||
const query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
@ -567,23 +807,25 @@ const filterData = (params: any) => {
|
||||
posko: posko ? posko.id : 0,
|
||||
idUid: uid ? uid.id : 0,
|
||||
idUp3: up3 ? up3.id : 0
|
||||
})
|
||||
}
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
data.value = queryResult.data.rekapitulasiAllGangguan
|
||||
}
|
||||
loadingData.value = true
|
||||
await requestGraphQl(queries.gangguan.rekap.gangguanAll, query)
|
||||
.then((result) => {
|
||||
if (result.data.data != null) {
|
||||
data.value = result.data.data.rekapitulasiAllGangguan
|
||||
} else {
|
||||
data.value = []
|
||||
}
|
||||
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingData.value = value
|
||||
})
|
||||
reportMeta.value = filters.value
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
loadingData.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const getDetail = async () => {
|
||||
@ -591,56 +833,99 @@ const getDetail = async () => {
|
||||
const dateValue = filters.value.periode.split(' s/d ')
|
||||
const selected = dataSelected.value
|
||||
|
||||
const query = {
|
||||
var query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
dateTo: dateValue[1]
|
||||
? dateValue[1].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
posko: selected?.id_posko ? selected?.id_posko : 0,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
idRegu: selected?.id_regu ? selected?.id_regu : 0,
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||
namaRegional: selected?.nama_regional ? selected?.nama_regional : '',
|
||||
media: selected?.media ? selected?.media : '',
|
||||
posko: 0,
|
||||
idUid: 0,
|
||||
idUp3: 0,
|
||||
idRegu: 0,
|
||||
idUlp: 0,
|
||||
namaRegional: '',
|
||||
media: '',
|
||||
isSelesai: progressSelected.value,
|
||||
tanggal: ''
|
||||
}
|
||||
if (groupDialog.value) {
|
||||
// if (groupColumnCaption.value != 'Semua Unit') {
|
||||
// if (groupColumnCaption.value == 'Regional') {
|
||||
// query = {
|
||||
// ...query,
|
||||
// namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
// }
|
||||
// } else if (groupColumnCaption.value == 'UID') {
|
||||
// query = {
|
||||
// ...query,
|
||||
// idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
// namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
// }
|
||||
// } else if (groupColumnCaption.value == 'UP3') {
|
||||
// query = {
|
||||
// ...query,
|
||||
// idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
// idUp3: groupData.value?.id_up3 ? groupData.value?.id_up3 : 0,
|
||||
// namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (groupIndex.value == 1) {
|
||||
query = {
|
||||
...query,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
} else if (groupIndex.value == 2) {
|
||||
query = {
|
||||
...query,
|
||||
idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
} else if (groupIndex.value == 3) {
|
||||
query = {
|
||||
...query,
|
||||
idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0,
|
||||
idUp3: groupData.value?.id_up3 ? groupData.value?.id_up3 : 0,
|
||||
namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : ''
|
||||
}
|
||||
}
|
||||
} else {
|
||||
query = {
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
dateTo: dateValue[1]
|
||||
? dateValue[1].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
posko: selected?.id_posko ? selected?.id_posko : 0,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
idRegu: selected?.id_regu ? selected?.id_regu : 0,
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||
namaRegional: selected?.nama_regional ? selected?.nama_regional : '',
|
||||
media: selected?.media ? selected?.media : '',
|
||||
isSelesai: progressSelected.value,
|
||||
tanggal: ''
|
||||
}
|
||||
}
|
||||
console.table(query)
|
||||
|
||||
await requestGraphQl(queries.gangguan.rekap.gangguanAllDetail.loc?.source.body!, query)
|
||||
await requestGraphQl(queries.gangguan.rekap.gangguanAllDetail, query)
|
||||
.then((result) => {
|
||||
dataSub.value = result.data.data.detailGangguan
|
||||
if (result.data.data != null) {
|
||||
dataSub.value = result.data.data.detailGangguan
|
||||
} else {
|
||||
dataSub.value = []
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
console.error(err)
|
||||
})
|
||||
.finally(() => {
|
||||
loadingSubData.value = false
|
||||
})
|
||||
|
||||
// const { onResult, onError, refetch, loading } = useQuery(
|
||||
// queries.gangguan.rekap.gangguanAllDetail,
|
||||
// query,
|
||||
// {
|
||||
// fetchPolicy: 'network-only'
|
||||
// }
|
||||
// )
|
||||
|
||||
// onResult((queryResult) => {
|
||||
// if (queryResult.data != undefined) {
|
||||
// dataSub.value = queryResult.data.detailGangguan
|
||||
// }
|
||||
// })
|
||||
|
||||
// onError((error) => {
|
||||
// console.log(error)
|
||||
// })
|
||||
|
||||
// watch(loading, (value) => {
|
||||
// loadingSubData.value = value
|
||||
// })
|
||||
}
|
||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||
const clearSelection = () => {
|
||||
@ -679,21 +964,18 @@ const handleCellClick = (e: any) => {
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
} else if (e.format === 'xlsx') {
|
||||
exportToXLSX(reportMeta.value, e)
|
||||
} else {
|
||||
const workbook = new Workbook()
|
||||
const worksheet = workbook.addWorksheet('Employees')
|
||||
}
|
||||
}
|
||||
|
||||
exportToExcel({
|
||||
component: e.component,
|
||||
worksheet,
|
||||
autoFilterEnabled: true
|
||||
}).then(() => {
|
||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), 'DataGrid.xlsx')
|
||||
})
|
||||
})
|
||||
|
||||
e.cancel = true
|
||||
const onExportingDetail = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportDetailToPDF(reportMeta.value, dataSub.value)
|
||||
} else if (e.format === 'xlsx') {
|
||||
exportDetailToXLSX(reportMeta.value, e)
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user