done delete row on list laporan tindakan
This commit is contained in:
No files matched your search
@@ -35,8 +35,9 @@ export const config: Config = {
|
|||||||
keys: ['reportAt', 'dpjp', 'operator', 'operationAt', 'operationType', 'billing', 'system', 'action'],
|
keys: ['reportAt', 'dpjp', 'operator', 'operationAt', 'operationType', 'billing', 'system', 'action'],
|
||||||
|
|
||||||
delKeyNames: [
|
delKeyNames: [
|
||||||
{ key: 'code', label: 'Kode' },
|
{ key: 'id', label: 'ID' },
|
||||||
{ key: 'name', label: 'Nama' },
|
{ key: 'dokter', label: 'Dokter' },
|
||||||
|
{ key: 'reportAt', label: 'Tanggal Laporan' },
|
||||||
],
|
],
|
||||||
|
|
||||||
parses: {
|
parses: {
|
||||||
|
|||||||
@@ -3,17 +3,22 @@
|
|||||||
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
import Dialog from '~/components/pub/my-ui/modal/dialog.vue'
|
||||||
import AppTreatmentReportList from '~/components/app/treatment-report/list.vue'
|
import AppTreatmentReportList from '~/components/app/treatment-report/list.vue'
|
||||||
import AppTreatmentReportListHistory from '~/components/app/treatment-report/list-history.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'
|
import { ButtonAction } from '~/components/pub/my-ui/form'
|
||||||
|
|
||||||
|
// config
|
||||||
|
import { config } from '~/components/app/treatment-report/list.cfg'
|
||||||
|
|
||||||
// types
|
// types
|
||||||
import { ActionEvents } from '~/components/pub/my-ui/data/types'
|
import { ActionEvents } from '~/components/pub/my-ui/data/types'
|
||||||
|
import type { Encounter } from '~/models/encounter'
|
||||||
|
|
||||||
// Samples
|
// Samples
|
||||||
import { sampleRows, type TreatmentReportData } from '~/components/app/treatment-report/sample'
|
import { sampleRows, type TreatmentReportData } from '~/components/app/treatment-report/sample'
|
||||||
import sampleReport from './sample'
|
import sampleReport from './sample'
|
||||||
|
|
||||||
// Models
|
// helpers
|
||||||
import type { Encounter } from '~/models/encounter'
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -108,7 +113,6 @@ watch([recId, recAction], (newVal) => {
|
|||||||
// Guard: jangan proses jika id = 0 atau action kosong
|
// Guard: jangan proses jika id = 0 atau action kosong
|
||||||
if (!id || !action) return
|
if (!id || !action) return
|
||||||
|
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ActionEvents.showDetail:
|
case ActionEvents.showDetail:
|
||||||
// onGetDetail(recId.value)
|
// onGetDetail(recId.value)
|
||||||
@@ -238,4 +242,35 @@ watch([recId, recAction], (newVal) => {
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</Dialog>
|
</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>
|
</template>
|
||||||
Reference in New Issue
Block a user