chore: restucture list and entry form
This commit is contained in:
No files matched your search
@@ -1,16 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// types
|
// Components
|
||||||
import type z from 'zod'
|
|
||||||
import type { MaterialFormData } from '~/schemas/material'
|
|
||||||
// helpers
|
|
||||||
import { useForm } from 'vee-validate'
|
|
||||||
import { toTypedSchema } from '@vee-validate/zod'
|
|
||||||
// components
|
|
||||||
import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
|
import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
|
||||||
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
|
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
|
||||||
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
||||||
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
|
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type z from 'zod'
|
||||||
|
import type { MaterialFormData } from '~/schemas/material.schema'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { useForm } from 'vee-validate'
|
||||||
|
import { toTypedSchema } from '@vee-validate/zod'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
schema: z.ZodSchema<any>
|
schema: z.ZodSchema<any>
|
||||||
uoms: any[]
|
uoms: any[]
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// helpers
|
// Components
|
||||||
import { toTypedSchema } from '@vee-validate/zod'
|
|
||||||
import { useForm } from 'vee-validate'
|
|
||||||
// types
|
|
||||||
import type z from 'zod'
|
|
||||||
import type { DeviceFormData } from '~/schemas/device'
|
|
||||||
// components
|
|
||||||
import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
|
import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
|
||||||
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
|
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
|
||||||
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
||||||
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
|
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { toTypedSchema } from '@vee-validate/zod'
|
||||||
|
import { useForm } from 'vee-validate'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import type z from 'zod'
|
||||||
|
import type { DeviceFormData } from '~/schemas/device.schema'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
schema: z.ZodSchema<any>
|
schema: z.ZodSchema<any>
|
||||||
uoms: any[]
|
uoms: any[]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue'
|
import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue'
|
||||||
import { MaterialSchema, type MaterialFormData } from '~/schemas/material'
|
import { MaterialSchema, type MaterialFormData } from '~/schemas/material.schema'
|
||||||
|
|
||||||
const data = ref({
|
const data = ref({
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { MaterialSchema, type MaterialFormData } from '~/schemas/material'
|
// Components
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
|
||||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
|
||||||
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 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'
|
||||||
|
|
||||||
// helpers
|
// Helpers
|
||||||
|
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 } from '~/components/pub/custom-ui/data/types'
|
||||||
|
import { MaterialSchema, type MaterialFormData } from '~/schemas/material.schema'
|
||||||
import type { Uom } from '~/models/uom'
|
import type { Uom } from '~/models/uom'
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// types
|
// types
|
||||||
import type { MaterialFormData } from '~/schemas/material'
|
import type { MaterialFormData } from '~/schemas/material.schema'
|
||||||
import { MaterialSchema } from '~/schemas/material'
|
import { MaterialSchema } from '~/schemas/material.schema'
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const uoms = [
|
const uoms = [
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
// Components
|
||||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
|
||||||
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 AppMedicineMethodEntryForm from '~/components/app/medicine-method/entry-form.vue'
|
||||||
import AppMedicineMethodList from '~/components/app/medicine-method/list.vue'
|
import AppMedicineMethodList from '~/components/app/medicine-method/list.vue'
|
||||||
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
import RecordConfirmation from '~/components/pub/custom-ui/confirmation/record-confirmation.vue'
|
||||||
|
|
||||||
|
// Helpers
|
||||||
|
import { usePaginatedList } from '~/composables/usePaginatedList'
|
||||||
import { toast } from '~/components/pub/ui/toast'
|
import { toast } from '~/components/pub/ui/toast'
|
||||||
|
|
||||||
|
// Types
|
||||||
|
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
||||||
|
import { MedicineBaseSchema, type MedicineBaseFormData } from '~/schemas/medicine.schema'
|
||||||
|
|
||||||
|
// Handlers
|
||||||
import {
|
import {
|
||||||
recId,
|
recId,
|
||||||
recAction,
|
recAction,
|
||||||
@@ -21,6 +29,8 @@ import {
|
|||||||
handleActionRemove,
|
handleActionRemove,
|
||||||
handleCancelForm,
|
handleCancelForm,
|
||||||
} from '~/handlers/medicine-method.handler'
|
} from '~/handlers/medicine-method.handler'
|
||||||
|
|
||||||
|
// Services
|
||||||
import { getMedicineMethods, getMedicineMethodDetail } from '~/services/medicine-method.service'
|
import { getMedicineMethods, getMedicineMethodDetail } from '~/services/medicine-method.service'
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue'
|
import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue'
|
||||||
import { MaterialSchema, type MaterialFormData } from '~/schemas/material'
|
import { MaterialSchema, type MaterialFormData } from '~/schemas/material.schema'
|
||||||
|
|
||||||
const data = ref({
|
const data = ref({
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DeviceSchema, type DeviceFormData } from '~/schemas/device'
|
// Components
|
||||||
import { usePaginatedList } from '~/composables/usePaginatedList'
|
|
||||||
import { ActionEvents, type HeaderPrep } from '~/components/pub/custom-ui/data/types'
|
|
||||||
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 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'
|
||||||
|
|
||||||
// helpers
|
// Helpers
|
||||||
|
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 } from '~/components/pub/custom-ui/data/types'
|
||||||
|
import { DeviceSchema, type DeviceFormData } from '~/schemas/device.schema'
|
||||||
import type { Uom } from '~/models/uom'
|
import type { Uom } from '~/models/uom'
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
export interface MedicineBase {
|
||||||
|
name: string
|
||||||
|
code: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface Medicine {
|
export interface Medicine {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { z } from 'zod'
|
||||||
|
import type { MedicineBase } from '~/models/medicine'
|
||||||
|
|
||||||
|
const MedicineBaseSchema = z.object({
|
||||||
|
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
|
||||||
|
name: z.string({ required_error: 'Nama harus diisi' }).min(1, 'Nama minimum 1 karakter')
|
||||||
|
})
|
||||||
|
|
||||||
|
type MedicineBaseFormData = z.infer<typeof MedicineBaseSchema> & MedicineBase
|
||||||
|
|
||||||
|
export { MedicineBaseSchema }
|
||||||
|
export type { MedicineBaseFormData }
|
||||||
Reference in New Issue
Block a user