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

fix: 待确认支付结果

parent 22822b5b
......@@ -12,6 +12,7 @@ export interface IStatusColor {
// 用于标签状态控制
export interface StatusColorsProps {
status: number,
text?: string,
type: 'out' | 'inside' | 'saleInside' | 'payOut' | 'deliveInside' | 'inquiry' | 'transformInside' |'transformOut'
}
......@@ -101,14 +102,14 @@ const typeMaps = {
// 订单内部状态显示
const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status, type } = props
const { status, type, text = null } = props
const statusText = typeMaps[type]
const statusShowColor = matchStatusColor(status)
// 单独处理支付比例 确认到账的状态颜色
if(type === 'payOut' && status === 3) {
return (<Tag color="#41CC9E">{statusText[status]}</Tag>)
}
return (<Tag color={statusShowColor}>{statusText[status]}</Tag>)
// // 单独处理支付比例 确认到账的状态颜色
// if(type === 'payOut' && status === 3) {
// return (<Tag color="#41CC9E">{statusText[status]}</Tag>)
// }
return (<Tag color={statusShowColor}>{statusText[status] || text}</Tag>)
}
StatusColors.defaultProps = {}
......
import React, { useState, useEffect, useContext } from 'react'
import { Modal, List, Avatar, Button, Space } from 'antd'
import { Modal, List, Button, Space } from 'antd'
import { usePageStatus } from '@/hooks/usePageStatus'
import { OrderDetailContext } from '../../context'
import { PayOutWorkState } from '@/constants'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
import OverflowText from '@/components/OverflowText'
......@@ -17,11 +16,11 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
const { id } = usePageStatus()
const [visible, setVisible] = useState(false)
const [isReady, setIsReady] = useState<any>()
const canCtlData = data.paymentInformationResponses.find(v => v.externalState === PayOutWorkState.READY_CONFIRM_RESULT) || {}
const canCtlData = data.payments.find(v => v.showConfirm) || {}
// const transData = canCtlData.payOrderUrls?.split(',') || []
// const transData = canCtlData.vouchers?.split(',') || []
const transData = canCtlData.payOrderUrls || []
const transData = canCtlData.vouchers || []
useEffect(() => {
if (currentRef) {
......@@ -39,12 +38,12 @@ const OrderPayResultModal:React.FC<OrderPayResultModalProps> = ({type, currentRe
const handleConfirm = (isReady) => {
setIsReady(isReady)
const params = {
state: isReady,
id: Number(id),
paymentInformationId: canCtlData.id
agree: isReady,
orderId: Number(id),
batchNo: canCtlData.batchNo
}
PublicApi.postOrderPlatformConfirmedPaymentResultsOrder(params).then(res => {
PublicApi.postOrderPlatformManagePayConfirm(params).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack()
......
......@@ -19,16 +19,16 @@ const TabHeader = ({dataSource}) => {
<Row justify='space-between' style={{minWidth: 216}}>
<Col>
<div className={style.fontGray}>支付比例</div>
<div className={style.bignumber}>{dataSource.payRatio}%</div>
<div className={style.bignumber}>{dataSource.payRate}%</div>
</Col>
<Col>
<StatusColors status={dataSource.externalState} type='payOut'/>
<StatusColors status={dataSource.outerStatusName} text={dataSource.outerStatusName} type='payOut'/>
</Col>
</Row>
<Row justify='space-between' align='middle' style={{width: '100%'}}>
<Col className={style.smallnumber}>{dataSource.payPrice || 0}</Col>
<Col className={style.smallnumber}>{dataSource.payAmount || 0}</Col>
<Col>
{ dataSource.externalState === PayOutWorkState.READY_CONFIRM_RESULT && <a onClick={() => {
{ dataSource.showView && <a onClick={() => {
setPayResultType('preview')
payResultVisible.current.setVisible(true)
}}>查看</a> }
......@@ -79,30 +79,21 @@ const OrderPayTabs:React.FC<OrderPayTabsProps> = (props) => {
<MellowCard bordered={false} fullHeight>
{/* <Row gutter={24}> */}
<Tabs defaultActiveKey='1'>
{ data.payments && data.payments.map(v => <TabPane key={v.id} tab={<TabHeader dataSource={v}/>}>
{ data.payments && data.payments.map(v => <TabPane key={v.paymentId} tab={<TabHeader dataSource={v}/>}>
<Row>
<Col className={style.fontGray} span={4}>支付环节: </Col>
<Col>{v.payNode}</Col>
</Row>
{
v.payWay === -1 ?
<Row>
<Col className={style.fontGray} span={4}>支付方式: </Col>
<Col>{v.channel === 100 ? '账期' : '月结'}</Col>
</Row>
:
<>
<Row>
<Col className={style.fontGray} span={4}>支付方式: </Col>
<Col>{payTextList[v.payWay]}</Col>
<Col>{v.payTypeName}</Col>
</Row>
<Row>
<Col className={style.fontGray} span={4}>支付渠道: </Col>
<Col>{payChannel[v.channel]}</Col>
<Col>{v.payChannelName}</Col>
</Row>
</>
</TabPane>)
}
</TabPane>) }
</Tabs>
{/* </Row> */}
</MellowCard>
......
......@@ -4,18 +4,13 @@ import { Button, Row, Col } from 'antd'
import { PublicApi } from '@/services/api'
import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE } from '@/constants'
import StatusColors from '../../components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import {
Chart,
Interval,
Axis,
Tooltip,
Coordinate,
Legend,
View,
Annotation,
} from 'bizcharts';
import DataSet from "@antv/data-set";
......@@ -23,11 +18,10 @@ import DataSet from "@antv/data-set";
const CircleChart = props => {
const { sumPrice = 100, alreadyPay = 10 } = props
const { DataView } = DataSet;
const dv = new DataView();
const amount = Number(sumPrice) - Number(alreadyPay)
const userData = [
{ type: '总金额', value: sumPrice - alreadyPay },
{ type: '已支付', value: alreadyPay }
{ type: '总金额', value: amount },
{ type: '已支付', value: Number(alreadyPay) }
];
const userDv = new DataView();
......@@ -63,7 +57,7 @@ export const useSelfTable = () => {
dataIndex: 'orderNo',
key: 'orderNo',
render: (text, record) => {
return <EyePreview url={`/orderSystem/detail?id=${record.id}`}>
return <EyePreview url={`/orderSystem/detail?id=${record.orderId}`}>
{text}
</EyePreview>
}
......@@ -96,7 +90,7 @@ export const useSelfTable = () => {
<div><span>已支付:</span><span>{record.paidAmount || 0}</span></div>
</Col>
<Col style={{ width: 40 }}>
<CircleChart sumPrice={record.amount} alreadyPay={record.paidAmount} />
<CircleChart sumPrice={text} alreadyPay={record.paidAmount} />
</Col>
</Row>,
width: 200
......@@ -127,7 +121,7 @@ export const useSelfTable = () => {
]
const handleConfirm = async (record) => {
history.push(`/orderSystem/readyConfirmPayList/detail?id=${record.id}`)
history.push(`/orderSystem/readyConfirmPayList/detail?id=${record.orderId}`)
}
const handleCancel = async (id) => {
......
......@@ -81,7 +81,7 @@ const AddRule:React.FC<{}> = (props) => {
<p>状态:</p>
</Col>
<Col span={21}>
<p>{ruleDetails?.state ? '有效' : '无效'}</p>
<p>{ruleDetails?.status ? '有效' : '无效'}</p>
</Col>
{/* <Col span={3}>
<p>交易流程名称:</p>
......@@ -103,7 +103,7 @@ const AddRule:React.FC<{}> = (props) => {
<p>是否所有会员共用:</p>
</Col>
<Col span={21}>
<p>{ruleDetails?.isTacitlyApprove === 1 ? '是' : '否'}</p>
<p>{ruleDetails?.allMembers ? '是' : '否'}</p>
</Col>
</Row>
<StandardTable
......
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