refactor(FE-212): replace quantity input with NumberInput for editable rows in PurchaseOrderStaffApprovalForm

This commit is contained in:
rstubryan
2025-11-22 13:32:10 +07:00
parent 09065f59cf
commit 01b9595606
@@ -712,6 +712,29 @@ const PurchaseOrderStaffApprovalForm = ({
/> />
</td> </td>
<td> <td>
{type === 'edit' ? (
<NumberInput
name={`items.${formItemIndex}.qty`}
value={formItem?.qty || purchaseItem?.quantity || ''}
onChange={(e) => {
const numValue =
typeof e.target.value === 'string'
? parseFloat(e.target.value) || 0
: e.target.value;
formik.setFieldValue(
`items.${formItemIndex}.qty`,
numValue
);
}}
onBlur={formik.handleBlur}
placeholder='Masukkan jumlah'
allowNegative={false}
decimalScale={0}
className={{
wrapper: 'min-w-24',
}}
/>
) : (
<TextInput <TextInput
name={`items.${formItemIndex}.quantity`} name={`items.${formItemIndex}.quantity`}
type='text' type='text'
@@ -728,6 +751,7 @@ const PurchaseOrderStaffApprovalForm = ({
}} }}
disabled={true} disabled={true}
/> />
)}
</td> </td>
<td> <td>
<TextInput <TextInput