From 13dce362c5321d7b76184b9e9d91a8c9b13c9047 Mon Sep 17 00:00:00 2001 From: kur0nek-o Date: Thu, 18 Apr 2024 10:22:43 +0700 Subject: [PATCH 1/3] fix: anomali keluhan --- .../Pages/Anomali/Keluhan/Anomali_LAPPKU.vue | 57 +++- .../Anomali/Keluhan/Anomali_LAPPKU_LPT.vue | 277 +++++++++++++++--- 2 files changed, 285 insertions(+), 49 deletions(-) diff --git a/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU.vue b/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU.vue index 20bbb4c..9957d49 100755 --- a/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU.vue +++ b/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU.vue @@ -18,7 +18,7 @@ /> - + @@ -43,6 +43,21 @@ const filters = ref({ up3: 0 }) +const grouping = ref([ + { + data: '', + caption: 'Semua Unit' + }, + { + data: 'nama_uid', + caption: 'UID' + }, + { + data: 'nama_up3', + caption: 'UP3' + } +]) + const resetData = () => { data.value = [] dataSecond.value = [] @@ -53,6 +68,46 @@ const filterData = async (params: any) => { const { ulp, uid, up3, jenisLaporan } = params console.table('LAPPGU', jenisLaporan) + var groupList: any[] = [ + { + data: '', + caption: 'Semua Unit' + }, + { + data: 'nama_uid', + caption: 'UID' + }, + { + data: 'nama_up3', + caption: 'UP3' + } + ] + + if (uid?.id != 0) { + groupList.forEach((item, index) => { + if (item.caption == 'Semua Unit') { + groupList.splice(index, 1) + } + }) + + if (up3?.id != 0) { + groupList.forEach((item, index) => { + if (item.caption == 'UID') { + groupList.splice(index, 1) + } + }) + + if (ulp?.id != 0) { + groupList.forEach((item, index) => { + if (item.caption == 'UP3') { + groupList.splice(index, 1) + } + }) + } + } + } + grouping.value = groupList + const dateValue = params.periode.split(' s/d ') const query = { dateFrom: dateValue[0] diff --git a/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU_LPT.vue b/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU_LPT.vue index 689b122..2f99d18 100755 --- a/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU_LPT.vue +++ b/src/components/Pages/Anomali/Keluhan/Anomali_LAPPKU_LPT.vue @@ -3,6 +3,7 @@

Laporan Pengaduan Total

- + @@ -42,35 +43,15 @@ cell-template="formatText" /> - - @@ -275,12 +256,13 @@

- + @@ -288,7 +270,8 @@ :show-in-group-footer="false" :align-by-column="true" column="wo_pln_mobile" - summary-type="sum" + name="wo_pln_mobile" + summary-type="custom" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" /> @@ -296,7 +279,8 @@ :show-in-group-footer="false" :align-by-column="true" column="wo_loket" - summary-type="sum" + name="wo_loket" + summary-type="custom" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" /> @@ -304,7 +288,8 @@ :show-in-group-footer="false" :align-by-column="true" column="wo_lainnya" - summary-type="sum" + name="wo_lainnya" + summary-type="custom" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" /> @@ -312,7 +297,8 @@ :show-in-group-footer="false" :align-by-column="true" column="wo_total" - summary-type="sum" + name="wo_total" + summary-type="custom" css-class="!text-right" :customize-text="(e: any) => formatNumber(e.value)" /> @@ -320,24 +306,27 @@ :show-in-group-footer="false" :align-by-column="true" column="anomali_pln_mobile" - summary-type="sum" - css-class="!text-right" + summary-type="custom" + name="anomali_pln_mobile" + css-class="!text-right cursor-pointer" :customize-text="(e: any) => formatNumber(e.value)" /> @@ -345,24 +334,27 @@ :show-in-group-footer="false" :align-by-column="true" column="persen_anomali_pln_mobile" - summary-type="avg" + summary-type="custom" css-class="!text-right" + name="persen_anomali_pln_mobile" :customize-text="(e: any) => formatPercentage(e.value)" /> @@ -730,7 +722,7 @@ - +