Commit 708f4af7 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 7601c6c9 8e8f676f
......@@ -3,13 +3,7 @@
* @Date: 2020-07-13 14:36:02
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-19 15:34:24
*/
/*
* @Author: Ljc
* @Date: 2020-07-10 16:15:28
* @Last Modified by: ljc
* @Last Modified time: 2020-07-10 16:15:28
* @LastEditTime: 2020-08-24 16:50:42
*/
const LogisticsRoute = {
path: '/memberCenter/logisticsAbility',
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-31 19:56:22
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 15:21:43
*/
const TranactionRoute = {
path: '/memberCenter/tranactionAbility',
......@@ -56,6 +63,19 @@ const TranactionRoute = {
component: '@/pages/transaction/stockSellStorage/inventory/index',
},
]
},
{
path:'/memberCenter/tranactionAbility/enquirySubmit',
name:'enquirySubmit',
key:'enquirySubmit',
routes:[
{
path:'/memberCenter/tranactionAbility/enquirySubmit/SearchList',
name:'SearchList',
key:'SearchList',
component: '@/pages/transaction/enquirySubmit/toSubmit'
}
]
}
]
......
......@@ -52,7 +52,7 @@
"react-reconciler": "^0.25.1",
"rgbaster": "^2.1.1",
"typescript": "^3.9.7",
"umi": "^3.2.0",
"umi": "^3.2.16",
"video-react": "^0.14.1",
"yorkie": "^2.0.0"
},
......
......@@ -22,21 +22,15 @@ export const useAsyncInitSelect = (name: string[], service?: () => Promise<any>)
linkage.loading(formPath);
service().then(res => {
if (res.code === 1000) {
linkage.loaded(formPath);
name.forEach(v => {
linkage.enum(v, res[v]);
});
// 请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch('requestAsyncSelect', {
name,
payload: res,
});
return;
}
linkage.loaded(formPath);
}).catch(err => {
name.forEach(v => {
linkage.enum(v, res[v] || []);
});
// 请求结束可以dispatch一个自定义事件收尾,方便后续针对该事件做联动
dispatch('requestAsyncSelect', {
name,
payload: res,
});
}).finally(() => {
linkage.loaded(formPath);
});
})
......
......@@ -17,19 +17,8 @@ export interface UserRegister {
useType: UseType;
}
export interface ShopInfo {
id: number;
name: string;
type: number;
environment: number;
logoUrl: string;
describe: string;
state: number;
url: string;
}
export interface Web {
shopInfo: ShopInfo[];
shopInfo: any[];
}
export interface PayConfig {
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-20 10:22:52
* @LastEditTime: 2020-08-24 15:26:39
*/
export default {
......@@ -94,6 +94,8 @@ export default {
'menu.tranactionAbility.stockSellStorage.bills': '单据',
'menu.tranactionAbility.stockSellStorage.addBills': '新增单据',
'menu.tranactionAbility.stockSellStorage.inventory': '库存',
'menu.tranactionAbility.enquirySubmit': '需求发布',
'menu.tranactionAbility.enquirySubmit.SearchList': '需求发布',
//物流能力
'menu.logisticsAbility': '物流',
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-05 16:36:51
* @LastEditTime: 2020-08-24 20:13:06
*/
import React, { Component, useState, useEffect } from 'react';
import ReactDOM from 'react-dom'
......@@ -61,7 +61,7 @@ for (let i = 10; i < 36; i++) {
}
const diaLogForm: React.FC<ListProps> = (props) => {
const type: string = history.location.query.type
const type: string = history.location.query.page_type
const [areaCode, setAreaCode] = useState<number>(null)
const [Options, setOptions] = useState([])
const [state, setState] = useState({ editable: true })
......@@ -89,7 +89,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const formSubmit = (values) => {
console.log(values)
let id = history.location.query.id //0新建
let type = history.location.query.type //'1' 发货 '2'收货
let type = history.location.query.page_type //'1' 发货 '2'收货
let value = { ...values }
value.isDefault = values.isDefault ? 1 : 0
value.provinceCode = value.provinceCode.split('-').length > 1 ? value.provinceCode.split('-')[0] : value.provinceCode
......@@ -167,7 +167,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
const id = Number(history.location.query.id)
console.log(typeof(id))
let title = id === 0 ? '新建' : '编辑'
history.location.query.type == '1' ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`)
history.location.query.page_type == '1' ? setHeaderTitle(`${title}发货地址`) : setHeaderTitle(`${title}收货地址`)
PublicApi.getManageGetTelCode().then(res => {
res.data.forEach((item,index) => {
TelCodeList.push({ label: item, value: (index).toString() })
......@@ -185,7 +185,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
})
},1000)
if (id != 0 && history.location.query.type == '1') {
if (id != 0 && history.location.query.page_type == '1') {
PublicApi.getLogisticsShipperAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -209,7 +209,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
}
//收货
if (id != 0 && history.location.query.type == '2') {
if (id != 0 && history.location.query.page_type == '2') {
PublicApi.getLogisticsReceiverAddressGet({ id: id.toString() }).then(res => {
if (res.code == 1000) {
let data = res.data
......@@ -317,7 +317,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
>
<FormMegaLayout labelCol={4} labelAlign="left">
{
history.location.query.type == '1' ?
history.location.query.page_type == '1' ?
<Field
required
title="发货人"
......@@ -341,7 +341,7 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
}
<FormMegaLayout label={history.location.query.type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<FormMegaLayout label={history.location.query.page_type == '1' ? '发货地区' : '收货地区'} grid full autoRow required>
<Field
x-mega-props={{ span: 1 }}
x-component="Select"
......
......@@ -22,13 +22,14 @@ const formActions = createFormActions();
const auditList: React.FC<PageProps> = props => {
const { pageType } = props;
let path =
pageType === '1'
? 'auditPrSubmit'
: pageType === '2'
? 'auditPr1'
: pageType === '3'
? 'auditPr2'
: 'auditPrComfirm';
pageType === '1' ?
'auditPrSubmit' :
pageType === '2' ?
'auditPr1' :
pageType === '3' ?
'auditPr2' :
'auditPrComfirm';
const ref = useRef<any>({});
const [searchItems, setSearchItems] = useState<any>({});
const [filteredInfo, setFilteredInfo] = useState<any>({});
......@@ -171,7 +172,7 @@ const auditList: React.FC<PageProps> = props => {
getListFn = PublicApi.getMemberValidateConfirmPage;
break;
}
return getListFn(params).then(res => res.data);
return getListFn(params).then(res => res.data || {});
};
const handleSearch = (filter: any) => {
......@@ -194,45 +195,6 @@ const auditList: React.FC<PageProps> = props => {
});
};
// 初始化高级筛选选项
const fetchSearchItems = async () => {
let result;
switch (pageType) {
case '1':
result = await PublicApi.getMemberValidateCommitPageitems();
break;
case '2':
result = await PublicApi.getMemberValidateStep1Pageitems();
break;
case '3':
result = await PublicApi.getMemberValidateStep2Pageitems();
break;
case '4':
result = await PublicApi.getMemberValidateConfirmPageitems();
break;
}
const { data } = result;
defaultColumns.find(target => {
switch (target.key) {
case 'memberStatus':
target.filters = fetchFilterOptions(data.memberStatus);
break;
case 'outerStatusName':
target.filters = fetchFilterOptions(data.outerStatus);
break;
case 'innerStatusName':
target.filters = fetchFilterOptions(data.innerStatus);
break;
}
});
return {
memberType: fetchSelectOptions(data.memberTypes),
roleId: fetchSelectOptions(data.memberRoles),
level: fetchSelectOptions(data.memberLevels),
source: fetchSelectOptions(data.memberSource),
};
};
const fetchSelectOptions = data => {
return data.map(v => ({ label: v.text, value: v.id }));
};
......@@ -262,6 +224,51 @@ const auditList: React.FC<PageProps> = props => {
});
};
// 初始化高级筛选选项
const fetchSearchItems = async () => {
let result;
switch (pageType) {
case '1':
result = await PublicApi.getMemberValidateCommitPageitems();
break;
case '2':
result = await PublicApi.getMemberValidateStep1Pageitems();
break;
case '3':
result = await PublicApi.getMemberValidateStep2Pageitems();
break;
case '4':
result = await PublicApi.getMemberValidateConfirmPageitems();
break;
}
const res = result;
if (res.code === 1000) {
const { data } = res;
defaultColumns.find(target => {
switch (target.key) {
case 'memberStatus':
target.filters = fetchFilterOptions(data.memberStatus);
break;
case 'outerStatusName':
target.filters = fetchFilterOptions(data.outerStatus);
break;
case 'innerStatusName':
target.filters = fetchFilterOptions(data.innerStatus);
break;
}
});
return {
memberType: fetchSelectOptions(data.memberTypes),
roleId: fetchSelectOptions(data.memberRoles),
level: fetchSelectOptions(data.memberLevels),
source: fetchSelectOptions(data.memberSource),
};
}
return {};
};
const controllerBtns = (
<Space>
<Popconfirm
......
......@@ -18,20 +18,54 @@ const { Step } = Steps;
const MemberDetail: React.FC<{}> = () => {
const { pageStatus, id, validateId } = usePageStatus();
const [hActived, setHActived] = useState('3');
const [actived, setActived] = useState('3');
const [detailData, setDetailData] = useState<any>({});
useEffect(() => {
const fetchDetailData = async () => {
const { data } = await PublicApi.getMemberValidateCommitDetail({
memberId: id,
validateId: validateId,
});
const fetchDetailData = async () => {
if (!id && !validateId) {
return;
}
const res = await PublicApi.getMemberValidateCommitDetail({
memberId: id,
validateId: validateId,
});
if (res.code === 1000) {
const { data } = res;
setDetailData(data);
};
}
};
useEffect(() => {
fetchDetailData();
}, []);
const handleTabChange = (val: string) => {
setActived(val);
};
const tabList = [
{
key: '1',
tab: '基本信息',
},
{
key: '2',
tab: '权限信息',
},
{
key: '3',
tab: '等级信息',
},
{
key: '4',
tab: '权益信息',
},
{
key: '5',
tab: '诚信信息',
},
];
return (
<PageHeaderWrapper
title={
......@@ -50,15 +84,6 @@ const MemberDetail: React.FC<{}> = () => {
</div>
</>
}
footer={
<Tabs activeKey={hActived} onChange={val => setHActived(val)}>
<TabPane tab="基本信息" key="1" />
<TabPane tab="权限信息" key="2" />
<TabPane tab="等级信息" key="3" />
<TabPane tab="权益信息" key="4" />
<TabPane tab="诚信信息" key="5" />
</Tabs>
}
>
<Descriptions size="small" column={3} style={{ padding: '0 32px' }}>
<Descriptions.Item label="会员类型">{123}</Descriptions.Item>
......@@ -76,14 +101,17 @@ const MemberDetail: React.FC<{}> = () => {
</PageHeader>
</>
}
tabList={tabList}
tabActiveKey={actived}
onTabChange={handleTabChange}
>
{hActived === '1' ? (
{actived === '1' ? (
<BaseDetail detailData={detailData} />
) : hActived === '2' ? (
) : actived === '2' ? (
<AuthDetail detailData={detailData} />
) : hActived === '3' ? (
) : actived === '3' ? (
<LevelDetail detailData={detailData} />
) : hActived === '4' ? (
) : actived === '4' ? (
<EquitiesDetail detailData={detailData} />
) : (
<IntegrityDetail detailData={detailData} />
......
......@@ -45,25 +45,25 @@ export const auditSchema: ISchema = {
properties: {
memberType: {
type: 'string',
default: 0,
default: undefined,
enum: [],
'x-component-props': {},
},
roleId: {
type: 'string',
default: 0,
default: undefined,
enum: [],
'x-component-props': {},
},
level: {
type: 'string',
default: 0,
default: undefined,
enum: [],
'x-component-props': {},
},
source: {
type: 'string',
default: 0,
default: undefined,
enum: [],
'x-component-props': {},
},
......
......@@ -9,9 +9,9 @@ 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 { initDetailSchema } from './schema';
import { PublicApi } from '@/services/api';
const formActions = createFormActions();
......@@ -78,7 +78,9 @@ const addMember: React.FC<any> = props => {
useEffect(() => {
PublicApi.getMemberMaintenanceAddpageitems().then(res => {
setMemberItems(res.data);
if (res.code === 1000) {
setMemberItems(res.data);
}
});
}, []);
......@@ -102,12 +104,17 @@ const addMember: React.FC<any> = props => {
// 会员类型、会员角色、会员等级选项
const fetchSelectOptions = async () => {
const { data } = await PublicApi.getMemberMaintenanceAddpageitems();
return {
memberTypeId: fetchSomeOptions(data.memberTypes),
roleId: fetchSomeOptions(data.memberRoles),
level: fetchSomeOptions(data.memberLevels),
};
const res = await PublicApi.getMemberMaintenanceAddpageitems();
if (res.code === 1000) {
const { data } = res;
return {
memberTypeId: mapOptions(data.memberTypes),
roleId: mapOptions(data.memberRoles),
level: mapOptions(data.memberLevels),
};
}
return {};
};
// 获取手机code
......@@ -116,7 +123,7 @@ const addMember: React.FC<any> = props => {
return data;
};
const fetchSomeOptions = data => {
const mapOptions = data => {
return data.map(v => ({ label: v.text, value: v.id }));
};
......
......@@ -231,13 +231,18 @@ const memberMaintain: React.FC<[]> = () => {
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
const { data } = await PublicApi.getMemberValidateCommitPageitems();
return {
memberType: fetchFilterOptions(data.memberTypes),
roleId: fetchFilterOptions(data.memberRoles),
level: fetchFilterOptions(data.memberLevels),
source: fetchFilterOptions(data.memberSource),
};
const res = await PublicApi.getMemberValidateCommitPageitems();
if (res.code === 1000) {
const { data } = res;
return {
memberType: fetchFilterOptions(data.memberTypes),
roleId: fetchFilterOptions(data.memberRoles),
level: fetchFilterOptions(data.memberLevels),
source: fetchFilterOptions(data.memberSource),
};
}
return {};
};
const fetchFilterOptions = data => {
......
......@@ -127,27 +127,42 @@ export const auditModalSchema = props => {
return modalSchema;
};
const FIELD_TYPE_MAP = {
'string': 'string',
'long': 'string',
'upload': 'upload',
};
const getXComponentProps = (type, item) => {
const MAP = {
'string': {
placeholder: item.fieldRemark,
},
'upload': {
listType: 'card',
action: '/api/file/file/upload',
data: { fileType: UPLOAD_TYPE },
fileList: [],
onChange: file => console.log(file),
},
};
return MAP[type];
};
const getCompnentValue = (elements: any) => {
let components = {};
const components = {};
for (let item of elements) {
let xComponentProps =
item.fieldType === 'string'
? {
placeholder: item.fieldRemark,
}
: {
listType: 'card',
action: '/api/file/file/upload',
data: { fileType: UPLOAD_TYPE },
fileList: [],
onChange: file => console.log(file),
};
components[item.fieldName] = {
type: item.fieldType,
required: item.fieldEmpty === 0,
title: item.fieldCNName,
'x-component-props': xComponentProps,
};
// 先判断是否存在 type,防止不存在的 type 报错
const realType = FIELD_TYPE_MAP[item.fieldType];
if (realType) {
components[item.fieldName] = {
type: FIELD_TYPE_MAP[item.fieldType],
required: item.fieldEmpty === 0,
title: item.fieldCNName,
'x-component-props': getXComponentProps(realType, item),
};
}
}
return components;
};
......@@ -199,40 +214,31 @@ export const initDetailSchema = (props: any) => {
},
},
MEGA_LAYOUT1_1: {
key: 'MEGA_LAYOUT1_1',
type: 'object',
name: 'MEGA_LAYOUT1_1',
'x-component': 'mega-layout',
'x-component-props': {
label: '注册手机',
wrapperCol: 24,
required: true,
},
required: true,
inline: true,
},
properties: {
MEGA_LAYOUT1_1_1: {
type: 'object',
'x-component': 'mega-layout',
telCode: {
type: 'string',
enum: [],
'x-component-props': {
placeholder: '请选择',
},
required: true,
},
tel: {
type: 'string',
'x-component-props': {
grid: true,
full: true,
},
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,
},
},
placeholder: '请输入你的手机号码',
maxLength: 11,
},
required: true,
},
},
},
......
This diff is collapsed.
import React, { ReactNode, useState, useRef, useEffect } from 'react';
import { history } from 'umi';
import { Row, Col, Tooltip, Button, Popconfirm, Card, Input } from 'antd';
import {
PlayCircleOutlined,
PauseCircleOutlined,
EyeOutlined,
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import style from './index.less';
import { PublicApi } from '@/services/api';
const data = [
{
key: '1',
id: '1',
level: '1',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '2',
id: '2',
level: '2',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
{
key: '3',
id: '3',
level: '3',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 1,
},
{
key: '4',
id: '4',
level: '4',
levelTab: '钻石会员',
levelType: '商户会员',
scoreTab: '交易分',
name: '采购商',
type: '服务消费',
roleType: '企业会员',
thresvalue: '100000',
status: 2,
},
];
const memberLevel: React.FC<[]> = () => {
const ref = useRef({});
const [keywords, setKeywords] = useState('');
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员等级',
dataIndex: 'level',
align: 'center',
key: 'level',
render: (text: any, record: any) => (
<div className={style[`levelIcon${record.level}`]}></div>
),
},
{
title: '会员等级标签',
dataIndex: 'levelTab',
align: 'center',
key: 'levelTab',
render: (text: any, record: any) => (
<span className={style.nameCellTitle} onClick={() => handleSee(record)}>
{text}&nbsp;
<EyeOutlined />
</span>
),
},
{
title: '会员等级类型',
dataIndex: 'levelType',
align: 'center',
key: 'levelType',
},
{
title: '升级分值标签',
dataIndex: 'scoreTab',
align: 'center',
key: 'scoreTab',
},
{
title: '会员角色名称',
dataIndex: 'name',
align: 'center',
key: 'name',
},
{
title: '角色类型',
dataIndex: 'type',
align: 'center',
key: 'type',
},
{
title: '会员类型',
dataIndex: 'roleType',
align: 'center',
key: 'roleType',
},
{
title: '升级阈值',
dataIndex: 'thresvalue',
align: 'center',
key: 'thresvalue',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
render: (text: any, record: any) => {
let component: ReactNode = null;
component = (
<Popconfirm
title="确定要执行这个操作?"
onConfirm={confirm}
onCancel={cancel}
okText="是"
cancelText="否"
>
<Button
type="link"
onClick={() => handleModify(record)}
style={
record.status === 1 ? { color: '#00B37A' } : { color: 'red' }
}
>
{record.status === 1 ? (
<>
<span>有效</span>
<PlayCircleOutlined />
</>
) : (
<>
<span>无效</span>
<PauseCircleOutlined />
</>
)}
</Button>
</Popconfirm>
);
return component;
},
},
{
title: '操作',
dataIndex: 'option',
align: 'center',
render: (record: any) => (
<Button type="link" onClick={record => handleSet(record)}>
设置
</Button>
),
},
];
// 模拟请求
const fetchData = (params: any) => {
return new Promise((resolve, reject) => {
PublicApi.getMemberManageLevelPage({
cond: '',
current: params.current,
pageSize: params.pageSize,
}).then(res => {
resolve(res.data);
});
});
};
useEffect(() => {
console.log(keywords);
});
const handleSee = (record: any) => {};
const confirm = () => {
console.log('confirm');
};
const cancel = () => {
console.log('cancel');
};
const handleModify = (record: object) => {
// 通过传入的params字符串判断是修改那种类型的数据
console.log('执行状态修改', record);
};
const handleSearch = () => {};
const handleReset = () => {};
const handleSet = (record: any) => {
history.push('/memberAbility/manage/level/addEquity');
};
return (
<Card>
<StandardTable
tableProps={{ rowKey: 'id' }}
columns={columns}
currentRef={ref}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<Row>
<Col className={style.col} span={12} offset={12}>
<Tooltip
trigger={['focus']}
placement="top"
title={
<span>
输入ID、会员等级、会员角色名称&nbsp;&nbsp;进行搜索
</span>
}
>
<Input.Search
style={{ width: '232px' }}
value={keywords}
placeholder="搜索"
onChange={e => setKeywords(e.target.value)}
onSearch={() => handleSearch}
/>
</Tooltip>
<Button className={style.resetBtn} onClick={() => handleReset()}>
重置
</Button>
</Col>
</Row>
}
/>
</Card>
);
};
export default memberLevel;
......@@ -16,8 +16,12 @@ import styles from './index.less';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getMemberManageLevelPage(params);
return res.data;
const res = await PublicApi.getMemberAbilityLevelPage(params);
if (res.code === 1000) {
return res.data;
}
return {};
};
const MemberLevel: React.FC<[]> = () => {
......@@ -28,13 +32,11 @@ const MemberLevel: React.FC<[]> = () => {
title: 'ID',
dataIndex: 'id',
align: 'center',
key: 'id',
},
{
title: '会员等级',
dataIndex: 'level',
align: 'center',
key: 'level',
render: (text: any, record: any) => (
<div className={styles[`levelIcon${record.level}`]}></div>
),
......@@ -54,45 +56,38 @@ const MemberLevel: React.FC<[]> = () => {
},
{
title: '会员等级类型',
dataIndex: 'memberLevelType',
dataIndex: 'memberLevelTypeName',
align: 'center',
key: 'memberLevelType',
},
{
title: '升级分值标签',
dataIndex: 'scoreTag',
align: 'center',
key: 'scoreTag',
},
{
title: '会员角色名称',
dataIndex: 'roleName',
align: 'center',
key: 'roleName',
},
{
title: '角色类型',
dataIndex: 'roleTypeName',
align: 'center',
key: 'roleTypeName',
},
{
title: '会员类型',
dataIndex: 'memberTypeName',
align: 'center',
key: 'memberTypeName',
},
{
title: '升级阈值',
dataIndex: 'levelUpPoint',
align: 'center',
key: 'levelUpPoint',
},
{
title: '状态',
dataIndex: 'status',
align: 'center',
key: 'status',
render: (text: any, record: any) => (
<StatusSwitch
handleConfirm={() => handleModify(record)}
......@@ -122,9 +117,11 @@ const MemberLevel: React.FC<[]> = () => {
const handleModify = record => {
const disabled = record.status === 0;
PublicApi.postMemberManageLevelStatus({
PublicApi.postMemberAbilityLevelUpdatestatus({
id: record.id,
status: disabled ? 1 : 0,
}, {
ctlType: 'none',
}).then(res => {
if (res.code === 1000) {
const msg = disabled ? '启用成功' : '禁用成功'
......@@ -146,14 +143,13 @@ const MemberLevel: React.FC<[]> = () => {
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
$('onFormInputChange').subscribe(state => {
console.log('InputChange')
ref.current.reload(state.values);
});
// $('onFieldInputChange', 'levelTag').subscribe(state => {
// ref.current.reload(state.values);
// });
useStateFilterSearchLinkageEffect(
$,
actions,
'cond',
'levelTag',
FORM_FILTER_PATH,
);
}}
......
......@@ -15,7 +15,7 @@ export const levelSchema: ISchema = {
grid: true,
},
properties: {
cond: {
levelTag: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......@@ -37,10 +37,11 @@ export const levelSchema: ISchema = {
},
properties: {
roleName: {
type: 'string',
type: 'string',
'x-component': 'Input',
'x-component-props': {
placeholder: '角色名称',
placeholder: '角色名称',
allowClear: true,
},
},
submit: {
......
......@@ -212,13 +212,18 @@ const memberMaintain: React.FC<[]> = () => {
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
const { data } = await PublicApi.getMemberValidateCommitPageitems();
return {
memberType: fetchFilterOptions(data.memberTypes),
roleId: fetchFilterOptions(data.memberRoles),
level: fetchFilterOptions(data.memberLevels),
source: fetchFilterOptions(data.memberSource),
};
const res = await PublicApi.getMemberValidateCommitPageitems();
if (res.code === 1000) {
const { data } = res;
return {
memberType: fetchFilterOptions(data.memberTypes),
roleId: fetchFilterOptions(data.memberRoles),
level: fetchFilterOptions(data.memberLevels),
source: fetchFilterOptions(data.memberSource),
};
}
return {};
};
const fetchFilterOptions = data => {
......
......@@ -31,7 +31,7 @@ export const maintianSchema: ISchema = {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
defaultValue: undefined,
},
enum: [],
},
......@@ -39,7 +39,7 @@ export const maintianSchema: ISchema = {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
defaultValue: undefined,
},
enum: [],
},
......@@ -47,7 +47,7 @@ export const maintianSchema: ISchema = {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
defaultValue: undefined,
},
enum: [],
},
......@@ -55,7 +55,7 @@ export const maintianSchema: ISchema = {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
defaultValue: undefined,
},
enum: [],
},
......@@ -63,7 +63,7 @@ export const maintianSchema: ISchema = {
type: 'string',
'x-component-props': {
placeholder: '请选择',
defaultValue: 0,
defaultValue: undefined,
},
enum: [
{ label: '时间范围(全部)', value: 0 },
......
......@@ -23,7 +23,7 @@ const MemberUpgradeRule: React.FC<[]> = () => {
const getRuleList = async (params) => {
setListLoading(true);
const res = await PublicApi.getMemberManageLevelRulePage(params);
const res = await PublicApi.getMemberAbilityLevelRulePage(params);
if (res.code === 1000) {
const { data, totalCount } = res.data;
......@@ -59,7 +59,7 @@ const MemberUpgradeRule: React.FC<[]> = () => {
},
{
title: '可获取的分值',
dataIndex: 'point',
dataIndex: 'score',
align: 'center',
width: '30%',
editable: true,
......@@ -79,7 +79,7 @@ const MemberUpgradeRule: React.FC<[]> = () => {
newData.splice(index, 1, {
...item,
...row,
point: +row.point,
score: +row.score,
});
setDataSource(newData);
};
......@@ -95,11 +95,15 @@ const MemberUpgradeRule: React.FC<[]> = () => {
}
const payload = dataSource.map(item => ({
id: item.id,
point: item.point,
score: item.score,
}));
setSubmitLoading(true);
const res = await PublicApi.postMemberManageLevelRuleSetpoint(payload);
const res = await PublicApi.postMemberAbilityLevelRuleUpdatescore({
items: payload,
}, {
ctlType: 'none',
});
if (res.code === 1000) {
message.success('保存成功');
......
/*
* @Author: LeeJiancong
* @Date: 2020-08-01 11:06:09
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-24 17:31:43
*/
export const TimeList = [
{
label: '单据时间(全部)', value: 0
},
{
label: '今天', value: 1
},
{
label: '一周内', value: 2
},
{
label: '一个月内', value: 3
},
{
label: '三个月内', value: 4
},
{
label: '六个月内', value: 5
},
{
label: '一年内', value: 6
},
{
label: '一年前', value: 7
}
]
import { ISchema} from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import {TimeList} from '../../common/statusList'
export const enquierySchema: ISchema = {
type:'object',
properties:{
megalayout:{
type:'object',
"x-component":'mega-layout',
"x-component-props":{
grid:true
},
properties:{
ctl:{
type:'object',
"x-component":"Children",
"x-component-props":{
children:"{{controllerBtns}}"
}
},
requisitionFormNo:{
type:'string',
"x-component":"Search",
"x-mega-props":{
},
"x-component-props":{
placeholder:'搜索'
}
}
}
},
[FORM_FILTER_PATH]:{
type:'object',
"x-component":"flex-layout",
"x-component-props":{
rowStyle:{
flexWrap:'nowrap'
},
colStyle:{
marginLeft: 20
}
},
properties:{
PRO_LAYOUT:{
type:'object',
"x-component":'mega-layout',
"x-mega-props":{
span: 5
},
"x-component-props":{
inline: true
},
properties:{
details:{
type:'string',
"x-component-props":{
placeholder:'需求摘要'
}
},
category:{
type:'string',
"x-component-props":{
placeholder:'请选择品类'
},
enum:[]
},
voucherTime:{
type:'string',
default: 0,
"x-component-props":{
placeholder:'请选择单据时间'
},
enum: TimeList
},
}
},
sumbit:{
"x-component":'Submit',
"x-mega-props":{
span:1
},
"x-component-props":{
children:'查询'
}
}
}
}
}
}
import React, { ReactNode, useRef, useState } from 'react';
import { history } from 'umi';
import {
Button,
Card,
Space,
Row,
Col
} from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import {
PlusOutlined
} from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import {
IFormFilter,
IButtonFilter,
} from 'god/dist/src/standard-table/TableController';
import EyePreview from '@/components/EyePreview';
import StatusSwitch from '@/components/StatusSwitch';
import NiceForm from '@/components/NiceForm';
import {timeRange} from '@/utils/index'
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { enquierySchema } from '../schema';
import { PublicApi } from '@/services/api';
import { values, action } from 'mobx';
const formActions = createFormActions();
const fetchData = async (params: any) => {
const res = await PublicApi.getOrderRequisitionFormAwaitList(params);
return res.data
}
const List:React.FC<{}> = () => {
const ref = useRef<any>({})
const [more, setmore] = useState(false)
const columns : ColumnType<any>[] = [
{
title:'需求单号',
key:'requisitionFormNo',
dataIndex:'requisitionFormNo',
align:'center'
},
{
title:'需求摘要',
key:'details',
dataIndex:'details',
align:'left'
},
{
title:'品类',
key:'category',
dataIndex:'category',
align:'left'
},
{
title:'交付日期',
key:'deliveryTime',
dataIndex:'deliveryTime',
align:'center'
},
{
title:'报价截至时间',
key:'quotationAsTime',
dataIndex:'quotationAsTime',
align:'center'
},
{
title:'单据时间',
key:'voucherTime',
dataIndex:'voucherTime',
align:'center'
},
{
title:'外部状态',
key:'externalState',
dataIndex:'externalState',
align:'center'
},
{
title:'内部状态',
key:'interiorState',
dataIndex:'interiorState',
align:'center'
},
{
title:'操作',
key:'options',
dataIndex:'options',
align:'center',
render:(text:any,record:any) => <></>
},
]
const handleSumbit = (values:any) => {
if(values.voucherTime){
values.startVoucherTime = timeRange(values.voucherTime).st
values.endVoucherTime = timeRange(values.voucherTime).et
delete values.voucherTime
}
console.log('values',values)
ref.current.reload(values)
}
const controllerBtns = <Row gutter={[0,16]}>
<Col span={24}>
<Space direction="horizontal" size={16}>
<Button type="primary" icon={<PlusOutlined/>}>新建</Button>
<Button >批量提交审核</Button>
<Button onClick={() => setmore(!more)}>更多</Button>
</Space>
</Col>
{
more &&
<Col >
<Space direction="horizontal" size={16}>
<Button>批量删除</Button>
</Space>
</Col>
}
</Row>
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{rowKew:'id'}}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => handleSumbit(values)}
effects={($,actions) => {
useStateFilterSearchLinkageEffect($,actions,'requisitionFormNo',FORM_FILTER_PATH)
}}
expressionScope={{
controllerBtns
}}
schema={enquierySchema}
>
</NiceForm>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default List
\ No newline at end of file
......@@ -16,8 +16,8 @@ const LoginWrap: React.FC = () => {
const finish = (value: any) => {
PublicApi.postMemberLogin(value).then(res => {
if (res.code === 1000) {
const { data } = res
const { data, code } = res
if (code === 1000) {
setAuth({
memberId: data.memberId,
userId: data.userId,
......
/*
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-24 16:09:13
*/
import { Config } from 'god-yapi2ts'
......@@ -10,6 +17,7 @@ const tokens = [
'7ec923520215c7e2f771867cb4d29cafbf823daf0fb2d3d9fa70b57a523c8bfb', // 店铺服务
'c789e0e56ee8a8cc2fbd85f930eb2928c58fc1014583c6643acf29cff954da49', // 支付服务
'ca19f532efba91f7773cbfbd526b798c6ac83df670071e97d72c50dca1d53a48', // 搜索服务
'5de0aaeaac12c8d911d86dada6cd128993e34cd6e13135fa79246aa5979a2bcd' //订单服务
]
const genMap = (tokens) => {
......
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