fix: select for item price

This commit is contained in:
riefive
2025-12-05 16:42:28 +07:00
parent a0d54c062a
commit db10a8b194
2 changed files with 9 additions and 1 deletions
+5 -1
View File
@@ -16,6 +16,7 @@ import { toTypedSchema } from '@vee-validate/zod'
interface Props {
schema: z.ZodSchema<any>
items: any[]
values: any
isLoading?: boolean
isReadonly?: boolean
@@ -81,10 +82,13 @@ function onCancelForm() {
<Cell>
<Label height="compact">Item</Label>
<Field :errMessage="errors.item_code">
<Input
<Select
id="item_code"
v-model="item_code"
icon-name="i-lucide-chevron-down"
placeholder="Pilih Item"
v-bind="item_codeAttrs"
:items="items"
:disabled="isLoading || isReadonly"
/>
</Field>
@@ -35,7 +35,9 @@ import {
// Services
import { getList, getDetail } from '~/services/item-price.service'
import { getValueLabelList as getItemGroupList } from '~/services/item.service'
const items = ref<{ value: string | number; label: string }[]>([])
const title = ref('')
const {
@@ -119,6 +121,7 @@ watch([recId, recAction], () => {
})
onMounted(async () => {
items.value = await getItemGroupList()
await getItemList()
})
</script>
@@ -151,6 +154,7 @@ onMounted(async () => {
>
<AppItemEntryForm
:schema="ItemPriceSchema"
:items="items"
:values="recItem"
:is-loading="isProcessing"
:is-readonly="isReadonly"