Refactor DatePicker.vue to remove console.log statement
Refactor RGangguan_BerdasarMedia.vue to fix css-class typo Refactor RKeluhan_BerdasarMedia.vue to update display-format and css-class Refactor RGangguan_KTI.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor RGangguan_CTTM.vue to remove 'Semua Unit' and 'Regional' from groupList Refactor Type11.vue to update placeholder and values in InputWithSuffix Refactor RKeluhan_PerUnit.vue to update calculateCustomSummary function
This commit is contained in:
		| @@ -1318,7 +1318,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1327,16 +1331,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1386,7 +1385,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_response = 0 | ||||
|       total_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = total_durasi_response / count_durasi_response | ||||
|       options.totalValue = isFinite(total_durasi_response / count_durasi_response) | ||||
|         ? 0 | ||||
|         : total_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : total_durasi_response / count_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1411,7 +1414,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = total_durasi_recovery / count_durasi_recovery | ||||
|       options.totalValue = isFinite(total_durasi_recovery / count_durasi_recovery) | ||||
|         ? 0 | ||||
|         : total_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : total_durasi_recovery / count_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @@ -1449,7 +1456,13 @@ const filterData = async (params: any) => { | ||||
|  | ||||
|   if (uid?.id != 0) { | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Semua Unit' || item.caption == 'Regional') { | ||||
|       if (item.caption == 'Semua Unit') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|  | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Regional') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|   | ||||
| @@ -108,7 +108,7 @@ | ||||
|         <DxTotalItem | ||||
|           display-format="Total" | ||||
|           show-in-column="media" | ||||
|           css-class="text-white !text-l eft" | ||||
|           css-class="text-white !text-left" | ||||
|         /> | ||||
|         <DxTotalItem | ||||
|           v-for="i in 31" | ||||
|   | ||||
| @@ -542,7 +542,13 @@ const filterData = async (params: any) => { | ||||
|  | ||||
|   if (uid?.id != 0) { | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Semua Unit' || item.caption == 'Regional') { | ||||
|       if (item.caption == 'Semua Unit') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|  | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Regional') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|   | ||||
| @@ -784,7 +784,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -793,16 +797,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -827,7 +826,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total_durasi_response = 0 | ||||
|       count_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_response / total_durasi_response | ||||
|       options.totalValue = isFinite(count_durasi_response / total_durasi_response) | ||||
|         ? 0 | ||||
|         : count_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_response / total_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -852,7 +855,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_recovery / total_durasi_recovery | ||||
|       options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery) | ||||
|         ? 0 | ||||
|         : count_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_recovery / total_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1050,7 +1050,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1059,16 +1063,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1093,7 +1092,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total_durasi_response = 0 | ||||
|       count_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_response / total_durasi_response | ||||
|       options.totalValue = isFinite(count_durasi_response / total_durasi_response) | ||||
|         ? 0 | ||||
|         : count_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_response / total_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1118,7 +1121,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_recovery / total_durasi_recovery | ||||
|       options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery) | ||||
|         ? 0 | ||||
|         : count_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_recovery / total_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1320,7 +1320,13 @@ const filterData = async (params: any) => { | ||||
|  | ||||
|   if (uid?.id != 0) { | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Semua Unit' || item.caption == 'Regional') { | ||||
|       if (item.caption == 'Semua Unit') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|  | ||||
|     groupList.forEach((item, index) => { | ||||
|       if (item.caption == 'Regional') { | ||||
|         groupList.splice(index, 1) | ||||
|       } | ||||
|     }) | ||||
|   | ||||
| @@ -1038,7 +1038,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1047,16 +1051,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1081,7 +1080,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total_durasi_response = 0 | ||||
|       count_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_response / total_durasi_response | ||||
|       options.totalValue = isFinite(count_durasi_response / total_durasi_response) | ||||
|         ? 0 | ||||
|         : count_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_response / total_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1106,7 +1109,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_recovery / total_durasi_recovery | ||||
|       options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery) | ||||
|         ? 0 | ||||
|         : count_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_recovery / total_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1054,7 +1054,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1063,16 +1067,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1097,7 +1096,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total_durasi_response = 0 | ||||
|       count_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_response / total_durasi_response | ||||
|       options.totalValue = isFinite(count_durasi_response / total_durasi_response) | ||||
|         ? 0 | ||||
|         : count_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_response / total_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1122,7 +1125,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_recovery / total_durasi_recovery | ||||
|       options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery) | ||||
|         ? 0 | ||||
|         : count_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_recovery / total_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -829,6 +829,7 @@ import { | ||||
|   exportDetailToDOCX | ||||
| } from '@/report/Gangguan/Rekap/RGangguan_PerTanggal' | ||||
| import BufferDialog from '@/components/Dialogs/BufferDialog.vue' | ||||
| import { reformatDate } from '@/utils/texts' | ||||
|  | ||||
| const client = apolloClient() | ||||
| provideApolloClient(client) | ||||
| @@ -871,12 +872,8 @@ const getDetail = async () => { | ||||
|   const ref = dataSelected.value | ||||
|  | ||||
|   const 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), | ||||
|     dateFrom: ref?.tanggal ? reformatDate(ref?.tanggal, 'yyyy/MM/dd', 'yyyy-MM-dd') : '', | ||||
|     dateTo: ref?.tanggal ? reformatDate(ref?.tanggal, 'yyyy/MM/dd', 'yyyy-MM-dd') : '', | ||||
|     posko: ref?.id_posko ? ref?.id_posko : 0, | ||||
|     idUid: ref?.id_uid ? ref?.id_uid : 0, | ||||
|     idUp3: ref?.id_up3 ? ref?.id_up3 : 0, | ||||
| @@ -885,7 +882,7 @@ const getDetail = async () => { | ||||
|     namaRegional: ref?.nama_regional ? ref?.nama_regional : '', | ||||
|     media: ref?.media ? ref?.media : '', | ||||
|     isSelesai: progressSelected.value, | ||||
|     tanggal: '' | ||||
|     tanggal: ref?.tanggal ? reformatDate(ref?.tanggal, 'yyyy/MM/dd', 'yyyy-MM-dd') : '' | ||||
|   } | ||||
|  | ||||
|   loadingSubData.value = true | ||||
| @@ -1041,15 +1038,36 @@ const filterData = async (params: any) => { | ||||
|   } | ||||
|  | ||||
|   loadingData.value = true | ||||
|   await requestGraphQl(queries.gangguan.rekap.gangguanPerTanggal, query) | ||||
|   await requestGraphQl( | ||||
|     isGroupBy.value | ||||
|       ? grouping.value[0].data == 'nama_uid' | ||||
|         ? queries.gangguan.rekap.gangguanPerTanggalUID | ||||
|         : grouping.value[0].data == 'nama_up3' | ||||
|           ? queries.gangguan.rekap.gangguanPerTanggalUP3 | ||||
|           : queries.gangguan.rekap.gangguanPerTanggalPosko | ||||
|       : queries.gangguan.rekap.gangguanPerTanggal, | ||||
|     query | ||||
|   ) | ||||
|     .then((result) => { | ||||
|       if (result.data.data != undefined) { | ||||
|         if (grouping.value.length > 0 && grouping.value[0].data != '') { | ||||
|           data.value = [...result.data.data.rekapitulasiGangguanPerTanggal].sort((a, b) => | ||||
|             a[grouping.value[0].data].localeCompare(b[grouping.value[0].data]) | ||||
|           ) | ||||
|           data.value = [ | ||||
|             ...(isGroupBy.value | ||||
|               ? grouping.value[0].data == 'nama_uid' | ||||
|                 ? result.data.data.rekapitulasiGangguanPerTanggalUid | ||||
|                 : grouping.value[0].data == 'nama_up3' | ||||
|                   ? result.data.data.rekapitulasiGangguanPerTanggalUp3 | ||||
|                   : result.data.data.rekapitulasiGangguanPerTanggalPosko | ||||
|               : result.data.data.rekapitulasiGangguanPerTanggal) | ||||
|           ].sort((a, b) => a[grouping.value[0].data].localeCompare(b[grouping.value[0].data])) | ||||
|         } else { | ||||
|           data.value = result.data.data.rekapitulasiGangguanPerTanggal | ||||
|           data.value = isGroupBy.value | ||||
|             ? grouping.value[0].data == 'nama_uid' | ||||
|               ? result.data.data.rekapitulasiGangguanPerTanggalUid | ||||
|               : grouping.value[0].data == 'nama_up3' | ||||
|                 ? result.data.data.rekapitulasiGangguanPerTanggalUp3 | ||||
|                 : result.data.data.rekapitulasiGangguanPerTanggalPosko | ||||
|             : result.data.data.rekapitulasiGangguanPerTanggal | ||||
|         } | ||||
|       } else { | ||||
|         data.value = [] | ||||
| @@ -1110,7 +1128,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_selesai / total) | ||||
|         ? 0 | ||||
|         : total_selesai == 0 | ||||
|           ? 0 | ||||
|           : (total_selesai / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1119,16 +1141,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total = 0 | ||||
|       total_inproses = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if (options.name === 'persen_selesai') { | ||||
|     if (options.summaryProcess === 'start') { | ||||
|       total = 0 | ||||
|       total_selesai = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = (total_selesai / total) * 100 | ||||
|       options.totalValue = isFinite(total_inproses / total) | ||||
|         ? 0 | ||||
|         : total_inproses == 0 | ||||
|           ? 0 | ||||
|           : (total_inproses / total) * 100 | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1153,7 +1170,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       total_durasi_response = 0 | ||||
|       count_durasi_response = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_response / total_durasi_response | ||||
|       options.totalValue = isFinite(count_durasi_response / total_durasi_response) | ||||
|         ? 0 | ||||
|         : count_durasi_response == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_response / total_durasi_response | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @@ -1178,7 +1199,11 @@ const calculateCustomSummary = (options: any) => { | ||||
|       count_durasi_recovery = 0 | ||||
|       total_durasi_recovery = 0 | ||||
|     } else if (options.summaryProcess === 'finalize') { | ||||
|       options.totalValue = count_durasi_recovery / total_durasi_recovery | ||||
|       options.totalValue = isFinite(count_durasi_recovery / total_durasi_recovery) | ||||
|         ? 0 | ||||
|         : count_durasi_recovery == 0 | ||||
|           ? 0 | ||||
|           : count_durasi_recovery / total_durasi_recovery | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user