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