Refactor RKeluhan_PerFungsiBidang.vue to update getDetail function and remove unused variables
This commit is contained in:
parent
98d5ac53fa
commit
2070c2a6b4
@ -11,7 +11,7 @@
|
||||
|
||||
<div>
|
||||
<DxDataGrid
|
||||
@cell-click=""
|
||||
@cell-click="onCellClicked"
|
||||
ref="dataGridRef"
|
||||
:allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)] mb-10"
|
||||
@ -27,7 +27,7 @@
|
||||
column-resizing-mode="widget"
|
||||
>
|
||||
<DxPaging :enabled="false" />
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="rowClick" />
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="" />
|
||||
<DxSelection mode="single" />
|
||||
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
@ -66,7 +66,7 @@
|
||||
data-type="number"
|
||||
caption="Total"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberTotal"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
@ -75,7 +75,7 @@
|
||||
data-type="number"
|
||||
caption="Selesai"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberSelesai"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
@ -93,7 +93,7 @@
|
||||
data-type="number"
|
||||
caption="InProgress"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberProgress"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
@ -412,13 +412,49 @@
|
||||
</DxSummary>
|
||||
|
||||
<template #formatTime="{ data }">
|
||||
<p class="cursor-pointer !text-right">
|
||||
<p class="!text-right">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumber="{ data }">
|
||||
<p class="text-right cursor-pointer">
|
||||
<p class="text-right">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberTotal="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberSelesai="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberProgress="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
@ -430,7 +466,7 @@
|
||||
</template>
|
||||
|
||||
<template #formatText="{ data }">
|
||||
<p class="cursor-pointer !text-left">
|
||||
<p class="!text-left">
|
||||
{{ data.text }}
|
||||
</p>
|
||||
</template>
|
||||
@ -804,6 +840,7 @@ import {
|
||||
exportDetailToDOCX
|
||||
} from '@/report/Keluhan/Rekap/RKeluhan_ALL'
|
||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||
import { getDataRowGroup } from '@/utils/helper'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -968,40 +1005,43 @@ const calculateCustomSummary = (options: any) => {
|
||||
|
||||
const onCellClicked = (e: any) => {
|
||||
console.log('cell clicked', e)
|
||||
// console.log('group cell clicked', e.column.caption)
|
||||
// console.log('value', e.values[e.row.groupIndex])
|
||||
if (e.rowType == 'group') {
|
||||
groupDialog.value = true
|
||||
groupIndex.value = e.row.groupIndex
|
||||
|
||||
setAgreementDialog(e.column.caption)
|
||||
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]
|
||||
const data = getDataRowGroup(e.data)
|
||||
console.table(data)
|
||||
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()
|
||||
// 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
|
||||
}
|
||||
|
@ -1331,19 +1331,15 @@ const getDetail = async () => {
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
namaRegional: selected?.nama_regional ? selected?.nama_regional : '',
|
||||
isSelesai: progressSelected.value,
|
||||
media: '',
|
||||
tanggal: '',
|
||||
namaIssuetype: '',
|
||||
namaSubissuetype: ''
|
||||
namaFungsiBidang: selected?.fungsi_bidang ? selected?.fungsi_bidang : ''
|
||||
}
|
||||
|
||||
loadingSubData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.rekapKeluhanAllDetail, query)
|
||||
await requestGraphQl(queries.keluhan.rekap.keluhanPenyelesaianPerFungsiBidangDetail, query)
|
||||
.then((result) => {
|
||||
if (result.data.data != undefined) {
|
||||
dataSub.value = result.data.data.detailKeluhanAll
|
||||
dataSub.value = result.data.data.detailRekapitulasiKeluhanPerBidang
|
||||
} else {
|
||||
dataSub.value = []
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ 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),
|
||||
@ -1139,7 +1139,7 @@ const getDetail = async () => {
|
||||
? dateValue[1].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
idUlp: 0,
|
||||
idUid: isGroupBy.value ? (selected?.id_uid ? selected?.id_uid : 0) : 0,
|
||||
idUid: 0,
|
||||
idUp3: 0,
|
||||
namaRegional: '',
|
||||
isSelesai: progressSelected.value,
|
||||
@ -1149,6 +1149,31 @@ const getDetail = async () => {
|
||||
namaSubissuetype: ''
|
||||
}
|
||||
|
||||
if (isGroupBy.value) {
|
||||
if (grouping.value[0].data == 'nama_uid') {
|
||||
query = {
|
||||
...query,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: 0,
|
||||
idUlp: 0
|
||||
}
|
||||
} else if (grouping.value[0].data == 'nama_up3') {
|
||||
query = {
|
||||
...query,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
idUlp: 0
|
||||
}
|
||||
} else {
|
||||
query = {
|
||||
...query,
|
||||
idUid: selected?.id_uid ? selected?.id_uid : 0,
|
||||
idUp3: selected?.id_up3 ? selected?.id_up3 : 0,
|
||||
idUlp: selected?.id_ulp ? selected?.id_ulp : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadingSubData.value = true
|
||||
await requestGraphQl(queries.keluhan.rekap.rekapKeluhanAllDetail, query)
|
||||
.then((result) => {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,36 +39,15 @@
|
||||
/>
|
||||
<DxColumnFixing :enabled="true" />
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UIW"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -155,112 +134,115 @@
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Total"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
@ -270,7 +252,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -278,7 +260,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -292,7 +273,11 @@ import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||
import { exportToPDF, exportToXLSX,exportToDOCX } from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan'
|
||||
import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_ENSGangguan'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -330,6 +315,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
@ -344,6 +402,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -46,36 +46,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UIW"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Tahun" css-class="custom-table-column">
|
||||
<DxColumn
|
||||
@ -179,7 +158,7 @@
|
||||
show-in-column="total"
|
||||
column="total"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
</DxDataGrid>
|
||||
@ -569,6 +548,21 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogDetail.value = false
|
||||
}
|
||||
@ -585,6 +579,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -47,37 +47,17 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
caption="NASIONAL"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="0"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="0"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
data-field="nama_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="1"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
data-field="nama_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="2"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -230,12 +210,13 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_bulan_ini"
|
||||
name="total_durasi_response_time_bulan_ini"
|
||||
column="total_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -243,8 +224,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_bulan_ini"
|
||||
name="count_durasi_response_time_bulan_ini"
|
||||
column="count_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -252,8 +234,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_bulan_ini"
|
||||
name="avg_durasi_response_time_bulan_ini"
|
||||
column="avg_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -261,8 +244,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_bulan_ini"
|
||||
name="total_durasi_recovery_time_bulan_ini"
|
||||
column="total_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -270,8 +254,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_bulan_ini"
|
||||
name="count_durasi_recovery_time_bulan_ini"
|
||||
column="count_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -279,8 +264,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_bulan_ini"
|
||||
name="avg_durasi_recovery_time_bulan_ini"
|
||||
column="avg_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -288,8 +274,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_tahun_ini"
|
||||
name="total_durasi_response_time_tahun_ini"
|
||||
column="total_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -297,8 +284,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_tahun_ini"
|
||||
name="count_durasi_response_time_tahun_ini"
|
||||
column="count_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -306,8 +294,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_tahun_ini"
|
||||
name="avg_durasi_response_time_tahun_ini"
|
||||
column="avg_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -315,8 +304,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_tahun_ini"
|
||||
name="total_durasi_recovery_time_tahun_ini"
|
||||
column="total_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -324,8 +314,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_tahun_ini"
|
||||
name="count_durasi_recovery_time_tahun_ini"
|
||||
column="count_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -333,8 +324,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_tahun_ini"
|
||||
name="avg_durasi_recovery_time_tahun_ini"
|
||||
column="avg_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -366,7 +358,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -374,7 +366,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -391,7 +382,6 @@ import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_JumlahDDRPTRCTGangguan'
|
||||
|
||||
const client = apolloClient()
|
||||
@ -422,6 +412,139 @@ const reportMeta = ref({
|
||||
currentYear: currentYear.value
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let total_durasi_response_time_bulan_ini = 0
|
||||
let count_durasi_response_time_bulan_ini = 0
|
||||
let total_durasi_recovery_time_bulan_ini = 0
|
||||
let count_durasi_recovery_time_bulan_ini = 0
|
||||
let total_durasi_response_time_tahun_ini = 0
|
||||
let count_durasi_response_time_tahun_ini = 0
|
||||
let total_durasi_recovery_time_tahun_ini = 0
|
||||
let count_durasi_recovery_time_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'total_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_bulan_ini = 0
|
||||
count_durasi_response_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_bulan_ini / count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_bulan_ini = 0
|
||||
count_durasi_recovery_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_bulan_ini / count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_tahun_ini = 0
|
||||
count_durasi_response_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_tahun_ini / count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_tahun_ini = 0
|
||||
count_durasi_recovery_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_tahun_ini / count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
@ -430,6 +553,59 @@ const resetData = () => {
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (regional?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'NASIONAL') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -50,31 +50,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="2"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<!-- <DxColumn
|
||||
alignment="center"
|
||||
@ -146,11 +130,12 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -158,7 +143,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -166,7 +152,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -174,7 +161,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -182,7 +170,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -190,7 +179,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -204,42 +194,48 @@
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -271,7 +267,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import { getMonthName } from '@/utils/texts'
|
||||
import {
|
||||
@ -280,7 +276,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -297,7 +292,6 @@ import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_JumlahKaliGangguan'
|
||||
|
||||
const client = apolloClient()
|
||||
@ -329,6 +323,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -360,6 +427,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUid: uid ? uid.id : 0,
|
||||
|
@ -1,53 +1,120 @@
|
||||
<template>
|
||||
<Filters @run-report="() => exportToPDF(reportMeta, data, true)" @reset-form="data = []"
|
||||
@run-search="() => filterData(filters)" :report-button="true" class="mb-4">
|
||||
<Filters
|
||||
@run-report="() => exportToPDF(reportMeta, data, true)"
|
||||
@reset-form="data = []"
|
||||
@run-search="() => filterData(filters)"
|
||||
:report-button="true"
|
||||
class="mb-4"
|
||||
>
|
||||
<Type2 @update:filters="(value) => (filters = value)" />
|
||||
</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" @selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget" :word-wrap-enabled="true">
|
||||
<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"
|
||||
@selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting"
|
||||
:allow-column-resizing="true"
|
||||
column-resizing-mode="widget"
|
||||
:word-wrap-enabled="true"
|
||||
>
|
||||
<DxGrouping :context-menu-enabled="true" expand-mode="rowClick" :auto-expand-all="false" />
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :enabled="false" />
|
||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
<DxExport
|
||||
:enabled="true"
|
||||
:formats="['pdf', 'xlsx', 'document']"
|
||||
:allow-export-selected-data="false"
|
||||
/>
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn alignment="center" data-field="nama_ulp" caption="Nama Unit" css-class="custom-table-column"
|
||||
cell-template="formatText" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="nama_regional" caption="Regional"
|
||||
css-class="custom-table-column" :group-index="0" name="namaRegional" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="id_uid" caption="UIW"
|
||||
css-class="custom-table-column" :group-index="1" name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="id_up3" caption="UP3"
|
||||
css-class="custom-table-column" :group-index="1" name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3" />
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
data-field="nama_ulp"
|
||||
caption="Nama Unit"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Lapor Ulang Gangguan" css-class="custom-table-column">
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
<DxColumn :width="150" alignment="center" data-field="mom_bulan_kemarin" data-type="number"
|
||||
:caption="`${getMonthName(lastMonth)} ${lastYearMoM}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="mom_bulan_ini" data-type="number"
|
||||
:caption="`${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="70" alignment="center" data-field="persen_mom" data-type="number" caption="%"
|
||||
css-class="custom-table-column" cell-template="formatNumber" />
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
data-field="persen_mom"
|
||||
data-type="number"
|
||||
caption="%"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
<DxColumn alignment="center" caption="YoY" css-class="custom-table-column">
|
||||
<DxColumn :width="150" alignment="center" data-field="yoy_tahun_kemarin" data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="yoy_tahun_ini" data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="70" alignment="center" data-field="persen_yoy" data-type="number" caption="%"
|
||||
css-class="custom-table-column" cell-template="formatNumber" />
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
data-field="persen_yoy"
|
||||
data-type="number"
|
||||
caption="%"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
@ -69,41 +136,115 @@
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<DxSummary>
|
||||
<DxTotalItem summary-type="sum" display-format="Total" show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left" />
|
||||
<DxTotalItem column="mom_bulan_kemarin" summary-type="sum" display-format="{0}"
|
||||
css-class="text-white !text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="mom_bulan_ini" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="persen_mom" summary-type="avg" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxTotalItem column="yoy_tahun_kemarin" summary-type="sum" display-format="{0}"
|
||||
css-class="text-white !text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem column="yoy_tahun_ini" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="persen_yoy" summary-type="avg" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum" display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin" column="mom_bulan_kemarin" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="mom_bulan_ini" column="mom_bulan_ini" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="persen_mom" column="persen_mom" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="yoy_tahun_kemarin" column="yoy_tahun_kemarin" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="yoy_tahun_ini" column="yoy_tahun_ini" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="persen_yoy" column="persen_yoy" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxTotalItem
|
||||
display-format="Total"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
</DxDataGrid>
|
||||
</div>
|
||||
@ -113,7 +254,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -121,7 +262,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -135,7 +275,11 @@ import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_LaporUlang'
|
||||
import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_LaporUlang'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@ -173,6 +317,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
@ -187,6 +404,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -40,36 +40,15 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UIW"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -95,6 +74,29 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -104,6 +106,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -124,6 +148,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -133,6 +179,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -145,51 +213,120 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Total"
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -198,9 +335,10 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -208,8 +346,31 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -217,8 +378,29 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -226,8 +408,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -235,8 +418,29 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -244,8 +448,29 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -278,7 +503,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -286,7 +511,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -304,7 +528,6 @@ import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_RecoveryTimeGangguan'
|
||||
|
||||
const client = apolloClient()
|
||||
@ -343,6 +566,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
@ -357,6 +740,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUid: uid ? uid.id : 0,
|
||||
|
@ -1,90 +1,480 @@
|
||||
<template>
|
||||
<Filters @run-report="() => exportToPDF(reportMeta, data, true)" @reset-form="data = []" :report-button="true"
|
||||
@run-search="() => filterData(filters)" class="mb-4">
|
||||
<Filters
|
||||
@run-report="() => exportToPDF(reportMeta, data, true)"
|
||||
@reset-form="data = []"
|
||||
:report-button="true"
|
||||
@run-search="() => filterData(filters)"
|
||||
class="mb-4"
|
||||
>
|
||||
<Type2 @update:filters="(value) => (filters = value)" />
|
||||
</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" @selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting" :allow-column-resizing="true" column-resizing-mode="widget" :word-wrap-enabled="true">
|
||||
<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"
|
||||
@selection-changed="onDataSelectionChanged"
|
||||
@exporting="onExporting"
|
||||
:allow-column-resizing="true"
|
||||
column-resizing-mode="widget"
|
||||
:word-wrap-enabled="true"
|
||||
>
|
||||
<DxGrouping expand-mode="rowClick" :auto-expand-all="false" />
|
||||
<DxSelection mode="single" />
|
||||
<DxPaging :enabled="false" />
|
||||
<DxScrolling column-rendering-mode="virtual" mode="virtual" />
|
||||
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
<DxExport :enabled="true" :formats="['pdf', 'xlsx', 'document']" :allow-export-selected-data="false" />
|
||||
<DxExport
|
||||
:enabled="true"
|
||||
:formats="['pdf', 'xlsx', 'document']"
|
||||
:allow-export-selected-data="false"
|
||||
/>
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="nama_regional" caption="Regional"
|
||||
css-class="custom-table-column" :group-index="0" name="namaRegional" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="id_uid" caption="UIW"
|
||||
css-class="custom-table-column" :group-index="1" name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="id_up3" caption="UP3"
|
||||
css-class="custom-table-column" :group-index="1" name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3" />
|
||||
<DxColumn alignment="center" :min-width="170" data-type="text" data-field="nama_ulp" caption="Nama Unit"
|
||||
css-class="custom-table-column" cell-template="formatText" />
|
||||
<DxColumn alignment="center" caption="Jumlah RPT Kali Gangguan" css-class="custom-table-column">
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_ulp"
|
||||
caption="Nama Unit"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
caption="Jumlah RPT Kali Gangguan"
|
||||
css-class="custom-table-column"
|
||||
>
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
<DxColumn :width="150" alignment="center" data-field="mom_bulan_kemarin" data-type="number"
|
||||
:caption="`${getMonthName(lastMonth)} ${lastYearMoM}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="mom_bulan_ini" data-type="number"
|
||||
:caption="`${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="70" alignment="center" data-field="persen_mom" data-type="number" caption="%"
|
||||
css-class="custom-table-column" cell-template="formatNumber" />
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
data-field="persen_mom"
|
||||
data-type="number"
|
||||
caption="%"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
<DxColumn alignment="center" caption="YoY" css-class="custom-table-column">
|
||||
<DxColumn :width="150" alignment="center" data-field="yoy_tahun_kemarin" data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="150" alignment="center" data-field="yoy_tahun_ini" data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`" css-class="custom-table-column"
|
||||
cell-template="formatNumber" />
|
||||
<DxColumn :width="70" alignment="center" data-field="persen_yoy" data-type="number" caption="%"
|
||||
css-class="custom-table-column" cell-template="formatNumber" />
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`s.d ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
data-field="persen_yoy"
|
||||
data-type="number"
|
||||
caption="%"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxTotalItem summary-type="sum" display-format="Total" show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left" />
|
||||
<DxTotalItem column="mom_bulan_kemarin" summary-type="sum" display-format="{0}"
|
||||
css-class="text-white !text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="mom_bulan_ini" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="persen_mom" summary-type="avg" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxTotalItem column="yoy_tahun_kemarin" summary-type="sum" display-format="{0}"
|
||||
css-class="text-white !text-right" :customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="yoy_tahun_ini" summary-type="sum" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxTotalItem column="persen_yoy" summary-type="avg" display-format="{0}" css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum" display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin" column="mom_bulan_kemarin" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="mom_bulan_ini" column="mom_bulan_ini" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="persen_mom" column="persen_mom" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="yoy_tahun_kemarin" column="yoy_tahun_kemarin" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="yoy_tahun_ini" column="yoy_tahun_ini" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)" />
|
||||
<DxGroupItem :show-in-group-footer="false" :align-by-column="true" summary-type="sum"
|
||||
show-in-column="persen_yoy" column="persen_yoy" css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)" />
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
|
||||
<template #formatNumber="{ data }">
|
||||
@ -113,7 +503,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -121,7 +511,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -139,7 +528,6 @@ import {
|
||||
exportToPDF,
|
||||
exportToXLSX,
|
||||
exportToDOCX
|
||||
|
||||
} from '@/report/Monalisa/Gangguan/Rekap/MonalisaGR_ResponseTimeGangguan'
|
||||
|
||||
const client = apolloClient()
|
||||
@ -178,6 +566,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const resetData = () => {
|
||||
data.value = []
|
||||
dataSub.value = []
|
||||
@ -192,6 +740,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUid: uid ? uid.id : 0,
|
||||
@ -240,7 +828,6 @@ const onExporting = (e: any) => {
|
||||
exportToXLSX(reportMeta.value, e)
|
||||
} else {
|
||||
exportToDOCX(reportMeta.value, data.value)
|
||||
|
||||
}
|
||||
}
|
||||
const getDetail = async () => {
|
||||
|
@ -49,44 +49,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
caption="NASIONAL"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="0"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -239,12 +210,13 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_bulan_ini"
|
||||
name="total_durasi_response_time_bulan_ini"
|
||||
column="total_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -252,8 +224,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_bulan_ini"
|
||||
name="count_durasi_response_time_bulan_ini"
|
||||
column="count_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -261,8 +234,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_bulan_ini"
|
||||
name="avg_durasi_response_time_bulan_ini"
|
||||
column="avg_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -270,8 +244,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_bulan_ini"
|
||||
name="total_durasi_recovery_time_bulan_ini"
|
||||
column="total_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -279,8 +254,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_bulan_ini"
|
||||
name="count_durasi_recovery_time_bulan_ini"
|
||||
column="count_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -288,8 +264,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_bulan_ini"
|
||||
name="avg_durasi_recovery_time_bulan_ini"
|
||||
column="avg_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -297,8 +274,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_tahun_ini"
|
||||
name="total_durasi_response_time_tahun_ini"
|
||||
column="total_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -306,8 +284,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_tahun_ini"
|
||||
name="count_durasi_response_time_tahun_ini"
|
||||
column="count_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -315,8 +294,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_tahun_ini"
|
||||
name="avg_durasi_response_time_tahun_ini"
|
||||
column="avg_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -324,8 +304,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_tahun_ini"
|
||||
name="total_durasi_recovery_time_tahun_ini"
|
||||
column="total_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -333,8 +314,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_tahun_ini"
|
||||
name="count_durasi_recovery_time_tahun_ini"
|
||||
column="count_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -342,8 +324,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_tahun_ini"
|
||||
name="avg_durasi_recovery_time_tahun_ini"
|
||||
column="avg_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -375,7 +358,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -383,7 +366,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -431,6 +413,139 @@ const reportMeta = ref({
|
||||
currentYear: currentYear.value
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let total_durasi_response_time_bulan_ini = 0
|
||||
let count_durasi_response_time_bulan_ini = 0
|
||||
let total_durasi_recovery_time_bulan_ini = 0
|
||||
let count_durasi_recovery_time_bulan_ini = 0
|
||||
let total_durasi_response_time_tahun_ini = 0
|
||||
let count_durasi_response_time_tahun_ini = 0
|
||||
let total_durasi_recovery_time_tahun_ini = 0
|
||||
let count_durasi_recovery_time_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'total_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_bulan_ini = 0
|
||||
count_durasi_response_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_bulan_ini / count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_bulan_ini = 0
|
||||
count_durasi_recovery_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_bulan_ini / count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_tahun_ini = 0
|
||||
count_durasi_response_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_tahun_ini / count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_tahun_ini = 0
|
||||
count_durasi_recovery_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_tahun_ini / count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -506,6 +621,58 @@ const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (regional?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'NASIONAL') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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
|
||||
|
||||
currentYear.value = tahun.id
|
||||
currentMonth.value = bulan.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
@ -50,36 +50,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Jumlah Kali Gangguan" css-class="custom-table-column">
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
@ -142,11 +121,12 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -154,7 +134,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -162,7 +143,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -170,7 +152,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -178,7 +161,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@ -186,7 +170,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -200,42 +185,48 @@
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@ -268,7 +259,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import { getMonthName } from '@/utils/texts'
|
||||
import {
|
||||
@ -277,7 +268,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -332,6 +322,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -356,6 +419,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -47,36 +47,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Tahun" css-class="custom-table-column">
|
||||
<DxColumn
|
||||
@ -104,7 +83,7 @@
|
||||
data-type="number"
|
||||
caption="Total"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatPercentage"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
|
||||
@ -515,7 +494,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
@ -525,7 +504,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPager,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
@ -579,6 +557,21 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -661,6 +654,46 @@ const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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
|
||||
|
||||
currentMonth.value = bulan.id
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
@ -47,36 +47,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Lapor Ulang Keluhan" css-class="custom-table-column">
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
@ -139,112 +118,115 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Total"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
|
||||
<template #formatNumber="{ data }">
|
||||
@ -270,7 +252,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
@ -280,7 +262,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -336,6 +317,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -416,6 +470,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -40,36 +40,15 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -96,6 +75,29 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -105,6 +107,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -125,6 +149,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -134,6 +180,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -146,108 +214,266 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="RATA-RATA"
|
||||
show-in-column="namaULP"
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
@ -277,13 +503,12 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
DxColumnFixing,
|
||||
DxExport,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -341,6 +566,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@ -358,6 +743,47 @@ const resetData = () => {
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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
|
||||
|
||||
lastMonth.value = bulan.id == 1 ? 12 : bulan.id - 1
|
||||
lastYearMoM.value = bulan.id == 1 ? tahun.id - 1 : tahun.id
|
||||
currentMonth.value = bulan.id
|
||||
|
@ -40,36 +40,15 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@ -96,6 +75,29 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -105,6 +107,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -125,6 +149,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@ -134,6 +180,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@ -146,108 +214,266 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="RATA-RATA"
|
||||
show-in-column="namaULP"
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
@ -277,13 +503,12 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
DxColumnFixing,
|
||||
DxExport,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@ -330,6 +555,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const lastMonth = ref(new Date().getMonth() == 1 ? 12 : new Date().getMonth() - 1)
|
||||
const lastYearMoM = ref(
|
||||
new Date().getMonth() == 1 ? new Date().getFullYear() - 1 : new Date().getFullYear()
|
||||
@ -362,6 +747,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
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 query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@ -774,6 +774,51 @@ export const queries = {
|
||||
}
|
||||
}
|
||||
`,
|
||||
keluhanPenyelesaianPerFungsiBidangDetail: gql`
|
||||
query detailRekapitulasiKeluhanPerBidang(
|
||||
$dateFrom: Date!
|
||||
$dateTo: Date!
|
||||
$idUlp: Int!
|
||||
$idUid: Int!
|
||||
$idUp3: Int!
|
||||
$isSelesai: Int!
|
||||
$namaFungsiBidang: String
|
||||
) {
|
||||
detailRekapitulasiKeluhanPerBidang(
|
||||
dateFrom: $dateFrom
|
||||
dateTo: $dateTo
|
||||
namaFungsiBidang: $namaFungsiBidang
|
||||
idUlp: $idUlp
|
||||
idUid: $idUid
|
||||
idUp3: $idUp3
|
||||
isSelesai: $isSelesai
|
||||
) {
|
||||
id
|
||||
nama_regional
|
||||
id_uid
|
||||
nama_uid
|
||||
id_up3
|
||||
nama_up3
|
||||
id_ulp
|
||||
nama_ulp
|
||||
no_laporan
|
||||
waktu_lapor
|
||||
waktu_response
|
||||
waktu_recovery
|
||||
durasi_response_time
|
||||
durasi_recovery_time
|
||||
status_akhir
|
||||
idpel_nometer
|
||||
nama_pelapor
|
||||
alamat_pelapor
|
||||
no_telp_pelapor
|
||||
keterangan_pelapor
|
||||
uraian
|
||||
respon_pelanggan
|
||||
is_selesai
|
||||
}
|
||||
}
|
||||
`,
|
||||
keluhanPenyelesaianPerFungsiBidangULP: gql`
|
||||
query rekapitulasiKeluhanPenyelesaianPerFungsiBidangUlp(
|
||||
$dateFrom: Date!
|
||||
@ -2683,9 +2728,13 @@ export const queries = {
|
||||
nama_ulp
|
||||
mom_bulan_ini
|
||||
mom_bulan_kemarin
|
||||
count_mom_bulan_ini
|
||||
count_mom_bulan_kemarin
|
||||
persen_mom
|
||||
yoy_tahun_ini
|
||||
yoy_tahun_kemarin
|
||||
count_yoy_tahun_ini
|
||||
count_yoy_tahun_kemarin
|
||||
persen_yoy
|
||||
}
|
||||
}
|
||||
@ -2950,9 +2999,13 @@ export const queries = {
|
||||
nama_ulp
|
||||
mom_bulan_ini
|
||||
mom_bulan_kemarin
|
||||
count_mom_bulan_ini
|
||||
count_mom_bulan_kemarin
|
||||
persen_mom
|
||||
yoy_tahun_ini
|
||||
yoy_tahun_kemarin
|
||||
count_yoy_tahun_ini
|
||||
count_yoy_tahun_kemarin
|
||||
persen_yoy
|
||||
}
|
||||
}
|
||||
@ -2984,9 +3037,13 @@ export const queries = {
|
||||
nama_ulp
|
||||
mom_bulan_ini
|
||||
mom_bulan_kemarin
|
||||
count_mom_bulan_ini
|
||||
count_mom_bulan_kemarin
|
||||
persen_mom
|
||||
yoy_tahun_ini
|
||||
yoy_tahun_kemarin
|
||||
count_yoy_tahun_ini
|
||||
count_yoy_tahun_kemarin
|
||||
persen_yoy
|
||||
}
|
||||
}
|
||||
@ -3045,6 +3102,7 @@ export const queries = {
|
||||
bulan: $bulan
|
||||
tahun: $tahun
|
||||
) {
|
||||
id
|
||||
nama_regional
|
||||
id_uid
|
||||
nama_uid
|
||||
@ -3058,6 +3116,10 @@ export const queries = {
|
||||
yoy_tahun_ini
|
||||
yoy_tahun_kemarin
|
||||
persen_yoy
|
||||
count_yoy_tahun_ini
|
||||
count_yoy_tahun_kemarin
|
||||
count_mom_bulan_ini
|
||||
count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
`,
|
||||
@ -3092,6 +3154,10 @@ export const queries = {
|
||||
yoy_tahun_ini
|
||||
yoy_tahun_kemarin
|
||||
persen_yoy
|
||||
count_yoy_tahun_ini
|
||||
count_yoy_tahun_kemarin
|
||||
count_mom_bulan_ini
|
||||
count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user