Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
364fb8da
Commit
364fb8da
authored
Oct 23, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:批量提交优化
parent
55bc792d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
index.tsx
src/pages/transaction/purchaseOrder/readyAddOrder/index.tsx
+2
-2
useReadyAddOrder.tsx
...on/purchaseOrder/readyAddOrder/model/useReadyAddOrder.tsx
+8
-3
No files found.
src/pages/transaction/purchaseOrder/readyAddOrder/index.tsx
View file @
364fb8da
...
...
@@ -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
...
...
src/pages/transaction/purchaseOrder/readyAddOrder/model/useReadyAddOrder.tsx
View file @
364fb8da
...
...
@@ -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
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment