Commit 53645b85 authored by XieZhiXiong's avatar XieZhiXiong

feat: 对接 待审核会员信息变更(二级) 相关

parent 48c79fce
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from 'antd'; } from 'antd';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi'; import { GetMemberModifyGradeTwoDetailResponse } from '@/services/MemberV2Api';
import { import {
MEMBER_TYPE_CHANNEL_CORPORATE, MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL, MEMBER_TYPE_CHANNEL_INDIVIDUAL,
...@@ -33,17 +33,16 @@ import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo'; ...@@ -33,17 +33,16 @@ import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import MemberDocQualification from '../components/MemberDocQualification'; import MemberDocQualification from '../components/MemberDocQualification';
const MemberPrVerifyChange2Detail: React.FC<{}> = () => { const MemberPrVerifyChange2Detail: React.FC<{}> = () => {
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null); const [memberInfo, setMemberInfo] = useState<GetMemberModifyGradeTwoDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false); const [infoLoading, setInfoLoaading] = useState(false);
const getBasicInfo = () => { const getBasicInfo = () => {
if (!id || !validateId) { if (!validateId) {
return; return;
} }
setInfoLoaading(true); setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({ PublicApi.getMemberModifyGradeTwoDetail({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
...@@ -131,7 +130,7 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => { ...@@ -131,7 +130,7 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName, outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag, levelTag: memberInfo?.levelTag,
email: memberInfo?.email, email: memberInfo?.email,
createTime: memberInfo?.createTime, createTime: memberInfo?.registerTime,
}} }}
id="basicInfo" id="basicInfo"
/> />
...@@ -160,10 +159,11 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => { ...@@ -160,10 +159,11 @@ const MemberPrVerifyChange2Detail: React.FC<{}> = () => {
{/* 入库信息 */} {/* 入库信息 */}
<Col span={24}> <Col span={24}>
<MemberDocIncomingInfo <MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo" id="incomingInfo"
/> />
</Col> </Col>
{/* 资质证明 */} {/* 资质证明 */}
<Col span={24}> <Col span={24}>
<MemberDocQualification <MemberDocQualification
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-05-26 10:26:20 * @Date: 2021-05-26 10:26:20
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-26 10:34:25 * @LastEditTime: 2021-06-04 14:18:47
* @Description: 待审核会员变更(二级) * @Description: 待审核会员变更(二级)
*/ */
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
...@@ -28,11 +28,10 @@ const formActions = createFormActions(); ...@@ -28,11 +28,10 @@ const formActions = createFormActions();
const MemberPrVerifyChange2: React.FC<{}> = props => { const MemberPrVerifyChange2: React.FC<{}> = props => {
const ref = useRef<any>({}); const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]); const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const [selectedList, setSelectList] = useState<any>([]);
const handleJumpAudit = record => { const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyChange2/verify?id=${record.memberId}&validateId=${record.validateId}`); history.push(`/memberCenter/memberAbility/manage/memberPrVerifyChange2/verify?validateId=${record.validateId}`);
}; };
const defaultColumns = verifyComingColumn('/memberCenter/memberAbility/manage/memberPrVerifyChange2/detail').concat([ const defaultColumns = verifyComingColumn('/memberCenter/memberAbility/manage/memberPrVerifyChange2/detail').concat([
...@@ -54,9 +53,8 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -54,9 +53,8 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns); const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = { const rowSelection = {
onChange: (keys: any, rows: {}[]) => { onChange: (keys: number[]) => {
setSelectedRowKeys(keys); setSelectedRowKeys(keys);
setSelectList(rows);
}, },
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
}; };
...@@ -72,7 +70,7 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -72,7 +70,7 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
payload.endDate = moment(+endDate).format('YYYY-MM-DD'); payload.endDate = moment(+endDate).format('YYYY-MM-DD');
} }
const res = await PublicApi.getMemberAbilityMaintenancePage(payload); const res = await PublicApi.getMemberModifyGradeTwoPage(payload);
if (res.code === 1000) { if (res.code === 1000) {
return res.data; return res.data;
...@@ -81,7 +79,7 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -81,7 +79,7 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
}; };
const handleBatch = () => { const handleBatch = () => {
if (!selectedList.length) { if (!selectedRowKeys.length) {
message.warning('未选择任何会员'); message.warning('未选择任何会员');
return; return;
} }
...@@ -90,9 +88,10 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -90,9 +88,10 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />, icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?', content: '确定要审核通过选中的会员吗?',
onOk() { onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
PublicApi.postMemberAbilityValidateCommitBatch(members) PublicApi.postMemberModifyGradeTwoBatch({
validateIds: selectedRowKeys,
})
.then(res => { .then(res => {
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
...@@ -111,14 +110,13 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -111,14 +110,13 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
// 初始化高级筛选选项 // 初始化高级筛选选项
const fetchSearchItems = async () => { const fetchSearchItems = async () => {
const res = await PublicApi.getMemberAbilityValidateCommitPageitems(); const res = await PublicApi.getMemberModifyPageConditions();
if (res.code === 1000) { if (res.code === 1000) {
const { data = {} }: any = res; const { data = {} }: any = res;
const { const {
memberTypes = [], memberTypes = [],
roles = [], roles = [],
sources = [],
} = data; } = data;
const memberTypeIndex = columns.findIndex((item) => item.dataIndex === 'memberTypeName'); const memberTypeIndex = columns.findIndex((item) => item.dataIndex === 'memberTypeName');
...@@ -139,13 +137,12 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -139,13 +137,12 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
return { return {
memberTypeId: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })), memberTypeId: memberTypes.map(item => ({ label: item.memberTypeName, value: item.memberTypeId })),
roleId: roles.map(item => ({ label: item.roleName, value: item.roleId })), roleId: roles.map(item => ({ label: item.roleName, value: item.roleId })),
source: sources.map(item => ({ label: item.text, value: item.id })),
}; };
} }
return {}; return {};
}; };
const controllerBtns = ( const ControllerBtns = () => (
<Space> <Space>
<Button onClick={handleBatch}> <Button onClick={handleBatch}>
批量审核通过 批量审核通过
...@@ -167,8 +164,8 @@ const MemberPrVerifyChange2: React.FC<{}> = props => { ...@@ -167,8 +164,8 @@ const MemberPrVerifyChange2: React.FC<{}> = props => {
<NiceForm <NiceForm
actions={formActions} actions={formActions}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
expressionScope={{ components={{
controllerBtns, ControllerBtns,
}} }}
effects={($, actions) => { effects={($, actions) => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
......
...@@ -15,9 +15,10 @@ import { ...@@ -15,9 +15,10 @@ import {
import { import {
CheckCircleOutlined, CheckCircleOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { history } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetMemberAbilityMaintenanceDetailBasicResponse } from '@/services/MemberApi'; import { GetMemberModifyGradeTwoDetailResponse } from '@/services/MemberV2Api';
import { import {
MEMBER_TYPE_CHANNEL_CORPORATE, MEMBER_TYPE_CHANNEL_CORPORATE,
MEMBER_TYPE_CHANNEL_INDIVIDUAL, MEMBER_TYPE_CHANNEL_INDIVIDUAL,
...@@ -35,21 +36,21 @@ import MemberBasicInfo from '../components/MemberBasicInfo'; ...@@ -35,21 +36,21 @@ import MemberBasicInfo from '../components/MemberBasicInfo';
import MemberChannelInfo from '../components/MemberChannelInfo'; import MemberChannelInfo from '../components/MemberChannelInfo';
import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo'; import MemberDocIncomingInfo from '../components/MemberDocIncomingInfo';
import MemberDocQualification from '../components/MemberDocQualification'; import MemberDocQualification from '../components/MemberDocQualification';
import VerifyModal from '../components/VerifyModal'; import VerifyModal, { ValueType as VerifyData } from '../components/VerifyModal';
const MemberPrVerifyChange2Verify: React.FC<{}> = () => { const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
const { id, validateId } = usePageStatus(); const { validateId } = usePageStatus();
const [memberInfo, setMemberInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null); const [memberInfo, setMemberInfo] = useState<GetMemberModifyGradeTwoDetailResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false); const [infoLoading, setInfoLoaading] = useState(false);
const [visibleVerifyModal, setVisibleVerifyModal] = useState(false); const [visibleVerifyModal, setVisibleVerifyModal] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const getBasicInfo = () => { const getBasicInfo = () => {
if (!id || !validateId) { if (!validateId) {
return; return;
} }
setInfoLoaading(true); setInfoLoaading(true);
PublicApi.getMemberAbilityMaintenanceDetailBasic({ PublicApi.getMemberModifyGradeTwoDetail({
memberId: id,
validateId, validateId,
}).then(res => { }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
...@@ -68,8 +69,25 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => { ...@@ -68,8 +69,25 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
setVisibleVerifyModal(!!flag); setVisibleVerifyModal(!!flag);
}; };
const handleSubmit = () => { const handleSubmit = (value: VerifyData) => {
console.log('表单提交') setSubmitLoading(true);
PublicApi.postMemberModifyGradeTwo({
validateId,
...value,
}, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
handleVisibleVerifyModal(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
}; };
const anchorsArr = [ const anchorsArr = [
...@@ -154,7 +172,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => { ...@@ -154,7 +172,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
outerStatusName: memberInfo?.outerStatusName, outerStatusName: memberInfo?.outerStatusName,
levelTag: memberInfo?.levelTag, levelTag: memberInfo?.levelTag,
email: memberInfo?.email, email: memberInfo?.email,
createTime: memberInfo?.createTime, createTime: memberInfo?.registerTime,
}} }}
id="basicInfo" id="basicInfo"
/> />
...@@ -183,6 +201,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => { ...@@ -183,6 +201,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
{/* 入库信息 */} {/* 入库信息 */}
<Col span={24}> <Col span={24}>
<MemberDocIncomingInfo <MemberDocIncomingInfo
dataSource={memberInfo?.depositDetails}
id="incomingInfo" id="incomingInfo"
/> />
</Col> </Col>
...@@ -211,6 +230,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => { ...@@ -211,6 +230,7 @@ const MemberPrVerifyChange2Verify: React.FC<{}> = () => {
<VerifyModal <VerifyModal
visible={visibleVerifyModal} visible={visibleVerifyModal}
onClose={() => handleVisibleVerifyModal(false)} onClose={() => handleVisibleVerifyModal(false)}
submitLoading={submitLoading}
onSubmit={handleSubmit} onSubmit={handleSubmit}
/> />
</Spin> </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