Commit 53645b85 authored by XieZhiXiong's avatar XieZhiXiong

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

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