Commit a0a492ca authored by XieZhiXiong's avatar XieZhiXiong

refactor

parent c836d775
......@@ -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',
......
......@@ -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,
......
......@@ -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 (
......
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