Refactor table cell templates in RGangguan_AlihPosko.vue
This commit is contained in:
parent
7770a3e114
commit
ef01593dea
@ -79,7 +79,7 @@
|
|||||||
data-field="posko_in"
|
data-field="posko_in"
|
||||||
caption="Posko IN"
|
caption="Posko IN"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatNumber"
|
cell-template="formatNumberPoskoIn"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="180"
|
:width="180"
|
||||||
@ -87,7 +87,7 @@
|
|||||||
data-field="posko_out"
|
data-field="posko_out"
|
||||||
caption="Posko OUT"
|
caption="Posko OUT"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatNumber"
|
cell-template="formatNumberPoskoOut"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DxSummary>
|
<DxSummary>
|
||||||
@ -96,6 +96,7 @@
|
|||||||
column="number"
|
column="number"
|
||||||
display-format="Total"
|
display-format="Total"
|
||||||
css-class="!text-left"
|
css-class="!text-left"
|
||||||
|
:customize-text="(e: any) => formatNumber(e.value)"
|
||||||
/>
|
/>
|
||||||
<DxGroupItem
|
<DxGroupItem
|
||||||
:show-in-group-footer="true"
|
:show-in-group-footer="true"
|
||||||
@ -103,6 +104,7 @@
|
|||||||
summary-type="sum"
|
summary-type="sum"
|
||||||
display-format="{0}"
|
display-format="{0}"
|
||||||
css-class="!text-right"
|
css-class="!text-right"
|
||||||
|
:customize-text="(e: any) => formatNumber(e.value)"
|
||||||
/>
|
/>
|
||||||
<DxGroupItem
|
<DxGroupItem
|
||||||
:show-in-group-footer="true"
|
:show-in-group-footer="true"
|
||||||
@ -110,17 +112,42 @@
|
|||||||
summary-type="sum"
|
summary-type="sum"
|
||||||
display-format="{0}"
|
display-format="{0}"
|
||||||
css-class="!text-right"
|
css-class="!text-right"
|
||||||
|
:customize-text="(e: any) => formatNumber(e.value)"
|
||||||
/>
|
/>
|
||||||
</DxSummary>
|
</DxSummary>
|
||||||
|
|
||||||
<template #formatText="{ data }">
|
<template #formatText="{ data }">
|
||||||
<p class="text-left cursor-pointer">
|
<p class="text-left cursor-pointer" @click="setPoskoSelected('')">
|
||||||
{{ 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="setPoskoSelected('')">
|
||||||
|
{{
|
||||||
|
isNumber(data.text)
|
||||||
|
? data.column.caption == '%'
|
||||||
|
? formatPercentage(data.text)
|
||||||
|
: formatNumber(data.text)
|
||||||
|
: data.text
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #formatNumberPoskoIn="{ data }">
|
||||||
|
<p class="text-right cursor-pointer" @click="setPoskoSelected('lama')">
|
||||||
|
{{
|
||||||
|
isNumber(data.text)
|
||||||
|
? data.column.caption == '%'
|
||||||
|
? formatPercentage(data.text)
|
||||||
|
: formatNumber(data.text)
|
||||||
|
: data.text
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #formatNumberPoskoOut="{ data }">
|
||||||
|
<p class="text-right cursor-pointer" @click="setPoskoSelected('baru')">
|
||||||
{{
|
{{
|
||||||
isNumber(data.text)
|
isNumber(data.text)
|
||||||
? data.column.caption == '%'
|
? data.column.caption == '%'
|
||||||
@ -522,13 +549,17 @@ const reportMeta = ref({
|
|||||||
posko: { id: 0, name: 'Semua Posko' },
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
const poskoSelected = ref('')
|
||||||
|
const setPoskoSelected = (value: string) => {
|
||||||
|
poskoSelected.value = value
|
||||||
|
}
|
||||||
|
|
||||||
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 ')
|
||||||
const ref = dataSelected.value
|
const ref = dataSelected.value
|
||||||
|
|
||||||
const query = {
|
var query: any = {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -537,8 +568,8 @@ const getDetail = async () => {
|
|||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
idUid: ref.id_uid,
|
idUid: ref.id_uid,
|
||||||
idUp3: ref.id_up3,
|
idUp3: ref.id_up3,
|
||||||
idPoskoLama: ref.id_posko_lama,
|
idPoskoLama: poskoSelected.value == 'baru' ? 0 : ref.id_posko_baru,
|
||||||
idPoskoBaru: ref.id_posko_baru
|
idPoskoBaru: poskoSelected.value == 'lama' ? 0 : ref.id_posko_lama
|
||||||
}
|
}
|
||||||
|
|
||||||
await requestGraphQl(queries.gangguan.rekap.gangguanAlihPoskoDetail, query)
|
await requestGraphQl(queries.gangguan.rekap.gangguanAlihPoskoDetail, query)
|
||||||
@ -567,9 +598,10 @@ const showDetail = () => {
|
|||||||
clearSelection()
|
clearSelection()
|
||||||
dataSub.value = []
|
dataSub.value = []
|
||||||
dataSubSelected.value = null
|
dataSubSelected.value = null
|
||||||
// dialogDetail.value = true
|
if (poskoSelected.value != '') {
|
||||||
getDetail()
|
getDetail()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
dialogDetail.value = false
|
dialogDetail.value = false
|
||||||
|
@ -1661,16 +1661,16 @@ export const queries = {
|
|||||||
$dateTo: Date!
|
$dateTo: Date!
|
||||||
$idUid: Int!
|
$idUid: Int!
|
||||||
$idUp3: Int!
|
$idUp3: Int!
|
||||||
$idPoskoLama: Int!
|
|
||||||
$idPoskoBaru: Int!
|
$idPoskoBaru: Int!
|
||||||
|
$idPoskoLama: Int!
|
||||||
) {
|
) {
|
||||||
detailGangguanAlihPosko(
|
detailGangguanAlihPosko(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
dateTo: $dateTo
|
dateTo: $dateTo
|
||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
idPoskoLama: $idPoskoLama
|
|
||||||
idPoskoBaru: $idPoskoBaru
|
idPoskoBaru: $idPoskoBaru
|
||||||
|
idPoskoLama: $idPoskoLama
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
nama_regional
|
nama_regional
|
||||||
|
Loading…
x
Reference in New Issue
Block a user