Commit b326debe authored by XieZhiXiong's avatar XieZhiXiong

对接授信额度管理列表中

parent f1feab42
......@@ -4,6 +4,7 @@ import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { FORM_FILTER_PATH } from '@/formSchema/const';
......@@ -48,7 +49,7 @@ const QuotaMenage: React.FC = () => {
const defaultColumns: ColumnType<any>[] = [
{
title: '会员归属',
dataIndex: 'memberName',
dataIndex: 'parentMemberName',
align: 'center',
render: (text, record) => (
<EyePreview
......@@ -60,34 +61,34 @@ const QuotaMenage: React.FC = () => {
},
{
title: '会员类型',
dataIndex: 'memberType',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'memberRole',
dataIndex: 'memberRoleName',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '所属会员等级',
dataIndex: 'memberLevel',
dataIndex: 'memberLevelName',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '剩余可用额度(元)',
dataIndex: 'available',
dataIndex: 'canUseQuota',
align: 'center',
},
{
title: '总额度/已用额度(元)',
dataIndex: 'count',
dataIndex: 'quota',
align: 'center',
render: (text, record) => (
<>
<div>总额度:{text}</div>
<div>已使用:{record.used}</div>
<div>已使用:{record.useQuota}</div>
</>
),
},
......@@ -98,7 +99,7 @@ const QuotaMenage: React.FC = () => {
render: (text, record) => (
<Progress
type="circle"
percent={40}
percent={Math.floor(record.useQuota / record.quota)}
strokeColor="#41CC9E"
strokeWidth={12}
width={40}
......@@ -108,28 +109,41 @@ const QuotaMenage: React.FC = () => {
},
{
title: '还款状态',
dataIndex: 'repaymentStatus',
dataIndex: 'repayStatusName',
align: 'center',
render: (text, record) => (
<StatusTag type="warnning" title="逾期 3 天" />
<StatusTag type="warnning" title={text} />
),
},
{
title: '状态',
dataIndex: 'status',
dataIndex: 'statusName',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color="#41CC9E" text="正常" />,
render: (text, record) => <Badge color="#41CC9E" text={text} />,
},
];
const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => {
return Promise.resolve({
total: 2,
data: mock,
const { status = 0, rePayStatus = 0, ...rest } = params;
return new Promise((resolve, reject) => {
PublicApi.getPayCreditApplyPageCredit({
status,
rePayStatus,
...rest,
})
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
})
.catch(() => {
reject();
});
});
};
......@@ -156,7 +170,7 @@ const QuotaMenage: React.FC = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
'parentMemberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
......
......@@ -16,7 +16,7 @@ export const listSearchSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
parentMemberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......@@ -35,7 +35,7 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
repaymentStatus: {
rePayStatus: {
type: 'string',
default: undefined,
enum: [],
......
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