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

fix: 会员资金账户

parent 95149885
/*
* 会员资金账户路由
*/
const router = {
path: '/capitalAccount',
name: 'capitalAccount',
icon: 'SmileOutlined',
hidePageHeader: true,
routes: [
{
path: '/capitalAccount/accountLists',
name: 'accountLists',
component: '@/pages/capitalAccount/accountLists',
},
{
path: '/capitalAccount/accountLists/details',
name: 'accountDetails',
component: '@/pages/capitalAccount/accountLists/accountDetails',
hideInMenu: true,
},
{
path: '/capitalAccount/checkWithdraw',
name: 'checkWithdraw',
component: '@/pages/capitalAccount/checkWithdraw',
},
{
path: '/capitalAccount/checkWithdraw/details',
name: 'checkDetails',
component: '@/pages/capitalAccount/checkWithdraw/checkDetails',
hideInMenu: true,
},
{
path: '/capitalAccount/paymentWithdraw',
name: 'paymentWithdraw',
component: '@/pages/capitalAccount/paymentWithdraw',
},
{
path: '/capitalAccount/paymentWithdraw/details',
name: 'paymentDetails',
component: '@/pages/capitalAccount/paymentWithdraw/paymentDetails',
hideInMenu: true,
},
]
}
export default router
......@@ -20,6 +20,7 @@ import rfqRoute from './rfqRoute' // 询价单路由
import commentRoutes from './commentRoutes';
import contentRoute from './contentRoute'; // 内容管理
import balancedRoute from './balancedRoute'; // 平台结算管理
import capitalAccount from './capitalAccountRoute'; // 会员资金账户
const routeList = [
pageCustomized,
calssPropertyRoute,
......@@ -35,7 +36,9 @@ const routeList = [
balancedRoute,
requisitionRoute,
enquiryOfferRoute,
capitalAccount,
]
const router = [
{
path: '/login',
......
......@@ -177,6 +177,16 @@ export default {
'menu.balanced.receiptAdd': '新建发票',
'menu.balanced.receiptDetail': '发票详情',
'menu.balanced.accountReceivableList': '代收账款结算',
'menu.balanced.accountReceivableDetail': '代收账款明细'
'menu.balanced.accountReceivableDetail': '代收账款明细',
// 会员资金账户
'menu.capitalAccount': '会员资金账户',
'menu.capitalAccount.accountLists': '会员账户',
'menu.capitalAccount.accountDetails': '账户详情',
'menu.capitalAccount.checkWithdraw': '待审核提现',
'menu.capitalAccount.checkDetails': '审核提现',
'menu.capitalAccount.paymentWithdraw': '待支付提现',
'menu.capitalAccount.paymentDetails': '支付提现',
}
// export default utils.transformDataPre(data, 'menu')
import React, { useState, useEffect, useRef, ReactNode } from 'react'
import { history } from 'umi'
import { Card, Space, Row, Col, Button, Table, Modal, Form, Input } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import styles from './index.less'
import StatusTag from '@/components/StatusTag'
import cx from 'classnames'
import moment from 'moment'
import { ColumnType } from 'antd/lib/table/interface'
import { memberStatusMap, moveStatusMap, operationMap, statusMap } from '../constant'
import { SettingOutlined, StopOutlined } from '@ant-design/icons'
import { validatorByte } from '@/utils/regExp'
import { PublicApi } from '@/services/api'
import { StandardTable } from 'god'
const { TextArea } = Input
const AccountDetail: React.FC<{}> = () => {
const refTrade = useRef<any>({})
const [checkForm] = Form.useForm()
const [moveRecord, setMoveRecord] = useState<any>()
const [isDisabled, setIsDisabled] = useState<boolean>(false)
const [visibleModal, setVisibleModal] = useState<boolean>(false)
const [ details, setDetails ] = useState<any>({ accountBalance: 0, lockBalance: 0})
useEffect(() => {
getAccountInfo()
}, [])
const getAccountInfo = async () => {
const { id } = history.location.query
let res = await PublicApi.getPayPlatFormAssetAccountGetPlatFormAssetAccount({id})
const { code, data } = res
setDetails(data)
if(code === 1000){
let statusRecord = await PublicApi.getPayPlatFormAssetAccountGetAccountStatusRecord({memberAssetAccountId: data.id + ''})
setMoveRecord(statusRecord.data)
}
}
// 获取交易记录
const fetchTradeData = (params) => {
return new Promise((resolve, reject) => {
PublicApi.getPayPlatFormAssetAccountGetAccountTradeRecord({memberAssetAccountId: history.location.query.id + '', ...params}).then(res => {
const { data } = res
resolve(data)
})
})
}
const columns: ColumnType<any>[] = [
{
title: '交易流水号',
dataIndex: 'tradeCode',
key: 'tradeCode',
},
{
title: '交易时间',
dataIndex: 'tradeTime',
key: 'tradeTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
},
{
title: '交易金额(元)',
dataIndex: 'tradeMoney',
key: 'tradeMoney',
render: (t, r) => `${operationMap[r.operation]['operator']} ${t.toFixed(2)}`
},
{
title: '交易项目',
dataIndex: 'operation',
key: 'operation',
render: (t, r) => operationMap[t]['title']
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text:any, record:any) => (<StatusTag title={statusMap[text]['title']} type={statusMap[text]['type']} />)
},
{
title: '意见',
dataIndex: 'remark',
key: 'remark',
},
];
const moveColumns: ColumnType<any>[] = [
{
title: '序号',
dataIndex: 'id',
key: 'id',
render: (t, c, i) => i + 1
},
{
title: '操作角色',
dataIndex: ['memberAssetAccount','parentMemberRoleName'],
key: 'id',
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (text:any, record:any) => (<StatusTag title={moveStatusMap[text]['title']} type={moveStatusMap[text]['type']} />)
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
render: (t, r)=> {
return t === 1 ? '冻结资金账户' : '解冻资金账户'
}
},
{
title: '操作时间',
dataIndex: 'createTime',
key: 'createTime',
render: (text: any) => moment(text).format("YYYY-MM-DD HH:mm:ss")
},
{
title: '意见',
dataIndex: 'remark',
key: 'remark',
},
];
const handleRelieve = () => {
setVisibleModal(true)
}
const handleCancel = () => {
setVisibleModal(false)
}
const handleOK = () => {
checkForm.validateFields().then(values => {
setVisibleModal(false)
PublicApi.postPayMemberAssetAccountUpdateMemberAssetAccountEnable({ id: details.id, status: details.accountStatus === 1 ? 2 : 1, ...values }).then(res => {
if(res.code === 1000)
getAccountInfo()
})
})
}
return (
<PageHeaderWrapper
title="账户详情"
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
extra={[
<Button
key="1"
onClick={handleRelieve}
type="primary"
icon={details?.accountStatus === 1 ? <SettingOutlined /> : <StopOutlined />}
disabled={isDisabled}
>
{details?.accountStatus === 1 ? '冻结' : '解冻'}
</Button>,
]}
>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="账户信息">
<Row gutter={100}>
<Col span={8}>
<div className={cx(styles.repayment, styles.repayinfo)}>
<div className={styles['repayment-left']}>
<div className={styles.statistic}>
<div className={styles['statistic-title']}>可用余额(元):</div>
<div className={styles['statistic-amount']}>
{`${((details.accountBalance*100 - details.lockBalance*100)/100).toFixed(2)}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
</div>
</div>
<div className={styles['repayment-end']}>
<span className={styles['repayment-time']}>
{details?.memberName}
</span>
</div>
</div>
</div>
</Col>
<Col span={16}>
<div className={styles.infoRight}>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户归属:</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.parentMemberName}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户余额(元):</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.accountBalance?.toFixed(2)}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>锁定金额(元):</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>{details?.lockBalance?.toFixed(2)}</p>
</Col>
</Row>
<Row>
<Col span={4}>
<p className={styles.rightTitle}>账户状态:</p>
</Col>
<Col span={20}>
<p className={styles.rightInfo}>
{
details?.accountStatus &&
<StatusTag title={memberStatusMap[details.accountStatus]['title']} type={memberStatusMap[details.accountStatus]['type']} />
}
</p>
</Col>
</Row>
</div>
</Col>
</Row>
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="交易记录">
<StandardTable
columns={columns}
currentRef={refTrade}
fetchTableData={(params: any) => fetchTradeData(params)}
/>
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="流转记录">
<Table columns={moveColumns} dataSource={moveRecord} pagination={false} />
{/* <StandardTable
columns={moveColumns}
currentRef={refMove}
fetchTableData={(params: any) => fetchMoveData(params)}
tableProps={{
pagination: false
}}
/> */}
</Card>
</Space>
<Modal
title={details?.accountStatus === 1 ? '会员冻结' : '会员解冻'}
visible={visibleModal}
onOk={handleOK}
onCancel={handleCancel}
destroyOnClose={true}
>
<Form
layout="vertical"
form={checkForm}
>
<Form.Item
name="remark"
label={details?.accountStatus === 1 ? '会员冻结原因' : '会员解冻原因'}
rules={[
{
required: true,
message: '请填写原因'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 120)
}
]}
>
<TextArea rows={6} placeholder="请填写原因" />
</Form.Item>
</Form>
</Modal>
</PageHeaderWrapper>
)
}
export default AccountDetail
.repayment {
padding: 56px 24px 33px;
display: flex;
align-items: center;
background: #8777D9;
border-radius: 4px;
border: 1px solid #8777D9;
color: #fff;
&-left {
flex: 1;
}
&-right {
flex-shrink: 0;
}
&-end {
margin-top: 32px;
}
&-action {
margin-left: 24px;
}
&-time {
line-height: 22px;
margin-right: 8px;
font-weight: 400;
}
}
.statistic {
&-title {
margin-bottom: 28px;
line-height: 22px;
font-weight: 400;
}
&-amount {
line-height: 40px;
font-size: 32px;
font-weight: 500;
}
&-input {
display: block !important;
width: 180px !important;
line-height: 40px !important;
padding: 8px 0 !important;
font-size: 32px !important;
font-weight: 500 !important;
color: #fff !important;
background: none !important;
border-top: none !important;
border-right: none !important;
border-left: none !important;
border-image: initial !important;
outline: none !important;
border-bottom: 1px solid #fff !important;
}
}
.infoRight {
margin: 35px 0;
.rightTitle {
height: 36px;
font-weight: 400;
color: #6B778C;
line-height: 36px;
}
.rightInfo {
height: 36px;
font-weight: 500;
color: #303133;
line-height: 36px;
}
}
.repayinfo {
background-color: #4279DF;
}
// 账户详情右侧操作按钮
.rightActions {
display: flex;
margin-top: 70px;
.rightAction {
width: 88px;
height: 40px;
&:last-child{
background-color: #6B778C;
color: #fff;
margin-left: 24px;
}
}
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react'
import { Card, Space, Button, Input, Modal, Form } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { PublicApi } from '@/services/api'
import NiceForm from '@/components/NiceForm'
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 { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import StatusTag from '@/components/StatusTag'
import { accountMemberType, accountStatusMap, memberStatusMap } from '../constant'
import LevelBrand from '@/pages/member/components/LevelBrand'
import { validatorByte } from '@/utils/regExp'
const formActions = createFormActions();
const { TextArea } = Input;
const AccountLists: React.FC<{}> = () => {
const ref = useRef<any>({})
const [checkForm] = Form.useForm()
const [currentRecord, setCurrentRecord] = useState<any>()
const [visibleModal, setVisibleModal] = useState<boolean>(false)
const columns: ColumnType<any>[] = [
{
title: '会员名称',
dataIndex: 'memberName',
key: 'memberName',
className: 'commonPickColor',
render: (text, record) => <>
<EyePreview
url={`/capitalAccount/accountLists/details?id=${record.id}`}
>
{text}
</EyePreview>
</>
},
{
title: '会员类型',
dataIndex: 'memberType',
key: 'memberType',
render: (t, r) => accountMemberType[t]
},
{
title: '会员角色',
dataIndex: 'memberRoleName',
key: 'memberRoleName',
},
{
title: '会员等级',
dataIndex: 'memberLevel',
key: 'memberLevel',
render: (t, r) => <LevelBrand level={r.level} />
},
{
title: '账户余额',
dataIndex: 'accountBalance',
key: 'accountBalance',
render: text => `¥${text.toFixed(2)}`
},
{
title: '锁定余额',
dataIndex: 'lockBalance',
key: 'lockBalance',
render: text => `¥${text.toFixed(2)}`
},
{
title: '可用余额',
dataIndex: 'usableBalance',
key: 'usableBalance',
render: (t, r) => `¥${((r.accountBalance*100 - r.lockBalance*100)/100).toFixed(2)}`
},
{
title: '会员状态',
dataIndex: 'memberStatus',
key: 'memberStatus',
render: (t, r) => (<StatusTag title={memberStatusMap[t]['title']} type={memberStatusMap[t]['type']} />)
},
{
title: '账户状态',
dataIndex: 'accountStatus',
key: 'accountStatus',
render: (t, r) => (<><span className={accountStatusMap[t]['className']}></span>{accountStatusMap[t]['title']}</>)
},
{
title: '操作',
dataIndex: 'option',
render: (t: any, r: any) => (
<Button type='link' onClick={() => handleRow(r)}>{r.accountStatus===1?'冻结':'解除'}</Button>
)
}
]
const handleRow = (data: any) => {
setCurrentRecord(data)
setVisibleModal(true)
}
const fetchData = (params: any) => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
PublicApi.getPayPlatFormAssetAccountGetPlatFormAssetAccountList(obj).then(res => {
resolve(res.data)
})
})
}
// 会员弹框筛选select值
const fetchSelectOptions = async () => {
const res = await PublicApi.getMemberManagePageitems()
if (res.code === 1000) {
const { data = {} }: any = res
const {
memberTypes = [],
roles = [],
levels = [],
} = data
return {
memberType: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
memberRoleId: roles.map(item => ({ label: item.roleName, value: item.roleId })),
memberLevel: levels.map(item => ({ label: item.levelTag, value: item.level })),
}
}
return {}
}
const handleCancel = () => {
setVisibleModal(false)
}
const handleOK = () => {
checkForm.validateFields().then(values => {
setVisibleModal(false)
PublicApi.postPayPlatFormAssetAccountUpdateMemberAssetAccountEnable({ id: currentRecord.id, status: currentRecord.accountStatus === 1 ? 2 : 1, ...values }).then(res => {
if(res.code === 1000)
ref.current.reload()
})
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: "id" }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
components={{
RangePicker: DatePicker.RangePicker
}}
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberType', 'memberRoleId', 'memberLevel'],
fetchSelectOptions,
);
}}
schema={searchSchema}
/>
}
/>
</Card>
<Modal
title={currentRecord?.accountStatus === 1 ? '会员冻结' : '会员解冻'}
visible={visibleModal}
onOk={handleOK}
onCancel={handleCancel}
destroyOnClose={true}
>
<Form
layout="vertical"
form={checkForm}
>
<Form.Item
name="remark"
label={currentRecord?.accountStatus === 1 ? '会员冻结原因' : '会员解冻原因'}
rules={[
{
required: true,
message: '请填写原因'
},
{
validator: (r, v, c) => validatorByte(r, v, c, 120)
}
]}
>
<TextArea rows={6} placeholder="请填写原因" />
</Form.Item>
</Form>
</Modal>
</PageHeaderWrapper>
)
}
export default AccountLists
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const searchSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '会员名称',
align: 'flex-left',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'end',
},
colStyle: {
marginRight: 20,
},
},
properties: {
memberType: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员类型',
style: {
width: 174
}
}
},
memberRoleId: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员角色',
style: {
width: 174
}
}
},
memberLevel: {
type: 'string',
enum: [],
"x-component-props": {
placeholder: '请选择会员等级',
style: {
width: 174
}
}
},
memberStatus: {
type: 'string',
'x-component-props': {
placeholder: '会员状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
accountStatus: {
type: 'string',
'x-component-props': {
placeholder: '账户状态',
style: { width: '174px' },
},
enum: [
{
label: '正常',
value: 1,
},
{
label: '已冻结',
value: 2,
}
],
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
export const rechargeSchema: ISchema = {
type: 'object',
properties: {
NO_SUBMIT: {
type: 'object',
"x-component": "mega-layout",
"x-component-props": {
labelAlign: 'left',
labelCol: 24,
wrapperCol: 24
},
properties: {
money: {
type: "string",
title: '充值金额',
'x-component-props': {
addonBefore: "¥"
},
"x-rules": [
{
required: true,
message: '请输入充值金额'
},
]
},
type: {
type: "array:number",
"x-component": 'CardCheckBox',
"x-component-props": {
dataSource: [],
type: 'radio' // CardCheckBox 单选模式
},
"title": "充值方式",
"x-rules": [
{
required: true,
message: '请选择充值方式'
}
],
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
.repayment {
padding: 56px 24px 33px;
display: flex;
align-items: center;
background: #8777D9;
border-radius: 4px;
border: 1px solid #8777D9;
color: #fff;
&-left {
flex: 1;
}
&-right {
flex-shrink: 0;
}
&-end {
margin-top: 32px;
}
&-action {
margin-left: 24px;
}
&-time {
line-height: 22px;
margin-right: 8px;
font-weight: 400;
}
}
.statistic {
&-title {
margin-bottom: 28px;
line-height: 22px;
font-weight: 400;
}
&-amount {
line-height: 40px;
font-size: 32px;
font-weight: 500;
}
&-input {
display: block;
width: 180px;
line-height: 40px;
padding: 8px 0;
font-size: 32px;
font-weight: 500;
color: #fff;
background: none;
border-top: none;
border-right: none;
border-left: none;
border-image: initial;
outline: none;
border-bottom: 1px solid #fff;
}
}
.infoRight {
margin: 35px 0;
.rightTitle {
height: 36px;
font-weight: 400;
color: #6B778C;
line-height: 36px;
}
.rightInfo {
height: 36px;
font-weight: 500;
color: #303133;
line-height: 36px;
}
}
.repayinfo {
background-color: #4279DF;
}
\ No newline at end of file
import React, { useState, useEffect, useRef } from 'react'
import { history } from 'umi'
import { Card, Space, Button, Modal, message } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { ColumnType } from 'antd/lib/table/interface'
import { PublicApi } from '@/services/api'
import NiceForm from '@/components/NiceForm'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchSchema } from './schema'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import EyePreview from '@/components/EyePreview'
import { DatePicker } from '@formily/antd-components'
import StatusTag from '@/components/StatusTag'
import { statusMap } from '../constant'
import moment from 'moment'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { ExclamationCircleOutlined } from '@ant-design/icons'
const { confirm } = Modal
const formActions = createFormActions();
const CheckWithdraw: React.FC<{}> = () => {
const ref = useRef<any>({})
const [withdrawRowSelection, withdrawRowCtl] = useRowSelectionTable()
const columns: ColumnType<any>[] = [
{
title: '会员名称',
dataIndex: ['memberAssetAccount', 'memberName'],
key: 'memberAssetAccount',
className: 'commonPickColor',
render: (text, record) => <EyePreview
type="button"
handleClick={()=>clickUp({...record, preview: true})}
>
{text}
</EyePreview>
},
{
title: '提现银行账户名称',
dataIndex: 'bankAccountName',
key: 'bankAccountName',
},
{
title: '银行账号',
dataIndex: 'bankAccount',
key: 'bankAccount',
},
{
title: '提现金额(元)',
dataIndex: 'tradeMoney',
key: 'tradeMoney',
render: (t, r) => t.toFixed(2)
},
{
title: '提现申请时间',
dataIndex: 'tradeTime',
key: 'tradeTime',
render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss'),
// sorter: (a, b) => b.tradeTime - a.tradeTime,
// defaultSortOrder: "ascend"
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (t, r) => (<StatusTag title={statusMap[t]['title']} type={statusMap[t]['type']} />)
},
{
title: '操作',
dataIndex: 'option',
render: (t, r) => <>{r.status === 1 && <Button type='link' onClick={()=>clickUp(r)}>审核</Button>}</>
}
]
const fetchData = (params: any) => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
PublicApi.getPayPlatFormAssetAccountGetCheckCashOutList(obj).then(res => {
resolve(res.data)
})
})
}
const clickUp = (r: any) => {
let params = {
tradeCode: r.tradeCode,
id: r.memberAssetAccount.id,
tradeId: r.id,
amount: r.tradeMoney,
preview: r.preview,
status: r.status,
}
history.push(`/capitalAccount/checkWithdraw/details?detailinfo=${btoa(JSON.stringify(params))}`)
}
const handleBatchCheck = () => {
if(withdrawRowCtl.selectedRowKeys.length > 0){
confirm({
title: '确定要执行批量审核操作?',
icon: <ExclamationCircleOutlined />,
onOk() {
PublicApi.postPayPlatFormAssetAccountBatchCheck({ idList: withdrawRowCtl.selectedRowKeys }).then(res => {
ref.current.reload()
})
},
okType: 'danger',
onCancel() {
console.log('Cancel');
},
okText: '确定',
cancelText: '取消'
})
}else{
message.error('请先选择对应项目进行操作!')
}
}
const controllerBtns = (
<Space>
<Button onClick={handleBatchCheck}>
批量审核通过
</Button>
</Space>
);
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: "id" }}
rowSelection={withdrawRowSelection}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
components={{
RangePicker: DatePicker.RangePicker
}}
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'memberName',
FORM_FILTER_PATH,
);
}}
schema={searchSchema}
expressionScope={{
controllerBtns,
}}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default CheckWithdraw
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const searchSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '会员名称',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
// rowStyle: {
// flexWrap: 'nowrap',
// justifyContent: 'end',
// },
colStyle: {
marginRight: 20,
},
},
properties: {
status: {
type: 'string',
'x-component-props': {
placeholder: '状态',
style: { width: '174px' },
},
enum: [
{
label: '申请提现',
value: 1,
},
{
label: '审核通过',
value: 2,
},
{
label: '审核不通过',
value: 3,
},
// {
// label: '提现成功',
// value: 4,
// },
// {
// label: '提现失败',
// value: 5,
// }
],
},
"[startTime,endTime]": {
type: 'array',
"x-component": 'RangePicker',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
/**
* 资金账户相关常量
*/
// 交易记录状态
export const statusMap = {
'1': { title: '申请提现', type: 'warning' },
'2': { title: '审核通过', type: 'success' },
'3': { title: '审核不通过', type: 'default' },
'4': { title: '提现成功', type: 'success' },
'5': { title: '提现失败', type: 'danger' },
'6': { title: '确认到账', type: 'success' },
}
// 流转状态
export const moveStatusMap = {
'1': { title: '冻结', type: 'danger' },
'2': { title: '解冻', type: 'success' },
}
// 会员状态
export const memberStatusMap = {
'1': { title: '正常', type: 'success' },
'2': { title: '已冻结', type: 'danger' },
}
// 账户状态
export const accountStatusMap = {
'1': { title: '正常', className: 'commonStatusValid' },
'2': { title: '已冻结', className: 'commonStatusNoPass' },
}
// 会员等级类型
export const memberLevelTypeMap = {
'1': '平台会员',
'2': '商户会员',
'3': '渠道会员',
}
// 操作项目
export const operationMap = {
'1': {title: '账户充值', operator: '+'},
'2': {title: '账户提现', operator: '-'},
'3': {title: '订单支付', operator: '-'},
'4': {title: '订单退款', operator: '+'},
'5': {title: '订单返利', operator: '+'}
}
// 会员类型
export const accountMemberType = {
'1': '企业会员',
'2': '企业个人会员',
'3': '渠道会员',
'4': '渠道个人会员',
}
\ No newline at end of file
import React, { useEffect, useState } from 'react'
import { Row, Col } from 'antd';
import styled from 'styled-components'
import { findItemAndDelete } from '@/utils'
import cx from 'classnames'
const RowStyleLayout = styled(props => <div {...props} />)`
.card-checkbox-item {
width: 130px;
height: 32px;
margin-right: 32px;
margin-bottom: 16px;
border:1px solid rgba(235,236,240,1);
padding: 0 16px;
display: flex;
align-items: center;
cursor: pointer;
}
.card-checkbox-item.active {
border-color: #00B382;
position: relative;
}
.card-checkbox-item.active::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 0;
height: 0;
border: 6px solid transparent;
border-right: 6px solid #00B382;
border-bottom: 6px solid #00B382;
}
.card-logo {
display: block;
width: 20px;
height: 20px;
border-radius: 50%;
margin-right: 6px;
}
.card-checkbox-title {
font-size: 12px;
color: #606266;
}
`
interface IProps {
dataSource: any[],
cardChange: any,
name: string,
type?: string,
editable?: boolean,
}
const CardCheckBox = (props: IProps) => {
const { dataSource = [], type = 'checkbox', editable = true, cardChange, name } = props
const [value, setValue] = useState<any>([])
useEffect(() => {
let transport = {}
transport[name] = value[0]
cardChange(transport)
}, [value])
const handleChange = (id) => {
if (!editable) {
return false
}
if (value.includes(id)) {
const newValue = findItemAndDelete(value, id)
setValue(newValue)
} else {
// type === 'radio' ? props.mutators.change([id]) : props.mutators.change([...value, id])
type === 'radio' ? setValue([id]) : setValue([...value, id])
}
}
const isChecked = (id) => {
return value.includes(id)
}
return (
<RowStyleLayout>
<div className='card-checkbox'>
{
dataSource.map(({title, items}, index) => (
<Row key={index}>
<Col span={6}>
<p>{title}</p>
</Col>
<Col span={18}>
<Row>
{
items.length > 0 && items.map((v, i) =>
<Col key={v.id} className={cx('card-checkbox-item', isChecked(v.id) ? 'active' : '')} onClick={() => handleChange(v.id)}>
{v.logoUrl ? <img className='card-logo' src={v.logoUrl} /> : null}
<span className='card-checkbox-title'>{v.name}</span>
</Col>
)
}
</Row>
</Col>
</Row>
))
}
</div>
</RowStyleLayout>
)
}
CardCheckBox.defaultProps = {}
export default CardCheckBox
\ No newline at end of file
.repayment {
padding: 56px 24px 33px;
display: flex;
align-items: center;
background: #8777D9;
border-radius: 4px;
border: 1px solid #8777D9;
color: #fff;
&-left {
flex: 1;
}
&-right {
flex-shrink: 0;
}
&-end {
margin-top: 32px;
}
&-action {
margin-left: 24px;
}
&-time {
line-height: 22px;
margin-right: 8px;
font-weight: 400;
}
}
.statistic {
&-title {
margin-bottom: 28px;
line-height: 22px;
font-weight: 400;
}
&-amount {
line-height: 40px;
font-size: 32px;
font-weight: 500;
}
&-input {
display: block;
width: 180px;
line-height: 40px;
padding: 8px 0;
font-size: 32px;
font-weight: 500;
color: #fff;
background: none;
border-top: none;
border-right: none;
border-left: none;
border-image: initial;
outline: none;
border-bottom: 1px solid #fff;
}
}
.infoRight {
margin: 35px 0;
.rightTitle {
height: 36px;
font-weight: 400;
color: #6B778C;
line-height: 36px;
}
.rightInfo {
height: 36px;
font-weight: 500;
color: #303133;
line-height: 36px;
}
}
.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'
import { ColumnType } from 'antd/lib/table/interface'
import { PublicApi } from '@/services/api'
import NiceForm from '@/components/NiceForm'
import { createFormActions, FormEffectHooks } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { searchSchema } from './schema'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import EyePreview from '@/components/EyePreview'
import { DatePicker } from '@formily/antd-components'
import StatusTag from '@/components/StatusTag'
import { statusMap } from '../constant'
import moment from 'moment'
const formActions = createFormActions();
const PaymentWithdraw: React.FC<{}> = () => {
const ref = useRef<any>({})
const columns: ColumnType<any>[] = [
{
title: '会员名称',
dataIndex: ['memberAssetAccount', 'memberName'],
key: 'memberAssetAccount',
className: 'commonPickColor',
render: (text, record) => <EyePreview
type="button"
handleClick={()=>clickUp({...record, preview: true})}
>
{text}
</EyePreview>
},
{
title: '提现银行账户名称',
dataIndex: 'bankAccountName',
key: 'bankAccountName',
},
{
title: '银行账号',
dataIndex: 'bankAccount',
key: 'bankAccount',
},
{
title: '提现金额(元)',
dataIndex: 'tradeMoney',
key: 'tradeMoney',
render: (t, r) => `¥${t.toFixed(2)}`
},
{
title: '提现申请时间',
dataIndex: 'tradeTime',
key: 'tradeTime',
render: (t, r) => moment(t).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
render: (t, r) => (<StatusTag title={statusMap[t]['title']} type={statusMap[t]['type']} />)
},
{
title: '操作',
dataIndex: 'option',
render: (t, r) => <>{r.status !== 4 && <Button type='link' onClick={()=>clickUp(r)}>支付</Button>}</>
}
]
const fetchData = (params: any) => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
PublicApi.getPayPlatFormAssetAccountGetPayCashOutList(obj).then(res => {
resolve(res.data)
})
})
}
const clickUp = (r: any) => {
let params = {
tradeCode: r.tradeCode,
id: r.memberAssetAccount.id,
payId: r.id,
amount: r.tradeMoney,
preview: r.preview,
status: r.status,
}
history.push(`/capitalAccount/paymentWithdraw/details?detailinfo=${btoa(JSON.stringify(params))}`)
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
currentRef={ref}
tableProps={{ rowKey: "id" }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
components={{
RangePicker: DatePicker.RangePicker
}}
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'memberName',
FORM_FILTER_PATH,
);
}}
schema={searchSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default PaymentWithdraw
This diff is collapsed.
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
export const searchSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '会员名称',
align: 'flex-left',
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
justifyContent: 'end',
},
colStyle: {
marginRight: 20,
},
},
properties: {
status: {
type: 'string',
'x-component-props': {
placeholder: '状态',
style: { width: '174px' },
},
enum: [
{
label: '审核通过',
value: 2,
},
{
label: '提现成功',
value: 4,
},
{
label: '提现失败',
value: 5,
}
],
},
"[startTime,endTime]": {
type: 'array',
"x-component": 'RangePicker',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
},
},
};
\ No newline at end of file
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