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

fix: 会员资金账户-待审核/支付提现

parent d41d6019
......@@ -21,13 +21,14 @@ const CheckDetail: React.FC<{}> = () => {
const refTrade = useRef<any>({})
const [checkForm] = Form.useForm();
const [visibleModal, setVisibleModal] = useState<boolean>(false)
const [dealRecord, setDealRecord] = useState<any>()
const [checkStatus, setCheckStatus] = useState<number>(4)
const [checkStatus, setCheckStatus] = useState<number>(1)
const [disableCheck, setDisableCheck] = useState<boolean>(false)
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const [ details, setDetails ] = useState<any>({ accountBalance: 0, lockBalance: 0})
const [details, setDetails] = useState<any>({ accountBalance: 0, lockBalance: 0})
const [bankDetail, setBankDetail] = useState<GetSettleAccountsCorporateAccountConfigResponse>()
const [tempStatus, setTempStatus] = useState<number>(0)
useEffect(() => {
getAccountInfo()
}, [])
......@@ -100,11 +101,12 @@ const CheckDetail: React.FC<{}> = () => {
checkForm.validateFields().then(values => {
setConfirmLoading(true)
// @ts-ignore
PublicApi.postPayMemberAssetAccountCheck({ id: urlParams.id ,...values}).then(res => {
PublicApi.postPayMemberAssetAccountCheck({ id: urlParams.tradeId ,...values}).then(res => {
if(res.code === 1000) {
setDisableCheck(true)
console.log(res.data)
console.log(values, res.data, 'value')
getAccountInfo()
refTrade.current.reload()
setTempStatus(values.status)
}else{
setDisableCheck(false)
}
......@@ -123,7 +125,7 @@ const CheckDetail: React.FC<{}> = () => {
title="审核提现"
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
extra={[
extra={ urlParams.preview ? [] : [
<Button
icon={<CheckSquareOutlined />}
key="1"
......@@ -137,7 +139,7 @@ const CheckDetail: React.FC<{}> = () => {
>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="外部流转">
<Steps progressDot current={1}>
<Steps progressDot current={urlParams.status === 2 || tempStatus === 1 ? 2 : 1}>
<Step title="申请提现" description="采购商" />
<Step title="审核提现" description="平台" />
<Step title="支付提现" description="平台" />
......@@ -295,15 +297,15 @@ const CheckDetail: React.FC<{}> = () => {
message: '请选择审核状态'
}
]}
initialValue={4}
initialValue={1}
>
<Radio.Group onChange={handleStatusChange}>
<Radio value={4}>审核通过</Radio>
<Radio value={3}>审核不通过</Radio>
<Radio value={1}>审核通过</Radio>
<Radio value={2}>审核不通过</Radio>
</Radio.Group>
</Form.Item>
{
checkStatus===3 && <Form.Item
checkStatus===2 && <Form.Item
name="remark"
label={'审核不通过原因'}
rules={[
......
......@@ -32,7 +32,9 @@ const CheckWithdraw: React.FC<{}> = () => {
key: 'memberAssetAccount',
className: 'commonPickColor',
render: (text, record) => <EyePreview
url={`/memberCenter/payandSettle/amountAccountManage/memberAccountManage/detail?id=${record.memberAssetAccount.id}`}
type="button"
handleClick={()=>clickUp({...record, preview: true})}
// url={`/memberCenter/payandSettle/amountAccountManage/memberAccountManage/detail?id=${record.memberAssetAccount.id}`}
>
{text}
</EyePreview>
......@@ -57,7 +59,9 @@ const CheckWithdraw: React.FC<{}> = () => {
title: '提现申请时间',
dataIndex: 'tradeTime',
key: 'tradeTime',
render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss')
render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
// sorter: (a, b) => b.tradeTime - a.tradeTime,
// defaultSortOrder: "ascend"
},
{
title: '状态',
......@@ -68,7 +72,7 @@ const CheckWithdraw: React.FC<{}> = () => {
{
title: '操作',
dataIndex: 'option',
render: (t, r) => (<Button type='link' onClick={()=>clickUp(r)}>审核</Button>)
render: (t, r) => <>{r.status === 1 && <Button type='link' onClick={()=>clickUp(r)}>审核</Button>}</>
}
]
......@@ -86,7 +90,10 @@ const CheckWithdraw: React.FC<{}> = () => {
let params = {
tradeCode: r.tradeCode,
id: r.memberAssetAccount.id,
amount: r.tradeMoney
tradeId: r.id,
amount: r.tradeMoney,
preview: r.preview,
status: r.status,
}
history.push(`/memberCenter/payandSettle/amountAccountManage/checkWithdraw/detail?detailinfo=${btoa(JSON.stringify(params))}`)
}
......
......@@ -63,14 +63,14 @@ export const searchSchema: ISchema = {
label: '审核不通过',
value: 3,
},
{
label: '提现成功',
value: 4,
},
{
label: '提现失败',
value: 5,
}
// {
// label: '提现成功',
// value: 4,
// },
// {
// label: '提现失败',
// value: 5,
// }
],
},
"[startTime,endTime]": {
......
import React, { useState } from 'react'
import React, { useEffect, useState } from 'react'
import { Row, Col } from 'antd';
import styled from 'styled-components'
import { findItemAndDelete } from '@/utils'
......@@ -47,29 +47,31 @@ const RowStyleLayout = styled(props => <div {...props} />)`
interface IProps {
dataSource: any[],
cardChange: any,
name: string,
type?: string,
editable?: boolean,
}
const CardCheckBox = (props: IProps) => {
const { dataSource = [], type = 'checkbox', editable = true } = props
const { dataSource = [], type = 'checkbox', editable = true, cardChange, name } = props
const [value, setValue] = useState<any>([])
// const value: number[] = props.value || []
useEffect(() => {
let transport = {}
transport[name] = value[0]
cardChange(transport)
}, [value])
const handleChange = (id) => {
console.log(id)
if (!editable) {
return false
}
if (value.includes(id)) {
const newValue = findItemAndDelete(value, id)
setValue(newValue)
console.log(newValue)
// props.mutators.change(newValue)
} else {
// type === 'radio' ? props.mutators.change([id]) : props.mutators.change([...value, id])
console.log([id])
type === 'radio' ? setValue([id]) : setValue([...value, id])
}
}
......
......@@ -77,3 +77,8 @@
.repayinfo {
background-color: #4279DF;
}
// 支付详情错误提示
.errorTips {
color: red;
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react'
import { history } from 'umi'
import { Card, Space, Button, } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
......@@ -9,11 +10,10 @@ import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchSchema } from './schema'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { PlusOutlined } from '@ant-design/icons'
import EyePreview from '@/components/EyePreview'
import { DatePicker } from '@formily/antd-components'
import StatusTag from '@/components/StatusTag'
import { accountStatusMap, memberStatusMap } from '../../constant'
import { statusMap } from '../../constant'
import moment from 'moment'
const formActions = createFormActions();
......@@ -28,7 +28,9 @@ const PaymentWithdraw: React.FC<{}> = () => {
key: 'memberAssetAccount',
className: 'commonPickColor',
render: (text, record) => <EyePreview
url={`/memberCenter/payandSettle/amountAccountManage/memberAccountManage/detail?id=${record.id}`}
type="button"
handleClick={()=>clickUp({...record, preview: true})}
// url={`/memberCenter/payandSettle/amountAccountManage/memberAccountManage/detail?id=${record.id}`}
>
{text}
</EyePreview>
......@@ -45,8 +47,8 @@ const PaymentWithdraw: React.FC<{}> = () => {
},
{
title: '提现金额(元)',
dataIndex: 'memberRoleName',
key: 'memberRoleName',
dataIndex: 'tradeMoney',
key: 'tradeMoney',
render: (t, r) => `¥${t.toFixed(2)}`
},
{
......@@ -56,15 +58,15 @@ const PaymentWithdraw: React.FC<{}> = () => {
render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '会员状态',
dataIndex: 'memberStatus',
key: 'memberStatus',
render: (t, r) => (<StatusTag title={memberStatusMap[t]['title']} type={memberStatusMap[t]['type']} />)
title: '状态',
dataIndex: 'status',
key: 'status',
render: (t, r) => (<StatusTag title={statusMap[t]['title']} type={statusMap[t]['type']} />)
},
{
title: '操作',
dataIndex: 'option',
render: (t, r) => (<Button type='link' onClick={()=>clickUp(r)}>支付</Button>)
render: (t, r) => <>{r.status !== 4 && <Button type='link' onClick={()=>clickUp(r)}>支付</Button>}</>
}
]
......@@ -79,7 +81,15 @@ const PaymentWithdraw: React.FC<{}> = () => {
}
const clickUp = (r: any) => {
console.log('通过')
let params = {
tradeCode: r.tradeCode,
id: r.memberAssetAccount.id,
payId: r.id,
amount: r.tradeMoney,
preview: r.preview,
status: r.status,
}
history.push(`/memberCenter/payandSettle/amountAccountManage/paymentWithdraw/detail?detailinfo=${btoa(JSON.stringify(params))}`)
}
return (
......
......@@ -47,15 +47,15 @@ export const searchSchema: ISchema = {
enum: [
{
label: '审核通过',
value: 1,
value: 2,
},
{
label: '提现成功',
value: 2,
value: 4,
},
{
label: '提现失败',
value: 3,
value: 5,
}
],
},
......
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