Commit ff616e94 authored by tjy's avatar tjy

调整会员 待审核一二级

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