Commit 579abcbb authored by XieZhiXiong's avatar XieZhiXiong

完善授信申请相关

parent de7eb11d
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Date: 2020-08-19 15:33:27 * @Date: 2020-08-19 15:33:27
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @Copyright: 1549414730@qq.com * @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-10-26 16:46:50 * @LastEditTime: 2020-10-27 14:33:09
*/ */
import { RouterChild } from '../utils'; import { RouterChild } from '../utils';
...@@ -47,7 +47,14 @@ const payandSettleRoute: RouterChild = { ...@@ -47,7 +47,14 @@ const payandSettleRoute: RouterChild = {
{ {
path: '/memberCenter/payandSettle/creditApplication/quotaMenage/apply', path: '/memberCenter/payandSettle/creditApplication/quotaMenage/apply',
name: 'quotaApply', name: 'quotaApply',
component: '@/pages/payandSettle/creditApplication/quotaPrSubmit/verify', component: '@/pages/payandSettle/creditApplication/quotaMenage/apply',
hideInMenu: true,
},
// 授信额度管理-历史申请单详情
{
path: '/memberCenter/payandSettle/creditApplication/quotaMenage/history',
name: 'quotaApply',
component: '@/pages/payandSettle/creditApplication/quotaFormQuery/detail',
hideInMenu: true, hideInMenu: true,
}, },
// 授信申请单查询 // 授信申请单查询
......
...@@ -16,20 +16,22 @@ import { GetPayCreditApplyGetApplyDetailResponse } from '@/services/PayApi'; ...@@ -16,20 +16,22 @@ import { GetPayCreditApplyGetApplyDetailResponse } from '@/services/PayApi';
import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS } from '@/constants'; import { CREDIT_INNER_STATUS, CREDIT_OUTER_STATUS } from '@/constants';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import StatusTag from '@/components/StatusTag'; import StatusTag from '@/components/StatusTag';
import { MEMBER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_BADGE_MAP } from '../../../../constant'; import { MEMBER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_BADGE_MAP } from '../../../constant';
const OuterCirculation = React.lazy(() => import('../../../components/OuterCirculation')); const OuterCirculation = React.lazy(() => import('../OuterCirculation'));
const QuotaApplicationInfo = React.lazy(() => import('../../../components/QuotaApplicationInfo')); const QuotaApplicationInfo = React.lazy(() => import('../QuotaApplicationInfo'));
const HitoryList = React.lazy(() => import('../../../components/HistoryList')); const HitoryList = React.lazy(() => import('../HistoryList'));
const OuterCirculationRecord = React.lazy(() => import('../../../components/OuterCirculationRecord')); const OuterCirculationRecord = React.lazy(() => import('../OuterCirculationRecord'));
interface DetailInfo { interface DetailInfoProps {
// 申请id // 申请id
id: string; id: string;
// 授信id // 授信id
creditId: string; creditId: string;
// 是否是编辑的 // 是否是编辑的
isEdit?: boolean; isEdit?: boolean;
// 历史记录目标路径
target?: string;
}; };
interface QuotaValues { interface QuotaValues {
...@@ -41,10 +43,11 @@ interface QuotaValues { ...@@ -41,10 +43,11 @@ interface QuotaValues {
repayPeriod: number | null; repayPeriod: number | null;
}; };
const DetailInfo: React.FC<DetailInfo> = ({ const DetailInfo: React.FC<DetailInfoProps> = ({
id, id,
creditId, creditId,
isEdit = false, isEdit = false,
target,
}) => { }) => {
const [quotaInfo, setQuotaInfo] = useState<GetPayCreditApplyGetApplyDetailResponse>(null); const [quotaInfo, setQuotaInfo] = useState<GetPayCreditApplyGetApplyDetailResponse>(null);
const [quotaValues, setQuotaValues] = useState<QuotaValues>({ const [quotaValues, setQuotaValues] = useState<QuotaValues>({
...@@ -198,7 +201,10 @@ const DetailInfo: React.FC<DetailInfo> = ({ ...@@ -198,7 +201,10 @@ const DetailInfo: React.FC<DetailInfo> = ({
</Suspense> </Suspense>
<Suspense fallback={null}> <Suspense fallback={null}>
<HitoryList dataSource={quotaInfo?.historyApplyList} /> <HitoryList
dataSource={quotaInfo?.historyApplyList}
target={target}
/>
</Suspense> </Suspense>
<Suspense fallback={null}> <Suspense fallback={null}>
......
...@@ -12,10 +12,13 @@ interface HistoryListHistoryListProps { ...@@ -12,10 +12,13 @@ interface HistoryListHistoryListProps {
auditQuota: number; auditQuota: number;
applyTime: string; applyTime: string;
}[]; }[];
// 目标路径
target?: string;
}; };
const HistoryList: React.FC<HistoryListHistoryListProps> = ({ const HistoryList: React.FC<HistoryListHistoryListProps> = ({
dataSource = [], dataSource = [],
target,
}) => { }) => {
const columns: EditableColumns[] = [ const columns: EditableColumns[] = [
...@@ -24,7 +27,7 @@ const HistoryList: React.FC<HistoryListHistoryListProps> = ({ ...@@ -24,7 +27,7 @@ const HistoryList: React.FC<HistoryListHistoryListProps> = ({
dataIndex: 'applyNo', dataIndex: 'applyNo',
render: (text, record) => ( render: (text, record) => (
<EyePreview <EyePreview
url={`/memberCenter/payandSettle/creditApplication/quotaPrSubmit/detail?id=${record.id}`} url={`${target ? target : '/memberCenter/payandSettle/creditApplication/quotaPrSubmit/detail'}?id=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
......
import React, { Suspense, useEffect, useState } from 'react'; import React from 'react';
import {
PageHeader,
Descriptions,
Card,
Spin,
Button,
Badge,
message,
} from 'antd';
import { FormOutlined } from '@ant-design/icons';
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 { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import AvatarWrap from '@/components/AvatarWrap'; import DetailInfo from '../components/DetailInfo';
import StatusTag from '@/components/StatusTag';
import { MEMBER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_TAG_MAP, CREDIT_OUTER_STATUS_BADGE_MAP } from '../../constant';
const OuterCirculation = React.lazy(() => import('../components/OuterCirculation'));
const QuotaApplicationInfo = React.lazy(() => import('../components/QuotaApplicationInfo'));
const HitoryList = React.lazy(() => import('../components/HistoryList'));
const OuterCirculationRecord = React.lazy(() => import('../components/OuterCirculationRecord'));
interface DetailInfo {
// 授信id
id: string;
// 申请id
applyId: string;
// 是否是编辑的
isEdit?: boolean;
};
interface QuotaValues {
// 申请调整额度
applyQuota: number | null;
// 申请调整账单日期
billDay: number | null;
// 申请还款周期
repayPeriod: number | null;
};
const QuotaFormQueryDetail: React.FC = () => { const QuotaFormQueryDetail: React.FC = () => {
const { id } = usePageStatus(); const { id, creditId } = usePageStatus();
const [quotaInfo, setQuotaInfo] = useState<GetPayCreditApplyGetApplyDetailResponse>(null);
const [quotaValues, setQuotaValues] = useState<QuotaValues>({
applyQuota: null,
billDay: null,
repayPeriod: null,
});
const [infoLoading, setInfoloading] = useState(false);
const getQuotaInfo = () => {
if (!id) {
return;
}
setInfoloading(true);
PublicApi.getPayCreditApplyGetApplyDetail({
id,
}).then(res => {
if (res.code === 1000) {
setQuotaInfo(res.data);
setQuotaValues({
applyQuota: res.data.applyQuota,
billDay: res.data.billDay,
repayPeriod: res.data.repayPeriod,
});
}
}).finally(() => {
setInfoloading(false);
});
};
useEffect(() => {
getQuotaInfo();
}, []);
return ( return (
<Spin spinning={infoLoading}> <DetailInfo
<PageHeaderWrapper id={id}
title={ creditId={creditId}
<> target="/memberCenter/payandSettle/creditApplication/quotaFormQuery/detail"
<PageHeader isEdit
style={{ padding: '0' }} />
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
aloneTxt: '单',
name: `申请单号:${quotaInfo && quotaInfo.applyNo ? quotaInfo.applyNo : ''}`,
}}
extra={quotaInfo && quotaInfo.member ? quotaInfo.member.levelTag || '' : ''}
/>
}
extra={(
<>
</>
)}
>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="会员归属">{'暂无'}</Descriptions.Item>
<Descriptions.Item label="会员类型">{quotaInfo?.member?.memberTypeName}</Descriptions.Item>
<Descriptions.Item label="会员角色名称">{quotaInfo?.member?.roleName}</Descriptions.Item>
<Descriptions.Item label="会员状态">
<StatusTag
type={MEMBER_STATUS_TAG_MAP[quotaInfo && quotaInfo.member ? quotaInfo.member.status || 1 : 1]}
title={quotaInfo && quotaInfo.member ? quotaInfo.member.status || 1 : 1}
/>
</Descriptions.Item>
<Descriptions.Item label="外部状态">
<StatusTag type={CREDIT_OUTER_STATUS_TAG_MAP[quotaInfo?.outerStatus]} title={CREDIT_OUTER_STATUS[quotaInfo?.outerStatus]} />
</Descriptions.Item>
<Descriptions.Item label="内部状态">
<Badge color={CREDIT_OUTER_STATUS_BADGE_MAP[quotaInfo?.innerStatus]} text={CREDIT_INNER_STATUS[quotaInfo?.innerStatus]} />
</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<Suspense fallback={null}>
<OuterCirculation
steps={
quotaInfo && quotaInfo.outerVerifyRecordList ?
quotaInfo.outerVerifyRecordList.map(item => ({
title: item.operate,
description: item.roleName,
})) :
[]
}
current={0}
/>
</Suspense>
<Suspense fallback={null}>
<QuotaApplicationInfo
quotaInfo={{
originalQuota: quotaInfo?.originalQuota,
applyQuota: quotaValues.applyQuota,
billDay: quotaValues.billDay,
repayPeriod: quotaValues.repayPeriod,
applyTime: quotaInfo?.applyTime,
}}
verify={
quotaInfo && quotaInfo.verify ? {
quota: quotaInfo?.verify?.quota,
billDay: quotaInfo?.verify?.billDay,
repayPeriod: quotaInfo?.verify?.repayPeriod,
verifyTime: quotaInfo?.verify?.verifyTime,
} :
null
}
editable={false}
/>
</Suspense>
<Suspense fallback={null}>
<HitoryList dataSource={quotaInfo?.historyApplyList} />
</Suspense>
<Suspense fallback={null}>
<OuterCirculationRecord dataSource={quotaInfo?.outerVerifyRecordList} />
</Suspense>
</PageHeaderWrapper>
</Spin>
); );
}; };
......
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const QuotaMenageApply: React.FC = () => {
const { id, creditId } = usePageStatus();
return (
<DetailInfo
id={id}
creditId={creditId}
target="/memberCenter/payandSettle/creditApplication/quotaMenage/history"
isEdit
/>
);
};
export default QuotaMenageApply;
\ No newline at end of file
...@@ -55,7 +55,7 @@ const BillInfo: React.FC<BillInfoProps> = ({ ...@@ -55,7 +55,7 @@ const BillInfo: React.FC<BillInfoProps> = ({
<TabPane <TabPane
tab={( tab={(
<div className={styles.dateWrap}> <div className={styles.dateWrap}>
<StatusTag type="danger" title={item.OverdueDay} /> <StatusTag type="danger" title={`逾期 ${item.overdueDay} 天`} />
<div className={styles.time}>{item.billName}</div> <div className={styles.time}>{item.billName}</div>
</div> </div>
)} )}
...@@ -89,7 +89,7 @@ const BillInfo: React.FC<BillInfoProps> = ({ ...@@ -89,7 +89,7 @@ const BillInfo: React.FC<BillInfoProps> = ({
textAlign: 'right', textAlign: 'right',
}} }}
> >
<StatusTag type="danger" title={trade.OverdueDay} /> <StatusTag type="danger" title={`逾期 ${trade.overdueDay} 天`} />
</Col> </Col>
</Row> </Row>
</Descriptions.Item> </Descriptions.Item>
......
...@@ -103,6 +103,13 @@ interface IntroduceRowProps { ...@@ -103,6 +103,13 @@ interface IntroduceRowProps {
interface IntroduceRowState { interface IntroduceRowState {
billId: number; billId: number;
billInfo: BillDetailData | null; billInfo: BillDetailData | null;
bankAccount: {
id: number,
name: string,
bankAccount: string,
bankDeposit: string,
memberId: number,
},
visibleRecord: boolean; visibleRecord: boolean;
visibleRepayment: boolean; visibleRepayment: boolean;
visibleUploadVoucher: boolean; visibleUploadVoucher: boolean;
...@@ -122,6 +129,13 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -122,6 +129,13 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
this.state = { this.state = {
billId: 0, billId: 0,
billInfo: null, billInfo: null,
bankAccount: {
id: 0,
name: '',
bankAccount: '',
bankDeposit: '',
memberId: 0,
},
visibleRecord: false, visibleRecord: false,
visibleRepayment: false, visibleRepayment: false,
visibleUploadVoucher: false, visibleUploadVoucher: false,
...@@ -138,6 +152,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -138,6 +152,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
tradeRecordRef = null; tradeRecordRef = null;
// 获取账单详情
getBillDetail = id => { getBillDetail = id => {
const { fetchBillDetail } = this.props; const { fetchBillDetail } = this.props;
...@@ -147,12 +162,27 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -147,12 +162,27 @@ 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();
}).finally(() => { }).finally(() => {
this.setState({ billInfoLoading: false }); this.setState({ billInfoLoading: false });
}); });
} }
}; };
// 获取对公账户信息
getSettleAccountsCorporateAccountConfig = (payee: string) => {
PublicApi.getSettleAccountsCorporateAccountConfig({
memberId: payee,
}).then(res => {
if (res.code === 1000) {
this.setState({
bankAccount: res.data,
});
}
});
};
// 根据下拉框数据改变设置默认选中第一项,并获取相应的账单详情
initialize = (options) => { initialize = (options) => {
if (options && options.length) { if (options && options.length) {
const first = options[0]; const first = options[0];
...@@ -224,7 +254,12 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -224,7 +254,12 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
handleUploadVoucherSubmit = values => { handleUploadVoucherSubmit = values => {
const { payProveList } = values; const { payProveList } = values;
const { repaymentValues, billId } = this.state; const { repaymentValues, billId, bankAccount } = this.state;
if (!bankAccount.id || !bankAccount.memberId) {
message.error('没有还款账户相关信息,无法还款');
return;
}
this.setState({ uploadVoucherSubmitLoading: true }); this.setState({ uploadVoucherSubmitLoading: true });
PublicApi.postPayCreditApplyCreditRepay({ PublicApi.postPayCreditApplyCreditRepay({
...@@ -289,6 +324,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -289,6 +324,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
billInfoLoading, billInfoLoading,
visibleRecord, visibleRecord,
billInfo, billInfo,
bankAccount,
visibleRepayment, visibleRepayment,
visibleUploadVoucher, visibleUploadVoucher,
repaymentSubmitLoading, repaymentSubmitLoading,
...@@ -389,7 +425,14 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -389,7 +425,14 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
<span className={styles['repayment-time']}> <span className={styles['repayment-time']}>
{billInfo?.expireTime} 到期 {billInfo?.expireTime} 到期
</span> </span>
<StatusTag type="danger" title={billInfo?.expireDay} /> <StatusTag
type="danger"
title={
billInfo && billInfo.expireDay !== undefined ?
billInfo.expireDay > 0 ? `${billInfo.expireDay}天后` : `逾期 ${billInfo.expireDay} 天` :
''
}
/>
</div> </div>
</div> </div>
<div className={styles['repayment-right']}> <div className={styles['repayment-right']}>
...@@ -415,13 +458,13 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -415,13 +458,13 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
<Col span={8}> <Col span={8}>
<div className={styles.badgeWrap}> <div className={styles.badgeWrap}>
<Badge color="#DFE1E6" text={(<span className={styles['badgeWrap-title']}>还款周期:</span>)} /> <Badge color="#DFE1E6" text={(<span className={styles['badgeWrap-title']}>还款周期:</span>)} />
<span className={styles['badgeWrap-content']}>{billInfo?.repayPeriod}</span> <span className={styles['badgeWrap-content']}>{billInfo?.repayPeriod}</span>
</div> </div>
</Col> </Col>
<Col span={8}> <Col span={8}>
<div className={styles.badgeWrap}> <div className={styles.badgeWrap}>
<Badge color="#DFE1E6" text={(<span className={styles['badgeWrap-title']}>账单日期:</span>)} /> <Badge color="#DFE1E6" text={(<span className={styles['badgeWrap-title']}>账单日期:</span>)} />
<span className={styles['badgeWrap-content']}>{billInfo?.billDay}</span> <span className={styles['badgeWrap-content']}>{billInfo?.billDay}</span>
</div> </div>
</Col> </Col>
</Row> </Row>
...@@ -488,6 +531,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState> ...@@ -488,6 +531,7 @@ class IntroduceRow extends React.Component<IntroduceRowProps, IntroduceRowState>
> >
<NiceForm <NiceForm
previewPlaceholder="" previewPlaceholder=""
initialValues={bankAccount}
effects={($, { setFieldState }) => { effects={($, { setFieldState }) => {
}} }}
......
...@@ -106,22 +106,19 @@ export const uploadVoucherModalSchema: ISchema = { ...@@ -106,22 +106,19 @@ export const uploadVoucherModalSchema: ISchema = {
full: true, full: true,
}, },
properties: { properties: {
accountName: { name: {
type: 'string', type: 'string',
title: '还款账户名称', title: '还款账户名称',
default: '温州市隆昌皮具有限公司',
'x-component': 'Text', 'x-component': 'Text',
}, },
bankAccount: { bankAccount: {
type: 'string', type: 'string',
title: '银行账号', title: '银行账号',
default: '6214 7812 3456 7891 1234',
'x-component': 'Text', 'x-component': 'Text',
}, },
bod: { bankDeposit: {
type: 'string', type: 'string',
title: '开户行', title: '开户行',
default: '中国建设银行广州市分行营业部',
'x-component': 'Text', 'x-component': 'Text',
}, },
payProveList: { payProveList: {
......
...@@ -187,7 +187,10 @@ const QuotaMenageDetail: React.FC = () => { ...@@ -187,7 +187,10 @@ const QuotaMenageDetail: React.FC = () => {
</Suspense> </Suspense>
<Suspense fallback={null}> <Suspense fallback={null}>
<HistoryList /> <HistoryList
dataSource={creditInfo?.historyApplyList}
target="/memberCenter/payandSettle/creditApplication/quotaMenage/history"
/>
</Suspense> </Suspense>
</PageHeaderWrapper> </PageHeaderWrapper>
</Spin> </Spin>
......
import React from 'react'; import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo'; import DetailInfo from '../components/DetailInfo';
const QuotaPrSubmitDetail: React.FC = () => { const QuotaPrSubmitDetail: React.FC = () => {
const { id, creditId } = usePageStatus(); const { id, creditId } = usePageStatus();
......
import React from 'react'; import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from './components/DetailInfo'; import DetailInfo from '../components/DetailInfo';
const VerifyQuotaPrSubmit: React.FC = () => { const VerifyQuotaPrSubmit: React.FC = () => {
const { id, creditId } = usePageStatus(); const { id, creditId } = usePageStatus();
return ( return (
<DetailInfo id={id} creditId={creditId} isEdit /> <DetailInfo
id={id}
creditId={creditId}
isEdit
/>
); );
}; };
......
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