fix(refactor): kena timpa ges sepertinya

This commit is contained in:
Khafid Prayoga
2025-10-08 16:20:37 +07:00
parent 55239606af
commit 3ffc28fdeb
14 changed files with 328 additions and 74 deletions

No files matched your search

+39 -7
View File
@@ -6,12 +6,13 @@ import Field from '~/components/pub/my-ui/doc-entry/field.vue'
import Label from '~/components/pub/my-ui/doc-entry/label.vue'
// Types
import type { MaterialFormData } from '~/schemas/material.schema.ts'
import type { MaterialFormData } from '~/schemas/material.schema'
// Helpers
import type z from 'zod'
import { useForm } from 'vee-validate'
import { toTypedSchema } from '@vee-validate/zod'
import { genBase } from '~/models/_base'
interface Props {
schema: z.ZodSchema<any>
@@ -61,6 +62,7 @@ const resetForm = () => {
function onSubmitForm() {
const formData: MaterialFormData = {
...genBase(),
name: name.value || '',
code: code.value || '',
uom_code: uom.value || '',
@@ -75,18 +77,35 @@ function onCancelForm() {
</script>
<template>
<form id="form-equipment" @submit.prevent>
<Block labelSize="thin" class="!mb-2.5 !pt-0 xl:!mb-3" :colCount="1">
<form
id="form-equipment"
@submit.prevent
>
<Block
labelSize="thin"
class="!mb-2.5 !pt-0 xl:!mb-3"
:colCount="1"
>
<Cell>
<Label height="">Kode</Label>
<Field :errMessage="errors.code">
<Input id="code" v-model="code" v-bind="codeAttrs" :disabled="isLoading || isReadonly" />
<Input
id="code"
v-model="code"
v-bind="codeAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
<Label height="compact">Nama</Label>
<Field :errMessage="errors.name">
<Input id="name" v-model="name" v-bind="nameAttrs" :disabled="isLoading || isReadonly" />
<Input
id="name"
v-model="name"
v-bind="nameAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
<Cell>
@@ -106,12 +125,25 @@ function onCancelForm() {
<Cell>
<Label height="compact">Stok</Label>
<Field :errMessage="errors.stock">
<Input id="stock" v-model="stock" type="number" v-bind="stockAttrs" :disabled="isLoading || isReadonly" />
<Input
id="stock"
v-model="stock"
type="number"
v-bind="stockAttrs"
:disabled="isLoading || isReadonly"
/>
</Field>
</Cell>
</Block>
<div class="my-2 flex justify-end gap-2 py-2">
<Button type="button" variant="secondary" class="w-[120px]" @click="onCancelForm"> Kembali </Button>
<Button
type="button"
variant="secondary"
class="w-[120px]"
@click="onCancelForm"
>
Kembali
</Button>
<Button
v-if="!isReadonly"
type="button"