feat: add FieldDescription component to RawMaterialForm for improved user guidance; adjust layout for better responsiveness in price and stock fields
This commit is contained in:
parent
a9b02a9bca
commit
c2747f542a
@ -15,6 +15,7 @@ import {
|
||||
FieldLabel,
|
||||
FieldSet,
|
||||
} from '@/components/ui/field';
|
||||
import FieldDescription from '@/components/ui/field/FieldDescription.vue';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import {
|
||||
Select,
|
||||
@ -278,7 +279,7 @@ function submit() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<FieldGroup>
|
||||
<FieldSet :class="['grid gap-4', method === 'put' ? 'md:grid-cols-1' : 'md:grid-cols-3']">
|
||||
<FieldSet :class="['grid gap-4', method === 'put' || (useSamePrice && prices.length > 1) ? 'md:grid-cols-2' : 'md:grid-cols-3']">
|
||||
<Field>
|
||||
<FieldLabel :for="`variant_${price.client_id}`" required>
|
||||
Nama Varian
|
||||
@ -288,7 +289,7 @@ function submit() {
|
||||
@update:model-value="setPriceField(price.client_id, 'variant', String($event))" />
|
||||
<FieldError :errors="priceErrors(form, price.client_id, 'variant')" />
|
||||
</Field>
|
||||
<Field v-if="method !== 'put'">
|
||||
<Field>
|
||||
<FieldLabel :for="`stock_${price.client_id}`" required>
|
||||
Stok
|
||||
</FieldLabel>
|
||||
@ -302,6 +303,7 @@ function submit() {
|
||||
</FieldLabel>
|
||||
<RupiahInput :id="`price_${price.client_id}`" :model-value="price.price"
|
||||
@update:model-value="setPriceValue(price.client_id, $event)" />
|
||||
<FieldDescription>Harga adalah harga per satuan bahan baku.</FieldDescription>
|
||||
<FieldError :errors="priceErrors(form, price.client_id, 'price')" />
|
||||
</Field>
|
||||
</FieldSet>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user