Commit b326debe authored by XieZhiXiong's avatar XieZhiXiong

对接授信额度管理列表中

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