Refactor RKeluhan_PerFungsiBidang.vue to update getDetail function and remove unused variables
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
<div>
|
||||
<DxDataGrid
|
||||
@cell-click=""
|
||||
@cell-click="onCellClicked"
|
||||
ref="dataGridRef"
|
||||
:allow-column-reordering="true"
|
||||
class="max-h-[calc(100vh-140px)] mb-10"
|
||||
@@ -27,7 +27,7 @@
|
||||
column-resizing-mode="widget"
|
||||
>
|
||||
<DxPaging :enabled="false" />
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="rowClick" />
|
||||
<DxGrouping :auto-expand-all="false" :context-menu-enabled="true" expand-mode="" />
|
||||
<DxSelection mode="single" />
|
||||
|
||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||
@@ -66,7 +66,7 @@
|
||||
data-type="number"
|
||||
caption="Total"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberTotal"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="150"
|
||||
@@ -75,7 +75,7 @@
|
||||
data-type="number"
|
||||
caption="Selesai"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberSelesai"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
@@ -93,7 +93,7 @@
|
||||
data-type="number"
|
||||
caption="InProgress"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatNumber"
|
||||
cell-template="formatNumberProgress"
|
||||
/>
|
||||
<DxColumn
|
||||
:width="70"
|
||||
@@ -412,13 +412,49 @@
|
||||
</DxSummary>
|
||||
|
||||
<template #formatTime="{ data }">
|
||||
<p class="cursor-pointer !text-right">
|
||||
<p class="!text-right">
|
||||
{{ parseInt(data.text) ? formatWaktu(data.text) : '-' }}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumber="{ data }">
|
||||
<p class="text-right cursor-pointer">
|
||||
<p class="text-right">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberTotal="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberSelesai="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
? formatPercentage(data.text)
|
||||
: formatNumber(data.text)
|
||||
: data.text
|
||||
}}
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<template #formatNumberProgress="{ data }">
|
||||
<p class="text-right cursor-pointer" @click="setAgreementDialog(data.column.caption)">
|
||||
{{
|
||||
isNumber(data.text)
|
||||
? data.column.caption == '%'
|
||||
@@ -430,7 +466,7 @@
|
||||
</template>
|
||||
|
||||
<template #formatText="{ data }">
|
||||
<p class="cursor-pointer !text-left">
|
||||
<p class="!text-left">
|
||||
{{ data.text }}
|
||||
</p>
|
||||
</template>
|
||||
@@ -804,6 +840,7 @@ import {
|
||||
exportDetailToDOCX
|
||||
} from '@/report/Keluhan/Rekap/RKeluhan_ALL'
|
||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||
import { getDataRowGroup } from '@/utils/helper'
|
||||
|
||||
const client = apolloClient()
|
||||
provideApolloClient(client)
|
||||
@@ -968,47 +1005,50 @@ const calculateCustomSummary = (options: any) => {
|
||||
|
||||
const onCellClicked = (e: any) => {
|
||||
console.log('cell clicked', e)
|
||||
// console.log('group cell clicked', e.column.caption)
|
||||
// console.log('value', e.values[e.row.groupIndex])
|
||||
if (e.rowType == 'group') {
|
||||
groupDialog.value = true
|
||||
groupIndex.value = e.row.groupIndex
|
||||
|
||||
setAgreementDialog(e.column.caption)
|
||||
if (e.row.groupIndex == 0) {
|
||||
//
|
||||
} else if (e.row.groupIndex == 1) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 2) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0].collapsedItems[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0].items[0]
|
||||
groupData.value = data
|
||||
}
|
||||
} else if (e.row.groupIndex == 3) {
|
||||
if (e.row.isExpanded) {
|
||||
const data = e.data.items[0]
|
||||
groupData.value = data
|
||||
} else {
|
||||
const data = e.data.collapsedItems[0]
|
||||
groupData.value = data
|
||||
}
|
||||
}
|
||||
const data = getDataRowGroup(e.data)
|
||||
console.table(data)
|
||||
groupData.value = data
|
||||
showDetail()
|
||||
// if (e.row.groupIndex == 0) {
|
||||
// //
|
||||
// } else if (e.row.groupIndex == 1) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0].collapsedItems[0].items[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0].items[0].items[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// } else if (e.row.groupIndex == 2) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0].collapsedItems[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0].items[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// } else if (e.row.groupIndex == 3) {
|
||||
// if (e.row.isExpanded) {
|
||||
// const data = e.data.items[0]
|
||||
// groupData.value = data
|
||||
// } else {
|
||||
// const data = e.data.collapsedItems[0]
|
||||
// groupData.value = data
|
||||
// }
|
||||
// }
|
||||
// showDetail()
|
||||
} else {
|
||||
groupDialog.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const setAgreementDialog = (column: string) => {
|
||||
if (column == 'Total' || column == 'Selesai' || column == 'In Progress') {
|
||||
if (column == 'Total' || column == 'Selesai' || column == 'InProgress') {
|
||||
agreeToShowDialog.value = true
|
||||
if (column == 'Total') {
|
||||
progressSelected.value = 0
|
||||
|
Reference in New Issue
Block a user