Commit 8817fa99 authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接 待审核会员入库资质 相关

parent ed70061f
......@@ -31,7 +31,7 @@ const columns = (target = '/memberCenter/memberAbility/manage/memberPrSubmit/det
{text}
</div>
<EyePreview
url={`${target}?id=${record.memberId}&validateId=${record.validateId}`}
url={`${target}?validateId=${record.validateId}`}
>
{record.name}
</EyePreview>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 11:46:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 11:46:36
* @LastEditTime: 2021-06-02 18:46:50
* @Description: 审核 Modal
*/
import React from 'react';
......@@ -16,6 +16,17 @@ const {
onFieldValueChange$,
} = FormEffectHooks;
export type ValueType = {
/**
* 是否同意
*/
agree: number,
/**
* 理由
*/
reason: string,
}
interface IProps {
/**
* 是否可见
......@@ -29,6 +40,10 @@ interface IProps {
* Form 提交事件
*/
onSubmit: (value: any) => void,
/**
* 提交loading
*/
submitLoading: boolean,
}
const VerifyModal: React.FC<IProps> = (props: IProps) => {
......@@ -36,6 +51,7 @@ const VerifyModal: React.FC<IProps> = (props: IProps) => {
visible,
onClose,
onSubmit,
submitLoading,
} = props;
const handleClose = () => {
......@@ -44,7 +60,7 @@ const VerifyModal: React.FC<IProps> = (props: IProps) => {
}
};
const handleSubmit = (values: any) => {
const handleSubmit = (values: ValueType) => {
if (onSubmit) {
onSubmit(values);
}
......@@ -54,7 +70,7 @@ const VerifyModal: React.FC<IProps> = (props: IProps) => {
<Modal
title="单据审核"
visible={visible}
confirmLoading={false}
confirmLoading={submitLoading}
onOk={() => formActions.submit()}
onCancel={handleClose}
destroyOnClose
......@@ -63,7 +79,12 @@ const VerifyModal: React.FC<IProps> = (props: IProps) => {
effects={($, { setFieldState }) => {
onFieldValueChange$('agree').subscribe(fieldState => {
setFieldState('reason', state => {
state.visible = !fieldState.value;
state.title = fieldState.value === 0 ? '不通过原因' : '通过原因';
state.rules = fieldState.value === 0 ? [...state.rules, { required: true }] : [];
state.required = fieldState.value === 0;
setTimeout(() => {
formActions.validate('reason');
}, 0);
});
});
}}
......
......@@ -29,7 +29,7 @@ const schema: ISchema = {
},
reason: {
type: 'string',
title: '审核不通过原因',
title: '不通过原因',
'x-component': 'textarea',
required: true,
'x-component-props': {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-24 17:47:32
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-02 15:15:36
* @LastEditTime: 2021-06-02 18:47:45
* @Description: 审核Form抽屉
*/
import React, { useEffect } from 'react';
......@@ -198,7 +198,7 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
// 渠道上级改变时,请求出对应的省级数据
onFieldInputChange$('upperRelationId').subscribe(fieldState => {
// 清空渠道原来数据
linkage.value('areas', []);
linkage.value('areaCodes', []);
});
// 渠道上级改变时,请求出对应的省级数据
......@@ -213,7 +213,7 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
if (res.code === 1000) {
const { data = [] } = res;
const options = data.map(item => ({ label: item.name, value: item.code }));
formActions.setFieldState('areas.*.provinceCode', state => {
formActions.setFieldState('areaCodes.*.provinceCode', state => {
FormPath.setIn(state, 'props.enum', options);
});
}
......@@ -221,9 +221,9 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
});
// 省级改变时,,请求出对应的市级数据
onFieldInputChange$('areas.*.provinceCode').subscribe(fieldState => {
onFieldInputChange$('areaCodes.*.provinceCode').subscribe(fieldState => {
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areas.${$1}.cityCode`),
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'value', undefined);
}
......@@ -231,14 +231,14 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
});
// 省级改变时,,请求出对应的市级数据
onFieldValueChange$('areas.*.provinceCode').subscribe(async (fieldState) => {
onFieldValueChange$('areaCodes.*.provinceCode').subscribe(async (fieldState) => {
if (fieldState.value === undefined) {
return;
}
const upperRelationValue = await formActions.getFieldValue('upperRelationId');
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areas.${$1}.cityCode`),
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'props.x-props.hasFeedback', true);
FormPath.setIn(state, 'loading', true);
......@@ -253,7 +253,7 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
const { data = [] } = res;
const options = data.map(item => ({ label: item.name, value: item.code }));
formActions.setFieldState(
FormPath.transform(fieldState.name, /\d/, $1 => `areas.${$1}.cityCode`),
FormPath.transform(fieldState.name, /\d/, $1 => `areaCodes.${$1}.cityCode`),
state => {
FormPath.setIn(state, 'props.enum', options);
FormPath.setIn(state, 'loading', false);
......@@ -299,12 +299,13 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
useBusinessEffects();
onFieldValueChange$('agree').subscribe(fieldState => {
formActions.validate('reason');
setFieldState('reason', state => {
state.required = !fieldState.value;
// if (state.value && fieldState.value) {
// formActions.clearErrors('reason');
// }
state.title = fieldState.value === 0 ? '不通过原因' : '通过原因';
state.rules = fieldState.value === 0 ? [...state.rules, { required: true }] : [];
state.required = fieldState.value === 0;
setTimeout(() => {
formActions.validate('reason');
}, 0);
});
});
}}
......
......@@ -125,7 +125,6 @@ export const schema: ISchema = {
type: 'string',
title: '不通过原因',
'x-component': 'Textarea',
required: true,
'x-component-props': {
placeholder: '在此输入你的内容,最长120个字符,60个汉字',
rows: 5,
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-24 10:27:36
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-01 15:41:24
* @LastEditTime: 2021-06-02 18:05:58
* @Description: 待审核入库资料
*/
import React, { useState, useRef } from 'react';
......@@ -32,7 +32,7 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
const [selectedList, setSelectList] = useState<any>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingData/verify?id=${record.memberId}&validateId=${record.validateId}`);
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingData/verify?validateId=${record.validateId}`);
};
const defaultColumns = verifyComingColumn('/memberCenter/memberAbility/manage/memberPrVerifyComingData/detail').concat([
......@@ -90,9 +90,9 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
const members = selectedList.map((item) => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberAbilityValidateCommitBatch(members)
PublicApi.postMemberDepositVerifyBatch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......
......@@ -13,7 +13,7 @@ import {
} from 'antd';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi';
import { GetMemberDepositQualifyDetailResponse } from '@/services/MemberV2Api';
import {
MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL,
......@@ -33,17 +33,16 @@ import MemberChannelInfo from '../components/MemberChannelInfo';
import PicWrap from '../components/PicWrap';
const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
const { id, validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberDepositQualifyDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false);
const getBasicInfo = () => {
if (!id || !validateId) {
if (!validateId) {
return;
}
setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({
memberId: id,
PublicApi.getMemberDepositQualifyDetail({
validateId,
}).then(res => {
if (res.code === 1000) {
......@@ -77,8 +76,8 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
: null
),
...(
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => ({
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => ({
key: `group${index}`,
name: item.groupName,
}))
......@@ -131,7 +130,7 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag,
email: memberInfo?.email,
createTime: memberInfo?.createTime,
createTime: memberInfo?.registerTime,
}}
id="basicInfo"
/>
......@@ -159,14 +158,14 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
{/* 其他注册信息 */}
{
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => (
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => (
<Col span={24} key={`group${index}`}>
<CustomizeColumn
title={item.groupName}
data={(
item.elements.map((ele) => ({
title: ele.fieldCNName,
title: ele.fieldLocalName,
value: (
ele.fieldType !== 'upload'
? ele.fieldValue
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 10:11:54
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 11:39:51
* @LastEditTime: 2021-06-02 18:25:48
* @Description: 待审核入库资质
*/
import React, { useState, useRef } from 'react';
......@@ -32,7 +32,7 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
const [selectedList, setSelectList] = useState<any>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingQualifications/verify?id=${record.memberId}&validateId=${record.validateId}`);
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingQualifications/verify?validateId=${record.validateId}`);
};
const defaultColumns = verifyComingColumn('/memberCenter/memberAbility/manage/memberPrVerifyComingQualifications/detail').concat([
......@@ -72,7 +72,7 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
payload.endDate = moment(+endDate).format('YYYY-MM-DD');
}
const res = await PublicApi.getMemberAbilityMaintenancePage(payload);
const res = await PublicApi.getMemberDepositQualifyPage(payload);
if (res.code === 1000) {
return res.data;
......@@ -90,9 +90,9 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
const members = selectedList.map((item) => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberAbilityValidateCommitBatch(members)
PublicApi.postMemberDepositQualifyBatch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......@@ -111,7 +111,7 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
// 初始化高级筛选选项
const fetchSearchItems = async () => {
const res = await PublicApi.getMemberAbilityValidateCommitPageitems();
const res = await PublicApi.getMemberDepositPageConditions();
if (res.code === 1000) {
const { data = {} }: any = res;
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 11:40:27
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-25 13:49:31
* @LastEditTime: 2021-06-02 18:33:14
* @Description: 审核入库资质
*/
import React, { useState, useEffect } from 'react';
......@@ -15,9 +15,10 @@ import {
import {
CheckCircleOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi';
import { GetMemberDepositQualifyDetailResponse } from '@/services/MemberV2Api';
import {
MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL,
......@@ -35,21 +36,21 @@ import {
import MemberBasicInfo from '../components/MemberBasicInfo';
import MemberChannelInfo from '../components/MemberChannelInfo';
import PicWrap from '../components/PicWrap';
import VerifyModal from '../components/VerifyModal';
import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
const { id, validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberDepositQualifyDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false);
const [visibleVerifyModal, setVisibleVerifyModal] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const getBasicInfo = () => {
if (!id || !validateId) {
if (!validateId) {
return;
}
setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({
memberId: id,
PublicApi.getMemberDepositQualifyDetail({
validateId,
}).then(res => {
if (res.code === 1000) {
......@@ -68,8 +69,25 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
setVisibleVerifyModal(!!flag);
};
const handleSubmit = () => {
console.log('表单提交')
const handleSubmit = (value: VerifyData) => {
setSubmitLoading(true);
PublicApi.postMemberDepositQualify({
validateId,
...value,
}, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
handleVisibleVerifyModal(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
};
const anchorsArr = [
......@@ -91,8 +109,8 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
: null
),
...(
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => ({
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => ({
key: `group${index}`,
name: item.groupName,
}))
......@@ -154,7 +172,7 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag,
email: memberInfo?.email,
createTime: memberInfo?.createTime,
createTime: memberInfo?.registerTime,
}}
id="basicInfo"
/>
......@@ -182,14 +200,14 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
{/* 其他注册信息 */}
{
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => (
memberInfo && memberInfo.registerDetails
? memberInfo.registerDetails.map((item, index) => (
<Col span={24} key={`group${index}`}>
<CustomizeColumn
title={item.groupName}
data={(
item.elements.map((ele) => ({
title: ele.fieldCNName,
title: ele.fieldLocalName,
value: (
ele.fieldType !== 'upload'
? ele.fieldValue
......@@ -225,6 +243,7 @@ const MemberPrVerifyComingQualificationsDetail: React.FC<{}> = () => {
<VerifyModal
visible={visibleVerifyModal}
onClose={() => handleVisibleVerifyModal(false)}
submitLoading={submitLoading}
onSubmit={handleSubmit}
/>
</Spin>
......
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