diff --git a/src/components/Pages/Gangguan/Rekap/RGangguan_ALL.vue b/src/components/Pages/Gangguan/Rekap/RGangguan_ALL.vue index aadc4a7..95cbad5 100755 --- a/src/components/Pages/Gangguan/Rekap/RGangguan_ALL.vue +++ b/src/components/Pages/Gangguan/Rekap/RGangguan_ALL.vue @@ -5,33 +5,15 @@
@@ -662,8 +464,9 @@ import { DxSummary, DxGroupItem, DxGrouping, + } from 'devextreme-vue/data-grid' -import { onMounted, ref, watch } from 'vue' +import { onMounted, ref } from 'vue' import { exportDataGrid as exportToExcel } from 'devextreme/excel_exporter' import { saveAs } from 'file-saver' import { Workbook } from 'exceljs' @@ -681,7 +484,9 @@ import { exportDetailToXLSX } from '@/report/Gangguan/Rekap/RGangguan_ALL' import { getDataRowGroup } from '@/utils/helper' - +const calculateGroupValue = (e: any) => { + console.log(e) +} const client = apolloClient() provideApolloClient(client) const position = { of: '#data' } @@ -765,22 +570,57 @@ const setAgreementDialog = (column: string) => { agreeToShowDialog.value = false } } - +let total_selesai = 0; +let total_inproses = 0; +let total = 0; const calculateCustomSummary = (options: any) => { - if (options.name == 'persenSelesai') { - console.log(options.component.persen_selesai) - switch (options.summaryProcess) { - case 'start': - // Initializing "totalValue" here - options.totalValue = 1 - break - case 'calculate': - // Modifying "totalValue" here - break - case 'finalize': - // Assigning the final value to "totalValue" here - break + if (options.name === 'total') { + if (options.summaryProcess === 'calculate') { + total += options.value; + } else if (options.summaryProcess === 'finalize') { + options.totalValue = total + + } + } + if (options.name === 'total_inproses') { + if (options.summaryProcess === 'calculate') { + total_inproses += options.value; + } else if (options.summaryProcess === 'finalize') { + options.totalValue = total_inproses + } + } + + if (options.name === 'total_selesai') { + if (options.summaryProcess === 'calculate') { + total_selesai += options.value; + + } else if (options.summaryProcess === 'finalize') { + options.totalValue = total_selesai + } + + } + + if (options.name === 'persen_selesai') { + if (options.summaryProcess === 'start') { + total_selesai = 0; + total = 0; + } else if (options.summaryProcess === 'calculate') { + + } else if (options.summaryProcess === 'finalize') { + + options.totalValue = (total_selesai / total) * 100; + } + } + if (options.name === 'persen_inproses') { + if (options.summaryProcess === 'start') { + total_inproses = 0; + total = 0; + } else if (options.summaryProcess === 'calculate') { + + } else if (options.summaryProcess === 'finalize') { + + options.totalValue = (total_inproses / total) * 100; } } } @@ -1176,4 +1016,3 @@ onMounted(() => { } }) -@/utils/helper