Commit ff616e94 authored by tjy's avatar tjy

调整会员 待审核一二级

parent c857db9d
...@@ -50,17 +50,30 @@ const MemberRoute = { ...@@ -50,17 +50,30 @@ const MemberRoute = {
component: '@/pages/member/memberPrSubmit/auditPrSubmit' component: '@/pages/member/memberPrSubmit/auditPrSubmit'
}, },
{ {
path: '/memberCenter/memberAbility/manage/memberPr', path: '/memberCenter/memberAbility/manage/memberPr1',
name: 'memberPr', name: 'memberPr1',
key: 'memberPr', key: 'memberPr1',
component: '@/pages/member/memberPr/index' component: '@/pages/member/memberPr1/index'
}, },
{ {
path: '/memberCenter/memberAbility/manage/auditPr', path: '/memberCenter/memberAbility/manage/auditPr1',
name: 'auditPr', name: 'auditPr1',
key: 'auditPr', key: 'auditPr1',
hideInMenu: true, hideInMenu: true,
component: '@/pages/member/memberPr/auditPr' component: '@/pages/member/memberPr1/auditPr1'
},
{
path: '/memberCenter/memberAbility/manage/memberPr2',
name: 'memberPr2',
key: 'memberPr2',
component: '@/pages/member/memberPr2/index'
},
{
path: '/memberCenter/memberAbility/manage/auditPr2',
name: 'auditPr2',
key: 'auditPr2',
hideInMenu: true,
component: '@/pages/member/memberPr2/auditPr2'
}, },
{ {
path: '/memberCenter/memberAbility/manage/memberPrConfirm', path: '/memberCenter/memberAbility/manage/memberPrConfirm',
......
...@@ -16,7 +16,6 @@ export const useAsyncInitSelect = (name: string[], service?: () => Promise<any>) ...@@ -16,7 +16,6 @@ export const useAsyncInitSelect = (name: string[], service?: () => Promise<any>)
}) })
name.forEach(v => linkage.loaded(v)) name.forEach(v => linkage.loaded(v))
service().then(res => { service().then(res => {
console.log(res)
name.forEach(v => { name.forEach(v => {
linkage.loaded(v) linkage.loaded(v)
linkage.enum(v, res[v]) linkage.enum(v, res[v])
......
...@@ -52,8 +52,10 @@ export default { ...@@ -52,8 +52,10 @@ export default {
'menu.memberAbility.memberManage.memberMaintain': '会员维护', 'menu.memberAbility.memberManage.memberMaintain': '会员维护',
'menu.memberAbility.memberManage.memberPrSubmit': '待提交审核', 'menu.memberAbility.memberManage.memberPrSubmit': '待提交审核',
'menu.memberAbility.memberManage.auditPrSubmit': '待提交审核详情', 'menu.memberAbility.memberManage.auditPrSubmit': '待提交审核详情',
'menu.memberAbility.memberManage.memberPr': '待审核', 'menu.memberAbility.memberManage.memberPr1': '待审核(一级)',
'menu.memberAbility.memberManage.auditPr': '待审核详情', 'menu.memberAbility.memberManage.auditPr2': '待审核详情(一级)',
'menu.memberAbility.memberManage.memberPr2': '待审核(二级)',
'menu.memberAbility.memberManage.auditPr1': '待审核详情(二级)',
'menu.memberAbility.memberManage.memberPrConfirm': '待确认审核', 'menu.memberAbility.memberManage.memberPrConfirm': '待确认审核',
'menu.memberAbility.memberManage.auditPrComfirm': '待确认审核详情', 'menu.memberAbility.memberManage.auditPrComfirm': '待确认审核详情',
'menu.memberAbility.memberManage.memberUpgradeRule': '会员升级规则', 'menu.memberAbility.memberManage.memberUpgradeRule': '会员升级规则',
......
import React, { ReactNode, useRef, useState } from 'react'; import React, { ReactNode, useRef, useState, useEffect } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import { StopOutlined, CheckSquareOutlined } from '@ant-design/icons'; import { StopOutlined, CheckSquareOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
...@@ -17,12 +17,14 @@ import { ...@@ -17,12 +17,14 @@ import {
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less'; import style from './index.less';
import { PublicApi } from '@/services/api';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const { Step } = Steps; const { Step } = Steps;
interface ItemProps { interface ItemProps {
auditType: string; auditType: string;
routeParams: any;
} }
const data = [ const data = [
...@@ -38,9 +40,11 @@ const data = [ ...@@ -38,9 +40,11 @@ const data = [
]; ];
const auditDetail: React.FC<ItemProps> = props => { const auditDetail: React.FC<ItemProps> = props => {
const { auditType, routeParams } = props;
const ref = useRef({}); const ref = useRef({});
const [fActived, setfActived] = useState('1'); const [fActived, setfActived] = useState('1');
const [lActived, setlActived] = useState('1'); const [lActived, setlActived] = useState('1');
const [detailData, setDetailData] = useState<any>({ const [detailData, setDetailData] = useState<any>({
step: { step: {
current: 0, current: 0,
...@@ -278,6 +282,16 @@ const auditDetail: React.FC<ItemProps> = props => { ...@@ -278,6 +282,16 @@ const auditDetail: React.FC<ItemProps> = props => {
}, },
]; ];
// 获取审核详情
useEffect(() => {
if (auditType === '1') {
PublicApi.getMemberValidateCommitDetail({
memberId: routeParams.memberId,
validateId: routeParams.validateId,
}).then(res => {});
}
}, []);
// 模拟请求 // 模拟请求
const fetchData = (params: any) => { const fetchData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
import React, { ReactNode, useState, useRef } from 'react'; import React, { ReactNode, useState, useRef } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import { Space, Card, Button } from 'antd'; import { Space, Card, Button, Tag } from 'antd';
import { ClockCircleOutlined } from '@ant-design/icons'; import { ClockCircleOutlined } from '@ant-design/icons';
import { StandardTable } from 'god'; import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
...@@ -44,9 +44,9 @@ const auditList: React.FC<PageProps> = props => { ...@@ -44,9 +44,9 @@ const auditList: React.FC<PageProps> = props => {
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ {
title: 'ID', title: 'ID',
dataIndex: 'id', dataIndex: 'memberId',
align: 'center', align: 'center',
key: 'id', key: 'memberId',
}, },
{ {
title: '会员名称', title: '会员名称',
...@@ -71,58 +71,30 @@ const auditList: React.FC<PageProps> = props => { ...@@ -71,58 +71,30 @@ const auditList: React.FC<PageProps> = props => {
}, },
{ {
title: '会员类型', title: '会员类型',
dataIndex: 'type', dataIndex: 'memberTypeName',
align: 'center', align: 'center',
key: 'type', key: 'memberTypeName',
render: (text: any, record: any) => ( render: (text: any, record: any) => <span>{text}</span>,
<>{record.type === 1 ? '企业会员' : '渠道企业会员'}</>
),
}, },
{ {
title: '会员角色', title: '会员角色',
dataIndex: 'role', dataIndex: 'roleName',
align: 'center', align: 'center',
key: 'role', key: 'roleName',
render: (text: any, record: any) => { render: (text: any, record: any) => <span>{text}</span>,
let component: ReactNode = null;
component = (
<div>
{record.role === 1
? '供应商'
: record.role === 2
? '加工企业'
: record.role === 3
? '物流服务商'
: record.role === 4
? '金融服务商'
: record.role === 5
? '采购商'
: '渠道供应商'}
</div>
);
return component;
},
}, },
{ {
title: '申请来源/时间', title: '申请来源/时间',
dataIndex: 'applyTime', dataIndex: 'registerTime',
align: 'center', align: 'center',
key: 'applyTime', key: 'registerTime',
render: (text: any, record: any) => { render: (text: any, record: any) => {
let component: ReactNode = null; let component: ReactNode = null;
component = ( component = (
<> <>
<div>{record.sourceName}</div>
<div> <div>
{record.source === 1 <ClockCircleOutlined /> {text}
? '平台录入'
: record.source === 2
? 'WEB企业商城申请'
: record.source === 3
? '商户录入'
: '渠道录入'}
</div>
<div>
<ClockCircleOutlined /> {record.applyTime}
</div> </div>
</> </>
); );
...@@ -131,101 +103,32 @@ const auditList: React.FC<PageProps> = props => { ...@@ -131,101 +103,32 @@ const auditList: React.FC<PageProps> = props => {
}, },
{ {
title: '会员状态', title: '会员状态',
dataIndex: 'status', dataIndex: 'statusName',
align: 'center', align: 'center',
key: 'status', key: 'statusName',
filters: [ filters: [],
{ text: '123', value: '123' }, render: (text: any, record: any) => (
{ text: '456', value: '456' }, <Tag color={record.status === 1 ? '#41CC9E' : '#EF6260'}>{text}</Tag>
], ),
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
<div
style={
record.status === 1 ? { color: '#00B37A' } : { color: '#42526E' }
}
>
{record.outSideStatus === 1 ? '正常' : '冻结'}
</div>
);
return component;
},
}, },
{ {
title: '外部状态', title: '外部状态',
dataIndex: 'outSideStatus', dataIndex: 'outerStatusName',
align: 'center', align: 'center',
key: 'outSideStatus', key: 'outerStatusName',
filters: [ filters: [],
{ text: '123', value: '123' }, render: (text: any, record: any) => <span>{text}</span>,
{ text: '456', value: '456' },
],
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
<div
style={
record.outSideStatus === 1
? { color: '#FF991F' }
: record.outSideStatus === 2
? { color: '#00B37A' }
: { color: '#E63F3B' }
}
>
{record.outSideStatus === 1
? '待审核'
: record.outSideStatus === 2
? '审核通过'
: '审核不通过'}
</div>
);
return component;
},
}, },
{ {
title: '内部状态', title: '内部状态',
dataIndex: 'inSideStatus', dataIndex: 'innerStatusName',
align: 'center', align: 'center',
key: 'inSideStatus', key: 'innerStatusName',
filters: [ filters: [
{ text: '123', value: '123' }, { text: '123', value: '123' },
{ text: '456', value: '456' }, { text: '456', value: '456' },
], ],
render: (text: any, record: any) => { render: (text: any, record: any) => <span>{text}</span>,
let component: ReactNode = null;
component = (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<span
className={
record.inSideStatus === 1
? 'commonStatusModify'
: record.inSideStatus === 2
? 'commonStatusInvalid'
: record.inSideStatus === 3
? 'commonStatusValid'
: 'commonStatusNoPass'
}
>
<span className="commonStatus"></span>
</span>
{record.inSideStatus === 1
? '待提交'
: record.inSideStatus === 2
? '待审核'
: record.inSideStatus === 3
? '审核通过'
: '审核不通过'}
</div>
);
return component;
},
}, },
{ {
title: '操作', title: '操作',
...@@ -274,16 +177,20 @@ const auditList: React.FC<PageProps> = props => { ...@@ -274,16 +177,20 @@ const auditList: React.FC<PageProps> = props => {
}, },
}; };
const handleSee = (record: any) => {}; const handleChange = record => {
const handleChange = (record: object) => {
let path = let path =
pageType === '1' pageType === '1'
? 'auditPrSubmit' ? 'auditPrSubmit'
: pageType === '2' : pageType === '2'
? 'auditPr' ? 'auditPr'
: 'auditPrComfirm'; : 'auditPrComfirm';
history.push(`/memberCenter/memberAbility/manage/${path}`); history.push({
pathname: `/memberCenter/memberAbility/manage/${path}`,
query: {
memberId: record.memberId,
validateId: record.validateId,
},
});
}; };
const controllerBtns = ( const controllerBtns = (
...@@ -301,6 +208,7 @@ const auditList: React.FC<PageProps> = props => { ...@@ -301,6 +208,7 @@ const auditList: React.FC<PageProps> = props => {
return ( return (
<Card> <Card>
<StandardTable <StandardTable
tableProps={{ rowKey: 'memberId' }}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
fetchTableData={(params: any) => fetchData(params)} fetchTableData={(params: any) => fetchData(params)}
...@@ -316,7 +224,7 @@ const auditList: React.FC<PageProps> = props => { ...@@ -316,7 +224,7 @@ const auditList: React.FC<PageProps> = props => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'search', 'name',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncInitSelect( useAsyncInitSelect(
......
...@@ -22,7 +22,7 @@ export const auditSchema: ISchema = { ...@@ -22,7 +22,7 @@ export const auditSchema: ISchema = {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
search: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-mega-props': {}, 'x-mega-props': {},
......
import React, { useState, useEffect, useRef, ReactNode } from 'react'; import React, { useState, useEffect, useRef, ReactNode } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import { Tabs, Badge, Button, Card, Row, Col, message, Upload } from 'antd'; import { Badge, Button, Card, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined } from '@ant-design/icons'; import { SaveOutlined } from '@ant-design/icons';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import ReutrnEle from '@/components/ReturnEle'; import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { initDetailSchema } from './schema'; import { initDetailSchema } from './schema';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
const { TabPane } = Tabs; const formActions = createFormActions();
const addSchemaAction = createFormActions();
const addMember: React.FC<any> = props => { const addMember: React.FC<any> = props => {
const ref = useRef<any>({}); const ref = useRef<any>({});
/* 会员类型、会员角色、会员等级、注册手机号选项 */
const [memberItems, setMemberItems] = useState<any>({}); const [memberItems, setMemberItems] = useState<any>({});
const data = [ const data = [
...@@ -75,6 +76,12 @@ const addMember: React.FC<any> = props => { ...@@ -75,6 +76,12 @@ const addMember: React.FC<any> = props => {
}, },
]; ];
useEffect(() => {
PublicApi.getMemberMaintenanceAddpageitems().then(res => {
setMemberItems(res.data);
});
}, []);
// 模拟请求 // 模拟请求
const fetchData = (params: any) => { const fetchData = (params: any) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -93,22 +100,25 @@ const addMember: React.FC<any> = props => { ...@@ -93,22 +100,25 @@ const addMember: React.FC<any> = props => {
console.log(values); console.log(values);
}; };
// 处理数据 // 会员类型、会员角色、会员等级选项
const processData = (data: any) => { const fetchSelectOptions = async () => {
for (let elem of data) { const { data } = await PublicApi.getMemberMaintenanceAddpageitems();
elem.label = elem.text; return {
elem.value = elem.id; memberTypeId: fetchSomeOptions(data.memberTypes),
} roleId: fetchSomeOptions(data.memberRoles),
level: fetchSomeOptions(data.memberLevels),
};
}; };
useEffect(() => { // 获取手机code
PublicApi.getMemberMaintenanceAddpageitems().then(res => { const fetchTelCode = async () => {
processData(res.data.memberLevels); const { data } = await PublicApi.getManageGetTelCode();
processData(res.data.memberRoles); return data;
processData(res.data.memberTypes); };
setMemberItems(res.data);
}); const fetchSomeOptions = data => {
}, ['memberItems']); return data.map(v => ({ label: v.text, value: v.id }));
};
const beforeUpload = (file: any) => { const beforeUpload = (file: any) => {
const isJpgOrPng = const isJpgOrPng =
...@@ -141,7 +151,7 @@ const addMember: React.FC<any> = props => { ...@@ -141,7 +151,7 @@ const addMember: React.FC<any> = props => {
key="1" key="1"
type="primary" type="primary"
icon={<SaveOutlined />} icon={<SaveOutlined />}
onClick={() => addSchemaAction.submit()} onClick={() => formActions.submit()}
> >
保存 保存
</Button>, </Button>,
...@@ -150,7 +160,20 @@ const addMember: React.FC<any> = props => { ...@@ -150,7 +160,20 @@ const addMember: React.FC<any> = props => {
<Card> <Card>
<NiceForm <NiceForm
onSubmit={handleSubmit} onSubmit={handleSubmit}
actions={addSchemaAction} actions={formActions}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['memberTypeId', 'roleId', 'level'],
fetchSelectOptions,
);
useAsyncSelect('telCode', fetchTelCode);
}}
schema={initDetailSchema(memberItems)} schema={initDetailSchema(memberItems)}
/> />
</Card> </Card>
......
...@@ -194,7 +194,7 @@ const memberImport: React.FC<{}> = () => { ...@@ -194,7 +194,7 @@ const memberImport: React.FC<{}> = () => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'search', 'name',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncInitSelect( useAsyncInitSelect(
......
...@@ -23,7 +23,7 @@ export const importSchema: ISchema = { ...@@ -23,7 +23,7 @@ export const importSchema: ISchema = {
children: '{{controllerBtns}}', children: '{{controllerBtns}}',
}, },
}, },
search: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-mega-props': {}, 'x-mega-props': {},
...@@ -122,6 +122,8 @@ const getCompnentValue = (elements: any) => { ...@@ -122,6 +122,8 @@ const getCompnentValue = (elements: any) => {
listType: 'card', listType: 'card',
action: '/api/file/file/upload', action: '/api/file/file/upload',
data: { fileType: 2 }, data: { fileType: 2 },
fileList: [],
onChange: file => console.log(file),
}; };
components[item.fieldName] = { components[item.fieldName] = {
type: item.fieldType, type: item.fieldType,
...@@ -152,54 +154,69 @@ export const initDetailSchema = (props: any) => { ...@@ -152,54 +154,69 @@ export const initDetailSchema = (props: any) => {
labelAlign: 'left', labelAlign: 'left',
}, },
properties: { properties: {
memberTypes: { memberTypeId: {
type: 'string', type: 'string',
required: true, required: true,
title: '会员类型', title: '会员类型',
enum: props.memberTypes, enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '请选择', placeholder: '请选择',
}, },
}, },
memberRoles: { roleId: {
type: 'string', type: 'string',
required: true, required: true,
title: '会员角色', title: '会员角色',
enum: props.memberRoles, enum: [],
'x-component-props': { 'x-component-props': {
placeholder: '请选择', placeholder: '请选择',
}, },
}, },
memberLevels: { level: {
type: 'string', type: 'string',
required: true, required: true,
title: '会员等级', title: '会员等级',
enum: [{ label: '1', value: 1 }], enum: [],
// enum: props.memberLevels,
'x-component-props': { 'x-component-props': {
placeholder: '请选择', placeholder: '请选择',
}, },
}, },
memberPhone: { MEGA_LAYOUT1_1: {
type: 'object', type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
label: '注册手机',
wrapperCol: 24,
required: true, required: true,
title: '注册手机', },
'x-component': 'CustomRegistryPhone', properties: {
MEGA_LAYOUT1_1_1: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': { 'x-component-props': {
dataSource: [ grid: true,
{ full: true,
text: '+86', },
id: 1, properties: {
url: require('../../../../../public/static/imgs/level1@2x.png'), telCode: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
tel: {
type: 'string',
'x-mega-props': { span: 2 },
'x-component-props': {
placeholder: '请输入你的手机号码',
maxLength: 11,
},
required: true,
},
}, },
{
text: '+126',
id: 2,
url: require('../../../../../public/static/imgs/level2@2x.png'),
}, },
],
selectPh: '请选择',
inputPh: '请输入你的手机号码',
}, },
}, },
memberEmail: { memberEmail: {
......
...@@ -276,7 +276,7 @@ const memberMaintain: React.FC<[]> = () => { ...@@ -276,7 +276,7 @@ const memberMaintain: React.FC<[]> = () => {
useStateFilterSearchLinkageEffect( useStateFilterSearchLinkageEffect(
$, $,
actions, actions,
'search', 'name',
FORM_FILTER_PATH, FORM_FILTER_PATH,
); );
useAsyncInitSelect( useAsyncInitSelect(
......
...@@ -8,7 +8,7 @@ export const maintianSchema: ISchema = { ...@@ -8,7 +8,7 @@ export const maintianSchema: ISchema = {
type: 'object', type: 'object',
'x-component': 'mega-layout', 'x-component': 'mega-layout',
properties: { properties: {
search: { name: {
type: 'string', type: 'string',
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
......
import React from 'react'; import React from 'react';
import AuditDetail from '../components/auditDetail'; import AuditDetail from '../components/auditDetail';
const auditPr = () => { const auditPr = (props: any) => {
return <AuditDetail auditType="2" />; return <AuditDetail auditType="2" routeParams={props.location.query} />;
}; };
export default auditPr; export default auditPr;
import React from 'react';
import AuditDetail from '../components/auditDetail';
const auditPr = (props: any) => {
return <AuditDetail auditType="2" routeParams={props.location.query} />;
};
export default auditPr;
import React from 'react';
import AuditList from '../components/auditList';
const memberPr = () => {
return <AuditList pageType="3" />;
};
export default memberPr;
import React from 'react'; import React from 'react';
import AuditDetail from '../components/auditDetail'; import AuditDetail from '../components/auditDetail';
const auditPrConfirm = () => { const auditPrConfirm = props => {
return <AuditDetail auditType="3" />; return <AuditDetail auditType="3" routeParams={props.location.query} />;
}; };
export default auditPrConfirm; export default auditPrConfirm;
import React from 'react'; import React from 'react';
import AuditDetail from '../components/auditDetail'; import AuditDetail from '../components/auditDetail';
const auditPrSubmit = () => { const auditPrSubmit = props => {
return <AuditDetail auditType="1" />; return <AuditDetail auditType="1" routeParams={props.location.query} />;
}; };
export default auditPrSubmit; export default auditPrSubmit;
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