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
62398a19
Commit
62398a19
authored
Dec 20, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复多个退货商品时退款信息抽屉退款金额值错误的问题
parent
6d7d6d61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
index.tsx
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
+25
-22
No files found.
src/pages/afterService/components/ReturnInfoDrawer/index.tsx
View file @
62398a19
...
...
@@ -203,36 +203,33 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
orderId
:
`
${
applyInfo
.
orderId
}
`
,
});
if
(
res
.
code
===
1000
)
{
payList
=
res
.
data
.
map
((
item
)
=>
({
payId
:
item
.
paymentId
,
payCount
:
item
.
batchNo
,
payNode
:
item
.
payNode
,
payRatio
:
+
(
new
BigNumber
(
item
.
payRate
).
multipliedBy
(
100
)).
toFixed
(
2
),
payAmount
:
item
.
payAmount
,
payWay
:
item
.
payType
,
payWayName
:
item
.
payTypeName
,
channel
:
item
.
payChannel
,
channelName
:
item
.
payChannelName
,
refundAmount
:
+
(
new
BigNumber
(
+
applyInfo
.
remaining
).
multipliedBy
(
applyInfo
.
purchasePrice
).
multipliedBy
(
new
BigNumber
(
item
.
payRate
*
100
).
dividedBy
(
100
))).
toFixed
(
2
),
payTime
:
item
.
payTime
,
payRuleId
:
item
.
fundMode
,
externalState
:
3
,
// 这个状态写死了,因为现在只有付款了才会出现这条支付信息
transactionPayId
:
item
.
tradeNo
,
// 微信 或 其他第三方支付返回的 code,原路退款需要
}));
payList
=
res
.
data
.
map
((
item
)
=>
{
const
payRatio
=
+
(
new
BigNumber
(
item
.
payRate
).
multipliedBy
(
100
)).
toFixed
(
2
);
return
{
payId
:
item
.
paymentId
,
payCount
:
item
.
batchNo
,
payNode
:
item
.
payNode
,
payRatio
,
payAmount
:
item
.
payAmount
,
payWay
:
item
.
payType
,
payWayName
:
item
.
payTypeName
,
channel
:
item
.
payChannel
,
channelName
:
item
.
payChannelName
,
refundAmount
:
+
(
new
BigNumber
(
+
applyInfo
.
remaining
).
multipliedBy
(
applyInfo
.
purchasePrice
).
multipliedBy
(
item
.
payRate
)).
toFixed
(
2
),
payTime
:
item
.
payTime
,
payRuleId
:
item
.
fundMode
,
externalState
:
3
,
// 这个状态写死了,因为现在只有付款了才会出现这条支付信息
transactionPayId
:
item
.
tradeNo
,
// 微信 或 其他第三方支付返回的 code,原路退款需要
};
});
}
}
}
catch
(
error
)
{
console
.
warn
(
error
);
}
setPayInfoLoading
(
false
);
if
(
payList
.
length
)
{
schemaAction
.
setFieldState
(
'REPOSIT_TABS'
,
state
=>
{
state
.
props
[
'x-component-props'
].
hiddenKeys
=
[];
});
}
setInnerApplyInfo
({
...
applyInfo
,
payList
,
returnCount
:
applyInfo
.
returnCount
||
applyInfo
.
remaining
,
// 默认赋值
refundAmount
:
applyInfo
.
refundAmount
!==
undefined
?
applyInfo
.
refundAmount
:
(
...
...
@@ -240,7 +237,13 @@ const ReturnInfoDrawer: React.FC<ReturnInfoDrawerProps> = ({
+
(
new
BigNumber
(
+
applyInfo
.
remaining
).
multipliedBy
(
applyInfo
.
purchasePrice
).
toFixed
(
2
))
:
0
),
// 默认赋值,如果是有支付信息的订单,退款金额 refundAmount 交给 payList 累加
payList
,
});
if
(
payList
.
length
)
{
schemaAction
.
setFieldState
(
'REPOSIT_TABS'
,
state
=>
{
state
.
props
[
'x-component-props'
].
hiddenKeys
=
[];
});
}
};
useEffect
(()
=>
{
...
...
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