Refactor RKeluhan_PerFungsiBidang.vue to update getDetail function and remove unused variables
This commit is contained in:
@@ -49,44 +49,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
caption="NASIONAL"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
:group-index="0"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@@ -239,12 +210,13 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_bulan_ini"
|
||||
name="total_durasi_response_time_bulan_ini"
|
||||
column="total_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -252,8 +224,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_bulan_ini"
|
||||
name="count_durasi_response_time_bulan_ini"
|
||||
column="count_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -261,8 +234,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_bulan_ini"
|
||||
name="avg_durasi_response_time_bulan_ini"
|
||||
column="avg_durasi_response_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -270,8 +244,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_bulan_ini"
|
||||
name="total_durasi_recovery_time_bulan_ini"
|
||||
column="total_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -279,8 +254,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_bulan_ini"
|
||||
name="count_durasi_recovery_time_bulan_ini"
|
||||
column="count_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -288,8 +264,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_bulan_ini"
|
||||
name="avg_durasi_recovery_time_bulan_ini"
|
||||
column="avg_durasi_recovery_time_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -297,8 +274,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_response_time_tahun_ini"
|
||||
name="total_durasi_response_time_tahun_ini"
|
||||
column="total_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -306,8 +284,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_response_time_tahun_ini"
|
||||
name="count_durasi_response_time_tahun_ini"
|
||||
column="count_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -315,8 +294,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_response_time_tahun_ini"
|
||||
name="avg_durasi_response_time_tahun_ini"
|
||||
column="avg_durasi_response_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -324,8 +304,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="total_durasi_recovery_time_tahun_ini"
|
||||
name="total_durasi_recovery_time_tahun_ini"
|
||||
column="total_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -333,8 +314,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="count_durasi_recovery_time_tahun_ini"
|
||||
name="count_durasi_recovery_time_tahun_ini"
|
||||
column="count_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -342,8 +324,9 @@
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
summary-type="custom"
|
||||
show-in-column="avg_durasi_recovery_time_tahun_ini"
|
||||
name="avg_durasi_recovery_time_tahun_ini"
|
||||
column="avg_durasi_recovery_time_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -375,7 +358,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@@ -383,7 +366,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@@ -431,6 +413,139 @@ const reportMeta = ref({
|
||||
currentYear: currentYear.value
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let total_durasi_response_time_bulan_ini = 0
|
||||
let count_durasi_response_time_bulan_ini = 0
|
||||
let total_durasi_recovery_time_bulan_ini = 0
|
||||
let count_durasi_recovery_time_bulan_ini = 0
|
||||
let total_durasi_response_time_tahun_ini = 0
|
||||
let count_durasi_response_time_tahun_ini = 0
|
||||
let total_durasi_recovery_time_tahun_ini = 0
|
||||
let count_durasi_recovery_time_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'total_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_bulan_ini = 0
|
||||
count_durasi_response_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_bulan_ini / count_durasi_response_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_bulan_ini = 0
|
||||
count_durasi_recovery_time_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_bulan_ini / count_durasi_recovery_time_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_response_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_response_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_response_time_tahun_ini = 0
|
||||
count_durasi_response_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_response_time_tahun_ini / count_durasi_response_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'total_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
total_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = total_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_durasi_recovery_time_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'avg_durasi_recovery_time_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
total_durasi_recovery_time_tahun_ini = 0
|
||||
count_durasi_recovery_time_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
total_durasi_recovery_time_tahun_ini / count_durasi_recovery_time_tahun_ini
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -506,6 +621,58 @@ const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: '',
|
||||
caption: 'NASIONAL'
|
||||
},
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (regional?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'NASIONAL') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
currentYear.value = tahun.id
|
||||
currentMonth.value = bulan.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
@@ -50,36 +50,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Jumlah Kali Gangguan" css-class="custom-table-column">
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
@@ -142,11 +121,12 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -154,7 +134,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -162,7 +143,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@@ -170,7 +152,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -178,7 +161,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
@@ -186,7 +170,8 @@
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@@ -200,42 +185,48 @@
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
@@ -268,7 +259,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import { getMonthName } from '@/utils/texts'
|
||||
import {
|
||||
@@ -277,7 +268,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@@ -332,6 +322,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -356,6 +419,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
const query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@@ -47,36 +47,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Tahun" css-class="custom-table-column">
|
||||
<DxColumn
|
||||
@@ -104,7 +83,7 @@
|
||||
data-type="number"
|
||||
caption="Total"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatPercentage"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
|
||||
@@ -515,7 +494,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
@@ -525,7 +504,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPager,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
@@ -579,6 +557,21 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -661,6 +654,46 @@ const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
currentMonth.value = bulan.id
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
@@ -47,36 +47,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Lapor Ulang Keluhan" css-class="custom-table-column">
|
||||
<DxColumn alignment="center" caption="MoM" css-class="custom-table-column">
|
||||
@@ -139,112 +118,115 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="Total"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
|
||||
<DxTotalItem
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="sum"
|
||||
show-in-column="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
|
||||
<template #formatNumber="{ data }">
|
||||
@@ -270,7 +252,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
@@ -280,7 +262,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@@ -336,6 +317,79 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let mom_bulan_ini = 0
|
||||
let yoy_tahun_kemarin = 0
|
||||
let yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -416,6 +470,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
const query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
@@ -40,36 +40,15 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@@ -96,6 +75,29 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@@ -105,6 +107,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@@ -125,6 +149,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@@ -134,6 +180,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@@ -146,108 +214,266 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="RATA-RATA"
|
||||
show-in-column="namaULP"
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
@@ -277,13 +503,12 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
DxColumnFixing,
|
||||
DxExport,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@@ -341,6 +566,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -358,6 +743,47 @@ const resetData = () => {
|
||||
const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
lastMonth.value = bulan.id == 1 ? 12 : bulan.id - 1
|
||||
lastYearMoM.value = bulan.id == 1 ? tahun.id - 1 : tahun.id
|
||||
currentMonth.value = bulan.id
|
||||
|
@@ -40,36 +40,15 @@
|
||||
<DxColumnFixing :enabled="true" />
|
||||
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
@@ -96,6 +75,29 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_kemarin"
|
||||
:caption="`Cal ${getMonthName(lastMonth)} ${lastYearMoM}`"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_kemarin * rowData.mom_bulan_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@@ -105,6 +107,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_mom_bulan_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_mom_bulan_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_mom_bulan_ini * rowData.mom_bulan_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@@ -125,6 +149,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${lastYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_kemarin"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_kemarin * rowData.yoy_tahun_kemarin
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
@@ -134,6 +180,28 @@
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="count_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
:caption="`Count ${getMonthName(currentMonth)} ${currentYear}`"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
<DxColumn
|
||||
:visible="false"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field="cal_yoy_tahun_ini"
|
||||
data-type="number"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
:calculate-cell-value="
|
||||
(rowData: any) => rowData.count_yoy_tahun_ini * rowData.yoy_tahun_ini
|
||||
"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
alignment="center"
|
||||
@@ -146,108 +214,266 @@
|
||||
</DxColumn>
|
||||
</DxColumn>
|
||||
|
||||
<DxSummary>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
display-format="{0}"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxSummary :calculate-custom-summary="calculateCustomSummary">
|
||||
<DxTotalItem
|
||||
summary-type="sum"
|
||||
display-format="RATA-RATA"
|
||||
show-in-column="namaULP"
|
||||
:display-format="`RATA-RATA`"
|
||||
show-in-column="nama_ulp"
|
||||
css-class="text-white !text-left"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_kemarin"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="mom_bulan_ini"
|
||||
summary-type="sum"
|
||||
name="mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_mom"
|
||||
summary-type="avg"
|
||||
name="persen_mom"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_kemarin"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="yoy_tahun_ini"
|
||||
summary-type="sum"
|
||||
name="yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
:align-by-column="true"
|
||||
column="persen_yoy"
|
||||
summary-type="avg"
|
||||
column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxTotalItem
|
||||
column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
css-class="text-white !text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="mom_bulan_kemarin"
|
||||
name="mom_bulan_kemarin"
|
||||
column="mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="cal_mom_bulan_kemarin"
|
||||
name="cal_mom_bulan_kemarin"
|
||||
column="cal_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
display-format="{0}"
|
||||
show-in-column="count_mom_bulan_kemarin"
|
||||
name="count_mom_bulan_kemarin"
|
||||
column="count_mom_bulan_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="mom_bulan_ini"
|
||||
name="mom_bulan_ini"
|
||||
column="mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_mom_bulan_ini"
|
||||
name="cal_mom_bulan_ini"
|
||||
column="cal_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_mom_bulan_ini"
|
||||
name="count_mom_bulan_ini"
|
||||
column="count_mom_bulan_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_mom"
|
||||
name="persen_mom"
|
||||
column="persen_mom"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_kemarin"
|
||||
name="yoy_tahun_kemarin"
|
||||
column="yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_kemarin"
|
||||
name="cal_yoy_tahun_kemarin"
|
||||
column="cal_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_kemarin"
|
||||
name="count_yoy_tahun_kemarin"
|
||||
column="count_yoy_tahun_kemarin"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="yoy_tahun_ini"
|
||||
name="yoy_tahun_ini"
|
||||
column="yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="cal_yoy_tahun_ini"
|
||||
name="cal_yoy_tahun_ini"
|
||||
column="cal_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="count_yoy_tahun_ini"
|
||||
name="count_yoy_tahun_ini"
|
||||
column="count_yoy_tahun_ini"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatNumber(e.value)"
|
||||
/>
|
||||
<DxGroupItem
|
||||
:show-in-group-footer="false"
|
||||
:align-by-column="true"
|
||||
summary-type="custom"
|
||||
show-in-column="persen_yoy"
|
||||
name="persen_yoy"
|
||||
column="persen_yoy"
|
||||
css-class="!text-right"
|
||||
:customize-text="(e: any) => formatPercentage(e.value)"
|
||||
/>
|
||||
</DxSummary>
|
||||
@@ -277,13 +503,12 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
DxColumnFixing,
|
||||
DxExport,
|
||||
DxLoadPanel,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
DxSearchPanel,
|
||||
@@ -330,6 +555,166 @@ const reportMeta = ref({
|
||||
lastYear: new Date().getFullYear() - 1
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
let mom_bulan_kemarin = 0
|
||||
let count_mom_bulan_kemarin = 0
|
||||
let cal_mom_bulan_kemarin = 0
|
||||
|
||||
let mom_bulan_ini = 0
|
||||
let count_mom_bulan_ini = 0
|
||||
let cal_mom_bulan_ini = 0
|
||||
|
||||
let yoy_tahun_kemarin = 0
|
||||
let count_yoy_tahun_kemarin = 0
|
||||
let cal_yoy_tahun_kemarin = 0
|
||||
|
||||
let yoy_tahun_ini = 0
|
||||
let count_yoy_tahun_ini = 0
|
||||
let cal_yoy_tahun_ini = 0
|
||||
const calculateCustomSummary = (options: any) => {
|
||||
if (options.name === 'count_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_kemarin = 0
|
||||
count_mom_bulan_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_kemarin / count_mom_bulan_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'mom_bulan_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_mom_bulan_ini = 0
|
||||
count_mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
mom_bulan_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_mom_bulan_ini / count_mom_bulan_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_mom') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
mom_bulan_kemarin = 0
|
||||
mom_bulan_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
mom_bulan_kemarin == 0 ? 0 : ((mom_bulan_kemarin - mom_bulan_ini) / mom_bulan_kemarin) * 100
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_kemarin') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_kemarin = 0
|
||||
count_yoy_tahun_kemarin = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_kemarin += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_kemarin / count_yoy_tahun_kemarin
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'count_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
count_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'cal_yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'calculate') {
|
||||
cal_yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'yoy_tahun_ini') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
cal_yoy_tahun_ini = 0
|
||||
count_yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'calculate') {
|
||||
yoy_tahun_ini += options.value
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue = cal_yoy_tahun_ini / count_yoy_tahun_ini
|
||||
}
|
||||
}
|
||||
|
||||
if (options.name === 'persen_yoy') {
|
||||
if (options.summaryProcess === 'start') {
|
||||
yoy_tahun_kemarin = 0
|
||||
yoy_tahun_ini = 0
|
||||
} else if (options.summaryProcess === 'finalize') {
|
||||
options.totalValue =
|
||||
yoy_tahun_kemarin == 0 ? 0 : ((yoy_tahun_kemarin - yoy_tahun_ini) / yoy_tahun_kemarin) * 100
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const lastMonth = ref(new Date().getMonth() == 1 ? 12 : new Date().getMonth() - 1)
|
||||
const lastYearMoM = ref(
|
||||
new Date().getMonth() == 1 ? new Date().getFullYear() - 1 : new Date().getFullYear()
|
||||
@@ -362,6 +747,46 @@ const filterData = async (params: any) => {
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
const query = {
|
||||
namaRegional: regional.name == 'Semua Regional' ? '' : regional.name,
|
||||
idUlp: ulp ? ulp.id : 0,
|
||||
|
Reference in New Issue
Block a user