Refactor code to improve readability and fix bugs in Gangguan and Monalisa components
This commit is contained in:
parent
57975f372e
commit
cafced8d76
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eis",
|
"name": "eis",
|
||||||
"version": "0.0.111",
|
"version": "0.0.116",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -325,7 +325,7 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="150"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field=""
|
data-field="pembuat_laporan"
|
||||||
caption="Nama Petugas"
|
caption="Nama Petugas"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
@ -333,7 +333,7 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="150"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field=""
|
data-field="nama_posko_lama"
|
||||||
caption="Posko Asal"
|
caption="Posko Asal"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
@ -341,7 +341,7 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="150"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field=""
|
data-field="nama_posko_baru"
|
||||||
caption="Posko Tujuan"
|
caption="Posko Tujuan"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
@ -477,17 +477,29 @@
|
|||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Nama Petugas:</h3>
|
<h3 class="text-sm font-medium w-[135px] text-gray-800">Nama Petugas:</h3>
|
||||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
<InputText
|
||||||
|
:readonly="true"
|
||||||
|
:value="dataSubSelected?.pembuat_laporan"
|
||||||
|
class-name="flex-1"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko Asal:</h3>
|
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko Asal:</h3>
|
||||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
<InputText
|
||||||
|
:readonly="true"
|
||||||
|
:value="dataSubSelected?.nama_posko_lama"
|
||||||
|
class-name="flex-1"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko Tujuan:</h3>
|
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko Tujuan:</h3>
|
||||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
<InputText
|
||||||
|
:readonly="true"
|
||||||
|
:value="dataSubSelected?.nama_posko_baru"
|
||||||
|
class-name="flex-1"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -334,13 +334,13 @@
|
|||||||
</DxColumn>
|
</DxColumn>
|
||||||
|
|
||||||
<template #formatText="{ data }">
|
<template #formatText="{ data }">
|
||||||
<p class="text-left cursor-pointer">
|
<p class="text-left" @click="setAgreementDialog(data.column.caption)">
|
||||||
{{ data.text }}
|
{{ data.text }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatNumber="{ data }">
|
<template #formatNumber="{ data }">
|
||||||
<p class="text-right cursor-pointer">
|
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||||
{{
|
{{
|
||||||
isNumber(data.text)
|
isNumber(data.text)
|
||||||
? data.column.caption == '%'
|
? data.column.caption == '%'
|
||||||
@ -352,13 +352,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatPercentage="{ data }">
|
<template #formatPercentage="{ data }">
|
||||||
<p class="text-right cursor-pointer">
|
<p class="text-right" @click="setAgreementDialog(data.column.caption)">
|
||||||
{{ parseFloat(data.text) ? formatPercentage(data.text) : '0%' }}
|
{{ parseFloat(data.text) ? formatPercentage(data.text) : '0%' }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #formatTime="{ data }">
|
<template #formatTime="{ data }">
|
||||||
<p class="!text-right cursor-pointer">
|
<p class="!text-right" @click="setAgreementDialog(data.column.caption)">
|
||||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||||
</p>
|
</p>
|
||||||
</template>
|
</template>
|
||||||
@ -796,6 +796,8 @@ const dataSubSelected = ref<any>()
|
|||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const loadingData = ref(false)
|
const loadingData = ref(false)
|
||||||
const loadingSubData = ref(false)
|
const loadingSubData = ref(false)
|
||||||
|
const progressSelected = ref(0)
|
||||||
|
const agreeToShowDialog = ref(false)
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
@ -803,6 +805,21 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const setAgreementDialog = (column: string) => {
|
||||||
|
if (column == 'd=(e+g)' || column == 'e' || column == 'g') {
|
||||||
|
agreeToShowDialog.value = true
|
||||||
|
if (column == 'd=(e+g)') {
|
||||||
|
progressSelected.value = 0
|
||||||
|
} else if (column == 'e') {
|
||||||
|
progressSelected.value = 1
|
||||||
|
} else {
|
||||||
|
progressSelected.value = 2
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
agreeToShowDialog.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
loadingSubData.value = true
|
loadingSubData.value = true
|
||||||
const dateValue = filters.value.periode.split(' s/d ')
|
const dateValue = filters.value.periode.split(' s/d ')
|
||||||
@ -819,7 +836,8 @@ const getDetail = async () => {
|
|||||||
posko: posko ? posko.id : 0,
|
posko: posko ? posko.id : 0,
|
||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0,
|
idUp3: up3 ? up3.id : 0,
|
||||||
idRegu: ref.id_regu
|
idRegu: ref?.id_regu ? ref.id_regu : 0,
|
||||||
|
isSelesai: progressSelected.value
|
||||||
}
|
}
|
||||||
|
|
||||||
await requestGraphQl(queries.gangguan.rekap.gangguanDiselesaikanMobileAPKTDetail, query)
|
await requestGraphQl(queries.gangguan.rekap.gangguanDiselesaikanMobileAPKTDetail, query)
|
||||||
@ -846,10 +864,11 @@ const clearSelection = () => {
|
|||||||
}
|
}
|
||||||
const showDetail = () => {
|
const showDetail = () => {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
dataSub.value = []
|
if (agreeToShowDialog.value) {
|
||||||
dataSubSelected.value = null
|
dataSub.value = []
|
||||||
// dialogDetail.value = true
|
dataSubSelected.value = null
|
||||||
getDetail()
|
getDetail()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
|
@ -1724,6 +1724,7 @@ export const queries = {
|
|||||||
$is_cleansing_transaksi_tm: Int!
|
$is_cleansing_transaksi_tm: Int!
|
||||||
$is_koreksi_transaksi_tm: Int!
|
$is_koreksi_transaksi_tm: Int!
|
||||||
$is_koreksi_gangguan_dan_anev: Int!
|
$is_koreksi_gangguan_dan_anev: Int!
|
||||||
|
$namaRegional: String
|
||||||
) {
|
) {
|
||||||
detailGangguanKoreksiTransaksiIndividu(
|
detailGangguanKoreksiTransaksiIndividu(
|
||||||
bulan: $bulan
|
bulan: $bulan
|
||||||
@ -1737,6 +1738,7 @@ export const queries = {
|
|||||||
is_cleansing_transaksi_tm: $is_cleansing_transaksi_tm
|
is_cleansing_transaksi_tm: $is_cleansing_transaksi_tm
|
||||||
is_koreksi_transaksi_tm: $is_koreksi_transaksi_tm
|
is_koreksi_transaksi_tm: $is_koreksi_transaksi_tm
|
||||||
is_koreksi_gangguan_dan_anev: $is_koreksi_gangguan_dan_anev
|
is_koreksi_gangguan_dan_anev: $is_koreksi_gangguan_dan_anev
|
||||||
|
namaRegional: $namaRegional
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
no_laporan
|
no_laporan
|
||||||
@ -1960,6 +1962,7 @@ export const queries = {
|
|||||||
$idUid: Int!
|
$idUid: Int!
|
||||||
$idUp3: Int!
|
$idUp3: Int!
|
||||||
$idRegu: Int!
|
$idRegu: Int!
|
||||||
|
$isSelesai: Int!
|
||||||
) {
|
) {
|
||||||
detailGangguanDiselesaikanMobileApkt(
|
detailGangguanDiselesaikanMobileApkt(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
@ -1968,6 +1971,7 @@ export const queries = {
|
|||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
idRegu: $idRegu
|
idRegu: $idRegu
|
||||||
|
isSelesai: $isSelesai
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
nama_regional
|
nama_regional
|
||||||
@ -2331,6 +2335,8 @@ export const queries = {
|
|||||||
no_telp_pelapor
|
no_telp_pelapor
|
||||||
keterangan_pelapor
|
keterangan_pelapor
|
||||||
media
|
media
|
||||||
|
nama_posko_baru
|
||||||
|
nama_posko_lama
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user