Commit 9d77105c authored by XieZhiXiong's avatar XieZhiXiong

修改最大额度字段、晚上样式

parent 315efde2
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-08-31 17:52:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-22 13:56:48
* @LastEditTime: 2020-10-30 13:34:05
* @Description: 状态 tag
*/
import React from 'react';
......@@ -12,12 +12,13 @@ import styles from './index.less';
interface StatusTagProps {
type: 'success' | 'warning' | 'default' | 'danger' | 'primary';
title: React.ReactNode;
style?: {[key: string]: any},
};
const StatusTag: React.FC<StatusTagProps> = ({ type, title }) => {
const StatusTag: React.FC<StatusTagProps> = ({ type, title, style }) => {
const cls = classNames(styles.tag, styles[`tag__${type}`]);
return (
<span className={cls}>{title}</span>
<span className={cls} style={style}>{title}</span>
);
};
......
......@@ -203,6 +203,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
billDay: quotaInfo?.verify?.billDay,
repayPeriod: quotaInfo?.verify?.repayPeriod,
verifyTime: quotaInfo?.verify?.verifyTime,
maxApplyQuota: quotaInfo?.verify?.maxApplyQuota,
} :
null
}
......
......@@ -49,6 +49,8 @@ interface QuotaApplicationInfo {
repayPeriod: number,
// 审批时间
verifyTime: string,
// 最大申请额度
maxApplyQuota: number,
} | null,
};
......@@ -60,6 +62,10 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
}) => {
const [modalVisible, setModalVisible] = useState(false);
// 最大申请额度,没有审批信息说明是第一次申请
// 第一次申请 最大值取 支付配置的默认额度,否则取审批信息的最大值数据
const maxQuota = !verify ? quotaInfo.applyQuota : verify.maxApplyQuota;
const handleSubmit = values => {
if (onSubmit) {
const {
......@@ -102,7 +108,7 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
left: '-20px'
}}
>
<div>{quotaInfo.applyQuota}</div>
<div>{maxQuota}</div>
<div>
最高可调额度
</div>
......@@ -254,17 +260,17 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
setFieldState('applyQuota', fileState => {
fileState.rules = fileState.rules.concat({
validator(value) {
return +value > quotaInfo.applyQuota ? '输入值已超出最大额度' : '';
return +value > maxQuota ? '输入值已超出最大额度' : '';
}
});
});
setFieldState('quotaSlide', fileState => {
fileState.props['x-component-props'].max = quotaInfo.applyQuota;
fileState.props['x-component-props'].max = maxQuota;
fileState.props['x-component-props'].marks = {
0: {
label: MinMarks,
},
[quotaInfo.applyQuota]: {
[maxQuota]: {
label: MaxMarks,
},
};
......
......@@ -6,6 +6,7 @@ import {
Badge,
} from 'antd';
import { history } from 'umi';
import lodash from 'lodash';
import { PublicApi } from '@/services/api';
import { GetPayCreditHandleGetApplyDetailResponse } from '@/services/PayApi';
import {
......@@ -80,8 +81,9 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setQuotaInfo(res.data);
// 审批信息不存在说明没有 修改过 审批信息,手动赋值 授信申请里的数据
if (!verify && res.data.member.innerStatus === CREDIT_INNER_STATUS_UNCOMMITTED) {
// 审批信息不存在 或者 审批信息里边 审批额度不存在
// 说明没有 修改过 审批信息,手动赋值 授信申请里的数据
if ((!verify || !lodash.isNumber(verify.quota)) && res.data.member.innerStatus === CREDIT_INNER_STATUS_UNCOMMITTED) {
setQuotaValues({
quota: apply.applyQuota,
billDay: apply.billDay,
......@@ -90,7 +92,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}
// 如果有审批信息则直接赋值 审批信息
if (verify) {
if (verify && lodash.isNumber(verify.quota)) {
setQuotaValues({
quota: verify.quota,
billDay: verify.billDay,
......@@ -221,11 +223,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
applyType: quotaInfo?.apply.applyType,
}}
verify={
!isNaN(quotaValues.quota) ? {
lodash.isNumber(quotaValues.quota) ? {
quota: quotaValues.quota,
billDay: quotaValues.billDay,
repayPeriod: quotaValues.repayPeriod,
verifyTime: quotaInfo?.verify?.verifyTime,
maxApplyQuota: quotaInfo?.verify?.maxApplyQuota,
} :
null
}
......
......@@ -51,6 +51,8 @@ interface QuotaApplicationInfo {
repayPeriod: number,
// 审批时间
verifyTime: string,
// 最大申请额度
maxApplyQuota: number,
} | null,
};
......@@ -106,7 +108,7 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
left: '-20px'
}}
>
<div>{quotaInfo.applyQuota}</div>
<div>{verify?.maxApplyQuota}</div>
<div>
最高可调额度
</div>
......@@ -255,17 +257,17 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
setFieldState('applyQuota', fileState => {
fileState.rules = fileState.rules.concat({
validator(value) {
return +value > quotaInfo.applyQuota ? '输入值已超出最大额度' : '';
return +value > verify?.maxApplyQuota ? '输入值已超出最大额度' : '';
}
});
});
setFieldState('quotaSlide', fileState => {
fileState.props['x-component-props'].max = quotaInfo.applyQuota;
fileState.props['x-component-props'].max = verify?.maxApplyQuota;
fileState.props['x-component-props'].marks = {
0: {
label: MinMarks,
},
[quotaInfo.applyQuota]: {
[verify?.maxApplyQuota]: {
label: MaxMarks,
},
};
......
......@@ -41,7 +41,13 @@ const QuotaPr1: React.FC = () => {
>
{text}
</EyePreview>
<StatusTag type="primary" title={record.applyTypeName} />
<StatusTag
type="primary"
title={record.applyTypeName}
style={{
marginLeft: 8,
}}
/>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div>
......
......@@ -41,7 +41,13 @@ const QuotaPr1: React.FC = () => {
>
{text}
</EyePreview>
<StatusTag type="primary" title={record.applyTypeName} />
<StatusTag
type="primary"
title={record.applyTypeName}
style={{
marginLeft: 8,
}}
/>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div>
......
......@@ -41,7 +41,13 @@ const QuotaPr3: React.FC = () => {
>
{text}
</EyePreview>
<StatusTag type="primary" title={record.applyTypeName} />
<StatusTag
type="primary"
title={record.applyTypeName}
style={{
marginLeft: 8,
}}
/>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div>
......
......@@ -41,7 +41,13 @@ const QuotaPrConfirm: React.FC = () => {
>
{text}
</EyePreview>
<StatusTag type="primary" title={record.applyTypeName} />
<StatusTag
type="primary"
title={record.applyTypeName}
style={{
marginLeft: 8,
}}
/>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div>
......
......@@ -41,7 +41,13 @@ const QuotaPrSubmit: React.FC = () => {
>
{text}
</EyePreview>
<StatusTag type="primary" title={record.applyTypeName} />
<StatusTag
type="primary"
title={record.applyTypeName}
style={{
marginLeft: 8,
}}
/>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div>
......
......@@ -501,7 +501,7 @@ export const useBusinessEffects = (context, actions) => {
);
const current = originAsyncData ? originAsyncData.find(item => item.productId === goodId) : null;
if (!current || isNaN(+value)) {
if (!current) {
return;
}
......
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