Commit fe62980e authored by 卢均锐's avatar 卢均锐

fix: 待对账列表更换选择key->id

parent 1f548f13
...@@ -185,18 +185,18 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -185,18 +185,18 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
let parentArr = [...selectedRowKeys]; let parentArr = [...selectedRowKeys];
let parentRowArr = [...selectedRows]; let parentRowArr = [...selectedRows];
if (selectedRow.length > 0) { if (selectedRow.length > 0) {
if (!parentArr.includes(item.billId)) { if (!parentArr.includes(item.id)) {
parentArr.push(item.billId); parentArr.push(item.id);
parentRowArr.push(item) parentRowArr.push(item)
} }
} else { } else {
if (parentArr.length && parentArr.find((d) => d === item.billId)) { if (parentArr.length && parentArr.find((d) => d === item.id)) {
parentArr.splice( parentArr.splice(
parentArr.findIndex((item1) => item1 === item.billId), parentArr.findIndex((item1) => item1 === item.id),
1 1
); );
parentRowArr.splice( parentRowArr.splice(
parentRowArr.findIndex((item1) => item1.billId === item.billId), parentRowArr.findIndex((item1) => item1.id === item.id),
1 1
); );
} }
...@@ -233,15 +233,15 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -233,15 +233,15 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
let parentArr = [...selectedRowKeys]; let parentArr = [...selectedRowKeys];
let parentRowArr = [...selectedRows]; let parentRowArr = [...selectedRows];
if (selected) { if (selected) {
parentArr.push(item.billId); parentArr.push(item.id);
parentRowArr.push(item); parentRowArr.push(item);
} else { } else {
parentArr.splice( parentArr.splice(
parentArr.findIndex((item) => item === item.billId), parentArr.findIndex((item) => item === item.id),
1 1
); );
parentRowArr.splice( parentRowArr.splice(
parentRowArr.findIndex((item) => item.billId === item.billId), parentRowArr.findIndex((item) => item.id === item.id),
1 1
); );
} }
...@@ -260,23 +260,23 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -260,23 +260,23 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
let childArr = [...childSelectedRowKeys]; let childArr = [...childSelectedRowKeys];
let childRowArr = [...childSelectedRows]; let childRowArr = [...childSelectedRows];
let setChildArr = dataSource.data let setChildArr = dataSource.data
.find((d) => d.billId === record.billId) .find((d) => d.id === record.id)
.products.map((item) => item.productId); .products.map((item) => item.productId);
let setChildRowArr = dataSource.data let setChildRowArr = dataSource.data
.find((d) => d.billId === record.billId) .find((d) => d.id === record.id)
.products; .products;
if (selected) { if (selected) {
patentArr.push(record.billId); patentArr.push(record.id);
patentRowArr.push(record); patentRowArr.push(record);
childArr = Array.from(new Set([...setChildArr, ...childArr])); childArr = Array.from(new Set([...setChildArr, ...childArr]));
childRowArr = Array.from(new Set([...setChildRowArr, ...childRowArr])); childRowArr = Array.from(new Set([...setChildRowArr, ...childRowArr]));
} else { } else {
patentArr.splice( patentArr.splice(
patentArr.findIndex((item) => item === record.billId), patentArr.findIndex((item) => item === record.id),
1 1
); );
patentRowArr.splice( patentRowArr.splice(
patentRowArr.findIndex((item) => item.billId === record.billId), patentRowArr.findIndex((item) => item.id === record.id),
1 1
); );
childArr = childArr.filter( childArr = childArr.filter(
...@@ -303,7 +303,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -303,7 +303,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
}); });
if (selected) { if (selected) {
patentArr = Array.from( patentArr = Array.from(
new Set([...patentArr, ...changeRows.map((item) => item.billId)]) new Set([...patentArr, ...changeRows.map((item) => item.id)])
); );
patentRowArr = Array.from( patentRowArr = Array.from(
new Set([...patentRowArr, ...changeRows]) new Set([...patentRowArr, ...changeRows])
...@@ -312,10 +312,10 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -312,10 +312,10 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
setChildSelectedRowKeys(setChildArr); setChildSelectedRowKeys(setChildArr);
} else { } else {
patentArr = patentArr.filter( patentArr = patentArr.filter(
(item) => !changeRows.some((e) => e.billId === item) (item) => !changeRows.some((e) => e.id === item)
); );
patentRowArr = patentRowArr.filter( patentRowArr = patentRowArr.filter(
(item) => !changeRows.some((e) => e.billId === item.billId) (item) => !changeRows.some((e) => e.id === item.id)
); );
setChildSelectedRows([]); setChildSelectedRows([]);
setChildSelectedRowKeys([]); setChildSelectedRowKeys([]);
...@@ -406,7 +406,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) => ...@@ -406,7 +406,7 @@ const DetailDrawer: React.FC<DetailDrawerProps> = (props: DetailDrawerProps) =>
fetchTableData={params => loadingTableData(params)} fetchTableData={params => loadingTableData(params)}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey="billId" rowKey="id"
tableProps={{ tableProps={{
expandable: { expandable: {
expandedRowRender: childRenderTable, expandedRowRender: childRenderTable,
......
...@@ -189,18 +189,18 @@ const ReadyReconciliation: React.FC = () => { ...@@ -189,18 +189,18 @@ const ReadyReconciliation: React.FC = () => {
let parentArr = [...selectedRowKeys]; let parentArr = [...selectedRowKeys];
let parentRowArr = [...selectedRows]; let parentRowArr = [...selectedRows];
if (selectedRow.length > 0) { if (selectedRow.length > 0) {
if (!parentArr.includes(item.billId)) { if (!parentArr.includes(item.id)) {
parentArr.push(item.billId); parentArr.push(item.id);
parentRowArr.push(item) parentRowArr.push(item)
} }
} else { } else {
if (parentArr.length && parentArr.find((d) => d === item.billId)) { if (parentArr.length && parentArr.find((d) => d === item.id)) {
parentArr.splice( parentArr.splice(
parentArr.findIndex((item1) => item1 === item.billId), parentArr.findIndex((item1) => item1 === item.id),
1 1
); );
parentRowArr.splice( parentRowArr.splice(
parentRowArr.findIndex((item1) => item1.billId === item.billId), parentRowArr.findIndex((item1) => item1.id === item.id),
1 1
); );
} }
...@@ -237,15 +237,15 @@ const ReadyReconciliation: React.FC = () => { ...@@ -237,15 +237,15 @@ const ReadyReconciliation: React.FC = () => {
let parentArr = [...selectedRowKeys]; let parentArr = [...selectedRowKeys];
let parentRowArr = [...selectedRows]; let parentRowArr = [...selectedRows];
if (selected) { if (selected) {
parentArr.push(item.billId); parentArr.push(item.id);
parentRowArr.push(item); parentRowArr.push(item);
} else { } else {
parentArr.splice( parentArr.splice(
parentArr.findIndex((item) => item === item.billId), parentArr.findIndex((item) => item === item.id),
1 1
); );
parentRowArr.splice( parentRowArr.splice(
parentRowArr.findIndex((item) => item.billId === item.billId), parentRowArr.findIndex((item) => item.id === item.id),
1 1
); );
} }
...@@ -264,23 +264,23 @@ const ReadyReconciliation: React.FC = () => { ...@@ -264,23 +264,23 @@ const ReadyReconciliation: React.FC = () => {
let childArr = [...childSelectedRowKeys]; let childArr = [...childSelectedRowKeys];
let childRowArr = [...childSelectedRows]; let childRowArr = [...childSelectedRows];
let setChildArr = dataSource.data let setChildArr = dataSource.data
.find((d) => d.billId === record.billId) .find((d) => d.id === record.id)
.products.map((item) => item.productId); .products.map((item) => item.productId);
let setChildRowArr = dataSource.data let setChildRowArr = dataSource.data
.find((d) => d.billId === record.billId) .find((d) => d.id === record.id)
.products; .products;
if (selected) { if (selected) {
patentArr.push(record.billId); patentArr.push(record.id);
patentRowArr.push(record); patentRowArr.push(record);
childArr = Array.from(new Set([...setChildArr, ...childArr])); childArr = Array.from(new Set([...setChildArr, ...childArr]));
childRowArr = Array.from(new Set([...setChildRowArr, ...childRowArr])); childRowArr = Array.from(new Set([...setChildRowArr, ...childRowArr]));
} else { } else {
patentArr.splice( patentArr.splice(
patentArr.findIndex((item) => item === record.billId), patentArr.findIndex((item) => item === record.id),
1 1
); );
patentRowArr.splice( patentRowArr.splice(
patentRowArr.findIndex((item) => item.billId === record.billId), patentRowArr.findIndex((item) => item.id === record.id),
1 1
); );
childArr = childArr.filter( childArr = childArr.filter(
...@@ -307,7 +307,7 @@ const ReadyReconciliation: React.FC = () => { ...@@ -307,7 +307,7 @@ const ReadyReconciliation: React.FC = () => {
}); });
if (selected) { if (selected) {
patentArr = Array.from( patentArr = Array.from(
new Set([...patentArr, ...changeRows.map((item) => item.billId)]) new Set([...patentArr, ...changeRows.map((item) => item.id)])
); );
patentRowArr = Array.from( patentRowArr = Array.from(
new Set([...patentRowArr, ...changeRows]) new Set([...patentRowArr, ...changeRows])
...@@ -316,10 +316,10 @@ const ReadyReconciliation: React.FC = () => { ...@@ -316,10 +316,10 @@ const ReadyReconciliation: React.FC = () => {
setChildSelectedRowKeys(setChildArr); setChildSelectedRowKeys(setChildArr);
} else { } else {
patentArr = patentArr.filter( patentArr = patentArr.filter(
(item) => !changeRows.some((e) => e.billId === item) (item) => !changeRows.some((e) => e.id === item)
); );
patentRowArr = patentRowArr.filter( patentRowArr = patentRowArr.filter(
(item) => !changeRows.some((e) => e.billId === item.billId) (item) => !changeRows.some((e) => e.id === item.id)
); );
setChildSelectedRows([]); setChildSelectedRows([]);
setChildSelectedRowKeys([]); setChildSelectedRowKeys([]);
...@@ -391,7 +391,7 @@ const ReadyReconciliation: React.FC = () => { ...@@ -391,7 +391,7 @@ const ReadyReconciliation: React.FC = () => {
fetchTableData={params => loadingTableData(params)} fetchTableData={params => loadingTableData(params)}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey="billId" rowKey="id"
tableProps={{ tableProps={{
expandable: { expandable: {
expandedRowRender: childRenderTable, expandedRowRender: childRenderTable,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment