Commit aa412753 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents b703e691 4d5cbcb2
...@@ -416,34 +416,6 @@ const MemberRoute: RouterChild = { ...@@ -416,34 +416,6 @@ const MemberRoute: RouterChild = {
hideInMenu: true, hideInMenu: true,
noMargin: true, noMargin: true,
}, },
// 会员升级规则
{
path: '/memberCenter/memberAbility/manage/upgradeRule',
name: 'memberUpgradeRule',
component: '@/pages/member/memberUpgradeRule/index',
},
// 会员等级
{
path: '/memberCenter/memberAbility/manage/level',
name: 'memberLevel',
component: '@/pages/member/memberLevel/index',
},
// 会员等级-设置
{
path: '/memberCenter/memberAbility/manage/level/edit',
name: 'editMemberLevel',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberLevel/addEquity',
},
// 会员等级-详情
{
path: '/memberCenter/memberAbility/manage/level/detail',
name: 'editMemberLevel',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberLevel/equityDetail',
},
] ]
}, },
// 会员信息查询 // 会员信息查询
...@@ -716,7 +688,72 @@ const MemberRoute: RouterChild = { ...@@ -716,7 +688,72 @@ const MemberRoute: RouterChild = {
component: '@/pages/member/memberWarning/tobeHandleWarning' component: '@/pages/member/memberWarning/tobeHandleWarning'
} }
] ]
} },
// 会员规则配置
{
path: '/memberCenter/memberAbility/ruleConfiguration',
name: 'memberRuleConfiguration',
routes: [
// 会员等级
{
path: '/memberCenter/memberAbility/ruleConfiguration/level',
name: 'memberLevel',
component: '@/pages/member/memberLevel/index',
},
// 会员等级-设置
{
path: '/memberCenter/memberAbility/ruleConfiguration/level/edit',
name: 'memberLevelEdit',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberLevel/addEquity',
},
// 会员等级-详情
{
path: '/memberCenter/memberAbility/ruleConfiguration/level/detail',
name: 'memberLevelDetail',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberLevel/equityDetail',
},
// 会员升级规则
{
path: '/memberCenter/memberAbility/ruleConfiguration/upgradeRule',
name: 'memberUpgradeRule',
component: '@/pages/member/memberUpgradeRule/index',
},
// 会员管理流程规则配置
{
path: '/memberCenter/memberAbility/ruleConfiguration/memberFlowRule',
name: 'memberFlowRule',
component: '@/pages/member/memberFlowRule/index',
},
// 会员管理流程规则配置-新增
{
path: '/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/add',
name: 'memberFlowRuleAdd',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberFlowRule/addFlowRule',
},
// 会员管理流程规则配置-编辑
{
path: '/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/edit',
name: 'memberFlowRuleEdit',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberFlowRule/editFlowRule',
},
// 会员管理流程规则配置-详情
{
path: '/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/detail',
name: 'memberFlowRuleDetail',
hideInMenu: true,
noMargin: true,
component: '@/pages/member/memberFlowRule/detail',
},
]
},
] ]
} }
......
...@@ -38,7 +38,7 @@ const Search = props => { ...@@ -38,7 +38,7 @@ const Search = props => {
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: justifyAlign, width: '100%' }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: justifyAlign, width: '100%' }}>
<Tooltip title={tip}> <Tooltip title={tip}>
<Input.Search <Input.Search
style={{width: '200px'}} style={{ width: '200px', marginRight: 16 }}
value={props.value || ''} value={props.value || ''}
onChange={e => props.mutators.change(e.target.value)} onChange={e => props.mutators.change(e.target.value)}
onSearch={(_, e) => { onSearch={(_, e) => {
...@@ -49,7 +49,7 @@ const Search = props => { ...@@ -49,7 +49,7 @@ const Search = props => {
/> />
</Tooltip> </Tooltip>
{advanced && ( {advanced && (
<Button onClick={changeFilterVisible} style={{margin: '0 16px'}}> <Button onClick={changeFilterVisible} style={{ marginRight: 16 }}>
高级筛选 高级筛选
{state.filterSearch ? <CaretUpOutlined /> : <CaretDownOutlined />} {state.filterSearch ? <CaretUpOutlined /> : <CaretDownOutlined />}
</Button> </Button>
......
...@@ -128,12 +128,18 @@ const NiceForm: React.FC<NiceFormProps> = props => { ...@@ -128,12 +128,18 @@ const NiceForm: React.FC<NiceFormProps> = props => {
useEffect(() => { useEffect(() => {
let paginationInfo: currentStateType = getCurrentState(); let paginationInfo: currentStateType = getCurrentState();
if(match.path === paginationInfo.pathname) {
// 一般 列表检索传入的 controlRender 的 NiceForm 是没有 value 或者 initialValues 的
// value 或者 initialValues 的,表单页有
if (
match.path === paginationInfo.pathname
&& !('value' in reset)
&& !('initialValues' in reset)
) {
reset.actions.setFormState( reset.actions.setFormState(
state => (state.values = paginationInfo.queryParams), state => (state.values = paginationInfo.queryParams),
); );
} }
}, []) }, [])
return ( return (
......
...@@ -9,7 +9,7 @@ import React from 'react'; ...@@ -9,7 +9,7 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
interface StatusTagProps { export type StatusTagProps = {
type: 'success' | 'warning' | 'default' | 'danger' | 'primary' | 'nobility'; type: 'success' | 'warning' | 'default' | 'danger' | 'primary' | 'nobility';
title: React.ReactNode; title: React.ReactNode;
style?: {[key: string]: any}, style?: {[key: string]: any},
......
...@@ -14,7 +14,7 @@ interface UploadImportProps { ...@@ -14,7 +14,7 @@ interface UploadImportProps {
/** 检查的接口 */ /** 检查的接口 */
checkfetch?: string, checkfetch?: string,
/** 导入的接口 */ /** 导入的接口 */
importfetch?: Promise<unknown>, importfetch?: string,
/** 完成导入 */ /** 完成导入 */
onClose?: (e) => void, onClose?: (e) => void,
/** 成功导入后返回数据 */ /** 成功导入后返回数据 */
...@@ -79,7 +79,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => { ...@@ -79,7 +79,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => {
fileList.forEach(file => { fileList.forEach(file => {
formData.append('file', file); formData.append('file', file);
}); });
uploadFileExcel(formData).then(res => { uploadFileExcel( importfetch ,formData).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
setStep(4) setStep(4)
return return
...@@ -103,7 +103,14 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => { ...@@ -103,7 +103,14 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => {
</> </>
const continueImport = () => { const continueImport = () => {
setStep(0) setStep(0)
setExceptionCheck(false)
} }
const handleClose = () => {
continueImport()
onClose()
}
return ( return (
<Modal <Modal
title={title} title={title}
...@@ -111,6 +118,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => { ...@@ -111,6 +118,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => {
footer={null} footer={null}
bodyStyle={{ padding: 0, position: 'relative' }} bodyStyle={{ padding: 0, position: 'relative' }}
visible={visible} visible={visible}
onCancel={onClose}
> >
{step === 0 && ( {step === 0 && (
<> <>
...@@ -173,7 +181,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => { ...@@ -173,7 +181,7 @@ const UploadImport: React.FC<UploadImportProps> = (props: any) => {
extra={ extra={
<> <>
<Button type='primary' onClick={continueImport}>继续导入</Button> <Button type='primary' onClick={continueImport}>继续导入</Button>
<Button onClick={onClose}>导入完成</Button> <Button onClick={handleClose}>导入完成</Button>
</> </>
} }
/> />
......
...@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react';
import { Modal, Result, Progress, Upload, Button } from 'antd'; import { Modal, Result, Progress, Upload, Button } from 'antd';
import { FileExcelOutlined } from '@ant-design/icons'; import { FileExcelOutlined } from '@ant-design/icons';
import styles from './index.less'; import styles from './index.less';
import { UPLOAD_TYPE } from '@/constants'
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
interface Uploader { interface Uploader {
...@@ -20,7 +19,7 @@ const UploadModal: React.FC<Uploader> = props => { ...@@ -20,7 +19,7 @@ const UploadModal: React.FC<Uploader> = props => {
const [file, setFile] = useState(); const [file, setFile] = useState();
const [fileList, setFileList] = useState([]); const [fileList, setFileList] = useState([]);
const downLoadTemplate = () => { }; const downLoadTemplate = () => {};
const step0Description = ( const step0Description = (
<> <>
...@@ -149,19 +148,14 @@ const UploadModal: React.FC<Uploader> = props => { ...@@ -149,19 +148,14 @@ const UploadModal: React.FC<Uploader> = props => {
const beforeUpload = file => { const beforeUpload = file => {
let extension = file.name.split('.')[1]; let extension = file.name.split('.')[1];
if (!['xlsx', 'xls'].includes(extension)) { if (['xlsx', 'xls'].includes[extension]) {
setTimeout(() => { setTimeout(() => {
setExceptionCheck(true); setExceptionCheck(true);
}, 250); }, 250);
} }
const flag = ['xlsx', 'xls'].includes(extension) return false;
return flag;
}; };
const handleChange = ({file}) => {
console.log(file)
}
// 上传 // 上传
const handleUpload = (type: string, file?: any, step: number = 0) => { const handleUpload = (type: string, file?: any, step: number = 0) => {
let title = ''; let title = '';
...@@ -184,7 +178,7 @@ const UploadModal: React.FC<Uploader> = props => { ...@@ -184,7 +178,7 @@ const UploadModal: React.FC<Uploader> = props => {
if (step === 1) return false; if (step === 1) return false;
}; };
const exportErrorLog = () => { }; const exportErrorLog = () => {};
const handleClose = () => { const handleClose = () => {
setModalStep(0); setModalStep(0);
...@@ -210,19 +204,20 @@ const UploadModal: React.FC<Uploader> = props => { ...@@ -210,19 +204,20 @@ const UploadModal: React.FC<Uploader> = props => {
icon={<FileExcelOutlined />} icon={<FileExcelOutlined />}
title={step0Description} title={step0Description}
extra={ extra={
<Upload // <Upload
action="/api/purchase/purchase/inquiry/import/excel/check" // name="file"
showUploadList={false} // action=""
beforeUpload={beforeUpload} // fileList={fileList}
onChange={handleChange} // beforeUpload={file => beforeUpload(file)}
> // customRequest={file => console.log(file)}
<Button type="primary">导入</Button> // >
</Upload> // <Button type="primary">导入</Button>
// <> // </Upload>
// <Button type="primary" onClick={() => handleUpload('upload')}> <>
// 导入 <Button type="primary" onClick={() => handleUpload('upload')}>
// </Button> 导入
// </> </Button>
</>
} }
/> />
</> </>
......
...@@ -125,9 +125,6 @@ export default { ...@@ -125,9 +125,6 @@ export default {
'menu.memberAbility.memberManage.memberPrVerifyChangeConfirm': '待确认会员变更', 'menu.memberAbility.memberManage.memberPrVerifyChangeConfirm': '待确认会员变更',
'menu.memberAbility.memberManage.memberPrVerifyChangeConfirmDetail': '待确认会员变更详情', 'menu.memberAbility.memberManage.memberPrVerifyChangeConfirmDetail': '待确认会员变更详情',
'menu.memberAbility.memberManage.memberPrVerifyChangeConfirmVerify': '确认会员变更', 'menu.memberAbility.memberManage.memberPrVerifyChangeConfirmVerify': '确认会员变更',
'menu.memberAbility.memberManage.memberUpgradeRule': '会员升级规则',
'menu.memberAbility.memberManage.memberLevel': '会员等级',
'menu.memberAbility.memberManage.editMemberLevel': '会员权益设置',
'menu.memberAbility.memberManage.maintainDetail': '会员详情', 'menu.memberAbility.memberManage.maintainDetail': '会员详情',
'menu.memberAbility.memberManage.maintainDetail.basicInfo': '会员基本信息', 'menu.memberAbility.memberManage.maintainDetail.basicInfo': '会员基本信息',
'menu.memberAbility.memberManage.maintainDetail.levelInfo': '会员等级信息', 'menu.memberAbility.memberManage.maintainDetail.levelInfo': '会员等级信息',
...@@ -143,6 +140,15 @@ export default { ...@@ -143,6 +140,15 @@ export default {
'menu.memberAbility.memberUpdate': '变更会员信息', 'menu.memberAbility.memberUpdate': '变更会员信息',
'menu.memberAbility.addSubRole': '新建会员角色', 'menu.memberAbility.addSubRole': '新建会员角色',
'menu.memberAbility.applyMember': '申请会员', 'menu.memberAbility.applyMember': '申请会员',
'menu.memberAbility.memberRuleConfiguration': '会员规则配置',
'menu.memberAbility.memberRuleConfiguration.memberLevel': '会员等级',
'menu.memberAbility.memberRuleConfiguration.memberLevelEdit': '会员权益设置',
'menu.memberAbility.memberRuleConfiguration.memberLevelDetail': '会员权益详情',
'menu.memberAbility.memberRuleConfiguration.memberUpgradeRule': '会员升级规则',
'menu.memberAbility.memberRuleConfiguration.memberFlowRule': '会员管理流程规则配置',
'menu.memberAbility.memberRuleConfiguration.memberFlowRuleAdd': '新建会员管理流程规则配置',
'menu.memberAbility.memberRuleConfiguration.memberFlowRuleEdit': '编辑会员管理流程规则配置',
'menu.memberAbility.memberRuleConfiguration.memberFlowRuleDetail': '会员管理流程规则配置详情',
// 店铺能力 // 店铺能力
'menu.shopAbility': '店铺', 'menu.shopAbility': '店铺',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:26:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:26:41
* @Description: 新建会员管理流程规则
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleAdd: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<FlowRuleForm id={id} validateId={validateId} isEdit />
);
};
export default MemberFlowRuleAdd;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-28 15:24:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:24:57
* @Description:
*/
import React from 'react';
import { Popconfirm, Button } from 'antd';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
const ComingConfigTable = () => {
const columns: EditableColumns[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
},
{
title: '中文名称',
dataIndex: 'name',
},
{
title: '分组信息',
dataIndex: 'groupName',
},
{
title: '操作',
dataIndex: 'option',
width: '20%',
align: 'center',
render: (text: any, record: any) => (
<>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => {}}
>
<Button
type="link"
danger
>
删除
</Button>
</Popconfirm>
</>
),
},
];
return (
<PolymericTable
rowKey="id"
dataSource={[
{
id: 1,
name: '企业名称',
groupName: '营业执照信息',
},
{
id: 2,
name: '住所',
groupName: '营业执照信息',
},
{
id: 3,
name: '企业类型',
groupName: '营业执照信息',
},
]}
columns={columns}
loading={false}
pagination={null}
/>
);
};
export default ComingConfigTable;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-28 15:19:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:48:37
* @Description: 入库资料操作组
*/
import React, { useState, useRef } from 'react';
import { PlusOutlined } from '@ant-design/icons';
import { Space, Button, Drawer } from 'antd';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions, useSchemaProps } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import NiceForm from '@/components/NiceForm';
import querySchema from './schema';
const formActions = createFormActions();
const fetchListData = async (params: any) => {
const payload = { ...params };
const res = await PublicApi.getMemberAbilitySubPage(payload);
if (res.code === 1000) {
// return res.data;
return {
data: [
{
validateId: 1,
id: 1,
roleName: '白银会员',
roleType: '白银会员2',
},
{
validateId: 2,
id: 2,
roleName: '白银会员3',
roleType: '白银会员3',
},
{
validateId: 3,
id: 3,
roleName: '白银会员4',
roleType: '白银会员4',
},
],
totalCount: 3,
};
}
return [];
};
const ComingCtl: React.FC = () => {
const [visibleDrawer, setVisibleDrawer] = useState(false);
const ref = useRef<any>({});
const schemaProps = useSchemaProps();
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'validateId' });
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
},
{
title: '会员角色',
dataIndex: 'roleName',
},
{
title: '角色类型',
dataIndex: 'roleType',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
},
{
title: '业务类型',
dataIndex: 'memberTypeName',
},
];
const handleVisibleDrawer = (flag: boolean) => {
setVisibleDrawer(!!flag);
};
const handleConfirm = () => {
console.log('RowCtlRowCtlRowCtl', RowCtl);
// props.mutators.change([]);
};
return (
<div>
<Space size="middle">
<Button
type="primary"
icon={<PlusOutlined />}
onClick={() => handleVisibleDrawer(true)}
>
新建入库资料
</Button>
<Button>
预览入库资料
</Button>
</Space>
<Drawer
title="选择入库资料"
width={1000}
onClose={() => handleVisibleDrawer(false)}
visible={visibleDrawer}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={() => handleVisibleDrawer(false)} style={{ marginRight: 16 }}>
取 消
</Button>
<Button onClick={handleConfirm} type="primary">
确 定
</Button>
</div>
}
>
<StandardTable
tableProps={{
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
}}
schema={querySchema}
/>
}
/>
</Drawer>
</div>
);
};
export default ComingCtl;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 18:01:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 11:07:18
* @Description:
*/
import { ISchema } from '@formily/antd';
const querySchema: ISchema = {
type: 'object',
properties: {
MAGE_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 中文名称 进行搜索',
advanced: false,
align: 'flex-left',
},
},
},
},
},
};
export default querySchema;
@import '~antd/es/style/themes/default.less';
.list {
padding: 0;
margin: 0;
&-item {
padding: 8px 14px;
width: 549px;
margin-bottom: 20px;
position: relative;
line-height: 28px;
list-style: none;
border: 1px solid #EEF0F3;
color: #303133;
background-color: #FFFFFF;
cursor: pointer;
&-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: @margin-sm;
}
&-desc {
color: @text-color-secondary;
}
&.active {
border: 1px solid @primary-color;
background-color: color(~`colorPalette('@{primary-color}', 0.04) `);
&::after {
content: '';
position: absolute;
width: 0;
height: 0;
border-bottom: 12px solid @primary-color;
border-left: 12px solid transparent;
bottom: 0;
right: 0;
z-index: 5;
}
}
&.disabled {
cursor: not-allowed;
}
&.hide {
display: none;
}
}
}
.more {
text-align: center;
cursor: pointer;
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-05-28 11:20:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 14:59:42
* @Description: 流程列表 Form Item
*/
import React, { useState } from 'react';
import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons';
import classNames from 'classnames';
import StatusTag, { StatusTagProps } from '@/components/StatusTag';
import styles from './index.less';
interface AddressItem {
/**
* 数据id
*/
id: string;
/**
* 标题
*/
title: string;
/**
* 流程
*/
flow: string;
/**
* 描述
*/
description: string;
};
interface IProps extends Pick<StatusTagProps, 'type'> {
/**
* 值
*/
value: AddressItem;
/**
* 列表数据
*/
dataSource: AddressItem[];
/**
* 默认展示的条数,默认值 3
*/
showCount?: number;
/**
* 数据选择改变触发事件
*/
onChange: (id: string) => {};
/**
* 是否是禁用的,默认 false
*/
disabled?: boolean;
/**
* 是否是只读的,默认 false
*/
readOnly?: boolean;
};
const FlowListFormItem = (props: IProps) => {
const {
value,
showCount = 3,
dataSource = [],
onChange,
disabled = false,
readOnly,
type,
} = props;
const [showMore, setShowMore] = useState(false);
const showDataSource = !showMore && !readOnly ? [...dataSource].splice(0, showCount) : dataSource;
const handleToogleMore = () => {
setShowMore(!showMore)
};
const handleSelectItem = record => {
if (onChange && !disabled) {
onChange(record);
}
};
return (
<div className={styles.flowList}>
<ul className={styles.list}>
{showDataSource.map(item => (
<li
className={classNames(styles['list-item'], {
[styles.active]: item.id === (value && value.id),
[styles.disabled]: disabled,
[styles.hide]: readOnly && item.id !== (value && value.id),
})}
onClick={() => handleSelectItem(item)}
key={item.id}
>
<div className={styles['list-item-head']}>
<div className={styles['list-item-title']}>
{item.title}
</div>
<StatusTag title={item.flow} type={type} />
</div>
<div className={styles['list-item-desc']}>
{item.description}
</div>
</li>
))}
</ul>
{(dataSource.length > showCount) && !readOnly && (
<div
className={styles.more}
onClick={handleToogleMore}
>
{!showMore ? '显示更多' : '隐藏更多'}
{!showMore ? <CaretDownOutlined /> : <CaretUpOutlined />}
</div>
)}
</div>
);
};
FlowListFormItem.defaultProps = {
showCount: 3,
disabled: false,
readOnly: false,
};
export default FlowListFormItem;
@import '~antd/es/style/themes/default.less';
.memberRole {
&-action {
margin-bottom: @margin-sm;
}
&-stamp {
padding: @padding-md @padding-md 0;
background-color: #FFFFFF;
border: 1px solid #EBECF0;
border-left-color: @primary-color;
}
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 17:12:55
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 11:16:25
* @Description: 适用会员角色 Form Item
*/
import React, { useState, useRef } from 'react';
import { Button, Descriptions, Drawer } from 'antd';
import {
PlusOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions, useSchemaProps } from '@formily/antd';
import { PublicApi } from '@/services/api';
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable';
import NiceForm from '@/components/NiceForm';
import querySchema from './schema';
import styles from './index.less';
const formActions = createFormActions();
const fetchListData = async (params: any) => {
const payload = { ...params };
const res = await PublicApi.getMemberAbilitySubPage(payload);
if (res.code === 1000) {
// return res.data;
return {
data: [
{
validateId: 1,
id: 1,
roleName: '白银会员',
roleType: '白银会员2',
},
{
validateId: 2,
id: 2,
roleName: '白银会员3',
roleType: '白银会员3',
},
{
validateId: 3,
id: 3,
roleName: '白银会员4',
roleType: '白银会员4',
},
],
totalCount: 3,
};
}
return [];
};
const MemberRoleFormItem = (props) => {
const [visibleDrawer, setVisibleDrawer] = useState(false);
const ref = useRef<any>({});
const schemaProps = useSchemaProps();
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'validateId', type: 'radio' });
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
},
{
title: '会员角色',
dataIndex: 'roleName',
},
{
title: '角色类型',
dataIndex: 'roleType',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
},
{
title: '业务类型',
dataIndex: 'memberTypeName',
},
];
const handleVisibleDrawer = (flag: boolean) => {
setVisibleDrawer(!!flag);
};
const handleConfirm = () => {
console.log('RowCtlRowCtlRowCtl', RowCtl);
// props.mutators.change([]);
};
return (
<div className={styles.memberRole}>
<Button
type="dashed"
icon={<PlusOutlined />}
className={styles['memberRole-action']}
onClick={() => handleVisibleDrawer(true)}
block
>
选择
</Button>
<div className={styles['memberRole-stamp']}>
<Descriptions column={1}>
<Descriptions.Item label="会员角色" labelStyle={{ width: 104 }}>供应商</Descriptions.Item>
<Descriptions.Item label="角色类型" labelStyle={{ width: 104 }}>服务消费者</Descriptions.Item>
<Descriptions.Item label="企业类型" labelStyle={{ width: 104 }}>企业会员</Descriptions.Item>
<Descriptions.Item label="业务类型" labelStyle={{ width: 104 }}>商品销售</Descriptions.Item>
</Descriptions>
</div>
<Drawer
title="选择会员角色"
width={1000}
onClose={() => handleVisibleDrawer(false)}
visible={visibleDrawer}
footer={
<div
style={{
textAlign: 'right',
}}
>
<Button onClick={() => handleVisibleDrawer(false)} style={{ marginRight: 16 }}>
取 消
</Button>
<Button onClick={handleConfirm} type="primary">
确 定
</Button>
</div>
}
>
<StandardTable
tableProps={{
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
}}
schema={querySchema}
/>
}
/>
</Drawer>
</div>
);
};
MemberRoleFormItem.isFieldComponent = true;
export default MemberRoleFormItem;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 18:01:56
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 11:07:18
* @Description:
*/
import { ISchema } from '@formily/antd';
const querySchema: ISchema = {
type: 'object',
properties: {
MAGE_LAYOUT: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 中文名称 进行搜索',
advanced: false,
align: 'flex-left',
},
},
},
},
},
};
export default querySchema;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-28 15:06:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:15:47
* @Description: 平台注册资料
*/
import React from 'react';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
const PlatformConfigTable = () => {
const columns: EditableColumns[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
},
{
title: '中文名称',
dataIndex: 'name',
},
{
title: '分组信息',
dataIndex: 'groupName',
},
];
return (
<PolymericTable
rowKey="id"
dataSource={[
{
id: 1,
name: '企业名称',
groupName: '营业执照信息',
},
{
id: 2,
name: '住所',
groupName: '营业执照信息',
},
{
id: 3,
name: '企业类型',
groupName: '营业执照信息',
},
]}
columns={columns}
loading={false}
pagination={null}
/>
);
};
export default PlatformConfigTable;
.search {
display: flex;
justify-content: flex-end;
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-05-28 14:30:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:04:40
* @Description: 搜索组件
*/
import React from 'react';
import { Input, Button } from 'antd';
import styles from './index.less';
interface IProps {
/**
* 值
*/
value: string,
/**
* 输入改变触发事件
*/
onChange: (value: string) => void,
/**
* 搜索事触发事件
*/
onSearch: (value: string) => void,
/**
* 点击重置按钮触发事件
*/
onReset?: () => void,
/**
* 是否在点击重置按钮的时候调用 onSearch 事件,默然为 true
*/
searchOnResetAction?: boolean,
}
const MySearch: React.FC<IProps> = (props: IProps) => {
const {
value,
onChange,
onSearch,
onReset,
searchOnResetAction,
...rest
} = props;
const handleChange = (e) => {
console.log('e', e)
if (onChange) {
onChange(e.target.value);
}
};
const handleSearch = (next) => {
if (onSearch) {
onSearch(next);
}
};
const handleReset = () => {
if (searchOnResetAction) {
onSearch(value);
}
if (onReset) {
onReset();
}
};
return (
<div className={styles.search}>
<Input.Search
style={{ width: '200px', marginRight: 16 }}
value={props.value || ''}
onChange={handleChange}
onSearch={handleSearch}
{...rest}
/>
<Button
onClick={handleReset}
>
重置
</Button>
</div>
);
};
MySearch.defaultProps = {
onReset: undefined,
searchOnResetAction: true,
};
export default MySearch;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:13:05
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:14:38
* @Description:
*/
import React, { useState, useEffect, useRef } from 'react';
import { history, Prompt } from 'umi';
import { Button, Card, Spin, Tooltip, message } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { SaveOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { Checkbox } from '@formily/antd-components';
import { merge } from 'rxjs';
import { usePageStatus } from '@/hooks/usePageStatus';
import ReutrnEle from '@/components/ReturnEle';
import NiceForm from '@/components/NiceForm';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { PublicApi } from '@/services/api';
import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi';
import formSchema from './schema';
import MemberRoleFormItem from './components/MemberRoleFormItem';
import FlowListFormItem from './components/FlowListFormItem';
import Search from './components/Search';
import PlatformConfigTable from './components/PlatformConfigTable';
import ComingCtl from './components/ComingCtl';
import ComingConfigTable from './components/ComingConfigTable';
const formActions = createFormActions();
const {
onFieldValueChange$,
onFieldInputChange$,
onFormInputChange$,
} = FormEffectHooks;
interface MemberFormProps {
/**
* 数据id
*/
id?: number;
/**
* 数据 审核id
*/
validateId?: number;
/**
* 是否可编辑的
*/
isEdit?: boolean,
};
const FlowRuleForm: React.FC<MemberFormProps> = ({
id,
validateId,
isEdit = false,
}) => {
const areaRef = useRef<any[]>([])
const [memberItems, setMemberItems] = useState<any>({});
const [submitLoading, setSubmitLoading] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const getDetailedInfo = async () => {
};
useEffect(() => {
getDetailedInfo();
}, []);
const handleSubmit = (values: any) => {
const {
memberTypeId,
roleId,
level,
countryCodeId,
phone,
email,
channelLevel,
channelTypeId,
areas = [],
remark,
outerStatus,
status,
statusName,
...rest
} = values;
const filtered = areas.filter(item => item.pcode || item.ccode);
if (!id && !isEdit) {
setSubmitLoading(true);
const msg = message.loading({
content: '正在添加,请稍候...',
duration: 0,
});
PublicApi.postMemberAbilitySubAdd({
memberTypeId,
roleId,
level,
countryCodeId,
phone,
email,
channelTypeId,
areas: filtered,
remark,
detail: rest,
}, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
msg();
setSubmitLoading(false);
});
return;
}
if (id && validateId && isEdit) {
setSubmitLoading(true);
const msg = message.loading({
content: '正在保存,请稍候...',
duration: 0,
});
PublicApi.postMemberAbilitySubUpdate({
memberId: id,
validateId,
memberTypeId,
roleId,
level,
countryCodeId,
phone,
email,
channelTypeId,
areas: filtered,
remark,
detail: rest,
}, {
timeout: 0,
}).then(res => {
if (res.code !== 1000) {
return;
}
setUnsaved(false);
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
msg();
setSubmitLoading(false);
});
}
};
const createRichTextUtils = () => {
return {
text(...args) {
return React.createElement('span', {}, ...args)
},
help(text, offset = 3) {
return React.createElement(
Tooltip,
{ title: text },
<QuestionCircleOutlined
style={{ margin: '0 3px', cursor: 'default', marginLeft: offset }}
size={16}
/>
)
},
}
}
return (
<Spin spinning={infoLoading}>
<PageHeaderWrapper
style={{
padding: 24,
}}
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回" />}
title={!id ? '新增会员管理流程规则' : '编辑会员管理流程规则会员'}
extra={[
<Button
key="1"
type="primary"
icon={<SaveOutlined />}
loading={submitLoading}
// onClick={() => formActions.submit()}
>
保存
</Button>,
]}
>
<Card>
<NiceForm
onSubmit={handleSubmit}
actions={formActions}
initialValues={{}}
components={{
MemberRoleFormItem,
FlowListFormItem,
MySearch: Search,
ComingCtl,
Checkbox,
CheckboxGroup: Checkbox.Group
}}
expressionScope={{
...createRichTextUtils(),
PlatformConfigTable: <PlatformConfigTable />,
ComingConfigTable: <ComingConfigTable />,
}}
effects={($, actions) => {
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={formSchema}
editable={isEdit}
/>
</Card>
</PageHeaderWrapper>
<Prompt when={unsaved} message="您还有未保存的内容,是否确定要离开?" />
</Spin>
);
};
FlowRuleForm.defaultProps = {
id: 0,
validateId: 0,
isEdit: false,
};
export default FlowRuleForm;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:13:26
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-28 15:45:23
* @Description:
*/
import { ISchema } from '@formily/antd';
import { PATTERN_MAPS } from '@/constants/regExp';
const formSchema: ISchema = {
type: 'object',
properties: {
tabs: {
type: 'object',
'x-component': 'Tab',
'x-component-props': {
type: 'card',
},
properties: {
'tab-1': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '基本信息',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: {
ruleName: {
type: 'string',
required: true,
title: '流程规则名称',
'x-component-props': {
placeholder: '请输入',
},
},
roleId: {
type: 'string',
required: true,
title: '适用会员角色',
'x-component': 'MemberRoleFormItem',
'x-component-props': {
},
},
},
},
},
},
'tab-2': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '会员入库流程',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: {
comingRule: {
type: 'string',
required: true,
title: '流程选择',
'x-component': 'FlowListFormItem',
'x-component-props': {
dataSource: [
{
id: 1,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
{
id: 2,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
{
id: 3,
title: 'XGG1',
flow: '会员入库流程',
description: '1-确认入库',
},
],
type: 'success',
},
},
},
},
},
},
'tab-3': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '平台注册资料',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 8,
wrapperCol: 10,
labelAlign: 'left',
grid: true,
},
properties: {
usePlatformConfig: {
type: 'string',
title: "{{ text('平台注册资料', help('会员在平台注册时已填写的资料')) }}",
'x-component': 'CheckboxGroup',
default: '1',
enum: [
{ label: '使用平台注册资料(默认)', value: '1' },
]
},
searchPlatformConfig: {
type: 'object',
'x-component': 'MySearch',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
platformConfigTable: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{PlatformConfigTable}}',
},
},
},
},
'tab-4': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '入库资料',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
comingCtl: {
type: 'object',
'x-component': 'ComingCtl',
},
searchComingConfig: {
type: 'object',
'x-component': 'MySearch',
'x-component-props': {
placeholder: '搜索',
},
},
},
},
comingConfigTable: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{ComingConfigTable}}',
},
},
},
},
'tab-5': {
type: 'object',
'x-component': 'TabPane',
'x-component-props': {
tab: '会员表更流程',
},
properties: {
MEGA_LAYOUT1: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
labelCol: 4,
wrapperCol: 8,
labelAlign: 'left',
},
properties: {
changeRule: {
type: 'string',
required: true,
title: '流程选择',
'x-component': 'FlowListFormItem',
'x-component-props': {
dataSource: [
{
id: 1,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 2,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 3,
title: 'XGG1',
flow: '会员表更流程',
description: '1-确认入库',
},
{
id: 4,
title: 'XGG4',
flow: '会员表更流程',
description: '1-确认入库',
},
],
type: 'warning',
},
},
},
},
},
},
},
},
},
};
export default formSchema;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:25:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:31:10
* @Description: 会员管理流程规则详情
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleDetail: React.FC = () => {
const { id, validateId } = usePageStatus();
return (
<FlowRuleForm id={id} validateId={validateId} />
);
};
export default MemberFlowRuleDetail;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:26:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:26:17
* @Description: 编辑会员管理流程规则
*/
import React from 'react';
import FlowRuleForm from './components/FlowRuleForm';
const MemberFlowRuleEdit: React.FC = () => {
return (
<FlowRuleForm isEdit />
);
};
export default MemberFlowRuleEdit;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:01:23
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:46:02
* @Description: 会员管理流程规则配置
*/
import React, { useState, useRef } from 'react';
import { history } from 'umi';
import {
Card,
Space,
Button,
Popconfirm,
message,
} from 'antd';
import {
PlusOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import moment from 'moment';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { PublicApi } from '@/services/api';
import {
MEMBER_OUTER_STATUS_UNCOMMITTED,
MEMBER_OUTER_STATUS_FAILED,
} from '@/constants/member';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusSwitch from '@/components/StatusSwitch';
import StatusTag from '../components/StatusTag';
import { querySchema } from './schema';
import { coverColFiltersItem } from '../utils';
import { MEMBER_OUTER_STATUS_TYPE } from '../constant';
import styles from './index.less';
const formActions = createFormActions();
const fetchListData = async (params: any) => {
const { startDate = null, endDate = null } = params;
const payload = { ...params };
if (startDate) {
payload.startDate = moment(+startDate).format('YYYY-MM-DD');
}
if (endDate) {
payload.endDate = moment(+endDate).format('YYYY-MM-DD');
}
const res = await PublicApi.getMemberAbilitySubPage(payload);
if (res.code === 1000) {
return res.data;
}
return [];
};
const MemberFlowRule: React.FC<[]> = () => {
const ref = useRef<any>({});
const handleDelete = (memberId: number, validateId: number) => {
const mesInstance = message.loading({
content: '正在删除',
duration: 0,
});
PublicApi.postMemberAbilitySubDelete({
memberId,
validateId,
}).then(res => {
if (res.code !== 1000) {
return;
}
ref.current.reload();
}).finally(() => {
mesInstance();
});
};
const handleCommit = (memberId: number, validateId: number) => {
PublicApi.postMemberAbilitySubCommit({
memberId,
validateId,
}).then(res => {
if (res.code !== 1000) {
return;
}
ref.current.reload();
});
};
const handleModify = record => {
};
const defaultColumns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
},
{
title: '流程规则名称',
dataIndex: 'name ',
render: (text, record) => (
<>
<EyePreview
url={`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/detail?id=${record.memberId}&validateId=${record.validateId}`}
>
{text}
</EyePreview>
</>
),
},
{
title: '会员角色',
dataIndex: 'roleName',
},
{
title: '角色类型',
dataIndex: 'roleName',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
},
{
title: '业务类型',
dataIndex: 'memberTypeName',
},
{
title: '操作时间',
dataIndex: 'registerTime',
},
{
title: '状态',
dataIndex: 'outerStatusName',
filters: [],
render: (text, record) => (
<StatusSwitch
fieldNames="state"
handleConfirm={() => handleModify(record)}
record={record}
/>
),
},
{
title: '操作',
dataIndex: 'option',
width: '20%',
align: 'center',
render: (_, record: any) => (
<>
<Button
type="link"
onClick={() =>
history.push(`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/edit?id=${record.memberId}&validateId=${record.validateId}`)
}
>
编辑
</Button>
<Popconfirm
title="确定要删除吗?"
okText="是"
cancelText="否"
onConfirm={() => handleDelete(record.memberId, record.validateId)}
>
<Button
type="link"
danger
>
删除
</Button>
</Popconfirm>
</>
),
},
];
const [columns, setColumns] = useState<any[]>(defaultColumns);
const controllerBtns = (
<>
<Space>
<Button
type="primary"
onClick={() =>
history.push(`/memberCenter/memberAbility/ruleConfiguration/memberFlowRule/add`)
}
>
<PlusOutlined />
新建
</Button>
</Space>
</>
);
return (
<Card>
<StandardTable
tableProps={{
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
}}
schema={querySchema}
/>
}
/>
</Card>
);
};
export default MemberFlowRule;
/*
* @Author: XieZhiXiong
* @Date: 2021-05-27 16:04:23
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-27 16:04:24
* @Description:
*/
import { ISchema } from '@formily/antd';
export const querySchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'Mega-Layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
name: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 流程规则名称 进行搜索',
advanced: false,
},
},
},
},
},
},
},
};
\ No newline at end of file
import { ISchema } from '@formily/antd'; import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const'; import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
import { PATTERN_MAPS } from '@/constants/regExp';
export const importSchema: ISchema = { export const importSchema: ISchema = {
type: 'object', type: 'object',
......
...@@ -49,7 +49,7 @@ const MemberLevel: React.FC<[]> = () => { ...@@ -49,7 +49,7 @@ const MemberLevel: React.FC<[]> = () => {
key: 'levelTag', key: 'levelTag',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview <EyePreview
url={`/memberCenter/memberAbility/manage/level/detail?id=${record.id}`} url={`/memberCenter/memberAbility/ruleConfiguration/level/detail?id=${record.id}`}
> >
{text} {text}
</EyePreview> </EyePreview>
...@@ -105,7 +105,7 @@ const MemberLevel: React.FC<[]> = () => { ...@@ -105,7 +105,7 @@ const MemberLevel: React.FC<[]> = () => {
<Button <Button
type="link" type="link"
onClick={() => onClick={() =>
history.push(`/memberCenter/memberAbility/manage/level/edit?id=${record.id}`) history.push(`/memberCenter/memberAbility/ruleConfiguration/level/edit?id=${record.id}`)
} }
> >
设置 设置
......
...@@ -82,7 +82,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => { ...@@ -82,7 +82,7 @@ const ComingClassifyDrawer: React.FC<IProps> = (props: IProps) => {
}} }}
> >
<Button onClick={handleClose} style={{ marginRight: 16 }}> <Button onClick={handleClose} style={{ marginRight: 16 }}>
取消
</Button> </Button>
<Button onClick={() => formActions.submit()} type="primary"> <Button onClick={() => formActions.submit()} type="primary">
确 定 确 定
......
...@@ -68,7 +68,7 @@ const VerifyComingInvestigateDrawer: React.FC<IProps> = (props: IProps) => { ...@@ -68,7 +68,7 @@ const VerifyComingInvestigateDrawer: React.FC<IProps> = (props: IProps) => {
}} }}
> >
<Button onClick={handleClose} style={{ marginRight: 16 }}> <Button onClick={handleClose} style={{ marginRight: 16 }}>
取消
</Button> </Button>
<Button onClick={() => formActions.submit()} type="primary"> <Button onClick={() => formActions.submit()} type="primary">
确 定 确 定
......
...@@ -68,7 +68,7 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => { ...@@ -68,7 +68,7 @@ const VerifyComingDataDrawer: React.FC<IProps> = (props: IProps) => {
}} }}
> >
<Button onClick={handleClose} style={{ marginRight: 16 }}> <Button onClick={handleClose} style={{ marginRight: 16 }}>
取消
</Button> </Button>
<Button onClick={() => formActions.submit()} type="primary"> <Button onClick={() => formActions.submit()} type="primary">
确 定 确 定
......
...@@ -122,22 +122,35 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -122,22 +122,35 @@ const Material: React.FC<Iprops> = (props: any) => {
key: 'category', key: 'category',
dataIndex: 'category', dataIndex: 'category',
render: (text: any, record: any, index: number) => ( render: (text: any, record: any, index: number) => (
<Form.Item <>
style={{ margin: 0 }} { materielMode === 1 && (
name={`category_${index + 1}`} <Form.Item
initialValue={record.ids} style={{ margin: 0 }}
rules={[{ required: true, message: '请输入' }]} name={`category_${index + 1}`}
> initialValue={record.ids}
<Cascader rules={[{ required: true, message: '请输入' }]}
options={category} >
onChange={(e, value) => handleEditCategory(e, value, index)} <Cascader
fieldNames={{ label: 'title', value: 'id', children: 'children' }} options={category}
placeholder="请选择品类" onChange={(e, value) => handleEditCategory(e, value, index)}
allowClear={false} fieldNames={{ label: 'title', value: 'id', children: 'children' }}
notFoundContent={<Spin size="small" />} placeholder="请选择品类"
/> allowClear={false}
</Form.Item> notFoundContent={<Spin size="small" />}
/>
</Form.Item>
)}
{ materielMode === 2 && (
<Form.Item
style={{ margin: 0 }}
name={`category_${index + 1}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]}
>
<Input onChange={(e) => handleEdit(e, 'category', index)} />
</Form.Item>
)}
</>
), ),
}, },
{ {
...@@ -304,6 +317,7 @@ const Material: React.FC<Iprops> = (props: any) => { ...@@ -304,6 +317,7 @@ const Material: React.FC<Iprops> = (props: any) => {
visible={flag} visible={flag}
title='导入' title='导入'
checkfetch='/api/purchase/purchase/inquiry/import/excel/check' checkfetch='/api/purchase/purchase/inquiry/import/excel/check'
importfetch='/api/purchase/purchase/inquiry/import/excel'
fetchData={fetchData} fetchData={fetchData}
onClose={() => setFlag(false)} onClose={() => setFlag(false)}
/> />
......
...@@ -19,9 +19,8 @@ export async function uploadFile(params) { ...@@ -19,9 +19,8 @@ export async function uploadFile(params) {
}) })
} }
export async function uploadFileExcel(params) { export async function uploadFileExcel(url, params) {
return umiRequest('/purchase/inquiry/import/excel', { return umiRequest(url, {
prefix: '/api/purchase',
method: 'post', method: 'post',
data: params, data: params,
requestType: 'form' requestType: 'form'
......
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