update detail dialog alih posko, berdasarkan media
This commit is contained in:
parent
f4bb7652d3
commit
51db0e9548
@ -31,8 +31,7 @@
|
||||
:show-indicator="showIndicator"
|
||||
:show-pane="showPane"
|
||||
:shading="shading"
|
||||
v-if="loading"
|
||||
v-model:visible="loading"
|
||||
v-model:visible="loadingData"
|
||||
:enabled="true"
|
||||
/>
|
||||
|
||||
@ -198,7 +197,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="no_laporan"
|
||||
caption="No Laporan"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -206,7 +205,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_lapor"
|
||||
caption="Tgl Lapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -214,7 +213,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_response"
|
||||
caption="Tgl Datang"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -222,7 +221,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_recovery"
|
||||
caption="Tgl Nyala"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -230,7 +229,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
@ -238,7 +237,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
@ -246,7 +245,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="status_akhir"
|
||||
caption="Status"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -254,7 +253,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="idpel_nometer"
|
||||
caption="IDPEL/NO METER"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -262,7 +261,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="nama_pelapor"
|
||||
caption="Nama Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -270,7 +269,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="alamat_pelapor"
|
||||
caption="Alamat Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -278,7 +277,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="no_telp_pelapor"
|
||||
caption="No Telp Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -286,7 +285,7 @@
|
||||
<DxColumn
|
||||
:width="200"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="keterangan_pelapor"
|
||||
caption="Keterangan Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -294,7 +293,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -355,68 +354,104 @@
|
||||
<div class="w-full mb-4 lg:w-[30%] lg:float-right">
|
||||
<div class="p-4 space-y-2 bg-white rounded-xl">
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Lapor:</h3>
|
||||
<InputText :readonly="true" :value="dataSubSelected?.waktu_lapor" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Lapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.waktu_lapor" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Datang:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.waktu_response"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Nyala:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.waktu_recovery"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Response Time:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataSubSelected?.durasi_response_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_response_time)
|
||||
: '-'
|
||||
"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Recovery Time:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataSubSelected?.durasi_recovery_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_recovery_time)
|
||||
: '-'
|
||||
"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Status:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.status_akhir" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">IDPEL/NO METER:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.idpel_nometer" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Nama Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.nama_pelapor" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Alamat Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.alamat_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Telp Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.no_telp_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Keterangan Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.keterangan_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.nama_posko" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
@ -446,7 +481,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -473,7 +508,11 @@ import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||
import InputText from '@/components/InputText.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
const position = { of: '#data' }
|
||||
const showIndicator = ref(true)
|
||||
const shading = ref(true)
|
||||
@ -483,10 +522,55 @@ const dataSub = ref<any[]>([])
|
||||
const dataSelected = ref<any>()
|
||||
const dataSubSelected = ref<any>()
|
||||
const dialogDetail = ref(false)
|
||||
const loadingData = ref(false)
|
||||
const loadingSubData = ref(false)
|
||||
|
||||
const getDetail = () => {
|
||||
loadingSubData.value = true
|
||||
const dateValue = filters.value.periode.split(' s/d ')
|
||||
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),
|
||||
posko: ref.id_posko,
|
||||
idUid: ref.id_uid,
|
||||
idUp3: ref.id_up3
|
||||
}
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(
|
||||
queries.gangguan.rekap.gangguanAllDetail,
|
||||
query
|
||||
)
|
||||
|
||||
refetch(query)
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
dataSub.value = queryResult.data.detailGangguan
|
||||
}
|
||||
})
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingSubData.value = value
|
||||
})
|
||||
}
|
||||
|
||||
const showDetail = () => {
|
||||
if (dataSelected.value != null) {
|
||||
dataSub.value = []
|
||||
dataSubSelected.value = null
|
||||
dialogDetail.value = true
|
||||
getDetail()
|
||||
}
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
@ -524,7 +608,7 @@ const onExporting = (e: any) => {
|
||||
|
||||
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
dataSelected.value = selectedRowsData[0]
|
||||
console.log(data)
|
||||
showDetail()
|
||||
}
|
||||
|
||||
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
@ -532,18 +616,13 @@ const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.gangguanAlihPosko, {
|
||||
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
posko: 0,
|
||||
idUid: 0,
|
||||
idUp3: 0
|
||||
})
|
||||
|
||||
const filterData = (params: any) => {
|
||||
const dateValue = params.periode.split(' s/d ')
|
||||
const { posko, uid, up3 } = params
|
||||
refetch({
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(
|
||||
queries.gangguan.rekap.gangguanAlihPosko,
|
||||
{
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
@ -553,7 +632,8 @@ const filterData = (params: any) => {
|
||||
posko: posko ? posko.id : 0,
|
||||
idUid: uid ? uid.id : 0,
|
||||
idUp3: up3 ? up3.id : 0
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
@ -563,9 +643,14 @@ const filterData = (params: any) => {
|
||||
console.log(queryResult.loading)
|
||||
console.log(queryResult.networkStatus)
|
||||
})
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingData.value = value
|
||||
})
|
||||
}
|
||||
|
||||
const filters = ref()
|
||||
|
@ -31,8 +31,7 @@
|
||||
:show-indicator="showIndicator"
|
||||
:show-pane="showPane"
|
||||
:shading="shading"
|
||||
v-if="loading"
|
||||
v-model:visible="loading"
|
||||
v-model:visible="loadingData"
|
||||
:enabled="true"
|
||||
/>
|
||||
|
||||
@ -192,7 +191,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="no_laporan"
|
||||
caption="No Laporan"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -200,7 +199,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_lapor"
|
||||
caption="Tgl Lapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -208,7 +207,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_response"
|
||||
caption="Tgl Datang"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -216,7 +215,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="waktu_recovery"
|
||||
caption="Tgl Nyala"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -224,7 +223,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="durasi_response_time"
|
||||
caption="Durasi Response Time"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
@ -232,7 +231,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="durasi_recovery_time"
|
||||
caption="Durasi Recovery Time"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatTime"
|
||||
@ -240,7 +239,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="status_akhir"
|
||||
caption="Status"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -248,7 +247,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="referensi_marking"
|
||||
caption="Referensi Marking"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -256,7 +255,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="idpel_nometer"
|
||||
caption="IDPEL/NO METER"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -264,7 +263,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="nama_pelapor"
|
||||
caption="Nama Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -272,7 +271,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="alamat_pelapor"
|
||||
caption="Alamat Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -280,7 +279,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="no_telp_pelapor"
|
||||
caption="No Telp Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -288,7 +287,7 @@
|
||||
<DxColumn
|
||||
:width="200"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="keterangan_pelapor"
|
||||
caption="Keterangan Pelapor"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -296,7 +295,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="nama_posko"
|
||||
caption="Posko"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -304,7 +303,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="tindakan"
|
||||
caption="Tidakan"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -312,7 +311,7 @@
|
||||
<DxColumn
|
||||
:width="150"
|
||||
alignment="center"
|
||||
data-field=""
|
||||
data-field="penyebab"
|
||||
caption="Penyebab"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatText"
|
||||
@ -342,82 +341,122 @@
|
||||
<div class="p-4 space-y-2 bg-white rounded-xl">
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.no_laporan" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Lapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.waktu_lapor" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Datang:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.waktu_response"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tgl Nyala:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.waktu_recovery"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Response Time:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataSubSelected?.durasi_response_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_response_time)
|
||||
: '-'
|
||||
"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Durasi Recovery Time:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="
|
||||
parseInt(dataSubSelected?.durasi_recovery_time)
|
||||
? formatWaktu(dataSubSelected?.durasi_recovery_time)
|
||||
: '-'
|
||||
"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Status:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.status_akhir" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Referensi Marking:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.referensi_marking"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">IDPEL/NO METER:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.idpel_nometer" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Nama Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.nama_pelapor" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Alamat Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.alamat_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Telp Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.no_telp_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Keterangan Pelapor:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText
|
||||
:readonly="true"
|
||||
:value="dataSubSelected?.keterangan_pelapor"
|
||||
class-name="flex-1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Posko:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.nama_posko" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Tindakan:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.tindakan" class-name="flex-1" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">Penyeban:</h3>
|
||||
<InputText :readonly="true" value="" class-name="flex-1" />
|
||||
<InputText :readonly="true" :value="dataSubSelected?.penyebab" class-name="flex-1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -427,7 +466,7 @@
|
||||
<script setup lang="ts">
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
import {
|
||||
DxColumn,
|
||||
@ -454,7 +493,11 @@ import { dummyData } from '@/utils/dummy'
|
||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||
import InputText from '@/components/InputText.vue'
|
||||
import { apolloClient } from '@/utils/api/api.graphql'
|
||||
import { provideApolloClient } from '@vue/apollo-composable'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
const position = { of: '#data' }
|
||||
const showIndicator = ref(true)
|
||||
const shading = ref(true)
|
||||
@ -464,10 +507,55 @@ const dataSub = ref<any[]>([])
|
||||
const dataSelected = ref<any>()
|
||||
const dataSubSelected = ref<any>()
|
||||
const dialogDetail = ref(false)
|
||||
const loadingData = ref(false)
|
||||
const loadingSubData = ref(false)
|
||||
|
||||
const getDetail = () => {
|
||||
loadingSubData.value = true
|
||||
const dateValue = filters.value.periode.split(' s/d ')
|
||||
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),
|
||||
posko: ref.id_posko,
|
||||
idUid: ref.id_uid,
|
||||
idUp3: ref.id_up3
|
||||
}
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(
|
||||
queries.gangguan.rekap.gangguanAllDetail,
|
||||
query
|
||||
)
|
||||
|
||||
refetch(query)
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
dataSub.value = queryResult.data.detailGangguan
|
||||
}
|
||||
})
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingSubData.value = value
|
||||
})
|
||||
}
|
||||
|
||||
const showDetail = () => {
|
||||
if (dataSelected.value != null) {
|
||||
dataSub.value = []
|
||||
dataSubSelected.value = null
|
||||
dialogDetail.value = true
|
||||
getDetail()
|
||||
}
|
||||
}
|
||||
|
||||
const closeDialog = () => {
|
||||
@ -505,7 +593,7 @@ const onExporting = (e: any) => {
|
||||
|
||||
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
dataSelected.value = selectedRowsData[0]
|
||||
console.log(data)
|
||||
showDetail()
|
||||
}
|
||||
|
||||
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
@ -513,18 +601,13 @@ const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||
console.log(data)
|
||||
}
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(queries.gangguan.rekap.berdasarkanMedia, {
|
||||
dateFrom: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
dateTo: new Date('2023-10-01').toISOString().slice(0, 10),
|
||||
posko: 0,
|
||||
idUid: 0,
|
||||
idUp3: 0
|
||||
})
|
||||
|
||||
const filterData = (params: any) => {
|
||||
const dateValue = params.periode.split(' s/d ')
|
||||
const { posko, uid, up3 } = params
|
||||
refetch({
|
||||
|
||||
const { onResult, onError, loading, refetch } = useQuery(
|
||||
queries.gangguan.rekap.berdasarkanMedia,
|
||||
{
|
||||
dateFrom: dateValue[0]
|
||||
? dateValue[0].split('-').reverse().join('-')
|
||||
: new Date().toISOString().slice(0, 10),
|
||||
@ -534,7 +617,8 @@ const filterData = (params: any) => {
|
||||
posko: posko ? posko.id : 0,
|
||||
idUid: uid ? uid.id : 0,
|
||||
idUp3: up3 ? up3.id : 0
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
onResult((queryResult) => {
|
||||
if (queryResult.data != undefined) {
|
||||
@ -544,9 +628,14 @@ const filterData = (params: any) => {
|
||||
console.log(queryResult.loading)
|
||||
console.log(queryResult.networkStatus)
|
||||
})
|
||||
|
||||
onError((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
watch(loading, (value) => {
|
||||
loadingData.value = value
|
||||
})
|
||||
}
|
||||
|
||||
const filters = ref()
|
||||
|
Loading…
x
Reference in New Issue
Block a user