Commit b02d6a7b authored by XieZhiXiong's avatar XieZhiXiong

chore: 调整授信内部状态相关逻辑

parent d74ff7a7
...@@ -1246,42 +1246,57 @@ export const BILL_TRADE_OPERATION = { ...@@ -1246,42 +1246,57 @@ export const BILL_TRADE_OPERATION = {
*/ */
export const CREDIT_INNER_STATUS_UNCOMMITTED = 1; export const CREDIT_INNER_STATUS_UNCOMMITTED = 1;
/** /**
* 已提交 * 提交审核失败
*/
export const CREDIT_INNER_STATUS_COMMITTED_FAILED = 2;
/**
* 提交审核成功
*/ */
export const CREDIT_INNER_STATUS_COMMITTED = 2; export const CREDIT_INNER_STATUS_COMMITTED_SUCCESS= 3;
/**
* 一级审核失败
*/
export const CREDIT_INNER_STATUS_FAILED_1 = 4;
/** /**
* 一级审核通过 * 一级审核通过
*/ */
export const CREDIT_INNER_STATUS_SUCCESS_1 = 3; export const CREDIT_INNER_STATUS_SUCCESS_1 = 5;
/**
* 二级审核失败
*/
export const CREDIT_INNER_STATUS_FAILED_2 = 6;
/** /**
* 二级审核通过 * 二级审核通过
*/ */
export const CREDIT_INNER_STATUS_SUCCESS_2 = 4; export const CREDIT_INNER_STATUS_SUCCESS_2 = 7;
/** /**
* 三级审核通过 * 三级审核失败
*/ */
export const CREDIT_INNER_STATUS_SUCCESS_3 = 5; export const CREDIT_INNER_STATUS_FAILED_3 = 8;
/** /**
* 审核不通过 * 三级审核通过
*/ */
export const CREDIT_INNER_STATUS_FAILED = 6; export const CREDIT_INNER_STATUS_SUCCESS_3 = 9;
/** /**
* 确认审核通过 * 审核不通过
*/ */
export const CREDIT_INNER_STATUS_CONFIRM_SUCCESS = 7; export const CREDIT_INNER_STATUS_FAILED = 10;
/** /**
* 确认审核不通过 * 审核通过
*/ */
export const CREDIT_INNER_STATUS_CONFIRM_FAILED = 8; export const CREDIT_INNER_STATUS_CONFIRM_SUCCESS = 11;
export const CREDIT_INNER_STATUS = { export const CREDIT_INNER_STATUS = {
[CREDIT_INNER_STATUS_UNCOMMITTED]: '待提交审核', [CREDIT_INNER_STATUS_UNCOMMITTED]: '待提交审核',
[CREDIT_INNER_STATUS_COMMITTED]: '已提交', [CREDIT_INNER_STATUS_COMMITTED_FAILED]: '提交审核失败',
[CREDIT_INNER_STATUS_COMMITTED_SUCCESS]: '提交审核成功',
[CREDIT_INNER_STATUS_FAILED_1]: '一级审核失败',
[CREDIT_INNER_STATUS_SUCCESS_1]: '一级审核通过', [CREDIT_INNER_STATUS_SUCCESS_1]: '一级审核通过',
[CREDIT_INNER_STATUS_FAILED_2]: '二级审核失败',
[CREDIT_INNER_STATUS_SUCCESS_2]: '二级审核通过', [CREDIT_INNER_STATUS_SUCCESS_2]: '二级审核通过',
[CREDIT_INNER_STATUS_FAILED_3]: '三级审核失败',
[CREDIT_INNER_STATUS_SUCCESS_3]: '三级审核通过', [CREDIT_INNER_STATUS_SUCCESS_3]: '三级审核通过',
[CREDIT_INNER_STATUS_FAILED]: '审核不通过', [CREDIT_INNER_STATUS_FAILED]: '审核不通过',
[CREDIT_INNER_STATUS_CONFIRM_SUCCESS]: '确认审核通过', [CREDIT_INNER_STATUS_CONFIRM_SUCCESS]: '审核通过',
[CREDIT_INNER_STATUS_CONFIRM_FAILED]: '确认审核不通过',
}; };
// 授信外部状态 // 授信外部状态
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-10-15 15:41:51 * @Date: 2020-10-15 15:41:51
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-28 14:49:44 * @LastEditTime: 2021-01-18 11:20:03
* @Description: * @Description:
*/ */
import { import {
...@@ -17,13 +17,16 @@ import { ...@@ -17,13 +17,16 @@ import {
CREDIT_OUTER_STATUS_SUCCESS, CREDIT_OUTER_STATUS_SUCCESS,
CREDIT_OUTER_STATUS_FAILED, CREDIT_OUTER_STATUS_FAILED,
CREDIT_INNER_STATUS_UNCOMMITTED, CREDIT_INNER_STATUS_UNCOMMITTED,
CREDIT_INNER_STATUS_COMMITTED, CREDIT_INNER_STATUS_COMMITTED_FAILED,
CREDIT_INNER_STATUS_COMMITTED_SUCCESS,
CREDIT_INNER_STATUS_FAILED_1,
CREDIT_INNER_STATUS_SUCCESS_1, CREDIT_INNER_STATUS_SUCCESS_1,
CREDIT_INNER_STATUS_SUCCESS_2, CREDIT_INNER_STATUS_SUCCESS_2,
CREDIT_INNER_STATUS_FAILED_2,
CREDIT_INNER_STATUS_FAILED_3,
CREDIT_INNER_STATUS_SUCCESS_3, CREDIT_INNER_STATUS_SUCCESS_3,
CREDIT_INNER_STATUS_FAILED, CREDIT_INNER_STATUS_FAILED,
CREDIT_INNER_STATUS_CONFIRM_SUCCESS, CREDIT_INNER_STATUS_CONFIRM_SUCCESS,
CREDIT_INNER_STATUS_CONFIRM_FAILED,
CREDIT_STATUS_NOT_APPLIED, CREDIT_STATUS_NOT_APPLIED,
CREDIT_STATUS_APPLYING, CREDIT_STATUS_APPLYING,
CREDIT_STATUS_NORMAL, CREDIT_STATUS_NORMAL,
...@@ -79,13 +82,17 @@ export const CREDIT_OUTER_STATUS_TAG_MAP = { ...@@ -79,13 +82,17 @@ export const CREDIT_OUTER_STATUS_TAG_MAP = {
// 授信内部部状态 Badge map // 授信内部部状态 Badge map
export const CREDIT_INNER_STATUS_BADGE_MAP = { export const CREDIT_INNER_STATUS_BADGE_MAP = {
[CREDIT_INNER_STATUS_UNCOMMITTED]: '#669EDE', [CREDIT_INNER_STATUS_UNCOMMITTED]: '#669EDE',
[CREDIT_INNER_STATUS_COMMITTED]: '#41CC9E', [CREDIT_INNER_STATUS_COMMITTED_FAILED]: '#EF6260',
[CREDIT_INNER_STATUS_COMMITTED_SUCCESS]: '#41CC9E',
[CREDIT_INNER_STATUS_FAILED_1]: '#EF6260',
[CREDIT_INNER_STATUS_SUCCESS_1]: '#41CC9E', [CREDIT_INNER_STATUS_SUCCESS_1]: '#41CC9E',
[CREDIT_INNER_STATUS_FAILED_2]: '#EF6260',
[CREDIT_INNER_STATUS_SUCCESS_2]: '#41CC9E', [CREDIT_INNER_STATUS_SUCCESS_2]: '#41CC9E',
[CREDIT_INNER_STATUS_FAILED_3]: '#EF6260',
[CREDIT_INNER_STATUS_SUCCESS_3]: '#41CC9E', [CREDIT_INNER_STATUS_SUCCESS_3]: '#41CC9E',
[CREDIT_INNER_STATUS_FAILED]: '#EF6260', [CREDIT_INNER_STATUS_FAILED]: '#EF6260',
[CREDIT_INNER_STATUS_CONFIRM_SUCCESS]: '#41CC9E', [CREDIT_INNER_STATUS_CONFIRM_SUCCESS]: '#41CC9E',
[CREDIT_INNER_STATUS_CONFIRM_FAILED]: '#EF6260', [CREDIT_INNER_STATUS_FAILED]: '#EF6260',
}; };
......
...@@ -46,16 +46,26 @@ interface QuotaValues { ...@@ -46,16 +46,26 @@ interface QuotaValues {
}; };
interface DetailInfoProps { interface DetailInfoProps {
// 申请id /**
* 申请id
*/
id: string; id: string;
// 授信id /**
* 授信id
*/
creditId: string; creditId: string;
// 审批信息是否可编辑 /**
* 审批信息是否可编辑
*/
approvalEditable?: boolean; approvalEditable?: boolean;
// 历史记录目标路径 /**
* 历史记录目标路径
*/
target?: string; target?: string;
// 头部右侧拓展 /**
headExtra?: React.ReactNode; * 头部右侧拓展
*/
headExtra?: (info: QuotaInfo) => React.ReactNode;
}; };
interface QuotaInfo extends GetPayCreditHandleGetApplyDetailResponse { interface QuotaInfo extends GetPayCreditHandleGetApplyDetailResponse {
...@@ -130,8 +140,8 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => { ...@@ -130,8 +140,8 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => {
quota: quotaValuesData.quota, quota: quotaValuesData.quota,
billDay: quotaValuesData.billDay, billDay: quotaValuesData.billDay,
repayPeriod: quotaValuesData.repayPeriod, repayPeriod: quotaValuesData.repayPeriod,
verifyTime: quotaInfo?.verify?.verifyTime, verifyTime: verify?.verifyTime,
maxApplyQuota: quotaInfo?.verify?.maxApplyQuota, maxApplyQuota: verify?.maxApplyQuota,
} : null, } : null,
}); });
} }
...@@ -188,7 +198,7 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => { ...@@ -188,7 +198,7 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => {
} }
extra={( extra={(
<> <>
{headExtra} {headExtra && headExtra(quotaInfo)}
</> </>
)} )}
> >
......
...@@ -136,7 +136,7 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto ...@@ -136,7 +136,7 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto
{outerHistory ? ( {outerHistory ? (
<Tabs.TabPane tab="外部流转记录" key="1"> <Tabs.TabPane tab="外部流转记录" key="1">
<PolymericTable <PolymericTable
rowKey="operateTime" rowKey="step"
dataSource={outerHistory} dataSource={outerHistory}
columns={outerColumns} columns={outerColumns}
loading={false} loading={false}
...@@ -146,7 +146,7 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto ...@@ -146,7 +146,7 @@ const FlowRecords: React.FC<FlowRecordsProps> = ({ outerHistory = [], innerHisto
) : null} ) : null}
<Tabs.TabPane tab="内部流转记录" key="2"> <Tabs.TabPane tab="内部流转记录" key="2">
<PolymericTable <PolymericTable
rowKey="operateTime" rowKey="step"
dataSource={innerHistory} dataSource={innerHistory}
columns={innerColumns} columns={innerColumns}
loading={false} loading={false}
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2020-10-28 17:29:14 * @Date: 2020-10-28 17:29:14
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-28 17:38:06 * @LastEditTime: 2021-01-18 11:30:49
* @Description: 提交审核 Modal * @Description: 提交审核 Modal
*/ */
import React from 'react'; import React, { useEffect } from 'react';
import { Modal } from 'antd'; import { Modal } from 'antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { auditModalSchema } from './schema'; import { auditModalSchema } from './schema';
const modalFormActions = createFormActions(); const modalFormActions = createAsyncFormActions();
const { const {
onFieldValueChange$, onFieldValueChange$,
onFieldInputChange$, onFieldInputChange$,
...@@ -22,6 +22,10 @@ interface VerifyModalProps { ...@@ -22,6 +22,10 @@ interface VerifyModalProps {
confirmLoading: boolean; confirmLoading: boolean;
onSubmit: (values: { agree: 0 | 1, reason: string }) => void; onSubmit: (values: { agree: 0 | 1, reason: string }) => void;
onVisible: (flag: boolean) => void; onVisible: (flag: boolean) => void;
/**
* 是否只可以选择 不接受申请
*/
rejected?: boolean;
}; };
const VerifyModal: React.FC<VerifyModalProps> = ({ const VerifyModal: React.FC<VerifyModalProps> = ({
...@@ -29,8 +33,26 @@ const VerifyModal: React.FC<VerifyModalProps> = ({ ...@@ -29,8 +33,26 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
confirmLoading, confirmLoading,
onSubmit, onSubmit,
onVisible, onVisible,
rejected = false,
}) => { }) => {
useEffect(() => {
// 内部状态为 审核通过 才能选择 审核通过选项
if (rejected) {
modalFormActions.setFieldState('agree', state => {
const newMenu =
state.props.enum.map(
(item: { label: string, value: any }) => ({
...item,
disabled: item.value === 1,
})
);
FormPath.setIn(state, 'props.enum', newMenu);
FormPath.setIn(state, 'value', 0);
});
}
}, [rejected]);
const handleSubmit = values => { const handleSubmit = values => {
if (onSubmit) { if (onSubmit) {
onSubmit(values); onSubmit(values);
...@@ -44,12 +66,11 @@ const VerifyModal: React.FC<VerifyModalProps> = ({ ...@@ -44,12 +66,11 @@ const VerifyModal: React.FC<VerifyModalProps> = ({
confirmLoading={confirmLoading} confirmLoading={confirmLoading}
onOk={() => modalFormActions.submit()} onOk={() => modalFormActions.submit()}
onCancel={() => onVisible(false)} onCancel={() => onVisible(false)}
destroyOnClose
> >
<NiceForm <NiceForm
effects={($, { setFieldState }) => { effects={($, { setFieldState }) => {
onFieldValueChange$('agree').subscribe(fieldState => { onFieldValueChange$('agree').subscribe(fieldState => {
setFieldState('reason', state => { setFieldState('opinion', state => {
state.visible = !fieldState.value; state.visible = !fieldState.value;
}); });
}); });
......
...@@ -20,7 +20,7 @@ export const auditModalSchema: ISchema = { ...@@ -20,7 +20,7 @@ export const auditModalSchema: ISchema = {
'x-component': 'radio', 'x-component': 'radio',
'x-component-props': {}, 'x-component-props': {},
}, },
reason: { opinion: {
type: 'string', type: 'string',
title: '审核不通过原因', title: '审核不通过原因',
'x-component': 'textarea', 'x-component': 'textarea',
......
...@@ -42,7 +42,7 @@ const QuotaPr1Verify: React.FC = () => { ...@@ -42,7 +42,7 @@ const QuotaPr1Verify: React.FC = () => {
id={id} id={id}
creditId={creditId} creditId={creditId}
target="/memberCenter/payandSettle/creditManage/quotaPr1/history" target="/memberCenter/payandSettle/creditManage/quotaPr1/history"
headExtra={( headExtra={() => (
<Button <Button
type="primary" type="primary"
icon={<FormOutlined />} icon={<FormOutlined />}
......
...@@ -42,7 +42,7 @@ const QuotaPr2Verify: React.FC = () => { ...@@ -42,7 +42,7 @@ const QuotaPr2Verify: React.FC = () => {
id={id} id={id}
creditId={creditId} creditId={creditId}
target="/memberCenter/payandSettle/creditManage/quotaPr2/history" target="/memberCenter/payandSettle/creditManage/quotaPr2/history"
headExtra={( headExtra={() => (
<Button <Button
type="primary" type="primary"
icon={<FormOutlined />} icon={<FormOutlined />}
......
...@@ -42,7 +42,7 @@ const QuotaPr3Verify: React.FC = () => { ...@@ -42,7 +42,7 @@ const QuotaPr3Verify: React.FC = () => {
id={id} id={id}
creditId={creditId} creditId={creditId}
target="/memberCenter/payandSettle/creditManage/quotaPr3/history" target="/memberCenter/payandSettle/creditManage/quotaPr3/history"
headExtra={( headExtra={() => (
<Button <Button
type="primary" type="primary"
icon={<FormOutlined />} icon={<FormOutlined />}
......
...@@ -6,6 +6,12 @@ import { history } from 'umi'; ...@@ -6,6 +6,12 @@ import { history } from 'umi';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { FormOutlined } from '@ant-design/icons'; import { FormOutlined } from '@ant-design/icons';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import {
CREDIT_INNER_STATUS_COMMITTED_FAILED,
CREDIT_INNER_STATUS_FAILED_1,
CREDIT_INNER_STATUS_FAILED_2,
CREDIT_INNER_STATUS_FAILED_3,
} from '@/constants';
import DetailInfo from '../components/DetailInfo'; import DetailInfo from '../components/DetailInfo';
import VerifyModal from '../components/VerifyModal'; import VerifyModal from '../components/VerifyModal';
...@@ -13,6 +19,7 @@ const QuotaPrConfirmVerify: React.FC = () => { ...@@ -13,6 +19,7 @@ const QuotaPrConfirmVerify: React.FC = () => {
const { id, creditId } = usePageStatus(); const { id, creditId } = usePageStatus();
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false); const [submitLoading, setSubmitLoading] = useState(false);
const [rejected, setRejected] = useState(false);
const handleSubmit = values => { const handleSubmit = values => {
if (!id) { if (!id) {
...@@ -36,17 +43,29 @@ const QuotaPrConfirmVerify: React.FC = () => { ...@@ -36,17 +43,29 @@ const QuotaPrConfirmVerify: React.FC = () => {
setModalVisible(!!flag); setModalVisible(!!flag);
}; };
const handleVerify = (info) => {
if (
info?.member?.innerStatus === CREDIT_INNER_STATUS_COMMITTED_FAILED ||
info?.member?.innerStatus === CREDIT_INNER_STATUS_FAILED_1 ||
info?.member?.innerStatus === CREDIT_INNER_STATUS_FAILED_2 ||
info?.member?.innerStatus === CREDIT_INNER_STATUS_FAILED_3
) {
setRejected(true);
}
handleVisible(true);
};
return ( return (
<> <>
<DetailInfo <DetailInfo
id={id} id={id}
creditId={creditId} creditId={creditId}
target="/memberCenter/payandSettle/creditManage/quotaPrConfirm/history" target="/memberCenter/payandSettle/creditManage/quotaPrConfirm/history"
headExtra={( headExtra={(info) => (
<Button <Button
type="primary" type="primary"
icon={<FormOutlined />} icon={<FormOutlined />}
onClick={() => handleVisible(true)} onClick={() => handleVerify(info)}
> >
确认 确认
</Button> </Button>
...@@ -54,6 +73,7 @@ const QuotaPrConfirmVerify: React.FC = () => { ...@@ -54,6 +73,7 @@ const QuotaPrConfirmVerify: React.FC = () => {
/> />
<VerifyModal <VerifyModal
visible={modalVisible} visible={modalVisible}
rejected={rejected}
confirmLoading={submitLoading} confirmLoading={submitLoading}
onSubmit={handleSubmit} onSubmit={handleSubmit}
onVisible={handleVisible} onVisible={handleVisible}
......
...@@ -42,7 +42,7 @@ const QuotaPrSubmitVerify: React.FC = () => { ...@@ -42,7 +42,7 @@ const QuotaPrSubmitVerify: React.FC = () => {
id={id} id={id}
creditId={creditId} creditId={creditId}
target="/memberCenter/payandSettle/creditManage/quotaPrSubmit/history" target="/memberCenter/payandSettle/creditManage/quotaPrSubmit/history"
headExtra={( headExtra={() => (
<Button <Button
type="primary" type="primary"
icon={<FormOutlined />} icon={<FormOutlined />}
......
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