薪资项目管理页面分页的bug

This commit is contained in:
黎永顺 2023-02-03 10:12:53 +08:00
parent a74d887d6a
commit b72dcc3e6b
4 changed files with 43 additions and 35 deletions

View File

@ -608,15 +608,15 @@ export default class Attendance extends React.Component {
// }
// })
return [
{
title: "序号",
dataIndex: "index",
width: 80,
render: (text, record, index) => {
const { current, pageSize } = this.pageInfo;
return (current - 1) * pageSize + index + 1;
}
},
// {
// title: "序号",
// dataIndex: "index",
// width: 80,
// render: (text, record, index) => {
// const { current, pageSize } = this.pageInfo;
// return (current - 1) * pageSize + index + 1;
// }
// },
...newColumns
];
};

View File

@ -575,20 +575,22 @@ export default class CumSituation extends React.Component {
showTotal: total => `${total}`,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange(current, pageSize) {
onShowSizeChange: (current, pageSize) => {
setPageObj({ ...pageObj, current, pageSize });
getTableDatas({
current,
pageSize,
taxYearMonth: this.state.monthValue + '-' + this.state.taxYearMonth,
taxAgentId: taxAgentId === "All" ? "" : taxAgentId,
year: monthValue
});
},
onChange(current) {
onChange: (current) => {
setPageObj({ ...pageObj, current, pageSize: pageObj.pageSize });
getTableDatas({
current,
pageSize: pageObj.pageSize,
taxYearMonth: this.state.monthValue + '-' + this.state.taxYearMonth,
taxAgentId: taxAgentId === "All" ? "" : taxAgentId,
year: monthValue
});

View File

@ -157,21 +157,23 @@ export default class SalaryItem extends React.Component {
}
});
}
return [{
title: "序号",
dataIndex: "index",
align: "left",
width: 60,
render: (text, record, index) => {
const { current, pageSize } = this.state.searchParams;
return (current - 1) * pageSize + index + 1;
}
}, ...columns];
return [
// {
// title: "序号",
// dataIndex: "index",
// align: "left",
// width: 60,
// render: (text, record, index) => {
// const { current, pageSize } = this.state.searchParams;
// return (current - 1) * pageSize + index + 1;
// }
// },
...columns];
};
handleSearch(value) {
const { salaryItemStore: { getTableDatas } } = this.props;
getTableDatas({ ...this.state.searchParams,current: 1, name: value }).then(res => {
getTableDatas({ ...this.state.searchParams, current: 1, name: value }).then(res => {
this.setState({
searchParams: {
...this.state.searchParams,
@ -184,7 +186,7 @@ export default class SalaryItem extends React.Component {
handlePageChange(value) {
const { salaryItemStore: { getTableDatas } } = this.props;
getTableDatas({ ...this.state.searchParams, current: value }).then(res => {
getTableDatas({ ...this.state.searchParams, name: this.state.searchValue, current: value }).then(res => {
this.setState({
searchParams: {
...this.state.searchParams,
@ -201,7 +203,11 @@ export default class SalaryItem extends React.Component {
}
render() {
const { salaryItemStore, salaryFileStore, taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentAdminOption } } = this.props;
const {
salaryItemStore,
salaryFileStore,
taxAgentStore: { showOperateBtn, showSalaryItemBtn, taxAgentAdminOption }
} = this.props;
const { userStatusList } = salaryFileStore;
const { selectedRowKeys } = this.state;
const {
@ -403,7 +409,7 @@ export default class SalaryItem extends React.Component {
pageSize
}
}, () => {
this.handleShowSizeChange(this.state.searchParams);
this.handleShowSizeChange({ name: this.state.searchValue, ...this.state.searchParams });
});
}}
/>

View File

@ -125,16 +125,16 @@ export default class Archives extends React.Component {
};
});
return tmpV.length > 0 ? [
{
title: "序号",
dataIndex: "index",
width: 60,
fixed: "left",
render: (text, record, index) => {
const { current, pageSize } = pageInfo;
return (current - 1) * pageSize + index + 1;
}
},
// {
// title: "序号",
// dataIndex: "index",
// width: 60,
// fixed: "left",
// render: (text, record, index) => {
// const { current, pageSize } = pageInfo;
// return (current - 1) * pageSize + index + 1;
// }
// },
...tmpV, {
title: "操作",
dataIndex: "operate",