Commit b02d6a7b authored by XieZhiXiong's avatar XieZhiXiong

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

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