Commit 03c15027 authored by XieZhiXiong's avatar XieZhiXiong

调整授信申请相关接口

parent f4162542
......@@ -13,10 +13,11 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { GetPayCreditApplyGetApplyDetailResponse } from '@/services/PayApi';
import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS } from '@/constants';
import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS, CREDIT_STATUS } from '@/constants';
import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag';
import { CREDIT_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_BADGE_MAP } from '../../../constant';
import { normalizeFiledata, FileData } from '@/utils';
const OuterCirculation = React.lazy(() => import('../OuterCirculation'));
const QuotaApplicationInfo = React.lazy(() => import('../QuotaApplicationInfo'));
......@@ -41,6 +42,8 @@ interface QuotaValues {
billDay: number | null;
// 申请还款周期
repayPeriod: number | null;
// 申请附件
fileList: FileData[];
};
const DetailInfo: React.FC<DetailInfoProps> = ({
......@@ -54,24 +57,28 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
applyQuota: null,
billDay: null,
repayPeriod: null,
fileList: [],
});
const [infoLoading, setInfoloading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
// 获取授信详情
const getQuotaInfo = () => {
if (!id) {
return;
}
setInfoloading(true);
PublicApi.getPayCreditApplyGetApplyDetail({
id,
applyId: id,
creditId,
}).then(res => {
if (res.code === 1000) {
setQuotaInfo(res.data);
setQuotaValues({
applyQuota: res.data.applyQuota,
billDay: res.data.billDay,
repayPeriod: res.data.repayPeriod,
applyQuota: res.data.apply.applyQuota,
billDay: res.data.apply.billDay,
repayPeriod: res.data.apply.repayPeriod,
fileList: res.data.apply.fileList ? res.data.apply.fileList.map(item => normalizeFiledata(item.fileUrl)) : [],
});
}
}).finally(() => {
......@@ -90,10 +97,13 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const handleSubmit = () => {
setSubmitLoading(true);
const { fileList, ...rest } = quotaValues;
PublicApi.postPayCreditApplyAddCreditApply({
applyId: +id,
creditId: creditId ? +creditId : 0,
...quotaValues,
fileList: fileList.map(item => ({ name: item.name, fileUrl: item.url })),
...rest,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
......@@ -117,7 +127,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<AvatarWrap
info={{
aloneTxt: '单',
name: `申请单号:${quotaInfo && quotaInfo.applyNo ? quotaInfo.applyNo : ''}`,
name: `申请单号:${quotaInfo && quotaInfo.member ? quotaInfo.member.applyNo : ''}`,
}}
extra={quotaInfo && quotaInfo.member ? quotaInfo.member.levelTag || '' : ''}
/>
......@@ -143,20 +153,20 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
padding: '0 32px',
}}
>
<Descriptions.Item label="会员归属">{'暂无'}</Descriptions.Item>
<Descriptions.Item label="会员归属">{quotaInfo?.member?.parentMemberName}</Descriptions.Item>
<Descriptions.Item label="会员类型">{quotaInfo?.member?.memberTypeName}</Descriptions.Item>
<Descriptions.Item label="会员角色名称">{quotaInfo?.member?.roleName}</Descriptions.Item>
<Descriptions.Item label="会员状态">
<StatusTag
type={CREDIT_STATUS_TAG_MAP[quotaInfo && quotaInfo.member ? quotaInfo.member.status || 1 : 1]}
title={quotaInfo && quotaInfo.member ? quotaInfo.member.status || 1 : 1}
type={CREDIT_STATUS_TAG_MAP[quotaInfo && quotaInfo.member ? quotaInfo.member.status : 'default']}
title={quotaInfo && quotaInfo.member ? CREDIT_STATUS[quotaInfo.member.status] : ''}
/>
</Descriptions.Item>
<Descriptions.Item label="外部状态">
<StatusTag type={CREDIT_OUTER_STATUS_TAG_MAP[quotaInfo?.outerStatus]} title={CREDIT_OUTER_STATUS[quotaInfo?.outerStatus]} />
<StatusTag type={CREDIT_OUTER_STATUS_TAG_MAP[quotaInfo?.member.outerStatus]} title={CREDIT_OUTER_STATUS[quotaInfo?.member.outerStatus]} />
</Descriptions.Item>
<Descriptions.Item label="内部状态">
<Badge color={CREDIT_OUTER_STATUS_BADGE_MAP[quotaInfo?.innerStatus]} text={CREDIT_INNER_STATUS[quotaInfo?.innerStatus]} />
<Badge color={CREDIT_OUTER_STATUS_BADGE_MAP[quotaInfo?.member.innerStatus]} text={CREDIT_INNER_STATUS[quotaInfo?.member.innerStatus]} />
</Descriptions.Item>
</Descriptions>
</PageHeader>
......@@ -166,25 +176,26 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
<Suspense fallback={null}>
<OuterCirculation
steps={
quotaInfo && quotaInfo.outerVerifyRecordList ?
quotaInfo.outerVerifyRecordList.map(item => ({
title: item.operate,
quotaInfo && quotaInfo.outerTaskList ?
quotaInfo.outerTaskList.map(item => ({
title: item.taskName,
description: item.roleName,
})) :
[]
}
current={0}
current={quotaInfo && quotaInfo.outerTaskList ? quotaInfo && quotaInfo.outerTaskList.findIndex(item => item.isExecute === 0) : 0}
/>
</Suspense>
<Suspense fallback={null}>
<QuotaApplicationInfo
quotaInfo={{
originalQuota: quotaInfo?.originalQuota,
originalQuota: quotaInfo?.apply.originalQuota,
applyQuota: quotaValues.applyQuota,
billDay: quotaValues.billDay,
repayPeriod: quotaValues.repayPeriod,
applyTime: quotaInfo?.applyTime,
applyTime: quotaInfo?.apply.applyTime,
fileList: quotaValues.fileList,
}}
verify={
quotaInfo && quotaInfo.verify ? {
......
......@@ -11,6 +11,7 @@ import {
} from 'antd';
import { FormOutlined, RightCircleFilled } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { FileData } from '@/utils';
import MellowCard from '@/components/MellowCard';
import NiceForm from '@/components/NiceForm';
import { editModalSchema } from './schema';
......@@ -33,8 +34,10 @@ interface QuotaApplicationInfo {
billDay: number,
// 申请还款周期
repayPeriod: number,
// //申请时间
// 申请时间
applyTime: string,
// 申请附件
fileList: FileData[];
},
// 授信审批信息
verify: {
......@@ -189,26 +192,7 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
</div>
<Upload
defaultFileList={[
{
uid: '1',
name: 'xxx.png',
status: 'done',
url: 'http://www.baidu.com/xxx.png',
},
{
uid: '2',
name: 'yyy.png',
status: 'done',
url: 'http://www.baidu.com/yyy.png',
},
{
uid: '3',
name: 'zzz.png',
status: 'done',
url: 'http://www.baidu.com/zzz.png',
},
]}
fileList={quotaInfo.fileList}
disabled
/>
</Col>
......@@ -261,6 +245,7 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
>
<NiceForm
previewPlaceholder=""
initialValues={quotaInfo}
effects={($, actions) => {
const { setFieldState, setFieldValue } = actions;
......
......@@ -101,7 +101,7 @@ export const editModalSchema: ISchema = {
},
],
},
attachment: {
fileList: {
type: 'string',
title: '申请附件',
'x-component': 'Upload',
......@@ -112,7 +112,7 @@ export const editModalSchema: ISchema = {
prefix: '/creditApplication/applicationAttachment/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.png, .jpg, .jpeg',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
{
......
......@@ -36,7 +36,7 @@ const QuotaFormQuery: React.FC = () => {
render: (text, record) => (
<>
<EyePreview
url={`/memberCenter/payandSettle/creditApplication/quotaFormQuery/detail?id=${record.id}`}
url={`/memberCenter/payandSettle/creditApplication/quotaFormQuery/detail?id=${record.id}&creditId=${record.creditId}`}
>
{text}
</EyePreview>
......
......@@ -3,11 +3,11 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const QuotaMenageApply: React.FC = () => {
const { id, creditId } = usePageStatus();
const { applyId, creditId } = usePageStatus();
return (
<DetailInfo
id={id}
id={applyId}
creditId={creditId}
target="/memberCenter/payandSettle/creditApplication/quotaMenage/history"
isEdit
......
......@@ -67,6 +67,10 @@ export interface BillDetailData {
* 最后还款日期
*/
lastRepayDate: string
/**
* 收款人Id
*/
memberId: number
};
export interface BillRecordParams extends RecordParams {
......@@ -162,7 +166,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
id: `${id}`,
}).then(res => {
this.setState({ billInfo: res });
// this.getSettleAccountsCorporateAccountConfig();
this.getSettleAccountsCorporateAccountConfig(res.memberId);
}).finally(() => {
this.setState({ billInfoLoading: false });
});
......@@ -170,7 +174,10 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
};
// 获取对公账户信息
getSettleAccountsCorporateAccountConfig = (payee: string) => {
getSettleAccountsCorporateAccountConfig = (payee: number) => {
if (!payee) {
return;
}
PublicApi.getSettleAccountsCorporateAccountConfig({
memberId: payee,
}).then(res => {
......@@ -256,7 +263,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
const { payProveList } = values;
const { repaymentValues, billId, bankAccount } = this.state;
if (!bankAccount.id || !bankAccount.memberId) {
if (!bankAccount || !bankAccount.id || !bankAccount.memberId) {
message.error('没有还款账户相关信息,无法还款');
return;
}
......
......@@ -35,7 +35,7 @@ const QuotaMenage: React.FC = () => {
const handleJumpApply = record => {
// 跳转申请页面
history.push(`/memberCenter/payandSettle/creditApplication/quotaMenage/apply?id=${record.id}`);
history.push(`/memberCenter/payandSettle/creditApplication/quotaMenage/apply?creditId=${record.id}&applyId=0`);
};
const defaultColumns: ColumnType<any>[] = [
......
......@@ -445,7 +445,6 @@ export interface FileData {
};
// 初始化 Upload 数据
export function normalizeFiledata<T>(url: T): T
export function normalizeFiledata(url: string): FileData
export function normalizeFiledata(url: any): any {
if (!url) {
......
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