done delete row on list laporan tindakan

This commit is contained in:
Khafid Prayoga
2025-12-02 14:23:22 +07:00
parent dfc25f0048
commit 45e3d60618
2 changed files with 41 additions and 5 deletions
@@ -35,8 +35,9 @@ export const config: Config = {
keys: ['reportAt', 'dpjp', 'operator', 'operationAt', 'operationType', 'billing', 'system', 'action'],
delKeyNames: [
{ key: 'code', label: 'Kode' },
{ key: 'name', label: 'Nama' },
{ key: 'id', label: 'ID' },
{ key: 'dokter', label: 'Dokter' },
{ key: 'reportAt', label: 'Tanggal Laporan' },
],
parses: {
@@ -3,17 +3,22 @@
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
import AppTreatmentReportList from '~/components/app/treatment-report/list.vue'
import AppTreatmentReportListHistory from '~/components/app/treatment-report/list-history.vue'
import RecordConfirmation from '~/components/pub/my-ui/confirmation/record-confirmation.vue'
import { ButtonAction } from '~/components/pub/my-ui/form'
// config
import { config } from '~/components/app/treatment-report/list.cfg'
// types
import { ActionEvents } from '~/components/pub/my-ui/data/types'
import type { Encounter } from '~/models/encounter'
// Samples
import { sampleRows, type TreatmentReportData } from '~/components/app/treatment-report/sample'
import sampleReport from './sample'
// Models
import type { Encounter } from '~/models/encounter'
// helpers
import { toast } from '~/components/pub/ui/toast'
// Props
interface Props {
@@ -108,7 +113,6 @@ watch([recId, recAction], (newVal) => {
// Guard: jangan proses jika id = 0 atau action kosong
if (!id || !action) return
switch (action) {
case ActionEvents.showDetail:
// onGetDetail(recId.value)
@@ -238,4 +242,35 @@ watch([recId, recAction], (newVal) => {
}"
/>
</Dialog>
<RecordConfirmation
v-model:open="isRecordConfirmationOpen"
action="delete"
:record="recItem"
@confirm="
() =>
handleActionRemove(
recItem.id,
() => {
router.go(0)
},
toast,
)
"
@cancel=""
>
<template #default="{ record }">
{{ console.log(JSON.stringify(record)) }}
<div class="space-y-1 text-sm">
<p
v-for="field in config.delKeyNames"
:key="field.key"
:v-if="record?.[field.key]"
>
<span class="font-semibold">{{ field.label }}:</span>
{{ record[field.key] }}
</p>
</div>
</template>
</RecordConfirmation>
</template>