Commit df4c048d authored by 前端-许佳敏's avatar 前端-许佳敏

fix:修复订单金额无法正常显示

parent 924e6db4
......@@ -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',
},
// 接口调用
{
......
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