fix: anomali gangguan
This commit is contained in:
		| @@ -349,7 +349,7 @@ | ||||
|         column="anomali_pln_mobile_marking" | ||||
|         name="anomali_pln_mobile_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
| @@ -358,7 +358,7 @@ | ||||
|         column="anomali_pln_mobile_non_marking" | ||||
|         name="anomali_pln_mobile_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
| @@ -367,7 +367,7 @@ | ||||
|         column="anomali_cc123_marking" | ||||
|         name="anomali_cc123_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
| @@ -376,7 +376,7 @@ | ||||
|         column="anomali_cc123_non_marking" | ||||
|         name="anomali_cc123_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
| @@ -385,7 +385,7 @@ | ||||
|         column="total_anomali_marking" | ||||
|         name="total_anomali_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
| @@ -394,7 +394,7 @@ | ||||
|         column="total_anomali_non_marking" | ||||
|         name="total_anomali_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|   | ||||
| @@ -22,6 +22,7 @@ | ||||
|     :data="data" | ||||
|     :filters="filters" | ||||
|     :loading-data="loadingData" | ||||
|     :grouping="grouping" | ||||
|     @update:loading-sub-data="loadingData = $event" | ||||
|   /> | ||||
|   <Anomali_LAPPGU_LPP :data="dataSecond" :filters="filters" /> | ||||
| @@ -60,11 +61,66 @@ const resetData = () => { | ||||
|   dataSecond.value = [] | ||||
| } | ||||
|  | ||||
| const grouping = ref<any[]>([ | ||||
|   { | ||||
|     data: '', | ||||
|     caption: 'Semua Unit' | ||||
|   }, | ||||
|   { | ||||
|     data: 'nama_uid', | ||||
|     caption: 'UID' | ||||
|   }, | ||||
|   { | ||||
|     data: 'nama_up3', | ||||
|     caption: 'UP3' | ||||
|   } | ||||
| ]) | ||||
|  | ||||
| const filterData = async (params: any) => { | ||||
|   resetData() | ||||
|   const { ulp, uid, up3, jenisLaporan } = params | ||||
|   console.table('LAPPGU', jenisLaporan) | ||||
|  | ||||
|   var groupList: any[] = [ | ||||
|     { | ||||
|       data: '', | ||||
|       caption: 'Semua Unit' | ||||
|     }, | ||||
|     { | ||||
|       data: 'nama_uid', | ||||
|       caption: 'UID' | ||||
|     }, | ||||
|     { | ||||
|       data: 'nama_up3', | ||||
|       caption: 'UP3' | ||||
|     } | ||||
|   ] | ||||
|  | ||||
|   if (uid?.id != 0) { | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Semua Unit') { | ||||
|         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 dateValue = params.periode.split(' s/d ') | ||||
|   const query = { | ||||
|     dateFrom: dateValue[0] | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|   </div> | ||||
|  | ||||
|   <DxDataGrid | ||||
|     @cell-click="onCellClicked" | ||||
|     ref="dataGridRef" | ||||
|     :allow-column-reordering="true" | ||||
|     class="max-h-[calc(100vh-140px)] mb-10" | ||||
| @@ -21,7 +22,7 @@ | ||||
|     column-resizing-mode="widget" | ||||
|     :word-wrap-enabled="true" | ||||
|   > | ||||
|     <DxGrouping expand-mode="rowClick" :auto-expand-all="false" /> | ||||
|     <DxGrouping :auto-expand-all="false" /> | ||||
|     <DxSelection mode="single" /> | ||||
|     <DxPaging :enabled="false" /> | ||||
|     <DxScrolling column-rendering-mode="virtual" mode="virtual" /> | ||||
| @@ -44,35 +45,15 @@ | ||||
|     /> | ||||
|  | ||||
|     <DxColumn | ||||
|       v-if="grouping.length > 0" | ||||
|       v-for="(group, index) in grouping" | ||||
|       :width="150" | ||||
|       alignment="center" | ||||
|       :min-width="170" | ||||
|       data-type="text" | ||||
|       data-field="" | ||||
|       caption="Semua Unit" | ||||
|       :data-field="group.data" | ||||
|       :caption="group.caption" | ||||
|       css-class="custom-table-column" | ||||
|       :group-index="0" | ||||
|     /> | ||||
|     <DxColumn | ||||
|       alignment="center" | ||||
|       :min-width="170" | ||||
|       data-type="text" | ||||
|       data-field="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="Total WO" css-class="custom-table-column"> | ||||
|       <DxColumn alignment="center" caption="CC 123" css-class="custom-table-column"> | ||||
| @@ -400,12 +381,13 @@ | ||||
|       </p> | ||||
|     </template> | ||||
|  | ||||
|     <DxSummary> | ||||
|     <DxSummary :calculate-custom-summary="calculateCustomSummary"> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="wo_cc123" | ||||
|         summary-type="sum" | ||||
|         name="wo_cc123" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
| @@ -413,7 +395,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="wo_pln_mobile" | ||||
|         summary-type="sum" | ||||
|         name="wo_pln_mobile" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
| @@ -421,7 +404,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="wo_loket" | ||||
|         summary-type="sum" | ||||
|         name="wo_loket" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
| @@ -429,7 +413,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="wo_lainnya" | ||||
|         summary-type="sum" | ||||
|         summary-type="custom" | ||||
|         name="wo_lainnya" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
| @@ -437,7 +422,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="wo_total" | ||||
|         summary-type="sum" | ||||
|         name="wo_total" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
| @@ -445,55 +431,62 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="anomali_pln_mobile_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="anomali_pln_mobile_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="anomali_pln_mobile_non_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="anomali_pln_mobile_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="anomali_cc123_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="anomali_cc123_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="anomali_cc123_non_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="anomali_cc123_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="total_anomali_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="total_anomali_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="total_anomali_non_marking" | ||||
|         summary-type="sum" | ||||
|         css-class="!text-right" | ||||
|         name="total_anomali_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right cursor-pointer" | ||||
|         :customize-text="(e: any) => formatNumber(e.value)" | ||||
|       /> | ||||
|       <DxGroupItem | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_pln_mobile_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_pln_mobile_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -501,7 +494,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_pln_mobile_non_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_pln_mobile_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -509,7 +503,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_cc123_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_cc123_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -517,7 +512,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_cc123_non_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_cc123_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -525,7 +521,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -533,7 +530,8 @@ | ||||
|         :show-in-group-footer="false" | ||||
|         :align-by-column="true" | ||||
|         column="persen_anomali_non_marking" | ||||
|         summary-type="avg" | ||||
|         name="persen_anomali_non_marking" | ||||
|         summary-type="custom" | ||||
|         css-class="!text-right" | ||||
|         :customize-text="(e: any) => formatPercentage(e.value)" | ||||
|       /> | ||||
| @@ -1077,6 +1075,7 @@ import { | ||||
|   exportDetailToDOCX | ||||
| } from '@/report/Anomali/Gangguan/Anomali_LAPPGU_LPT' | ||||
| import BufferDialog from '@/components/Dialogs/BufferDialog.vue' | ||||
| import { getDataRowGroup } from '@/utils/helper' | ||||
|  | ||||
| const position = { of: '#data' } | ||||
| const showIndicator = ref(true) | ||||
| @@ -1085,7 +1084,11 @@ const showPane = ref(true) | ||||
| const props = defineProps({ | ||||
|   data: Array as () => any[], | ||||
|   filters: Object as () => any, | ||||
|   loadingData: Boolean | ||||
|   loadingData: Boolean, | ||||
|   grouping: { | ||||
|     type: Array as () => any[], | ||||
|     default: [] | ||||
|   } | ||||
| }) | ||||
| const emit = defineEmits(['update:loadingSubData']) | ||||
| const filters = ref<any>(computed(() => props.filters)) | ||||
| @@ -1102,6 +1105,9 @@ const parameterRequest = ref<any>({ | ||||
|   media: null, | ||||
|   marking: null | ||||
| }) | ||||
| const groupDialog = ref(false) | ||||
| const groupData = ref<any>(null) | ||||
| const groupIndex = ref(0) | ||||
|  | ||||
| const setParameterRequest = (data: any) => { | ||||
|   parameterRequest.value = data | ||||
| @@ -1113,6 +1119,234 @@ const setParameterRequest = (data: any) => { | ||||
|   } | ||||
| } | ||||
|  | ||||
| const onCellClicked = (e: any) => { | ||||
|   if (e.rowType == 'group') { | ||||
|     groupDialog.value = true | ||||
|     groupIndex.value = e.row.groupIndex | ||||
|  | ||||
|     if (e.column.dataField == 'anomali_pln_mobile_marking') { | ||||
|       setParameterRequest({ media: 'PLN Mobile', marking: 1 }) | ||||
|     } else if (e.column.dataField == 'anomali_pln_mobile_non_marking') { | ||||
|       setParameterRequest({ media: 'PLN Mobile', marking: 2 }) | ||||
|     } else if (e.column.dataField == 'anomali_cc123_marking') { | ||||
|       setParameterRequest({ media: 'Call PLN 123', marking: 1 }) | ||||
|     } else if (e.column.dataField == 'anomali_cc123_non_marking') { | ||||
|       setParameterRequest({ media: 'Call PLN 123', marking: 2 }) | ||||
|     } else if (e.column.dataField == 'total_anomali_marking') { | ||||
|       setParameterRequest({ media: '', marking: 1 }) | ||||
|     } else if (e.column.dataField == 'total_anomali_non_marking') { | ||||
|       setParameterRequest({ media: '', marking: 2 }) | ||||
|     } else { | ||||
|       setParameterRequest({ media: null, marking: null }) | ||||
|     } | ||||
|     groupData.value = getDataRowGroup(e.data) | ||||
|     showDetail() | ||||
|   } else { | ||||
|     groupDialog.value = false | ||||
|   } | ||||
| } | ||||
|  | ||||
| let wo_cc123 = 0 | ||||
| let wo_pln_mobile = 0 | ||||
| let wo_loket = 0 | ||||
| let wo_lainnya = 0 | ||||
| let wo_total = 0 | ||||
| let anomali_pln_mobile_marking = 0 | ||||
| let anomali_pln_mobile_non_marking = 0 | ||||
| let anomali_cc123_marking = 0 | ||||
| let anomali_cc123_non_marking = 0 | ||||
| let total_anomali_marking = 0 | ||||
| let total_anomali_non_marking = 0 | ||||
| let persen_anomali_pln_mobile_marking = 0 | ||||
| let persen_anomali_pln_mobile_non_marking = 0 | ||||
| let persen_anomali_cc123_marking = 0 | ||||
| let persen_anomali_cc123_non_marking = 0 | ||||
| let persen_anomali_marking = 0 | ||||
| let persen_anomali_non_marking = 0 | ||||
|  | ||||
| const calculateCustomSummary = (options: any) => { | ||||
|   if (options.name === 'wo_cc123') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       wo_cc123 += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = wo_cc123 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'wo_pln_mobile') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       wo_pln_mobile += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = wo_pln_mobile | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'wo_loket') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       wo_loket += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = wo_loket | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'wo_lainnya') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       wo_lainnya += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = wo_lainnya | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'wo_total') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       wo_cc123 = 0 | ||||
|       wo_pln_mobile = 0 | ||||
|       wo_loket = 0 | ||||
|       wo_lainnya = 0 | ||||
|     } else if (options.summaryProcess === 'calculate') { | ||||
|       wo_total = wo_cc123 + wo_pln_mobile + wo_loket + wo_lainnya | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = wo_cc123 + wo_pln_mobile + wo_loket + wo_lainnya | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'anomali_pln_mobile_marking') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       anomali_pln_mobile_marking += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_pln_mobile_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'anomali_pln_mobile_non_marking') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       anomali_pln_mobile_non_marking += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_pln_mobile_non_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'anomali_cc123_marking') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       anomali_cc123_marking += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_cc123_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'anomali_cc123_non_marking') { | ||||
|     if (options.summaryProcess === 'calculate') { | ||||
|       anomali_cc123_non_marking += options.value | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_cc123_non_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'total_anomali_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_pln_mobile_marking = 0 | ||||
|       anomali_cc123_marking = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_pln_mobile_marking + anomali_cc123_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'total_anomali_non_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_pln_mobile_non_marking = 0 | ||||
|       anomali_cc123_non_marking = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = anomali_pln_mobile_non_marking + anomali_cc123_non_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_pln_mobile_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_pln_mobile_marking = 0 | ||||
|       wo_total = 0 | ||||
|     } else if (options.summaryProcess === 'calculate') { | ||||
|       persen_anomali_pln_mobile_marking = | ||||
|         !isFinite(anomali_pln_mobile_marking / wo_total) || anomali_pln_mobile_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_pln_mobile_marking / wo_total) * 100 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = | ||||
|         !isFinite(anomali_pln_mobile_marking / wo_total) || anomali_pln_mobile_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_pln_mobile_marking / wo_total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_pln_mobile_non_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_pln_mobile_non_marking = 0 | ||||
|       wo_total = 0 | ||||
|     } else if (options.summaryProcess === 'calculate') { | ||||
|       persen_anomali_pln_mobile_non_marking = | ||||
|         !isFinite(anomali_pln_mobile_non_marking / wo_total) || anomali_pln_mobile_non_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_pln_mobile_non_marking / wo_total) * 100 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = | ||||
|         !isFinite(anomali_pln_mobile_non_marking / wo_total) || anomali_pln_mobile_non_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_pln_mobile_non_marking / wo_total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_cc123_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_cc123_marking = 0 | ||||
|       wo_total = 0 | ||||
|     } else if (options.summaryProcess === 'calculate') { | ||||
|       persen_anomali_cc123_marking = | ||||
|         !isFinite(anomali_cc123_marking / wo_total) || anomali_cc123_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_cc123_marking / wo_total) * 100 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = | ||||
|         !isFinite(anomali_cc123_marking / wo_total) || anomali_cc123_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_cc123_marking / wo_total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_cc123_non_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       anomali_cc123_non_marking = 0 | ||||
|       wo_total = 0 | ||||
|     } else if (options.summaryProcess === 'calculate') { | ||||
|       persen_anomali_cc123_non_marking = | ||||
|         !isFinite(anomali_cc123_non_marking / wo_total) || anomali_cc123_non_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_cc123_non_marking / wo_total) * 100 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = | ||||
|         !isFinite(anomali_cc123_non_marking / wo_total) || anomali_cc123_non_marking == 0 | ||||
|           ? 0 | ||||
|           : (anomali_cc123_non_marking / wo_total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       persen_anomali_pln_mobile_marking = 0 | ||||
|       persen_anomali_cc123_marking = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = persen_anomali_pln_mobile_marking + persen_anomali_cc123_marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_anomali_non_marking') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       persen_anomali_cc123_non_marking = 0 | ||||
|       persen_anomali_pln_mobile_non_marking = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = persen_anomali_pln_mobile_non_marking + persen_anomali_cc123_non_marking | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| const resetData = () => { | ||||
|   dataSub.value = [] | ||||
|   dataSubSelected.value = null | ||||
| @@ -1124,21 +1358,53 @@ const getDetail = async () => { | ||||
|  | ||||
|   const dateValue = periode.split(' s/d ') | ||||
|   const selected = dataSelected.value | ||||
|   const query = { | ||||
|   let query = { | ||||
|     dateFrom: dateValue[0] | ||||
|       ? dateValue[0].split('-').reverse().join('-') | ||||
|       : new Date().toISOString().slice(0, 10), | ||||
|     dateTo: dateValue[1] | ||||
|       ? dateValue[1].split('-').reverse().join('-') | ||||
|       : new Date().toISOString().slice(0, 10), | ||||
|     idUlp: selected?.id_ulp ? selected?.id_ulp : 0, | ||||
|     idUid: selected?.id_uid ? selected?.id_uid : 0, | ||||
|     idUp3: selected?.id_up3 ? selected?.id_up3 : 0, | ||||
|     idUlp: 0, | ||||
|     idUid: 0, | ||||
|     idUp3: 0, | ||||
|     namaRegional: '', | ||||
|     media: parameterRequest.value?.media, | ||||
|     isMarking: parameterRequest.value?.marking | ||||
|   } | ||||
|  | ||||
|   if (groupDialog.value) { | ||||
|     if (props.grouping[groupIndex.value].data == 'nama_uid') { | ||||
|       query = { | ||||
|         ...query, | ||||
|         idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0, | ||||
|         namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : '' | ||||
|       } | ||||
|     } else if (props.grouping[groupIndex.value].data == 'nama_up3') { | ||||
|       query = { | ||||
|         ...query, | ||||
|         idUid: groupData.value?.id_uid ? groupData.value?.id_uid : 0, | ||||
|         idUp3: groupData.value?.id_up3 ? groupData.value?.id_up3 : 0, | ||||
|         namaRegional: groupData.value?.nama_regional ? groupData.value?.nama_regional : '' | ||||
|       } | ||||
|     } | ||||
|   } else { | ||||
|     query = { | ||||
|       dateFrom: dateValue[0] | ||||
|         ? dateValue[0].split('-').reverse().join('-') | ||||
|         : new Date().toISOString().slice(0, 10), | ||||
|       dateTo: dateValue[1] | ||||
|         ? dateValue[1].split('-').reverse().join('-') | ||||
|         : new Date().toISOString().slice(0, 10), | ||||
|       idUlp: selected?.id_ulp ? selected?.id_ulp : 0, | ||||
|       idUid: selected?.id_uid ? selected?.id_uid : 0, | ||||
|       idUp3: selected?.id_up3 ? selected?.id_up3 : 0, | ||||
|       namaRegional: selected?.nama_regional ? selected?.nama_regional : '', | ||||
|       media: parameterRequest.value?.media, | ||||
|       isMarking: parameterRequest.value?.marking | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   loadingSubData.value = true | ||||
|   emit('update:loadingSubData', true) | ||||
|   await requestGraphQl( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user