Refactor RKeluhan_PerFungsiBidang.vue to update getDetail function and remove unused variables
This commit is contained in:
@@ -47,36 +47,15 @@
|
||||
cell-template="formatText"
|
||||
/>
|
||||
<DxColumn
|
||||
v-if="grouping.length > 0"
|
||||
v-for="(group, index) in grouping"
|
||||
:width="150"
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="nama_regional"
|
||||
caption="Regional"
|
||||
:data-field="group.data"
|
||||
:caption="group.caption"
|
||||
css-class="custom-table-column"
|
||||
:group-index="0"
|
||||
name="namaRegional"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_uid"
|
||||
caption="UID"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_uid"
|
||||
/>
|
||||
<DxColumn
|
||||
alignment="center"
|
||||
:min-width="170"
|
||||
data-type="text"
|
||||
data-field="id_up3"
|
||||
caption="UP3"
|
||||
css-class="custom-table-column"
|
||||
:group-index="1"
|
||||
name="namaUID"
|
||||
:calculate-group-value="(rowData: any) => rowData.nama_up3"
|
||||
cell-template="formatText"
|
||||
:group-index="index"
|
||||
/>
|
||||
<DxColumn alignment="center" caption="Tahun" css-class="custom-table-column">
|
||||
<DxColumn
|
||||
@@ -104,7 +83,7 @@
|
||||
data-type="number"
|
||||
caption="Total"
|
||||
css-class="custom-table-column"
|
||||
cell-template="formatPercentage"
|
||||
cell-template="formatNumber"
|
||||
/>
|
||||
</DxColumn>
|
||||
|
||||
@@ -515,7 +494,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import Filters from '@/components/Form/Filters.vue'
|
||||
import Type2 from '@/components/Form/FiltersType/Type2.vue'
|
||||
import { DxDataGrid } from 'devextreme-vue'
|
||||
@@ -525,7 +504,6 @@ import {
|
||||
DxExport,
|
||||
DxGroupItem,
|
||||
DxGrouping,
|
||||
DxLoadPanel,
|
||||
DxPager,
|
||||
DxPaging,
|
||||
DxScrolling,
|
||||
@@ -579,6 +557,21 @@ const reportMeta = ref({
|
||||
periode: ''
|
||||
})
|
||||
|
||||
const grouping = ref<any[]>([
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
])
|
||||
|
||||
const onExporting = (e: any) => {
|
||||
if (e.format === 'pdf') {
|
||||
exportToPDF(reportMeta.value, data.value)
|
||||
@@ -661,6 +654,46 @@ const filterData = async (params: any) => {
|
||||
resetData()
|
||||
const { regional, ulp, uid, up3, bulan, tahun } = params
|
||||
|
||||
var groupList: any[] = [
|
||||
{
|
||||
data: 'nama_regional',
|
||||
caption: 'Regional'
|
||||
},
|
||||
{
|
||||
data: 'nama_uid',
|
||||
caption: 'UID'
|
||||
},
|
||||
{
|
||||
data: 'nama_up3',
|
||||
caption: 'UP3'
|
||||
}
|
||||
]
|
||||
|
||||
if (uid?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'Regional') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (up3?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UID') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
|
||||
if (ulp?.id != 0) {
|
||||
groupList.forEach((item, index) => {
|
||||
if (item.caption == 'UP3') {
|
||||
groupList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
grouping.value = groupList
|
||||
|
||||
currentMonth.value = bulan.id
|
||||
currentYear.value = tahun.id
|
||||
lastYear.value = tahun.id - 1
|
||||
|
Reference in New Issue
Block a user