feat(medicine): finishing form + list
This commit is contained in:
@@ -10,7 +10,7 @@ import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||
import { toast } from '~/components/pub/ui/toast'
|
||||
|
||||
// Types
|
||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
||||
import { ActionEvents, type HeaderPrep, type RefSearchNav } from '~/components/pub/custom-ui/data/types'
|
||||
import { MedicineSchema, type MedicineFormData } from '~/schemas/medicine.schema'
|
||||
import type { MedicineGroup } from '~/models/medicine-group'
|
||||
import type { MedicineMethod } from '~/models/medicine-method'
|
||||
@@ -82,6 +82,18 @@ const headerPrep: HeaderPrep = {
|
||||
},
|
||||
}
|
||||
|
||||
const refSearchNav: RefSearchNav = {
|
||||
onClick: () => {
|
||||
// open filter modal
|
||||
},
|
||||
onInput: (_val: string) => {
|
||||
// filter patient list
|
||||
},
|
||||
onClear: () => {
|
||||
// clear url param
|
||||
},
|
||||
}
|
||||
|
||||
provide('rec_id', recId)
|
||||
provide('rec_action', recAction)
|
||||
provide('rec_item', recItem)
|
||||
@@ -153,14 +165,22 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- <Header :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" /> -->
|
||||
<Header v-model="searchInput" :prep="headerPrep" @search="handleSearch" class="mb-4 xl:mb-5" />
|
||||
<Header
|
||||
v-model="searchInput"
|
||||
:prep="headerPrep"
|
||||
@search="handleSearch"
|
||||
:ref-search-nav="refSearchNav"
|
||||
class="mb-4 xl:mb-5"
|
||||
/>
|
||||
<AppMedicineList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||
|
||||
<Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Obat'" size="lg" prevent-outside>
|
||||
<AppMedicineEntryForm
|
||||
:schema="MedicineSchema"
|
||||
:values="recItem"
|
||||
:medicineGroups="medicineGroups"
|
||||
:medicineMethods="medicineMethods"
|
||||
:uoms="uoms"
|
||||
:is-loading="isProcessing"
|
||||
:is-readonly="isReadonly"
|
||||
@submit="
|
||||
|
||||
Reference in New Issue
Block a user