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
linweijiong
jinfa-platform
Commits
c7115bb4
Commit
c7115bb4
authored
Nov 26, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:采购订单待支付订单添加取消订单操作
parent
869f9342
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
16 deletions
+43
-16
index.tsx
src/pages/transaction/purchaseOrder/readyPayOrder/index.tsx
+5
-2
useSelfTable.tsx
...action/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
+38
-14
No files found.
src/pages/transaction/purchaseOrder/readyPayOrder/index.tsx
View file @
c7115bb4
import
React
from
'react'
import
React
,
{
useRef
}
from
'react'
import
{
history
}
from
'umi'
import
{
Card
,
Button
,
Space
,
Dropdown
,
Menu
}
from
'antd'
import
{
StandardTable
}
from
'god'
...
...
@@ -24,14 +24,17 @@ const fetchTableData = async (params) => {
// TODO
const
FirstApprovedOrder
:
React
.
FC
<
FirstApprovedOrderProps
>
=
(
props
)
=>
{
const
refTable
=
useRef
<
any
>
({})
const
{
columns
}
=
useSelfTable
()
}
=
useSelfTable
(
refTable
)
return
<
PageHeaderWrapper
>
<
Card
>
<
StandardTable
fetchTableData=
{
params
=>
fetchTableData
(
params
)
}
ref=
{
refTable
}
columns=
{
columns
}
rowKey=
{
'orderNo'
}
formilyLayouts=
{
{
...
...
src/pages/transaction/purchaseOrder/readyPayOrder/model/useSelfTable.tsx
View file @
c7115bb4
import
React
,
{
useRef
}
from
'react'
import
{
history
,
Link
}
from
'umi'
import
{
Button
,
Row
,
Col
,
Progress
}
from
'antd'
import
{
Button
,
Row
,
Col
,
Progress
,
Popconfirm
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
EyePreview
from
'@/components/EyePreview'
import
{
formatTimeString
}
from
'@/utils'
...
...
@@ -49,8 +49,18 @@ const CircleChart = props => {
}
// 业务hooks, 待支付订单
export
const
useSelfTable
=
()
=>
{
export
const
useSelfTable
=
(
props
)
=>
{
const
{
refTable
}
=
props
const
ref
=
useRef
<
any
>
({})
const
handleCancel
=
(
param
)
=>
{
PublicApi
.
postOrderPurchaseOrderCancel
({
id
:
param
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
refTable
.
current
.
reload
()
}
})
}
const
payOrderColumns
:
any
[]
=
[
{
title
:
'订单号'
,
...
...
@@ -124,27 +134,41 @@ export const useSelfTable = () => {
title
:
'当前支付'
,
align
:
'center'
,
dataIndex
:
'currentPayments'
,
width
:
140
,
render
:
(
text
,
record
)
=>
<>
<
Row
justify=
'space-between'
>
<
Col
>
{
record
.
currentPayments
}
/
{
record
.
sum
}
</
Col
>
<
Col
>
{
/*
<Col>
{
record.currentPayments !== record.sum &&
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
}
</
Col
>
</Col>
*/
}
</
Row
>
<
Progress
percent=
{
Math
.
ceil
(
record
.
currentPayments
/
record
.
sum
)
}
showInfo=
{
false
}
/>
</>
},
// {
// title: '操作',
// align: 'center',
// dataIndex: 'ctl',
// key: 'ctl',
// render: (text, record) => <>
// <Button type='link' onClick={() => handleConfirm(record)}>支付</Button>
// <Button type='link' onClick={() => handleCancel(record.id)}>取消订单</Button>
// </>
// }
{
title
:
'操作'
,
align
:
'center'
,
dataIndex
:
'ctl'
,
key
:
'ctl'
,
render
:
(
text
,
record
)
=>
<>
{
record
.
currentPayments
!==
record
.
sum
&&
(
record
.
externalState
===
PurchaseOrderOutWorkState
.
PAY_ORDER
||
record
.
externalState
===
PurchaseOrderOutWorkState
.
CONFIRM_NOT_ARRIVED_ACCOUNT
)
&&
<
Link
to=
{
`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`
}
>
去支付
</
Link
>
}
{
(
record
.
externalState
===
PurchaseOrderOutWorkState
.
PAY_ORDER
&&
!
record
.
signatureLogId
||
record
.
externalState
===
PurchaseOrderOutWorkState
.
CONFIRM_NOT_ARRIVED_ACCOUNT
)
&&
<
Popconfirm
title=
"是否要取消该订单?"
onConfirm=
{
()
=>
handleCancel
(
record
.
id
)
}
okText=
"是"
cancelText=
"否"
>
<
Button
type=
'link'
>
取消订单
</
Button
>
</
Popconfirm
>
}
</>
}
]
return
{
...
...
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