Refactor DatePicker.vue to remove console.log statement
Refactor RGangguan_BerdasarMedia.vue to fix css-class typo Refactor RKeluhan_BerdasarMedia.vue to update display-format and css-class Refactor RGangguan_KTI.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor RGangguan_CTTM.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor Type11.vue to update placeholder and values in InputWithSuffix Refactor RKeluhan_PerUnit.vue to update calculateCustomSummary function
This commit is contained in:
@ -43,6 +43,7 @@
|
||||
data-field="nama_ulp"
|
||||
caption="Nama Unit"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
|
||||
<DxColumn
|
||||
@ -885,7 +886,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -894,16 +899,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -928,7 +928,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -953,7 +957,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1047,7 +1055,13 @@ const filterData = async (params: any) => {
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Semua Unit' || item.caption == 'Regional') {
|
||||
if (item.caption == 'Semua Unit') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
@ -72,9 +72,8 @@
|
||||
|
||||
<DxSummary>
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Call PLN 123"
|
||||
show-in-column="no"
|
||||
display-format="Total"
|
||||
show-in-column="media"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
|
@ -267,6 +267,191 @@
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
show-in-column="No"
|
||||
css-class="!text-left"
|
||||
:customize-text="(e: any) => ''"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
display-format="Total"
|
||||
show-in-column="Fungsi Bidang"
|
||||
css-class="!text-left"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="total"
|
||||
column="total"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="total_selesai"
|
||||
column="total_selesai"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="persen_selesai"
|
||||
column="persen_selesai"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="total_inproses"
|
||||
column="total_inproses"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="persen_inproses"
|
||||
column="persen_inproses"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="total_durasi_response"
|
||||
column="total_durasi_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="count_durasi_response"
|
||||
column="count_durasi_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="avg_durasi_response"
|
||||
column="avg_durasi_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
column="min_durasi_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => (parseInt(e.value) ? formatWaktu(e.value) : '-')"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
column="max_durasi_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => (parseInt(e.value) ? formatWaktu(e.value) : '-')"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
column="total_diatas_sla_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
column="total_dibawah_sla_response"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="total_durasi_recovery"
|
||||
column="total_durasi_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="count_durasi_recovery"
|
||||
column="count_durasi_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
name="avg_durasi_recovery"
|
||||
column="avg_durasi_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="min"
|
||||
display-format="{0}"
|
||||
column="min_durasi_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => (parseInt(e.value) ? formatWaktu(e.value) : '-')"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="max"
|
||||
display-format="{0}"
|
||||
column="max_durasi_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => (parseInt(e.value) ? formatWaktu(e.value) : '-')"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
column="total_diatas_sla_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="true"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
column="total_dibawah_sla_recovery"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
display-format="Total"
|
||||
show-in-column="Fungsi Bidang"
|
||||
@ -826,7 +1011,8 @@ import {
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
DxSelection,
|
||||
DxGrouping
|
||||
DxGrouping,
|
||||
DxGroupItem
|
||||
} from 'devextreme-vue/data-grid'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||
@ -911,7 +1097,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -920,16 +1110,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -954,7 +1139,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -979,7 +1168,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1073,27 +1266,48 @@ const filterData = async (params: any) => {
|
||||
}
|
||||
|
||||
loadingData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBIidang, query)
|
||||
await requestGraphQl(
|
||||
isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBidangUID
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBidangUP3
|
||||
: queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBidangULP
|
||||
: queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBIidang,
|
||||
query
|
||||
)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
if (grouping.value.length > 0 && grouping.value[0].data != '') {
|
||||
data.value = [...result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidang].sort(
|
||||
(a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data])
|
||||
)
|
||||
data.value = [
|
||||
...(isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUp3
|
||||
: result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUlp
|
||||
: result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidang)
|
||||
].sort((a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data]))
|
||||
} else {
|
||||
data.value = result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidang
|
||||
}
|
||||
|
||||
reportMeta.value = {
|
||||
uid: uid ? uid : { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
up3: up3 ? up3 : { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||
ulp: ulp ? ulp : { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||
periode: params.periode,
|
||||
groupBy: params.groupBy
|
||||
data.value = isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUp3
|
||||
: result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidangUlp
|
||||
: result.data.data.rekapitulasiKeluhanPenyelesaianPerFungsiBidang
|
||||
}
|
||||
} else {
|
||||
data.value = []
|
||||
}
|
||||
|
||||
reportMeta.value = {
|
||||
uid: uid ? uid : { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||
up3: up3 ? up3 : { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||
ulp: ulp ? ulp : { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||
periode: params.periode,
|
||||
groupBy: params.groupBy
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
|
@ -1063,7 +1063,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -1072,16 +1076,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -1106,7 +1105,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -1131,7 +1134,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -907,7 +907,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -916,16 +920,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -950,7 +949,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -975,7 +978,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1070,23 +1077,35 @@ const filterData = async (params: any) => {
|
||||
|
||||
loadingData.value = true
|
||||
await requestGraphQl(
|
||||
params.groupBy
|
||||
? queries.keluhan.rekap.keluhanPerKelompokKeluhanUID
|
||||
isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? queries.keluhan.rekap.keluhanPerKelompokKeluhanUID
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? queries.keluhan.rekap.keluhanPerKelompokKeluhanUP3
|
||||
: queries.keluhan.rekap.keluhanPerKelompokKeluhanULP
|
||||
: queries.keluhan.rekap.keluhanPerKelompokKeluhan,
|
||||
query
|
||||
)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
const ref = isGroupBy.value
|
||||
? [...result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUid]
|
||||
: [...result.data.data.rekapitulasiKeluhanPerKelompokKeluhan]
|
||||
|
||||
if (grouping.value.length > 0 && grouping.value[0].data != '') {
|
||||
data.value = ref.sort((a, b) =>
|
||||
a[grouping.value[0].data].localeCompare(b[grouping.value[0].data])
|
||||
)
|
||||
data.value = [
|
||||
...(isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerKelompokKeluhan)
|
||||
].sort((a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data]))
|
||||
} else {
|
||||
data.value = ref
|
||||
data.value = isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerKelompokKeluhanUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerKelompokKeluhan
|
||||
}
|
||||
} else {
|
||||
data.value = []
|
||||
|
@ -912,7 +912,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,16 +925,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -955,7 +954,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -980,7 +983,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1074,17 +1081,36 @@ const filterData = async (params: any) => {
|
||||
}
|
||||
|
||||
loadingData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.keluhanPerTanggal, query)
|
||||
await requestGraphQl(
|
||||
isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? queries.keluhan.rekap.keluhanPerTanggalUID
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? queries.keluhan.rekap.keluhanPerTanggalUP3
|
||||
: queries.keluhan.rekap.keluhanPerTanggalULP
|
||||
: queries.keluhan.rekap.keluhanPerTanggal,
|
||||
query
|
||||
)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
if (grouping.value.length > 0 && grouping.value[0].data != '') {
|
||||
console.log([...result.data.data.rekapitulasiKeluhanPerTanggal])
|
||||
|
||||
data.value = [...result.data.data.rekapitulasiKeluhanPerTanggal].sort((a, b) =>
|
||||
a[grouping.value[0].data].localeCompare(b[grouping.value[0].data])
|
||||
)
|
||||
data.value = [
|
||||
...(isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggalUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggal)
|
||||
].sort((a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data]))
|
||||
} else {
|
||||
data.value = result.data.data.rekapitulasiKeluhanPerTanggal
|
||||
data.value = isGroupBy.value
|
||||
? grouping.value[0].data == 'nama_uid'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUid
|
||||
: grouping.value[0].data == 'nama_up3'
|
||||
? result.data.data.rekapitulasiKeluhanPerTanggalUp3
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggalUlp
|
||||
: result.data.data.rekapitulasiKeluhanPerTanggal
|
||||
}
|
||||
} else {
|
||||
data.value = []
|
||||
|
@ -1055,7 +1055,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_selesai / total)
|
||||
? 0
|
||||
: total_selesai == 0
|
||||
? 0
|
||||
: (total_selesai / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -1064,16 +1068,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total = 0
|
||||
total_inproses = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_selesai') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total = 0
|
||||
total_selesai = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = (total_selesai / total) * 100
|
||||
options.totalValue = isFinite(total_inproses / total)
|
||||
? 0
|
||||
: total_inproses == 0
|
||||
? 0
|
||||
: (total_inproses / total) * 100
|
||||
}
|
||||
}
|
||||
|
||||
@ -1098,7 +1097,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
total_durasi_response = 0
|
||||
count_durasi_response = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response / total_durasi_response
|
||||
options.totalValue = isFinite(count_durasi_response / total_durasi_response)
|
||||
? 0
|
||||
: count_durasi_response == 0
|
||||
? 0
|
||||
: count_durasi_response / total_durasi_response
|
||||
}
|
||||
}
|
||||
|
||||
@ -1123,7 +1126,11 @@ const calculateCustomSummary = (options: any) => {
|
||||
count_durasi_recovery = 0
|
||||
total_durasi_recovery = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery / total_durasi_recovery
|
||||
options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery)
|
||||
? 0
|
||||
: count_durasi_recovery == 0
|
||||
? 0
|
||||
: count_durasi_recovery / total_durasi_recovery
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user