Commit 364fb8da authored by 前端-许佳敏's avatar 前端-许佳敏

fix:批量提交优化

parent 55bc792d
......@@ -27,8 +27,7 @@ const fetchTableData = async (params) => {
// TODO
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const { columns, ref } = useSelfTable()
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const { columns, ref, rowSelection, rowSelectionCtl } = useSelfTable()
const handleMenuClick = async (e) => {
switch(e.key) {
case '1': {
......@@ -55,6 +54,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
}
}
console.log(rowSelection)
return <PageHeaderWrapper>
<Card>
<StandardTable
......
......@@ -9,7 +9,13 @@ import { PurchaseOrderInsideWorkState, PurchaseOrderOutWorkState } from '@/const
// 业务hooks, 待新增订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id', extendsSelection: {
getCheckboxProps: record => ({
// 不等于可提交审核的 都无法通过批量提交
disabled: record.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER,
interiorState: record.interiorState,
})
}})
const handleSubmit = async (id) => {
// 从待新增订单直接传到一级审核, 状态写死, 默认传-1
......@@ -23,7 +29,6 @@ export const useSelfTable = () => {
}
const handleEdit = (id) => {
// history.push(`/memberCenter/tranactionAbility/purchaseOrder/orderDetail?page_type=0&id=${id}&preview=0`)
history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/edit?id=${id}`)
}
......@@ -46,7 +51,7 @@ export const useSelfTable = () => {
PurchaseOrderOutWorkState.NOT_ACCEPTED_ORDER
// 待提交审核且从未提交过审核的订单才可删除
const showDeleteOrSubmit = PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER
const showDeleteOrSubmit = record.interiorState === PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER
return <>
{
showDeleteOrSubmit &&
......
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