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