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