feat(medicine-method): refactor + integrate
This commit is contained in:
No files matched your search
@@ -1,4 +1,3 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// Components
|
||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||
@@ -84,23 +83,23 @@ provide('table_data_loader', isLoading)
|
||||
watch([recId, recAction], () => {
|
||||
switch (recAction.value) {
|
||||
case ActionEvents.showDetail:
|
||||
getMedicineMethodDetail(recId.value).then(result => {
|
||||
getMedicineMethodDetail(recId.value).then((result) => {
|
||||
if (result.success) {
|
||||
recItem.value = result.body?.data || {}
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
})
|
||||
title.value = 'Detail Metode Pemberian'
|
||||
title.value = 'Detail Metode Obat'
|
||||
isReadonly.value = true
|
||||
break
|
||||
case ActionEvents.showEdit:
|
||||
getMedicineMethodDetail(recId.value).then(result => {
|
||||
getMedicineMethodDetail(recId.value).then((result) => {
|
||||
if (result.success) {
|
||||
recItem.value = result.body?.data || {}
|
||||
isFormEntryDialogOpen.value = true
|
||||
}
|
||||
})
|
||||
title.value = 'Edit Metode Pemberian'
|
||||
title.value = 'Edit Metode Obat'
|
||||
isReadonly.value = false
|
||||
break
|
||||
case ActionEvents.showConfirmDelete:
|
||||
@@ -123,16 +122,17 @@ onMounted(async () => {
|
||||
|
||||
<Dialog
|
||||
v-model:open="isFormEntryDialogOpen"
|
||||
:title="!!recItem ? title : 'Tambah Metode Pemberian'"
|
||||
:title="!!recItem ? title : 'Tambah Metode Obat'"
|
||||
size="lg"
|
||||
prevent-outside
|
||||
>
|
||||
<AppMedicineMethodEntryForm
|
||||
:model-value="recItem"
|
||||
:schema="MedicineBaseSchema"
|
||||
:values="recItem"
|
||||
:is-loading="isProcessing"
|
||||
:is-readonly="isReadonly"
|
||||
@submit="
|
||||
(values: Record<string, any>, resetForm: () => void) => {
|
||||
(values: MedicineBaseFormData | Record<string, any>, resetForm: () => void) => {
|
||||
if (recId > 0) {
|
||||
handleActionEdit(recId, values, getMedicineMethodList, resetForm, toast)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user