IO-1408 Resolve bill form index issue.

This commit is contained in:
Patrick Fic
2021-10-18 13:29:35 -07:00
parent f0a13856bc
commit 3d8c390291

View File

@@ -148,7 +148,7 @@ export function BillEnterModalLinesComponent({
], ],
}; };
}, },
formInput: (record, index) => ( formInput: (record, index, ...restProp) => (
<CurrencyInput <CurrencyInput
min={0} min={0}
disabled={disabled} disabled={disabled}
@@ -156,7 +156,7 @@ export function BillEnterModalLinesComponent({
setFieldsValue({ setFieldsValue({
billlines: getFieldsValue("billlines").billlines.map( billlines: getFieldsValue("billlines").billlines.map(
(item, idx) => { (item, idx) => {
console.log("Checking", index, idx); console.log("Checking", index, idx, restProp);
if (idx === index) { if (idx === index) {
console.log( console.log(
"Found and setting.", "Found and setting.",
@@ -493,6 +493,7 @@ const EditableCell = ({
additional, additional,
...restProps ...restProps
}) => { }) => {
console.log(record);
if (additional) if (additional)
return ( return (
<td {...restProps}> <td {...restProps}>
@@ -502,9 +503,9 @@ const EditableCell = ({
labelCol={{ span: 0 }} labelCol={{ span: 0 }}
{...(formItemProps && formItemProps(record))} {...(formItemProps && formItemProps(record))}
> >
{(formInput && formInput(record, record.key)) || children} {(formInput && formInput(record, record.name)) || children}
</Form.Item> </Form.Item>
{additional && additional(record, record.key)} {additional && additional(record, record.name)}
</Space> </Space>
</td> </td>
); );
@@ -516,7 +517,7 @@ const EditableCell = ({
name={dataIndex} name={dataIndex}
{...(formItemProps && formItemProps(record))} {...(formItemProps && formItemProps(record))}
> >
{(formInput && formInput(record, record.key)) || children} {(formInput && formInput(record, record.name)) || children}
</Form.Item> </Form.Item>
</td> </td>
); );