Commit dbfc8a71 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理订单详情价格运费显示异常

parent 2df872b7
......@@ -84,10 +84,10 @@ const warehouseColumns: any[] = [
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { orderProductRequests = [], receiverAddressId, orderModel } = dataSource || {}
const { orderProductRequests = [], receiverAddressId, orderModel, sumPrice, amount, freight } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const sum = orderProductRequests.reduce((prev, next) => prev + Number((next.price || 0)), 0)
const sum = amount || orderProductRequests.reduce((prev, next) => prev + Number((next.price || 0)), 0)
const modelRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(0)
const handleSetting = () => {
......@@ -126,11 +126,11 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
</Col>
<Col span={2}>
<div>运费 { isEditData && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/>}</div>
<div>{freePrice}</div>
<div>{freight || freePrice}</div>
</Col>
<Col span={2}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{sum + freePrice}</div>
<div>{sumPrice || sum + freePrice}</div>
</Col>
<ModalForm
modalTitle='设置运费'
......@@ -293,7 +293,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
}
return v
})
ctl.setData({
...data,
orderProductRequests: newData
......@@ -365,7 +365,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'memberPrice',
align: 'center',
key: 'memberPrice',
render: (text, record) => record.isMemberPrice ? (text + '%') : null
render: (text, record) => record.isMemberPrice ? (text * 100 + '%') : null
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
......@@ -382,9 +382,9 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
dataIndex: 'price',
dataIndex: 'money',
align: 'center',
key: 'price',
key: 'money',
},
// 接口调用
{
......@@ -450,4 +450,4 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
OrderProductTable.defaultProps = {}
export default OrderProductTable
\ No newline at end of file
export default OrderProductTable
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