Commit ce3422cb authored by GuanHua's avatar GuanHua
parents 6658f523 bac6f25c
...@@ -90,6 +90,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) { ...@@ -90,6 +90,10 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
return; return;
} }
if (whiteLists.includes(location.pathname)) {
return
}
// 是否登录 // 是否登录
if (getAuth()) { if (getAuth()) {
const { query, pathname } = location const { query, pathname } = location
......
...@@ -137,3 +137,21 @@ export const MEMBER_OUTER_STATUS = { ...@@ -137,3 +137,21 @@ export const MEMBER_OUTER_STATUS = {
[MEMBER_OUTER_STATUS_FAILED]: '审核不通过', [MEMBER_OUTER_STATUS_FAILED]: '审核不通过',
[MEMBER_OUTER_STATUS_SUCCESS]: '审核通过', [MEMBER_OUTER_STATUS_SUCCESS]: '审核通过',
}; };
// 会员申请来源
export const MEMBER_SOURCE_WEB_ENTERPRISE = 1; // Web企业商城
export const MEMBER_SOURCE_H5_ENTERPRISE = 2; // H5企业商城
export const MEMBER_SOURCE_WEB_CHANNEL = 3; // Web渠道商城
export const MEMBER_SOURCE_H5_CHANNEL = 4; // H5渠道商城
export const MEMBER_SOURCE_PLATFORM = 5; // 平台代录入
export const MEMBER_SOURCE_MERCHANTS = 6; // 商户代录入
export const MEMBER_SOURCE_CHANNEL = 7; // 渠道代录入
export const MEMBER_source = {
[MEMBER_SOURCE_WEB_ENTERPRISE]: 'Web企业商城',
[MEMBER_SOURCE_H5_ENTERPRISE]: 'H5企业商城',
[MEMBER_SOURCE_WEB_CHANNEL]: 'Web渠道商城',
[MEMBER_SOURCE_H5_CHANNEL]: 'H5渠道商城',
[MEMBER_SOURCE_PLATFORM]: '平台代录入',
[MEMBER_SOURCE_MERCHANTS]: '商户代录入',
[MEMBER_SOURCE_CHANNEL]: '渠道代录入',
};
\ No newline at end of file
...@@ -97,10 +97,18 @@ const Products: React.FC<{}> = () => { ...@@ -97,10 +97,18 @@ const Products: React.FC<{}> = () => {
dataIndex: 'min', dataIndex: 'min',
key: 'min', key: 'min',
render: (text:any, reocrd:any) => { render: (text:any, reocrd:any) => {
if(reocrd.priceType === 1) if(reocrd.priceType === 1){
return <>{reocrd.min} ~ ¥{reocrd.max}</> if(reocrd.max === reocrd.min)
if(reocrd.priceType === 3) return <>{reocrd.min}</>
return <>{reocrd.min} ~ {reocrd.max}</> else
return <>{reocrd.min} ~ ¥{reocrd.max}</>
}
if(reocrd.priceType === 3){
if(reocrd.max === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ {reocrd.max}</>
}
if(reocrd.priceType === 2) if(reocrd.priceType === 2)
return null return null
} }
......
...@@ -111,10 +111,18 @@ const Products: React.FC<{}> = () => { ...@@ -111,10 +111,18 @@ const Products: React.FC<{}> = () => {
dataIndex: 'min', dataIndex: 'min',
key: 'min', key: 'min',
render: (text:any, reocrd:any) => { render: (text:any, reocrd:any) => {
if(reocrd.priceType === 1) if(reocrd.priceType === 1){
return <>{reocrd.min} ~ ¥{reocrd.max}</> if(reocrd.max === reocrd.min)
if(reocrd.priceType === 3) return <>{reocrd.min}</>
return <>{reocrd.min} ~ {reocrd.max}</> else
return <>{reocrd.min} ~ ¥{reocrd.max}</>
}
if(reocrd.priceType === 3){
if(reocrd.max === reocrd.min)
return <>{reocrd.min}</>
else
return <>{reocrd.min} ~ {reocrd.max}</>
}
if(reocrd.priceType === 2) if(reocrd.priceType === 2)
return null return null
} }
......
...@@ -34,6 +34,7 @@ import { ...@@ -34,6 +34,7 @@ import {
MEMBER_OUTER_STATUS_SUCCESS, MEMBER_OUTER_STATUS_SUCCESS,
MEMBER_INNER_STATUS_UNCOMMITTED, MEMBER_INNER_STATUS_UNCOMMITTED,
MEMBER_INNER_STATUS_FAILED, MEMBER_INNER_STATUS_FAILED,
MEMBER_SOURCE_PLATFORM,
} from '@/constants'; } from '@/constants';
import { importSchema, auditModalSchema } from './schema'; import { importSchema, auditModalSchema } from './schema';
import { import {
...@@ -171,10 +172,10 @@ const memberMaintain: React.FC<[]> = () => { ...@@ -171,10 +172,10 @@ const memberMaintain: React.FC<[]> = () => {
</Button> </Button>
</Link> </Link>
)} )}
{/* 外部审核状态等于 待提交 或者 审核失败 可进行编辑操作 */} {/* 平台代录入的会员资料才可以修改、删除 */}
{( {(
record.outerStatus === MEMBER_INNER_STATUS_UNCOMMITTED || record.source === MEMBER_SOURCE_PLATFORM &&
record.outerStatus === MEMBER_INNER_STATUS_FAILED record.outerStatus !== MEMBER_OUTER_STATUS_SUCCESS
) && ( ) && (
<> <>
<Button <Button
...@@ -185,23 +186,20 @@ const memberMaintain: React.FC<[]> = () => { ...@@ -185,23 +186,20 @@ const memberMaintain: React.FC<[]> = () => {
> >
编辑 编辑
</Button> </Button>
</> <Popconfirm
)} title="确定要删除吗?"
{/* 外部审核状态不等于 审核通过 可进行删除操作 */} okText="是"
{record.outerStatus !== MEMBER_OUTER_STATUS_SUCCESS && ( cancelText="否"
<Popconfirm onConfirm={() => handleDelete(record.memberId, record.validateId)}
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => handleDelete(record.memberId, record.validateId)}
>
<Button
type="link"
danger
> >
删除 <Button
</Button> type="link"
</Popconfirm> danger
>
删除
</Button>
</Popconfirm>
</>
)} )}
</> </>
), ),
......
...@@ -19,7 +19,7 @@ import TabTree, { createTreeActions } from '@/components/TabTree'; ...@@ -19,7 +19,7 @@ import TabTree, { createTreeActions } from '@/components/TabTree';
import CheckboxTree from '@/components/CheckBoxTree'; import CheckboxTree from '@/components/CheckBoxTree';
import MellowCard from '@/components/MellowCard'; import MellowCard from '@/components/MellowCard';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createAsyncFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { useTreeTabs, FormState } from '@/hooks/useTreeTabs'; import { useTreeTabs, FormState } from '@/hooks/useTreeTabs';
import { MEMBER_INNER_STATUS_SUCCESS } from '@/constants'; import { MEMBER_INNER_STATUS_SUCCESS } from '@/constants';
import { import {
...@@ -36,10 +36,11 @@ import styles from './index.less'; ...@@ -36,10 +36,11 @@ import styles from './index.less';
import { values } from 'mobx'; import { values } from 'mobx';
const treeActions = createTreeActions(); const treeActions = createTreeActions();
const modalFormActions = createFormActions(); const modalFormActions = createAsyncFormActions();
const { const {
onFieldValueChange$, onFieldValueChange$,
onFieldInputChange$, onFieldInputChange$,
onFieldInit$,
} = FormEffectHooks; } = FormEffectHooks;
interface QueryProps { interface QueryProps {
...@@ -62,6 +63,8 @@ const AuditPrComfirm: React.FC<QueryProps> = props => { ...@@ -62,6 +63,8 @@ const AuditPrComfirm: React.FC<QueryProps> = props => {
const [powerLoading, setPowerLoading] = useState(false); const [powerLoading, setPowerLoading] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false); const [confirmLoading, setConfirmLoading] = useState(false);
const infoRef = useRef<any>({});
const getBasicInfo = () => { const getBasicInfo = () => {
if (!id || !validateId) { if (!id || !validateId) {
return; return;
...@@ -75,22 +78,7 @@ const AuditPrComfirm: React.FC<QueryProps> = props => { ...@@ -75,22 +78,7 @@ const AuditPrComfirm: React.FC<QueryProps> = props => {
return; return;
} }
setBasicInfo(res.data); setBasicInfo(res.data);
infoRef.current.info = res.data;
// 内部状态为 审核通过 才能选择 审核通过选项
if (res.data.innerStatus !== MEMBER_INNER_STATUS_SUCCESS) {
modalFormActions.setFieldState('agree', (state: any) => {
const newMenu =
state.props.enum.map(
(item: { label: string, value: any }) => ({
...item,
disabled: item.value === 1,
})
);
FormPath.setIn(state, 'props.enum', newMenu);
FormPath.setIn(state, 'value', 0);
});
}
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
}); });
...@@ -237,7 +225,7 @@ const AuditPrComfirm: React.FC<QueryProps> = props => { ...@@ -237,7 +225,7 @@ const AuditPrComfirm: React.FC<QueryProps> = props => {
return PublicApi.postMemberValidateCommitUpdatemenu({ return PublicApi.postMemberValidateCommitUpdatemenu({
memberId: id, memberId: id,
validateId, validateId,
checkIds: menuIds, menuIds,
}, { }, {
ctlType: 'none', ctlType: 'none',
}); });
...@@ -397,6 +385,22 @@ const AuditPrComfirm: React.FC<QueryProps> = props => { ...@@ -397,6 +385,22 @@ const AuditPrComfirm: React.FC<QueryProps> = props => {
> >
<NiceForm <NiceForm
effects={($, { setFieldState }) => { effects={($, { setFieldState }) => {
onFieldInit$().subscribe(() => {
// 内部状态为 审核通过 才能选择 审核通过选项
if (infoRef.current.info.innerStatus !== MEMBER_INNER_STATUS_SUCCESS) {
modalFormActions.setFieldState('agree', (state: any) => {
const newEnum =
state.props.enum.map(
(item: { label: string, value: any }) => ({
...item,
disabled: item.value === 1,
})
);
FormPath.setIn(state, 'props.enum', newEnum);
FormPath.setIn(state, 'value', 0);
});
}
})
onFieldValueChange$('agree').subscribe(fieldState => { onFieldValueChange$('agree').subscribe(fieldState => {
setFieldState('reason', state => { setFieldState('reason', state => {
state.visible = !fieldState.value; state.visible = !fieldState.value;
......
...@@ -48,7 +48,7 @@ const Trademark: React.FC<{}> = () => { ...@@ -48,7 +48,7 @@ const Trademark: React.FC<{}> = () => {
key: 'memberName', key: 'memberName',
}, },
{ {
title: '申请时间', title: '申请审核时间',
dataIndex: 'applyTime', dataIndex: 'applyTime',
key: 'applyTime', key: 'applyTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'), render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
......
...@@ -50,7 +50,7 @@ const Trademark: React.FC<{}> = () => { ...@@ -50,7 +50,7 @@ const Trademark: React.FC<{}> = () => {
key: 'memberName', key: 'memberName',
}, },
{ {
title: '申请时间', title: '申请审核时间',
dataIndex: 'applyTime', dataIndex: 'applyTime',
key: 'applyTime', key: 'applyTime',
render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'), render: (text: any, record: any) => text && moment(text).format('YYYY-MM-DD HH:mm:ss'),
......
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