Commit f4f6a588 authored by Bill's avatar Bill

fix: 当进行批量操作时批量操作完成后需要重新修改勾选数组

parent 4be7de76
......@@ -44,8 +44,11 @@ const MaterialQuery = () => {
}
setDeleteLoading((prev) => prev.concat(_row.id))
try {
const { selectedRowKeys, selectRow } = selectRowFns;
const { data, code } = await postProductGoodsDeleteBatchGoods({ idList: [_row.id] });
if (code === 1000) {
selectRowFns.setSelectedRowKeys(selectedRowKeys.filter((_item) => _item !== _row.id))
selectRowFns.setSelectRow(selectRow.filter((_item) => _item.id !== _row.id))
formActions.submit();
}
} finally {
......@@ -86,8 +89,11 @@ const MaterialQuery = () => {
});
return;
}
const { selectedRowKeys, selectRow } = selectRowFns;
const { data, code } = await postProductGoodsSubmit({ id: _row.id });
if (code === 1000) {
selectRowFns.setSelectedRowKeys(selectedRowKeys.filter((_item) => _item !== _row.id))
selectRowFns.setSelectRow(selectRow.filter((_item) => _item.id !== _row.id))
formActions.submit();
}
} catch(e) {}
......@@ -211,13 +217,14 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsDeleteBatchGoods({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
finally {
setLoading(false);
}
}
const handleSearch = (values: SearchParams) => {
......
......@@ -76,6 +76,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineChangeBatch1({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -80,6 +80,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineChangeBatch2({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -77,6 +77,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineBatch1({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
......@@ -76,6 +76,8 @@ const MaterialQuery = () => {
try {
const { data, code } = await postProductGoodsGoodsExamineBatch2({ idList: selectedRowKeys })
if (code === 1000) {
selectRowFns.setSelectedRowKeys([])
selectRowFns.setSelectRow([])
ref.current.reload()
}
} catch(e) {}
......
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