Commit 62398a19 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复多个退货商品时退款信息抽屉退款金额值错误的问题

parent 6d7d6d61
......@@ -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(() => {
......
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