refactor: update RawMaterialForm.vue to improve layout responsiveness and remove unused components for a cleaner UI
This commit is contained in:
parent
7af2cca9f0
commit
c23e791c5e
@ -15,7 +15,6 @@ 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,
|
||||||
@ -236,7 +235,7 @@ function submit() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<FieldGroup>
|
<FieldGroup>
|
||||||
<FieldSet class="grid gap-4 md:grid-cols-2">
|
<FieldSet :class="['grid gap-4', method === 'put' ? 'md:grid-cols-1' : 'md:grid-cols-2']">
|
||||||
<Field>
|
<Field>
|
||||||
<FieldLabel for="name" required>Nama Bahan Baku</FieldLabel>
|
<FieldLabel for="name" required>Nama Bahan Baku</FieldLabel>
|
||||||
<Input id="name" v-model="form.name" type="text"
|
<Input id="name" v-model="form.name" type="text"
|
||||||
@ -244,9 +243,9 @@ function submit() {
|
|||||||
<FieldError :errors="formErrors(form, 'name')" />
|
<FieldError :errors="formErrors(form, 'name')" />
|
||||||
</Field>
|
</Field>
|
||||||
|
|
||||||
<Field>
|
<Field v-if="method !== 'put'">
|
||||||
<FieldLabel for="unit" required>Satuan</FieldLabel>
|
<FieldLabel for="unit" required>Satuan</FieldLabel>
|
||||||
<Select v-if="!isEditMode" v-model="form.unit">
|
<Select v-model="form.unit">
|
||||||
<SelectTrigger id="unit" class="w-full">
|
<SelectTrigger id="unit" class="w-full">
|
||||||
<SelectValue placeholder="Pilih satuan" />
|
<SelectValue placeholder="Pilih satuan" />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
@ -256,13 +255,6 @@ function submit() {
|
|||||||
</SelectItem>
|
</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<div v-else id="unit"
|
|
||||||
class="flex h-9 w-full items-center rounded-md border bg-muted/40 px-3 text-sm">
|
|
||||||
{{ unitLabel }}
|
|
||||||
</div>
|
|
||||||
<p v-if="isEditMode" class="text-xs text-muted-foreground">
|
|
||||||
Satuan tidak dapat diubah agar stok tetap konsisten.
|
|
||||||
</p>
|
|
||||||
<FieldError :errors="formErrors(form, 'unit')" />
|
<FieldError :errors="formErrors(form, 'unit')" />
|
||||||
</Field>
|
</Field>
|
||||||
</FieldSet>
|
</FieldSet>
|
||||||
@ -313,7 +305,7 @@ function submit() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<FieldGroup>
|
<FieldGroup>
|
||||||
<FieldSet class="grid gap-4 md:grid-cols-3">
|
<FieldSet :class="['grid gap-4', method === 'put' ? 'md:grid-cols-1' : 'md:grid-cols-3']">
|
||||||
<Field>
|
<Field>
|
||||||
<FieldLabel :for="`variant_${price.client_id}`" required>
|
<FieldLabel :for="`variant_${price.client_id}`" required>
|
||||||
Nama Varian
|
Nama Varian
|
||||||
@ -324,7 +316,7 @@ function submit() {
|
|||||||
<FieldError
|
<FieldError
|
||||||
:errors="priceError(price.client_id, 'variant') ? [priceError(price.client_id, 'variant')!] : []" />
|
:errors="priceError(price.client_id, 'variant') ? [priceError(price.client_id, 'variant')!] : []" />
|
||||||
</Field>
|
</Field>
|
||||||
<Field>
|
<Field v-if="method !== 'put'">
|
||||||
<FieldLabel :for="`stock_${price.client_id}`" required>
|
<FieldLabel :for="`stock_${price.client_id}`" required>
|
||||||
Stok
|
Stok
|
||||||
</FieldLabel>
|
</FieldLabel>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user