refactor: replace Input component with NumberInput in StockVerifyDialog for improved input handling and consistency
This commit is contained in:
parent
e252f6c767
commit
2895ebff02
@ -2,6 +2,7 @@
|
|||||||
import { useForm } from '@inertiajs/vue3';
|
import { useForm } from '@inertiajs/vue3';
|
||||||
import { computed, watch } from 'vue';
|
import { computed, watch } from 'vue';
|
||||||
import { toast } from 'vue-sonner';
|
import { toast } from 'vue-sonner';
|
||||||
|
import NumberInput from '@/components/form/number-input/NumberInput.vue';
|
||||||
import { RupiahInput } from '@/components/form/rupiah-input';
|
import { RupiahInput } from '@/components/form/rupiah-input';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
@ -16,7 +17,6 @@ import {
|
|||||||
FieldError,
|
FieldError,
|
||||||
FieldLabel,
|
FieldLabel,
|
||||||
} from '@/components/ui/field';
|
} from '@/components/ui/field';
|
||||||
import { Input } from '@/components/ui/input';
|
|
||||||
import { Separator } from '@/components/ui/separator';
|
import { Separator } from '@/components/ui/separator';
|
||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { parseRupiah } from '@/lib/rupiah';
|
import { parseRupiah } from '@/lib/rupiah';
|
||||||
@ -158,15 +158,15 @@ function submitVerify() {
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<label :for="`stock-good-${index}`"
|
<label :for="`stock-good-${index}`"
|
||||||
class="text-[10px] text-muted-foreground block">Bagus</label>
|
class="text-[10px] text-muted-foreground block">Bagus</label>
|
||||||
<Input :id="`stock-good-${index}`" type="number" v-model.number="result.good"
|
<NumberInput :id="`stock-good-${index}`" v-model="result.good"
|
||||||
min="0" :max="result.cutting_result" class="h-7 w-16 px-1.5 text-xs text-center"
|
class="h-7 w-20 px-1.5 text-xs text-center"
|
||||||
@input="result.reject = result.cutting_result - result.good" />
|
@input="result.reject = result.cutting_result - result.good" />
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<label :for="`stock-reject-${index}`"
|
<label :for="`stock-reject-${index}`"
|
||||||
class="text-[10px] text-muted-foreground block">Reject</label>
|
class="text-[10px] text-muted-foreground block">Reject</label>
|
||||||
<Input :id="`stock-reject-${index}`" type="number" v-model.number="result.reject"
|
<NumberInput :id="`stock-reject-${index}`" v-model="result.reject"
|
||||||
min="0" :max="result.cutting_result" class="h-7 w-16 px-1.5 text-xs text-center"
|
class="h-7 w-20 px-1.5 text-xs text-center"
|
||||||
@input="result.good = result.cutting_result - result.reject" />
|
@input="result.good = result.cutting_result - result.reject" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user