feat(encounter): update ui cancellation + integration
This commit is contained in:
@@ -39,6 +39,13 @@ const linkItems: LinkItem[] = [
|
||||
},
|
||||
icon: 'i-lucide-circle-x',
|
||||
},
|
||||
{
|
||||
label: 'Hapus',
|
||||
onClick: () => {
|
||||
remove()
|
||||
},
|
||||
icon: 'i-lucide-trash',
|
||||
},
|
||||
]
|
||||
|
||||
function detail() {
|
||||
@@ -64,6 +71,12 @@ function cancel() {
|
||||
recAction.value = ActionEvents.showCancel
|
||||
recItem.value = props.rec
|
||||
}
|
||||
|
||||
function remove() {
|
||||
recId.value = props.rec.id || 0
|
||||
recAction.value = ActionEvents.showConfirmDelete
|
||||
recItem.value = props.rec
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -117,7 +117,7 @@ async function getPatientList() {
|
||||
|
||||
// Handle confirmation result
|
||||
async function handleConfirmCancel(record: any, action: string) {
|
||||
if (action === 'delete' && record?.id) {
|
||||
if (action === 'deactivate' && record?.id) {
|
||||
try {
|
||||
const result = await cancelEncounter(record.id)
|
||||
if (result.success) {
|
||||
@@ -287,14 +287,15 @@ onMounted(() => {
|
||||
<!-- Record Confirmation Modal -->
|
||||
<RecordConfirmation
|
||||
v-model:open="isRecordCancelOpen"
|
||||
action="delete"
|
||||
custom-title="Batalkan Kunjungan"
|
||||
custom-message="Apakah anda yakin ingin membatalkan kunjungan pasien berikut?"
|
||||
action="deactivate"
|
||||
:record="recItem"
|
||||
@confirm="handleConfirmCancel"
|
||||
@cancel="handleCancelConfirmation"
|
||||
>
|
||||
<template #default="{ record }">
|
||||
<div class="text-sm">
|
||||
<p>Apakah anda yakin ingin membatalkan kunjungan pasien berikut?</p>
|
||||
<p v-if="record?.patient?.person?.name">
|
||||
<strong>Nama:</strong>
|
||||
{{ record.patient.person.name }}
|
||||
|
||||
Reference in New Issue
Block a user