feat: restructure list
This commit is contained in:
+1
-2
@@ -15,7 +15,6 @@ import { useForm } from 'vee-validate'
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
schema: z.ZodSchema<any>
|
schema: z.ZodSchema<any>
|
||||||
uoms: any[]
|
|
||||||
values: any
|
values: any
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
isReadonly?: boolean
|
isReadonly?: boolean
|
||||||
@@ -72,7 +71,7 @@ function onCancelForm() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form id="form-tools" @submit.prevent>
|
<form id="form-division" @submit.prevent>
|
||||||
<Block labelSize="thin" class="!mb-2.5 !pt-0 xl:!mb-3" :colCount="1">
|
<Block labelSize="thin" class="!mb-2.5 !pt-0 xl:!mb-3" :colCount="1">
|
||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">Kode</Label>
|
<Label height="compact">Kode</Label>
|
||||||
@@ -48,8 +48,4 @@ export const funcComponent: RecStrFuncComponent = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const funcHtml: RecStrFuncUnknown = {
|
export const funcHtml: RecStrFuncUnknown = {}
|
||||||
patient_address(_rec) {
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -10,11 +10,6 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue'))
|
const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue'))
|
||||||
|
|
||||||
const _doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const cols: Col[] = [{}, {}, { width: 50 }]
|
export const cols: Col[] = [{}, {}, { width: 50 }]
|
||||||
|
|
||||||
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
|
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
|
||||||
@@ -39,8 +34,4 @@ export const funcComponent: RecStrFuncComponent = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const funcHtml: RecStrFuncUnknown = {
|
export const funcHtml: RecStrFuncUnknown = {}
|
||||||
patient_address(_rec) {
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,11 +10,6 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
|
|
||||||
const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue'))
|
const action = defineAsyncComponent(() => import('~/components/pub/custom-ui/data/dropdown-action-dud.vue'))
|
||||||
|
|
||||||
const _doctorStatus = {
|
|
||||||
0: 'Tidak Aktif',
|
|
||||||
1: 'Aktif',
|
|
||||||
}
|
|
||||||
|
|
||||||
export const cols: Col[] = [{}, {}, { width: 50 }]
|
export const cols: Col[] = [{}, {}, { width: 50 }]
|
||||||
|
|
||||||
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
|
export const header: Th[][] = [[{ label: 'Kode' }, { label: 'Nama' }, { label: 'Aksi' }]]
|
||||||
@@ -39,8 +34,4 @@ export const funcComponent: RecStrFuncComponent = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const funcHtml: RecStrFuncUnknown = {
|
export const funcHtml: RecStrFuncUnknown = {}
|
||||||
patient_address(_rec) {
|
|
||||||
return '-'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
import type { HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
||||||
import AppDivisionEntryForm from '~/components/app/divison/entry-form.vue'
|
import AppDivisionEntryForm from '~/components/app/division/entry-form.vue'
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
import { ActionEvents } from '~/components/pub/custom-ui/data/types'
|
import { ActionEvents } from '~/components/pub/custom-ui/data/types'
|
||||||
|
|||||||
@@ -1,28 +1,38 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
// Components
|
||||||
import AppDivisionEntryForm from '~/components/app/divison/entry-form.vue'
|
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
import { ActionEvents } from '~/components/pub/custom-ui/data/types'
|
import AppDivisionEntryForm from '~/components/app/division/entry-form.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/header.vue'
|
|
||||||
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
import { divisionConf, divisionTreeConfig, schema } from './entry'
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
// #region State & Computed
|
|
||||||
// Dialog state
|
|
||||||
const isFormEntryDialogOpen = ref(false)
|
|
||||||
const isRecordConfirmationOpen = ref(false)
|
|
||||||
|
|
||||||
// Table action rowId provider
|
// Types
|
||||||
const recId = ref<number>(0)
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
||||||
const recAction = ref<string>('')
|
import { DivisionSchema, type DivisionFormData } from '~/schemas/division.schema'
|
||||||
const recItem = ref<any>(null)
|
|
||||||
|
|
||||||
async function fetchDivisionData(_params: any) {
|
// Handlers
|
||||||
const endpoint = '/api/v1/_dev/division/list'
|
import {
|
||||||
return await xfetch(endpoint)
|
recId,
|
||||||
}
|
recAction,
|
||||||
|
recItem,
|
||||||
|
isReadonly,
|
||||||
|
isProcessing,
|
||||||
|
isFormEntryDialogOpen,
|
||||||
|
isRecordConfirmationOpen,
|
||||||
|
handleActionSave,
|
||||||
|
handleActionEdit,
|
||||||
|
handleActionRemove,
|
||||||
|
handleCancelForm,
|
||||||
|
} from '~/handlers/division.handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
|
import { getDivisions, getDivisionDetail } from '~/services/division.service'
|
||||||
|
|
||||||
|
const title = ref('')
|
||||||
|
|
||||||
// Menggunakan composable untuk pagination
|
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
isLoading,
|
isLoading,
|
||||||
@@ -32,7 +42,10 @@ const {
|
|||||||
handleSearch,
|
handleSearch,
|
||||||
fetchData: getDivisionList,
|
fetchData: getDivisionList,
|
||||||
} = usePaginatedList({
|
} = usePaginatedList({
|
||||||
fetchFn: fetchDivisionData,
|
fetchFn: async ({ page, search }) => {
|
||||||
|
const result = await getDivisions({ search, page })
|
||||||
|
return { success: result.success || false, body: result.body || {} }
|
||||||
|
},
|
||||||
entityName: 'division',
|
entityName: 'division',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -44,21 +57,20 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {
|
onInput: (value: string) => {
|
||||||
// Handle search input - this will be triggered by the header component
|
searchInput.value = value
|
||||||
},
|
|
||||||
onClick: () => {
|
|
||||||
// Handle search button click if needed
|
|
||||||
},
|
|
||||||
onClear: () => {
|
|
||||||
// Handle search clear
|
|
||||||
},
|
},
|
||||||
|
onClick: () => {},
|
||||||
|
onClear: () => {},
|
||||||
},
|
},
|
||||||
addNav: {
|
addNav: {
|
||||||
label: 'Tambah Divisi',
|
label: 'Tambah',
|
||||||
icon: 'i-lucide-send',
|
icon: 'i-lucide-plus',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
recItem.value = null
|
||||||
|
recId.value = 0
|
||||||
isFormEntryDialogOpen.value = true
|
isFormEntryDialogOpen.value = true
|
||||||
|
isReadonly.value = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -67,142 +79,83 @@ provide('rec_id', recId)
|
|||||||
provide('rec_action', recAction)
|
provide('rec_action', recAction)
|
||||||
provide('rec_item', recItem)
|
provide('rec_item', recItem)
|
||||||
provide('table_data_loader', isLoading)
|
provide('table_data_loader', isLoading)
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// #region Functions
|
const getCurrentDivisionDetail = async (id: number | string) => {
|
||||||
|
const result = await getDivisionDetail(id)
|
||||||
async function handleDeleteRow(record: any) {
|
if (result.success) {
|
||||||
try {
|
const currentValue = result.body?.data || {}
|
||||||
// TODO : hit backend request untuk delete
|
recItem.value = currentValue
|
||||||
console.log('Deleting record:', record)
|
isFormEntryDialogOpen.value = true
|
||||||
|
|
||||||
// Simulate API call
|
|
||||||
// const response = await xfetch(`/api/v1/division/${record.id}`, {
|
|
||||||
// method: 'DELETE'
|
|
||||||
// })
|
|
||||||
|
|
||||||
// Refresh data setelah berhasil delete
|
|
||||||
await getDivisionList()
|
|
||||||
|
|
||||||
// TODO: Show success message
|
|
||||||
console.log('Record deleted successfully')
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error deleting record:', error)
|
|
||||||
// TODO: Show error message
|
|
||||||
} finally {
|
|
||||||
// Reset record state
|
|
||||||
recId.value = 0
|
|
||||||
recAction.value = ''
|
|
||||||
recItem.value = null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #endregion region
|
// Watch for row actions when recId or recAction changes
|
||||||
|
watch([recId, recAction], () => {
|
||||||
// #region Form event handlers
|
|
||||||
|
|
||||||
function onCancelForm(resetForm: () => void) {
|
|
||||||
isFormEntryDialogOpen.value = false
|
|
||||||
setTimeout(() => {
|
|
||||||
resetForm()
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onSubmitForm(values: any, resetForm: () => void) {
|
|
||||||
let isSuccess = false
|
|
||||||
try {
|
|
||||||
// TODO: Implement form submission logic
|
|
||||||
console.log('Form submitted:', values)
|
|
||||||
|
|
||||||
// Simulate API call
|
|
||||||
// const response = await xfetch('/api/v1/division', {
|
|
||||||
// method: 'POST',
|
|
||||||
// body: JSON.stringify(values)
|
|
||||||
// })
|
|
||||||
|
|
||||||
// If successful, mark as success and close dialog
|
|
||||||
isFormEntryDialogOpen.value = false
|
|
||||||
isSuccess = true
|
|
||||||
|
|
||||||
// Refresh data after successful submission
|
|
||||||
await getDivisionList()
|
|
||||||
|
|
||||||
// TODO: Show success message
|
|
||||||
console.log('Division created successfully')
|
|
||||||
} catch (error: unknown) {
|
|
||||||
console.warn('Error submitting form:', error)
|
|
||||||
isSuccess = false
|
|
||||||
// Don't close dialog or reset form on error
|
|
||||||
// TODO: Show error message to user
|
|
||||||
} finally {
|
|
||||||
if (isSuccess) {
|
|
||||||
setTimeout(() => {
|
|
||||||
resetForm()
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
// #region Watchers
|
|
||||||
|
|
||||||
// Watch for row actions
|
|
||||||
watch(recId, () => {
|
|
||||||
switch (recAction.value) {
|
switch (recAction.value) {
|
||||||
|
case ActionEvents.showDetail:
|
||||||
|
getCurrentDivisionDetail(recId.value)
|
||||||
|
title.value = 'Detail Divisi'
|
||||||
|
isReadonly.value = true
|
||||||
|
break
|
||||||
case ActionEvents.showEdit:
|
case ActionEvents.showEdit:
|
||||||
// TODO: Handle edit action
|
getCurrentDivisionDetail(recId.value)
|
||||||
// isFormEntryDialogOpen.value = true
|
title.value = 'Edit Divisi'
|
||||||
|
isReadonly.value = false
|
||||||
break
|
break
|
||||||
case ActionEvents.showConfirmDelete:
|
case ActionEvents.showConfirmDelete:
|
||||||
// Trigger confirmation modal open
|
|
||||||
isRecordConfirmationOpen.value = true
|
isRecordConfirmationOpen.value = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Handle confirmation result
|
onMounted(async () => {
|
||||||
function handleConfirmDelete(record: any, action: string) {
|
await getDivisionList()
|
||||||
console.log('Confirmed action:', action, 'for record:', record)
|
})
|
||||||
handleDeleteRow(record)
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleCancelConfirmation() {
|
|
||||||
// Reset record state when cancelled
|
|
||||||
recId.value = 0
|
|
||||||
recAction.value = ''
|
|
||||||
recItem.value = null
|
|
||||||
}
|
|
||||||
// #endregion
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header v-model="searchInput" :prep="headerPrep" @search="handleSearch" />
|
<Header
|
||||||
<AppDivisonList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
v-model="searchInput"
|
||||||
|
:prep="headerPrep"
|
||||||
<Dialog v-model:open="isFormEntryDialogOpen" title="Tambah Divisi" size="lg" prevent-outside>
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
@search="handleSearch"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
|
<AppMedicineGroupList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
|
||||||
|
<Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Divisi'" size="lg" prevent-outside>
|
||||||
<AppDivisionEntryForm
|
<AppDivisionEntryForm
|
||||||
:division="divisionConf" :division-tree="divisionTreeConfig" :schema="schema"
|
:schema="DivisionSchema"
|
||||||
:initial-values="{ name: '', code: '', parentId: '' }" @submit="onSubmitForm" @cancel="onCancelForm"
|
:values="recItem"
|
||||||
|
:is-loading="isProcessing"
|
||||||
|
:is-readonly="isReadonly"
|
||||||
|
@submit="
|
||||||
|
(values: DivisionFormData | Record<string, any>, resetForm: () => void) => {
|
||||||
|
if (recId > 0) {
|
||||||
|
handleActionEdit(recId, values, getDivisionList, resetForm, toast)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
handleActionSave(values, getDivisionList, resetForm, toast)
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@cancel="handleCancelForm"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<!-- Record Confirmation Modal -->
|
<!-- Record Confirmation Modal -->
|
||||||
<RecordConfirmation
|
<RecordConfirmation
|
||||||
v-model:open="isRecordConfirmationOpen" action="delete" :record="recItem"
|
v-model:open="isRecordConfirmationOpen"
|
||||||
@confirm="handleConfirmDelete" @cancel="handleCancelConfirmation"
|
action="delete"
|
||||||
>
|
:record="recItem"
|
||||||
|
@confirm="() => handleActionRemove(recId, getDivisionList, toast)"
|
||||||
|
@cancel=""
|
||||||
|
>
|
||||||
<template #default="{ record }">
|
<template #default="{ record }">
|
||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<p><strong>ID:</strong> {{ record?.id }}</p>
|
<p><strong>ID:</strong> {{ record?.id }}</p>
|
||||||
<p v-if="record?.firstName"><strong>Nama:</strong> {{ record.firstName }}</p>
|
<p v-if="record?.name"><strong>Nama:</strong> {{ record.name }}</p>
|
||||||
<p v-if="record?.code"><strong>Kode:</strong> {{ record.cellphone }}</p>
|
<p v-if="record?.code"><strong>Kode:</strong> {{ record.code }}</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</RecordConfirmation>
|
</RecordConfirmation>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* component style */
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppEquipmentEntryForm from '~/components/app/equipment/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppEquipmentEntryForm from '~/components/app/equipment/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
@@ -60,15 +60,11 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {
|
onInput: (value: string) => {
|
||||||
// Handle search input - this will be triggered by the header component
|
searchInput.value = value
|
||||||
},
|
|
||||||
onClick: () => {
|
|
||||||
// Handle search button click if needed
|
|
||||||
},
|
|
||||||
onClear: () => {
|
|
||||||
// Handle search clear
|
|
||||||
},
|
},
|
||||||
|
onClick: () => {},
|
||||||
|
onClear: () => {},
|
||||||
},
|
},
|
||||||
addNav: {
|
addNav: {
|
||||||
label: 'Tambah Perlengkapan',
|
label: 'Tambah Perlengkapan',
|
||||||
@@ -130,7 +126,13 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<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="headerPrep.refSearchNav"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
<AppEquipmentList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<AppEquipmentList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppMedicineGroupEntryForm from '~/components/app/medicine-group/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppMedicineGroupEntryForm from '~/components/app/medicine-group/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
@@ -57,7 +57,9 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {},
|
onInput: (value: string) => {
|
||||||
|
searchInput.value = value
|
||||||
|
},
|
||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
onClear: () => {},
|
onClear: () => {},
|
||||||
},
|
},
|
||||||
@@ -112,7 +114,13 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header v-model="searchInput" :prep="headerPrep" @search="handleSearch" class="mb-4 xl:mb-5" />
|
<Header
|
||||||
|
v-model="searchInput"
|
||||||
|
:prep="headerPrep"
|
||||||
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
@search="handleSearch"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
<AppMedicineGroupList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<AppMedicineGroupList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppMedicineMethodEntryForm from '~/components/app/medicine-method/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppMedicineMethodEntryForm from '~/components/app/medicine-method/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
@@ -57,7 +57,9 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {},
|
onInput: (value: string) => {
|
||||||
|
searchInput.value = value
|
||||||
|
},
|
||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
onClear: () => {},
|
onClear: () => {},
|
||||||
},
|
},
|
||||||
@@ -112,7 +114,13 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Header v-model="searchInput" :prep="headerPrep" @search="handleSearch" class="mb-4 xl:mb-5" />
|
<Header
|
||||||
|
v-model="searchInput"
|
||||||
|
:prep="headerPrep"
|
||||||
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
@search="handleSearch"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
<AppMedicineMethodList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<AppMedicineMethodList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppMedicineEntryForm from '~/components/app/medicine/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppMedicineEntryForm from '~/components/app/medicine/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
import { toast } from '~/components/pub/ui/toast'
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { ActionEvents, type HeaderPrep, type RefSearchNav } from '~/components/pub/custom-ui/data/types'
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
||||||
import { MedicineSchema, type MedicineFormData } from '~/schemas/medicine.schema'
|
import { MedicineSchema, type MedicineFormData } from '~/schemas/medicine.schema'
|
||||||
import type { MedicineGroup } from '~/models/medicine-group'
|
import type { MedicineGroup } from '~/models/medicine-group'
|
||||||
import type { MedicineMethod } from '~/models/medicine-method'
|
import type { MedicineMethod } from '~/models/medicine-method'
|
||||||
@@ -69,12 +69,8 @@ const headerPrep: HeaderPrep = {
|
|||||||
onInput: (value: string) => {
|
onInput: (value: string) => {
|
||||||
searchInput.value = value
|
searchInput.value = value
|
||||||
},
|
},
|
||||||
onClick: () => {
|
onClick: () => {},
|
||||||
// open filter modal
|
onClear: () => {},
|
||||||
},
|
|
||||||
onClear: () => {
|
|
||||||
// clear url param
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
addNav: {
|
addNav: {
|
||||||
label: 'Tambah',
|
label: 'Tambah',
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppToolsEntryForm from '~/components/app/tools/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppToolsEntryForm from '~/components/app/tools/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
@@ -60,8 +60,8 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {
|
onInput: (value: string) => {
|
||||||
// Handle search input - this will be triggered by the header component
|
searchInput.value = value
|
||||||
},
|
},
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
// Handle search button click if needed
|
// Handle search button click if needed
|
||||||
@@ -131,7 +131,13 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<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="headerPrep.refSearchNav"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
<AppToolsList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<AppToolsList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// Components
|
// Components
|
||||||
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
import Dialog from '~/components/pub/base/modal/dialog.vue'
|
||||||
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
import Header from '~/components/pub/custom-ui/nav-header/prep.vue'
|
||||||
import AppUomEntryForm from '~/components/app/uom/entry-form.vue'
|
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
import AppUomEntryForm from '~/components/app/uom/entry-form.vue'
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
@@ -57,7 +57,9 @@ const headerPrep: HeaderPrep = {
|
|||||||
minLength: 3,
|
minLength: 3,
|
||||||
debounceMs: 500,
|
debounceMs: 500,
|
||||||
showValidationFeedback: true,
|
showValidationFeedback: true,
|
||||||
onInput: (_val: string) => {},
|
onInput: (value: string) => {
|
||||||
|
searchInput.value = value
|
||||||
|
},
|
||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
onClear: () => {},
|
onClear: () => {},
|
||||||
},
|
},
|
||||||
@@ -113,17 +115,18 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<Header v-model="searchInput" :prep="headerPrep" @search="handleSearch" />
|
<Header
|
||||||
|
v-model="searchInput"
|
||||||
|
:prep="headerPrep"
|
||||||
|
:ref-search-nav="headerPrep.refSearchNav"
|
||||||
|
@search="handleSearch"
|
||||||
|
class="mb-4 xl:mb-5"
|
||||||
|
/>
|
||||||
<div class="rounded-md border p-4">
|
<div class="rounded-md border p-4">
|
||||||
<AppUomList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
<AppUomList :data="data" :pagination-meta="paginationMeta" @page-change="handlePageChange" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog
|
<Dialog v-model:open="isFormEntryDialogOpen" :title="!!recItem ? title : 'Tambah Uom'" size="lg" prevent-outside>
|
||||||
v-model:open="isFormEntryDialogOpen"
|
|
||||||
:title="!!recItem ? title : 'Tambah Uom'"
|
|
||||||
size="lg"
|
|
||||||
prevent-outside
|
|
||||||
>
|
|
||||||
<AppUomEntryForm
|
<AppUomEntryForm
|
||||||
:schema="UomSchema"
|
:schema="UomSchema"
|
||||||
:values="recItem"
|
:values="recItem"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ definePageMeta({
|
|||||||
// middleware: ['rbac'],
|
// middleware: ['rbac'],
|
||||||
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
roles: ['doctor', 'nurse', 'admisi', 'pharmacy', 'billing', 'management'],
|
||||||
title: 'Daftar Divisi',
|
title: 'Daftar Divisi',
|
||||||
contentFrame: 'cf-full-width',
|
contentFrame: 'cf-container-lg',
|
||||||
})
|
})
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
Reference in New Issue
Block a user