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,
|
FieldLabel,
|
||||||
FieldSet,
|
FieldSet,
|
||||||
} from '@/components/ui/field';
|
} from '@/components/ui/field';
|
||||||
|
import FieldDescription from '@/components/ui/field/FieldDescription.vue';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
@ -278,7 +279,7 @@ function submit() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<FieldGroup>
|
<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>
|
<Field>
|
||||||
<FieldLabel :for="`variant_${price.client_id}`" required>
|
<FieldLabel :for="`variant_${price.client_id}`" required>
|
||||||
Nama Varian
|
Nama Varian
|
||||||
@ -288,7 +289,7 @@ function submit() {
|
|||||||
@update:model-value="setPriceField(price.client_id, 'variant', String($event))" />
|
@update:model-value="setPriceField(price.client_id, 'variant', String($event))" />
|
||||||
<FieldError :errors="priceErrors(form, price.client_id, 'variant')" />
|
<FieldError :errors="priceErrors(form, price.client_id, 'variant')" />
|
||||||
</Field>
|
</Field>
|
||||||
<Field v-if="method !== 'put'">
|
<Field>
|
||||||
<FieldLabel :for="`stock_${price.client_id}`" required>
|
<FieldLabel :for="`stock_${price.client_id}`" required>
|
||||||
Stok
|
Stok
|
||||||
</FieldLabel>
|
</FieldLabel>
|
||||||
@ -302,6 +303,7 @@ function submit() {
|
|||||||
</FieldLabel>
|
</FieldLabel>
|
||||||
<RupiahInput :id="`price_${price.client_id}`" :model-value="price.price"
|
<RupiahInput :id="`price_${price.client_id}`" :model-value="price.price"
|
||||||
@update:model-value="setPriceValue(price.client_id, $event)" />
|
@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')" />
|
<FieldError :errors="priceErrors(form, price.client_id, 'price')" />
|
||||||
</Field>
|
</Field>
|
||||||
</FieldSet>
|
</FieldSet>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user