Commit 861cba6e authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复编辑授信信息成功之后页面数据还是旧数据的问题

parent b02d6a7b
......@@ -82,11 +82,6 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => {
headExtra,
} = props;
const [quotaInfo, setQuotaInfo] = useState<QuotaInfo>(null);
const [quotaValues, setQuotaValues] = useState<QuotaValues>({
quota: undefined,
billDay: undefined,
repayPeriod: undefined,
});
const [infoLoading, setInfoloading] = useState(false);
// 获取授信详情
......@@ -123,8 +118,6 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => {
quotaValuesData.repayPeriod = verify.repayPeriod;
}
setQuotaValues(quotaValuesData);
setQuotaInfo({
...res.data,
quotaInfo: {
......@@ -166,7 +159,13 @@ const DetailInfo: React.FC<DetailInfoProps> = (props) => {
...values,
}).then(res => {
if (res.code === 1000) {
setQuotaValues(values);
setQuotaInfo({
...quotaInfo,
verify: {
...quotaInfo.verify,
...values,
},
});
resolve();
}
reject();
......
......@@ -276,7 +276,7 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
onFormInit$().subscribe(() => {
// 初始化数据
setFieldState('applyQuota', fileState => {
setFieldState('quota', fileState => {
fileState.rules = fileState.rules.concat({
validator(value) {
return +value > verify?.maxApplyQuota ? '输入值已超出最大额度' : '';
......
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