From eeb4a3be40a65afb1e4cf00cb5f06cbf6861d551 Mon Sep 17 00:00:00 2001 From: Dede Fuji Abdul Date: Sat, 30 Mar 2024 21:08:41 +0700 Subject: [PATCH] Remove console.log statement in DGangguan_MLD1K.vue --- .../Pages/Gangguan/Daftar/DGangguan_MLD1K.vue | 2 - .../Pages/Keluhan/Daftar/DKeluhan_PLD1K.vue | 241 +++++++++++++++--- 2 files changed, 201 insertions(+), 42 deletions(-) diff --git a/src/components/Pages/Gangguan/Daftar/DGangguan_MLD1K.vue b/src/components/Pages/Gangguan/Daftar/DGangguan_MLD1K.vue index 97cec24..88b6b4e 100755 --- a/src/components/Pages/Gangguan/Daftar/DGangguan_MLD1K.vue +++ b/src/components/Pages/Gangguan/Daftar/DGangguan_MLD1K.vue @@ -474,8 +474,6 @@ const reportMeta = ref({ }) const setDetailType = (columnCaption: string) => { - console.log('Column Caption', columnCaption) - if (columnCaption == 'Jml Lapor') { detailType.value = 'table' } else { diff --git a/src/components/Pages/Keluhan/Daftar/DKeluhan_PLD1K.vue b/src/components/Pages/Keluhan/Daftar/DKeluhan_PLD1K.vue index ad4c068..55094e3 100755 --- a/src/components/Pages/Keluhan/Daftar/DKeluhan_PLD1K.vue +++ b/src/components/Pages/Keluhan/Daftar/DKeluhan_PLD1K.vue @@ -14,7 +14,7 @@ :show-borders="true" :row-alternation-enabled="true" :hover-state-enabled="true" - @selection-changed="onSelectionChanged" + @selection-changed="onDataSelectionChanged" :column-width="100" @exporting="onExporting" :allow-column-resizing="true" @@ -37,8 +37,7 @@ :show-indicator="showIndicator" :show-pane="showPane" :shading="shading" - v-if="loading" - v-model:visible="loading" + v-model:visible="loadingData" :enabled="true" /> @@ -178,40 +177,33 @@ cell-template="formatText" /> - - - -
+ +

No Laporan:

@@ -313,6 +305,130 @@
+ +
+
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+

No Laporan:

+ +
+ +
+

Create Date:

+ +
+ +
+

User:

+ +
+ +
+

Keterangan:

+ +
+
+
@@ -347,11 +463,58 @@ const position = { of: '#data' } const showIndicator = ref(true) const shading = ref(true) const showPane = ref(true) +const data = ref([]) +const dataSub = ref([]) const dataSelected = ref() +const dataSubSelected = ref() const dialogDetail = ref(false) +const closedialogDetail = () => (dialogDetail.value = false) +const loadingData = ref(false) +const loadingSubData = ref(false) +const detailType = ref('form') // form, table -const closeDialog = () => { - dialogDetail.value = false +const filters = ref() +const reportMeta = ref({ + uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' }, + up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' }, + ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' }, + minJmlLapor: 1, + maxJmlLapor: 1, + periode: '' +}) + +const setDetailType = (columnCaption: string) => { + if (columnCaption == 'Jml Lapor') { + detailType.value = 'table' + } else { + detailType.value = 'form' + } +} + +const getDetail = async () => { + const dateValue = filters.value.periode.split(' s/d ') + const selected = dataSelected.value + + const query = { + noLaporan: selected?.no_laporan ? selected?.no_laporan : '' + } + loadingSubData.value = false + await requestGraphQl(queries.keluhan.daftar.keluhanMelaporLebihDariSatuKaliDetail, query) + .then((result) => { + if (result.data.data != undefined) { + dataSub.value = result.data.data.detailKeluhanLaporLebihDariSatuKali + } else { + dataSub.value = [] + } + + reportMeta.value = filters.value + }) + .catch((err) => { + console.error(err) + }) + .finally(() => { + loadingSubData.value = false + }) } const dataGridRef = ref(null) @@ -361,16 +524,27 @@ const clearSelection = () => { } const showDetail = () => { clearSelection() + dataSubSelected.value = null dialogDetail.value = true + if (detailType.value == 'table') { + getDetail() + } } -const onSelectionChanged = ({ selectedRowsData }: any) => { +const onDataSelectionChanged = ({ selectedRowsData }: any) => { if (selectedRowsData[0] != undefined) { dataSelected.value = selectedRowsData[0] + showDetail() } - showDetail() } +const onDataSubSelectionChanged = ({ selectedRowsData }: any) => { + const data = selectedRowsData[0] + dataSubSelected.value = data +} + +const closeDialog = () => (dialogDetail.value = false) + const onExporting = (e: any) => { const periode = reportMeta.value.periode ? reportMeta.value.periode.split(' s/d ') : '' @@ -565,9 +739,6 @@ const onExporting = (e: any) => { } } -const data = ref([]) -const loading = ref(false) - const filterData = async (params: any) => { const dateValue = params.periode.split(' s/d ') const { ulp, uid, up3 } = params @@ -588,7 +759,7 @@ const filterData = async (params: any) => { idUp3: up3 ? up3.id : 0 } - loading.value = true + loadingData.value = true await requestGraphQl(queries.keluhan.daftar.keluhanMelaporLebihDariSatuKali, query) .then((result) => { if (result.data.data != undefined) { @@ -603,20 +774,10 @@ const filterData = async (params: any) => { console.error(err) }) .finally(() => { - loading.value = false + loadingData.value = false }) } -const filters = ref() -const reportMeta = ref({ - uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' }, - up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' }, - ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' }, - minJmlLapor: 1, - maxJmlLapor: 1, - periode: '' -}) - onMounted(() => { if (import.meta.env.DEV) { data.value = [