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

fix: e账户管理对接冻结/解冻金额

parent f46164ed
......@@ -10,7 +10,7 @@
"upload:v2Preview": "cross-env PRO_ENV=v2Preview taskName=upload yarn scripts:build",
"upload:study": "cross-env PRO_ENV=study taskName=upload yarn scripts:build",
"upload:v2Test": "cross-env PRO_ENV=v2Test taskName=upload yarn scripts:build",
"api": "god-ytt",
"api": "cross-env PRO_ENV=v2 god-ytt",
"start:analyze": "ANALYZE=1 umi dev",
"scripts:build": "node scripts/run",
"scripts:init": "node scripts/init",
......
......@@ -17,8 +17,8 @@ export const statusMap = {
// 流转状态
export const moveStatusMap = {
'1': { title: '冻结', type: 'danger' },
'2': { title: '解冻', type: 'success' },
'2': { title: '冻结', type: 'danger' },
'1': { title: '解冻', type: 'success' },
}
// 会员状态
......
......@@ -21,7 +21,7 @@
&-action {
margin-left: 24px;
}
&-time {
line-height: 22px;
margin-right: 8px;
......@@ -59,7 +59,7 @@
}
.infoRight {
margin: 35px 0;
// margin: 35px 0;
.rightTitle {
height: 36px;
font-weight: 400;
......@@ -70,7 +70,7 @@
height: 36px;
font-weight: 500;
color: #303133;
line-height: 36px;
line-height: 36px;
}
}
......@@ -82,7 +82,7 @@
.rightActions {
display: flex;
margin-top: 70px;
.rightAction {
width: 88px;
height: 40px;
......@@ -90,7 +90,7 @@
&:last-child{
background-color: #6B778C;
color: #fff;
margin-left: 24px;
margin-left: 24px;
}
}
}
\ No newline at end of file
}
import React, { useState, useRef } from 'react'
import { Card, Button, Input, Modal, Form } from 'antd'
import { Card, Button, Input, Form } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { StandardTable } from 'god'
import { history } from 'umi'
......@@ -13,19 +13,15 @@ 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 { validatorByte } from '@/utils/regExp'
import { getPayPlatFormAssetAccountGetPlatFormAssetAccountList, postPayPlatFormAssetAccountUpdateMemberAssetAccountEnable } from '@/services/PayV2Api'
import { accountMemberType, memberStatusMap } from '../constant'
import { getPayPlatFormEAccountAllInPayGetPlatFormEAccountList } from '@/services/PayV2Api'
import { getMemberManagePageitems } from '@/services/MemberV2Api'
import LevelBrand from '@/components/LevelBrand'
const formActions = createFormActions();
const { TextArea } = Input;
const EAccountLists: 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>[] = [
{
......@@ -52,63 +48,44 @@ const EAccountLists: React.FC<{}> = () => {
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: 'memberLevel',
key: 'memberLevel',
render: (t, r) => <LevelBrand level={r.level} />
},
{
title: '锁定余额',
dataIndex: 'lockBalance',
key: 'lockBalance',
render: text => `¥${text.toFixed(2)}`
title: '开户认证',
dataIndex: 'isAuth',
key: 'isAuth',
render: t => t ? '是' : '否'
},
{
title: '可用余额',
dataIndex: 'usableBalance',
key: 'usableBalance',
render: (t, r) => `¥${((r.accountBalance*100 - r.lockBalance*100)/100).toFixed(2)}`
title: '电子协议签约',
dataIndex: 'isSign',
key: 'isSign',
render: t => t ? '是' : '否'
},
{
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']}</>)
render: (t, r) => t && <StatusTag title={memberStatusMap[t]['title']} type={memberStatusMap[t]['type']} />
},
{
title: '操作',
dataIndex: 'option',
render: (t: any, r: any) => (
// `/settlementManage/capitalAccount/accountLists/detail?id=${record.id}`
// handleRow(r)}>{r.accountStatus===1?'冻结':'解除'
<Button type='link' onClick={() => history.push(`/settlementManage/capitalAccount/eAccountLists/detail?id=${r.id}&status=${r.accountStatus}`)}>{r.accountStatus===1?'冻结':'解除'}</Button>
// {r.accountStatus===1?'冻结':'解除'}
<Button type='link' onClick={() => history.push(`/settlementManage/capitalAccount/eAccountLists/detail?id=${r.id}&status=${r.accountStatus}`)}>冻结/解冻</Button>
)
}
]
const handleRow = (data: any) => {
setCurrentRecord(data)
setVisibleModal(true)
}
const fetchData = (params: any) => {
console.log(params)
return new Promise((resolve, reject) => {
let obj = { ...params }
getPayPlatFormAssetAccountGetPlatFormAssetAccountList(obj).then(res => {
getPayPlatFormEAccountAllInPayGetPlatFormEAccountList(obj).then(res => {
resolve(res.data)
})
})
......@@ -134,20 +111,6 @@ const EAccountLists: React.FC<{}> = () => {
return {}
}
const handleCancel = () => {
setVisibleModal(false)
}
const handleOK = () => {
checkForm.validateFields().then(values => {
setVisibleModal(false)
postPayPlatFormAssetAccountUpdateMemberAssetAccountEnable({ id: currentRecord.id, status: currentRecord.accountStatus === 1 ? 2 : 1, ...values }).then(res => {
if(res.code === 1000)
ref.current.reload()
})
})
}
return (
<PageHeaderWrapper>
<Card>
......@@ -180,34 +143,6 @@ const EAccountLists: React.FC<{}> = () => {
}
/>
</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>
)
}
......
......@@ -17,8 +17,12 @@ const tailLayout = {
const Template: React.FC<{}> = () => {
const [form] = Form.useForm();
const { query } = history.location;
const onFinish = (values: any) => {
values.id = query.id;
if(values.id === '5' && !/^([0,1]*)$/.test(values.parameterValue)) {
return message.error('参数值仅为0或1')
}
postManageParameterManageUpdate(values).then(res => {
if (res.code === 1000) {
history.goBack();
......@@ -47,7 +51,15 @@ const Template: React.FC<{}> = () => {
form={form}
onFinish={onFinish}
>
<Form.Item label='参数值' name='parameterValue' rules={[{ required: true, message: '请输入参数值' }]}>
<Form.Item
label='参数值'
name='parameterValue'
rules={[
{
required: true,
message: '请输入参数值'
}
]}>
<Input />
</Form.Item>
<Form.Item {...tailLayout}>
......
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