Commit 539a8cb2 authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-system into dev

parents bd2ab9ff 886063cf
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-12-18 10:42:26
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-12-18 15:38:02
* @LastEditTime: 2020-12-23 14:50:54
* @Description: 退货查询相关路由
*/
const returnManageRoute = {
......@@ -10,13 +10,13 @@ const returnManageRoute = {
name: 'returnManage',
icon: 'SmileOutlined',
routes: [
// 换货申请单查询
// 退货申请单查询
{
path: '/returnManage/query',
name: 'query',
component: '@/pages/returnManage/query/index',
},
// 换货申请单详情
// 退货申请单详情
{
path: '/returnManage/query/detail',
name: 'queryDetail',
......
import React, { useState, useEffect } from 'react';
import { Input, Space, Select, Button, Cascader } from 'antd';
import { useFieldState, FormPath, FormEffectHooks, useFormEffects } from '@formily/antd';
/**
* 筛选项 搜索和远程数据结合的 Cascader
* 属性Data数据暂存至schema的props下的dataOption
*/
const CustomCategorySearch = props => {
const justifyAlign = props.props['x-component-props'].align || 'flex-end'
const option = props.props['x-component-props'].dataoption
const [dataOption, setDataOption] = useState<any>([])
const [value, setValue] = useState<any>([])
useEffect(() => {
setDataOption(option)
}, [option])
useFormEffects(() => {
FormEffectHooks.onFormReset$().subscribe(() => {
setValue([])
})
})
const onChange = (value, selectedOptions) => {
props.mutators.change(value[value.length - 1])
setValue(value)
}
const displayRender = (label) => {
return label[label.length - 1];
}
return (
<Space size={20} style={{ justifyContent: justifyAlign, width: '100%' }}>
<Cascader
options={dataOption}
onChange={onChange}
value={value}
displayRender={displayRender}
{...props.props['x-component-props']}
/>
</Space>
);
};
CustomCategorySearch.defaultProps = {};
CustomCategorySearch.isFieldComponent = true;
export default CustomCategorySearch;
......@@ -13,12 +13,6 @@ import { PublicApi } from '@/services/api';
const { Option } = Select
// export interface SearchProps {
// value: string;
// mutators: any;
// props: any;
// }
const CustomInputSearch = props => {
const { form } = props
const justifyAlign = props.props['x-component-props'].align || 'flex-end'
......
......@@ -56,6 +56,7 @@ const Search = props => {
<Button
onClick={() => {
props.form.reset();
sessionStorage.setItem('tableRest', 'true')
props.form.submit();
}}
>
......
......@@ -8,7 +8,8 @@ import CustomStatus from './components/CustomStatus';
import CustomAddArray from './components/CustomAddArray';
import CustomSlider from './components/CustomSlider';
import Search from './components/Search';
import CustomInputSearch from './components/CustomInputSearch'
import CustomInputSearch from './components/CustomInputSearch';
import CustomCategorySearch from './components/CustomCategorySearch';
import Submit from './components/Submit';
import Text from './components/Text';
import CardCheckBox from './components/CardCheckBox';
......@@ -77,6 +78,7 @@ export const componentExport = {
CustomRadio,
Search,
CustomInputSearch,
CustomCategorySearch,
Submit,
Text,
CardCheckBox,
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-08-20 16:15:59
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-10 14:07:35
* @LastEditTime: 2020-12-21 13:57:49
* @Description: 简单封装了分页事件的 Table
*/
import React from 'react';
......@@ -54,7 +54,6 @@ export default class NormalTable extends React.PureComponent<StandardTableProps>
showSizeChanger: true,
showQuickJumper: true,
onChange: this.handlePaginationChange,
onShowSizeChange: this.handlePaginationChange,
size: 'small',
showTotal: () => `共 ${pagination.total || 0} 条`,
...pagination,
......
......@@ -21,7 +21,12 @@ export const searchBrandOptionEffect = (context: any, fieldName: string) => {
export const searchCustomerCategoryOptionEffect = (context: any, fieldName: string) => {
context.getFieldState(fieldName, state => {
PublicApi.getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// PublicApi.getProductSelectGetSelectCategory({ name: state.props['x-component-props'].searchValue }).then(res => {
// context.setFieldState(fieldName, state => {
// state.props['x-component-props'].dataoption = res.data
// })
// })
PublicApi.getProductPlatformGetCategoryTree().then(res => {
context.setFieldState(fieldName, state => {
state.props['x-component-props'].dataoption = res.data
})
......
......@@ -43,11 +43,16 @@ const Products: React.FC<{}> = () => {
key: 'memberName',
},
{
title: '品类',
title: '会员品类',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory.name',
},
{
title: '平台品类',
dataIndex: ['customerCategory', 'category', 'name'],
key: 'customerCategory.category.name',
},
{
title: '品牌',
dataIndex: ['brand', 'name'],
key: 'brand.name',
......@@ -164,8 +169,8 @@ const Products: React.FC<{}> = () => {
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchBrandOptionEffect(actions, 'brandId')
})
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
FormEffectHooks.onFieldChange$('categoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(actions, 'categoryId')
})
}}
schema={productWillSchema}
......
......@@ -42,11 +42,16 @@ const Products: React.FC<{}> = () => {
key: 'memberName',
},
{
title: '品类',
title: '会员品类',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory.name',
},
{
title: '平台品类',
dataIndex: ['customerCategory', 'category', 'name'],
key: 'customerCategory.category.name',
},
{
title: '品牌',
dataIndex: ['brand', 'name'],
key: 'brand.name',
......@@ -152,8 +157,8 @@ const Products: React.FC<{}> = () => {
FormEffectHooks.onFieldChange$('brandId').subscribe(state => {
searchBrandOptionEffect(actions, 'brandId')
})
FormEffectHooks.onFieldChange$('customerCategoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(actions, 'customerCategoryId')
FormEffectHooks.onFieldChange$('categoryId').subscribe(state => {
searchCustomerCategoryOptionEffect(actions, 'categoryId')
})
}}
schema={productSchema}
......
......@@ -58,19 +58,16 @@ export const productSchema: ISchema = {
dataoption: [],
},
},
customerCategoryId: {
categoryId: {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component': 'CustomCategorySearch',
'x-component-props': {
placeholder: '商品品类',
placeholder: '平台品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
searchValue: null,
dataoption: []
dataoption: [],
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
},
status: {
......@@ -223,19 +220,16 @@ export const productWillSchema: ISchema = {
dataoption: [],
},
},
customerCategoryId: {
categoryId: {
type: 'string',
'x-component': 'CustomInputSearch',
'x-component': 'CustomCategorySearch',
'x-component-props': {
placeholder: '商品品类',
placeholder: '平台品类',
showSearch: true,
showArrow: true,
defaultActiveFirstOption: false,
filterOption: false,
notFoundContent: null,
style: { width: '174px' },
searchValue: null,
dataoption: []
dataoption: [],
fieldNames: { label: 'title', value: 'id', children: 'children' },
},
},
'NO_NAME_FIELD_$2': {
......
......@@ -74,13 +74,13 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
const [receivedPage, setReceivedPage] = useState(1);
const [receivedSize, setReceivedSize] = useState(PAGE_SIZE);
const [receivedTotal, setReceivedTotal] = useState(0);
const [receivedList, setReceivedList] = useState([]);
const [receivedList, setReceivedList] = useState<ReceivedData[]>([]);
const [receivedListLoading, setReceivedListLoading] = useState(false);
const [usagePage, setUsagePage] = useState(1);
const [usageSize, setUsageSize] = useState(PAGE_SIZE);
const [usageTotal, setUsageTotal] = useState(0);
const [usageList, setUsageList] = useState([]);
const [usageList, setUsageList] = useState<UsageData[]>([]);
const [usageListLoading, setUsageListLoading] = useState(false);
const receivedColumns: EditableColumns[] = [
......@@ -146,7 +146,7 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
},
];
const getReceivedList = () => {
const getReceivedList = (params?) => {
if (fetchReceivedList) {
if (receivedListLoading) {
return;
......@@ -155,6 +155,7 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
fetchReceivedList({
current: receivedPage,
pageSize: receivedSize,
...params,
}).then(res => {
const { data = [], totalCount = 0 } = (res || {});
setReceivedList(data);
......@@ -165,7 +166,7 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
}
};
const getUsageList = () => {
const getUsageList = (params?) => {
if (fetchUsageList) {
if (usageListLoading) {
return;
......@@ -174,6 +175,7 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
fetchUsageList({
current: usagePage,
pageSize: usageSize,
...params,
}).then(res => {
const { data = [], totalCount = 0 } = (res || {});
setUsageList(data);
......@@ -206,13 +208,19 @@ const EquityInfo: React.FC<EquityInfoProps> = ({
const handleReceivedPaginationChange = (page: number, size: number) => {
setReceivedPage(page);
setReceivedSize(size);
getReceivedList();
getReceivedList({
current: page,
pageSize: size,
});
};
const handleUsagePaginationChange = (page: number, size: number) => {
setUsagePage(page);
setUsageSize(size);
getReceivedList();
getUsageList({
current: page,
pageSize: size,
});
};
return (
......
......@@ -31,8 +31,8 @@ const SensitiveWords: React.FC<{}> = () => {
dataIndex: 'state',
render: (text: any, record: any) => (
<StatusSwitch
fieldNames="status"
handleConfirm={() => handleChangeStatus(record.id, record.status)}
fieldNames="state"
handleConfirm={() => handleChangeStatus(record.id, record.state)}
record={record}
expectTrueValue={1}
/>
......
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