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

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

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