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
陈智峰
jinfa-platform
Commits
df4c048d
Commit
df4c048d
authored
Oct 23, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修复订单金额无法正常显示
parent
924e6db4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
index.tsx
src/pages/transaction/components/orderProductTable/index.tsx
+10
-5
No files found.
src/pages/transaction/components/orderProductTable/index.tsx
View file @
df4c048d
...
...
@@ -42,8 +42,13 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const
modalPriceActions
=
createFormActions
()
// 总计金额联动框
export
const
MoneyTotalBox
=
({
dataSource
,
preview
})
=>
{
const
{
orderProductRequests
=
[],
deliveryAddressInfo
,
freight
=
0
}
=
dataSource
||
{}
const
sum
=
orderProductRequests
.
reduce
((
prev
,
next
)
=>
prev
+
parseInt
((
next
.
price
||
0
)),
0
)
const
{
orderProductRequests
=
[],
deliveryAddressInfo
,
freight
=
0
,
sumPrice
,
amount
}
=
dataSource
||
{}
// 合计金额, 如果后端有传则用后端数据
const
sum
=
sumPrice
||
orderProductRequests
.
reduce
((
prev
,
next
)
=>
prev
+
parseInt
((
next
.
money
||
0
)),
0
)
// 总计金额
const
amountMoney
=
amount
||
sum
+
freight
// const modelRef = useRef<any>({})
// const [freePrice, setFreePrice] = useState<number>(0)
// const handleSetting = () => {
...
...
@@ -87,7 +92,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
</
Col
>
<
Col
span=
{
2
}
>
<
div
>
总计金额
</
div
>
<
div
>
{
sum
+
freight
}
</
div
>
<
div
>
{
amountMoney
}
</
div
>
</
Col
>
{
/* <ModalForm
modalTitle='设置运费'
...
...
@@ -322,9 +327,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
},
{
title
:
'金额'
,
dataIndex
:
'
price
'
,
dataIndex
:
'
money
'
,
align
:
'center'
,
key
:
'
price
'
,
key
:
'
money
'
,
},
// 接口调用
{
...
...
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