refactor: replace Input component with NumberInput in StockVerifyDialog for improved input handling and consistency

This commit is contained in:
Yoga Pangestu 2026-06-29 09:15:07 +07:00
parent e252f6c767
commit 2895ebff02

View File

@ -2,6 +2,7 @@
import { useForm } from '@inertiajs/vue3';
import { computed, watch } from 'vue';
import { toast } from 'vue-sonner';
import NumberInput from '@/components/form/number-input/NumberInput.vue';
import { RupiahInput } from '@/components/form/rupiah-input';
import { Button } from '@/components/ui/button';
import {
@ -16,7 +17,6 @@ import {
FieldError,
FieldLabel,
} from '@/components/ui/field';
import { Input } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
import { Textarea } from '@/components/ui/textarea';
import { parseRupiah } from '@/lib/rupiah';
@ -158,15 +158,15 @@ function submitVerify() {
<div class="text-center">
<label :for="`stock-good-${index}`"
class="text-[10px] text-muted-foreground block">Bagus</label>
<Input :id="`stock-good-${index}`" type="number" v-model.number="result.good"
min="0" :max="result.cutting_result" class="h-7 w-16 px-1.5 text-xs text-center"
<NumberInput :id="`stock-good-${index}`" v-model="result.good"
class="h-7 w-20 px-1.5 text-xs text-center"
@input="result.reject = result.cutting_result - result.good" />
</div>
<div class="text-center">
<label :for="`stock-reject-${index}`"
class="text-[10px] text-muted-foreground block">Reject</label>
<Input :id="`stock-reject-${index}`" type="number" v-model.number="result.reject"
min="0" :max="result.cutting_result" class="h-7 w-16 px-1.5 text-xs text-center"
<NumberInput :id="`stock-reject-${index}`" v-model="result.reject"
class="h-7 w-20 px-1.5 text-xs text-center"
@input="result.good = result.cutting_result - result.reject" />
</div>
</div>