Commit 9be3d2eb authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加 没有入库资料展示

parent 28e29bee
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-26 16:52:48 * @Date: 2021-05-26 16:52:48
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-05 10:40:46 * @LastEditTime: 2021-07-05 15:03:14
* @Description: 申请会员 * @Description: 申请会员
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
...@@ -21,6 +21,7 @@ import { usePageStatus } from '@/hooks/usePageStatus'; ...@@ -21,6 +21,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import NoData from '@/components/NoData';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { normalizeFiledata, FileData } from '@/utils'; import { normalizeFiledata, FileData } from '@/utils';
import schema, { GroupItem } from './schema'; import schema, { GroupItem } from './schema';
...@@ -130,6 +131,11 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => { ...@@ -130,6 +131,11 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => {
}); });
if (res.code === 1000) { if (res.code === 1000) {
setDepositInfo(res.data.depositDetails); setDepositInfo(res.data.depositDetails);
if (!res.data.depositDetails || !res.data.depositDetails.length) {
formActions.setFieldState('step3.NO_DEPOSIT', state => {
state.visible = true;
});
}
} }
setLoading(false); setLoading(false);
}; };
...@@ -156,6 +162,11 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => { ...@@ -156,6 +162,11 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => {
})) }))
}, },
}); });
if (!res.data.groups || !res.data.groups.length) {
formActions.setFieldState('step3.NO_DEPOSIT', state => {
state.visible = true;
});
}
} }
setLoading(false); setLoading(false);
}; };
...@@ -353,6 +364,7 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => { ...@@ -353,6 +364,7 @@ const MemberQueryApplyMember: React.FC<RouteComponentProps> = (props: any) => {
AreaSelect, AreaSelect,
QualitiesUpload, QualitiesUpload,
QualitiesUploadFormItem, QualitiesUploadFormItem,
NoData,
}} }}
expressionScope={{ expressionScope={{
currenStep, currenStep,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-26 17:00:39 * @Date: 2021-05-26 17:00:39
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-30 09:55:17 * @LastEditTime: 2021-07-05 14:59:46
* @Description: * @Description:
*/ */
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
...@@ -19,13 +19,21 @@ export type GroupItem = { ...@@ -19,13 +19,21 @@ export type GroupItem = {
elements: ElementType[], elements: ElementType[],
}; };
const schema = (groups: GroupItem[], validateId?: number): ISchema => { const depositSchema: ISchema = {
const depositSchema: ISchema = {
type: 'object', type: 'object',
properties: {}, properties: {
}; NO_DEPOSIT: {
type: 'object',
visible: false,
'x-component': 'NoData',
'x-component-props': {
content: '您当前无可变更的入库信息',
},
},
},
};
const schema = (groups: GroupItem[], validateId?: number): ISchema => {
(groups || []).forEach((item, index) => { (groups || []).forEach((item, index) => {
depositSchema.properties[`CARD_BOX_${index}`] = { depositSchema.properties[`CARD_BOX_${index}`] = {
type: 'object', type: 'object',
......
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