diff --git a/pc4mobx/hrmSalary/components/customPaginationTable/index.js b/pc4mobx/hrmSalary/components/customPaginationTable/index.js new file mode 100644 index 00000000..8b265977 --- /dev/null +++ b/pc4mobx/hrmSalary/components/customPaginationTable/index.js @@ -0,0 +1,25 @@ +import React from 'react' +import { WeaTable } from 'ecCom' +import CustomTable from '../../components/customTable' + +export default class CustomPaginationTable extends React.Component { + render() { + return ( + {this.props.onPageChange(value)}, + total: this.props.total, + showTotal: (total) => `共 ${total} 条`, + current: this.props.current, + showSizeChanger: true, + showQuickJumper: true, + pageSize: this.props.pageSize, + onShowSizeChange: (current, pageSize) => { + this.props.onShowSizeChange && this.props.onShowSizeChange(current, pageSize); + } + }} + /> + ) + } +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js index a40a19da..66955b65 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/index.js @@ -14,6 +14,7 @@ import { columns, dataSource } from './columns'; import moment from 'moment'; import BaseFormModal from './baseFormModal' import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable' const { RangePicker } = DatePicker; @@ -42,6 +43,7 @@ export default class Calculate extends React.Component { } }) } + this.pageInfo = { current: 1, pageSize: 10} } componentWillMount() { @@ -170,6 +172,7 @@ export default class Calculate extends React.Component { // 分页 handleDataPageChange(value) { this.setState({current: value}) + this.pageInfo.current = value const { calculateStore } = this.props; const { getSalaryAcctList } = calculateStore getSalaryAcctList({ @@ -180,6 +183,17 @@ export default class Calculate extends React.Component { }) } + handleShowSizeChange(pageInfo){ + const { calculateStore } = this.props; + const { getSalaryAcctList } = calculateStore + getSalaryAcctList({ + name: this.state.searchValue, + startMonthStr: this.state.startDate, + endMonthStr: this.state.endDate, + ...pageInfo + }) + } + render() { @@ -258,12 +272,20 @@ export default class Calculate extends React.Component { onChange={(v) => { }} /> - {this.handleDataPageChange(value)}, - total: salaryListPageInfo.total, - current: salaryListPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, + + { + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) }} /> diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index d5afecde..9cbfbe0a 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -7,6 +7,7 @@ import CustomTab from '../../components/customTab' import { inject, observer } from 'mobx-react'; import CompareDetailImportModal from './compareDetailImportModal' import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable' @inject('calculateStore') @observer @@ -20,6 +21,7 @@ export default class CompareDetail extends React.Component { importModalVisible: false, searchValue: "" } + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -80,11 +82,25 @@ export default class CompareDetail extends React.Component { handleDataPageChange(value) { const { calculateStore: {fetchComparisonResultList}} = this.props; const { onlyDiffEmployee, onlyDiffSalaryItem} = this.state; + let params = { onlyDiffEmployee, onlyDiffSalaryItem, salaryAcctRecordId: this.id, - current: value + current: value, + ...this.pageInfo + } + fetchComparisonResultList(params) + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: {fetchComparisonResultList}} = this.props; + const { onlyDiffEmployee, onlyDiffSalaryItem} = this.state; + let params = { + onlyDiffEmployee, + onlyDiffSalaryItem, + salaryAcctRecordId: this.id, + ...pageInfo } fetchComparisonResultList(params) } @@ -146,6 +162,8 @@ export default class CompareDetail extends React.Component { // 线下对比导入 handleComparisonFinish() { + this.pageInfo.current = 1 + this.pageInfo.pageSize = 10 this.handleSearch(this.state.searchValue) } @@ -198,18 +216,23 @@ export default class CompareDetail extends React.Component {
- {this.handleDataPageChange(value)}, - total: comparisonResultPageInfo.total, - current: comparisonResultPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, - }} - /> + total={comparisonResultPageInfo.total} + current={comparisonResultPageInfo.pageNum} + pageSize={this.pageInfo.pageSize} + onPageChange={(value) => { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + />
{ diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 13e31904..679d03a6 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -7,6 +7,7 @@ import SlideModalTitle from "../../components/slideModalTitle" import FileMergeDetail from './fileMergeDetail' import { getQueryString } from "../../util/url"; import { inject, observer } from 'mobx-react'; +import CustomPaginationTable from '../../components/customPaginationTable' @inject('calculateStore') @observer @@ -22,9 +23,15 @@ export default class PlaceOnFileDetail extends React.Component { }) this.state = { slideVisiable: false, - selectedRowKeys: [] + selectedRowKeys: [], + searchValue: "" } this.id = ""; + this.length = 0 + this.pageInfo = { + current: 1, + pageSize: 10 + } } componentWillMount() { @@ -46,11 +53,17 @@ export default class PlaceOnFileDetail extends React.Component { result.dataIndex = item.column result.oldWidth = result.width; result.width = null; + this.length = 0 if(result.children) { result.children.map(child => { + child.width = 150 child.title = child.text child.dataIndex = child.column + this.length ++ }) + } else { + this.length ++ + result.width = 150 } return result; }) @@ -67,11 +80,21 @@ export default class PlaceOnFileDetail extends React.Component { onDetail() { this.setState({slideVisiable: true}) } + + handleSearch(value){ + const { calculateStore: {acctResultList}} = this.props; + acctResultList(this.id, value, this.pageInfo.current, this.pageInfo) + } // 分页 handleDataPageChange(value) { const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.props.employeeName, value) + acctResultList(this.id, this.state.searchValue, value, this.pageInfo) + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: {acctResultList}} = this.props; + acctResultList(this.id, this.state.searchValue, pageInfo.current, pageInfo ) } handleMenuClick() { @@ -116,7 +139,7 @@ export default class PlaceOnFileDetail extends React.Component { return (
{this.handleExportAll()}} overlay={menu}>导出全部 - + {this.setState({searchValue: value})}} value={this.state.searchValue} onSearch={(value) => {this.handleSearch(value)}}/>
) } @@ -147,17 +170,23 @@ export default class PlaceOnFileDetail extends React.Component { />
- {this.handleDataPageChange(value)}, - total: acctResultListPageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: acctResultListPageInfo.pageNum - }} - /> + { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + />
{ diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index fb470b84..a08140a7 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -11,6 +11,7 @@ import { columns } from '../salaryItem/columns' import { getQueryString } from '../../util/url' import { inject, observer } from 'mobx-react'; import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable' @inject('calculateStore') @observer @@ -32,6 +33,7 @@ export default class SalaryDetail extends React.Component { } this.recordId = "" this.id = "" + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -114,7 +116,12 @@ export default class SalaryDetail extends React.Component { // 分页 handleDataPageChange(value) { const { calculateStore: {acctResultList}} = this.props; - acctResultList(this.id, this.props.employeeName, value) + acctResultList(this.id, this.props.employeeName, value, this.pageInfo) + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: {acctResultList}} = this.props; + acctResultList(this.id, this.props.employeeName, pageInfo.current, pageInfo) } render() { @@ -141,17 +148,23 @@ export default class SalaryDetail extends React.Component { {/* {this.setState({visible: true})}}>校验异常:0 */}
- {this.handleDataPageChange(value)}, - total: acctResultListPageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: acctResultListPageInfo.pageNum - }} - /> + total={acctResultListPageInfo.total} + current={acctResultListPageInfo.pageNum} + pageSize={this.pageInfo.pageSize} + onPageChange={(value) => { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + />
{this.setState({visible: false})}}/> { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js index b8a084d1..9d5cb1fd 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/userSure.js @@ -6,6 +6,7 @@ import { dataSource , monthOnMonthColumns, userSureColumns} from './columns' import "./index.less" import { getQueryString } from '../../util/url' import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable'; @inject('calculateStore') @observer @@ -19,6 +20,8 @@ export default class UserSure extends React.Component { } this.id = "" this.current = 1 + this.pageInfo = {current: 1, pageSize: 10} + this.reducePageInfo = { current: 1, pageSize: 10} } componentWillMount() { @@ -139,7 +142,12 @@ export default class UserSure extends React.Component { handleUserListPageChange(value) { const { calculateStore: {acctemployeeList}} = this.props; this.current = value; - acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, current: value}) + acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...this.pageInfo}) + } + + handleShowSizeChange(pageInfo) { + const { calculateStore: {acctemployeeList}} = this.props; + acctemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...pageInfo}) } // 环比减少人员分页 @@ -149,14 +157,19 @@ export default class UserSure extends React.Component { this.current = value } + handleReduceShowSizeChange(pageInfo) { + const { calculateStore: { reducedemployeeList }} = this.props; + reducedemployeeList({salaryAcctRecordId: this.id, employeeName: this.state.userListSearchValue, ...pageInfo}) + } // 搜索 handleUserListSearch(value) { const { calculateStore: {acctemployeeList, reducedemployeeList}} = this.props; + this.pageInfo.current = 1 if(this.state.selectedKey == 0) { - acctemployeeList({salaryAcctRecordId: this.id, employeeName: value, current: 1}) + acctemployeeList({salaryAcctRecordId: this.id, employeeName: value, ...this.pageInfo}) this.current = 1 } else { - reducedemployeeList({salaryAcctRecordId: this.id, employeeName: value, current: 1}) + reducedemployeeList({salaryAcctRecordId: this.id, employeeName: value, ...this.pageInfo}) this.current = 1 } } @@ -265,30 +278,42 @@ export default class UserSure extends React.Component {
{ - this.state.selectedKey == 0 && {this.handleUserListPageChange(value)}, - total: acctemployeeListPageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: acctemployeeListPageInfo.pageNum - }} - /> + this.state.selectedKey == 0 && + { + this.pageInfo.current = value + this.handleUserListPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + /> } { - this.state.selectedKey == 1 && {this.handleReducedemployeeListPageChange(value)}, - total: reducedemployeeListPageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: reducedemployeeListPageInfo.pageNum - }} - /> + this.state.selectedKey == 1 && + { + this.reducePageInfo.current = value + this.handleReducedemployeeListPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleReduceShowSizeChange(this.pageInfo) + }} + /> }
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 90226099..0f1e2698 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -24,6 +24,7 @@ import TwoColContent from '../../../components/twoColContent' import TipLabel from '../../../components/TipLabel' import ItemMangeFormModal from './itemMangeFormModal' import CustomTable from '../../../components/customTable'; +import CustomPaginationTable from '../../../components/customPaginationTable' const { RangePicker } = DatePicker; const { Option } = Select @@ -67,6 +68,7 @@ export default class Attendance extends React.Component { this.listSearch = {} this.recordId = ""; // 考勤数据列表查看选择项 this.salaryYearMonth = ""; // 考勤数据查看,当前数据的薪资所属月 + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -109,6 +111,12 @@ export default class Attendance extends React.Component { getAttendanceFieldList(this.fieldSearch) } + handleFieldShowSizeChange(pageInfo) { + const { attendanceStore: {getAttendanceFieldList} } = this.props; + this.fieldSearch.current = value + getAttendanceFieldList({...this.fieldSearch, ...pageInfo}) + } + // 列表 handleDataPageChange(value) { const { attendanceStore: { getAttendanceList }} = this.props; @@ -116,6 +124,11 @@ export default class Attendance extends React.Component { getAttendanceList(this.listSearch) } + handleDataShowSizeChange(pageInfo) { + const { attendanceStore: { getAttendanceList }} = this.props; + getAttendanceList({...this.listSearch, ...pageInfo}) + } + // 下载导入模板链接点击 handleTemplateLinkClick() { const { attendanceStore: { downloadTemplate }} = this.props; @@ -532,17 +545,20 @@ export default class Attendance extends React.Component { // onOperatesClick={this.onOperatesClick.bind(this)} /> */} - {this.handleDataPageChange(value)}, - total: attendancePageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: attendancePageInfo.pageNum + total={attendancePageInfo.total} + current={attendancePageInfo.pageNum} + pageSize={this.pageInfo.pageSize} + onPageChange={(value) => { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleDataShowSizeChange(this.pageInfo) }} /> @@ -569,17 +585,24 @@ export default class Attendance extends React.Component { // onOperatesClick={this.onItemOperatesClick.bind(this)} // /> - {this.handleFieldPageChange(value)}, - total: fieldPageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: fieldPageInfo.pageNum + { + this.pageInfo.current = value + this.handleFieldPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleFieldShowSizeChange(this.pageInfo) }} /> + + } rightContent={ { item = {...item} item.width = "150px" + if(item.dataIndex == "employeeName") { + item.fixed = 'left' + } return item; }) } + handlePageChange() { + const { declareStore: { getDetailList, getDeclareInfo }} = this.props; + getDetailList(this.id, this.pageInfo) + } + + render() { - const { declareStore: { detailDataSource, detailTableStore, declareInfo, datailColumns }} = this.props; + const { declareStore: { detailDataSource, detailTableStore, declareInfo, datailColumns, detailPageInfo }} = this.props; const renderRightOperation = () => { return ( @@ -67,7 +79,22 @@ export default class GenerateDeclarationDetail extends React.Component { } />
- + { + this.pageInfo.current = value; + this.handlePageChange() + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handlePageChange() + }} + />
) diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index cc4559d8..93823c41 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -10,6 +10,7 @@ import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的 import CustomTab from '../../components/customTab'; import ContentWrapper from '../../components/contentWrapper'; import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable' import { columns, dataSource } from './columns'; import GenerateModal from './generateModal' @@ -30,6 +31,7 @@ export default class Declare extends React.Component { endDate: moment(new Date()).subtract(-3,'months').startOf('month').format('YYYY-MM') } this.searchParams = {current: 1} + this.pageInfo = {current: 1, pageSize: 10} columns.map(item => { if(item.dataIndex == "cz") { item.render =(text, record) => { @@ -59,11 +61,14 @@ export default class Declare extends React.Component { startDate: range[0], endDate: range[1] }) + this.pageInfo.current = 1 getDeclareList({ fromSalaryMonthStr: range[0], endSalaryMonthStr: range[1], - current: 1 + ...this.pageInfo }) + + } @@ -105,6 +110,16 @@ export default class Declare extends React.Component { getDeclareList(this.searchParams) } + handleShowSizeChange(pageInfo) { + const { declareStore : {getDeclareList} } = this.props; + this.searchParams = { + fromSalaryMonthStr: this.state.startDate, + endSalaryMonthStr: this.state.endDate, + ...pageInfo + } + getDeclareList(this.searchParams) + } + render() { const { declareStore } = this.props; @@ -176,14 +191,24 @@ export default class Declare extends React.Component { renderRightOperation() } /> - {this.handleDataPageChange(value)}, - total: pageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: pageInfo.pageNum - }} + + { + this.pageInfo.current =value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} /> + { diff --git a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js index a2939e2c..349ffb11 100644 --- a/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js +++ b/pc4mobx/hrmSalary/pages/ledger/step3/canMoveItem.js @@ -127,6 +127,7 @@ export default class CanMoveItem extends React.Component { handleTableDrop = (datas) => { console.log("datas:", datas); + console.log("datas.parent():", $(datas).parent()); } render() { @@ -163,6 +164,10 @@ export default class CanMoveItem extends React.Component { rowSelection={rowSelection} dataSource={this.props.dataSource} columns={this.state.columns} + onRow={(record, index) => ({ + index, + moveRow: record, + })} pagination={false} onDrop={(datas) => this.handleTableDrop(datas)} draggable={true}/> diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index 1af0f821..2fc76f76 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -10,6 +10,7 @@ import { renderNoright, getSearchs } from '../../util'; // 渲染form数据的 import CustomTab from '../../components/customTab'; import ContentWrapper from '../../components/contentWrapper'; import CustomTable from '../../components/customTable' +import CustomPaginationTable from '../../components/customPaginationTable' import moment from 'moment' import "./index.less" @@ -32,6 +33,9 @@ export default class MySalary extends React.Component { salaryBillVisible: false } this.salaryInfoId = "" + this.range = [] + this.pageInfo = {current: 1, pageSize: 10} + this.historyPageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -77,7 +81,8 @@ export default class MySalary extends React.Component { // 区间改变事件 handleSalaryRangePickerChange(range) { const { mySalaryStore : {mySalaryBillList}} = this.props; - mySalaryBillList(range.map(item => moment(item).format("YYYY-MM"))) + this.range = range.map(item => moment(item).format("YYYY-MM")) + mySalaryBillList(this.range, this.pageInfo) } @@ -88,10 +93,20 @@ export default class MySalary extends React.Component { } } + handlePageChange() { + const { mySalaryStore : {mySalaryBillList}} = this.props; + mySalaryBillList(this.range, this.pageInfo) + } + + handleHistoryPageChange() { + const { mySalaryStore: {getRecordList}} = this.props; + getRecordList(this.historyPageInfo) + } + render() { const { mySalaryStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = mySalaryStore; - const { tabIndex, myBillTableStore, myBillDataSource, recordListColumns, recordListDataSource, recordListPageInfo } = mySalaryStore + const { tabIndex, myBillTableStore, myBillDataSource, recordListColumns, recordListDataSource, recordListPageInfo, myBillPageInfo } = mySalaryStore const { salaryBillVisible } = this.state; if (!hasRight && !loading) { // 无权限处理 return renderNoright(); @@ -160,8 +175,6 @@ export default class MySalary extends React.Component { } - - return (
+ + { + this.pageInfo.current = value + this.handlePageChange() + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handlePageChange() + }} + /> } {/* { this.state.selectedKey == '1' && } */} { - this.state.selectedKey == '2' && + this.state.selectedKey == '2' && + { + this.historyPageInfo.current = value + this.handleHistoryPageChange() + }} + onShowSizeChange={(current, pageSize) => { + this.historyPageInfo = {current, pageSize} + this.handleHistoryPageChange() + }} + /> } diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js index abdd74c0..fd074126 100644 --- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js +++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js @@ -6,13 +6,15 @@ import moment from 'moment' import CustomTable from '../../components/customTable'; +import CustomPaginationTable from '../../components/customPaginationTable' @inject('payrollStore') @observer export default class SalarySendList extends React.Component { constructor(props) { super(props) - this.searchParams = {} + this.searchParams = {salaryYearMonth: this.props.salaryYearMonth} + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -20,7 +22,6 @@ export default class SalarySendList extends React.Component { getPayrollList() } - // 发放回调 handleGrant(record) { window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=" + record.id) @@ -42,12 +43,7 @@ export default class SalarySendList extends React.Component { this.props.onEditTemplate && this.props.onEditTemplate(templateRecord) } - // 页面跳转 - handleDataPageChange(value) { - this.searchParams.current = value; - const { payrollStore: {getPayrollList} } = this.props; - getPayrollList(this.searchParams) - } + // 获取表头数据 getColumns() { @@ -112,14 +108,23 @@ export default class SalarySendList extends React.Component { const { salarySendTableStore, salarySendDataSource, pageInfo, loading } = payrollStore; return (
- {this.handleDataPageChange(value)}, - total: pageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: pageInfo.pageNum + { + this.pageInfo.current = value + this.props.handleListDataPageChange(value, this.pageInfo) }} - /> + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.props.handleListShowSizeChange(this.pageInfo) + }} + /> +
) } diff --git a/pc4mobx/hrmSalary/pages/payroll/index.js b/pc4mobx/hrmSalary/pages/payroll/index.js index e7146358..fd12a3cd 100644 --- a/pc4mobx/hrmSalary/pages/payroll/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/index.js @@ -43,6 +43,8 @@ export default class Payroll extends React.Component { copyModalVisible: false } this.recordId = "" + this.salaryYearMonth = [] + this.listPageInfo = {current: 1, pageSize: 10} columns.map(item => { if(item.dataIndex == "cz") { item.render = (text, record) => { @@ -81,7 +83,6 @@ export default class Payroll extends React.Component { // 更新模板 handleUpdateTemplate(record) { - alert(JSON.stringify(record)) this.setState({ selectedKey: "1", editSlideVisible: true, @@ -184,7 +185,8 @@ export default class Payroll extends React.Component { handleRangePickerChange(value) { let range = value.map(item => moment(item).format("YYYY-MM")) const { payrollStore: { getPayrollList } } = this.props; - getPayrollList({salaryYearMonth: range}) + this.salaryYearMonth = range + getPayrollList({salaryYearMonth: range, ...this.listPageInfo}) } // 预览 @@ -208,6 +210,20 @@ export default class Payroll extends React.Component { }) } + // 发放页面页码跳转 + handleListDataPageChange(value, pageInfo) { + const { payrollStore: {getPayrollList} } = this.props; + this.listPageInfo = pageInfo + getPayrollList({salaryYearMonth: this.salaryYearMonth, ...pageInfo}) + } + + // 发放页面每页条数 + handleListShowSizeChange(pageInfo) { + const { payrollStore: {getPayrollList} } = this.props; + this.listPageInfo = pageInfo + getPayrollList({salaryYearMonth: this.salaryYearMonth, ...pageInfo}) + } + render() { const { payrollStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = payrollStore; @@ -336,6 +352,13 @@ export default class Payroll extends React.Component { onEditTemplate={(record) => { this.handleTemplateListEdit(record) }} + salaryYearMonth={this.salaryYearMonth} + handleListDataPageChange={(value, pageInfo) => { + this.handleListDataPageChange(value, pageInfo) + }} + handleListShowSizeChange={(pageInfo) => { + this.handleListShowSizeChange(pageInfo) + }} /> // diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js index 49bc837c..be353c75 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/index.js @@ -8,6 +8,7 @@ import CustomTab from '../../../components/customTab' import "./index.less" import { getQueryString } from '../../../util/url' import { renderNoright, getSearchs } from '../../../util'; +import CustomPaginationTable from '../../../components/customPaginationTable'; @inject('payrollStore') @observer @@ -18,6 +19,7 @@ export default class PayrollDetail extends React.Component { currentId: "", current: 1 } + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -116,17 +118,21 @@ export default class PayrollDetail extends React.Component { } - // 分页 - handleDataPageChange(value) { - this.setState({current: value}) - const { payrollStore: {getPayrollInfo, getPayrollDetailList, getPayrollDetailSa} } = this.props; - getPayrollDetailList({salarySendId: this.state.currentId, current: value}) - } + // 分页 + handleDataPageChange(value) { + const { payrollStore: {getPayrollInfo, getPayrollDetailList, getPayrollDetailSa} } = this.props; + getPayrollDetailList({salarySendId: this.state.currentId, ...this.pageInfo}) + } + handleShowSizeChange(pageInfo) { + const { payrollStore: {getPayrollInfo, getPayrollDetailList, getPayrollDetailSa} } = this.props; + getPayrollDetailList({salarySendId: this.state.currentId, ...pageInfo}) + } + handleSearch() { const { payrollStore: {getPayrollDetailList}} = this.props; - getPayrollDetailList({salarySendId: this.state.currentId, current: this.state.current}) + getPayrollDetailList({salarySendId: this.state.currentId, ...this.pageInfo}) } render() { const {payrollStore} = this.props; @@ -176,18 +182,23 @@ export default class PayrollDetail extends React.Component {
- { - this.handleDataPageChange(value)}, - total: salarySendDetailPageInfo.total, - current: salarySendDetailPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, - }} - /> + + { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + />
) diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js index 56776d76..725ce143 100644 --- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js +++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js @@ -10,6 +10,7 @@ import PayrollGrantModal from './payrollGrantModal' import PayrollWithdrawModal from './payrollWithdrawModal' import { getQueryString } from '../../../util/url' import { renderNoright, getSearchs } from '../../../util'; +import CustomPaginationTable from '../../../components/customPaginationTable'; @inject('payrollStore') @observer @@ -21,6 +22,7 @@ export default class PayrollGrant extends React.Component { payrollWithdrawVisible: false, currentId: "" } + this.pageInfo = {current : 1, pageSize: 10} } componentWillMount() { @@ -151,11 +153,18 @@ export default class PayrollGrant extends React.Component { // 分页 handleDataPageChange(value) { - this.setState({current: value}) const { payrollStore: { getInfoList } } = this.props; getInfoList({ salarySendId:this.state.currentId, - current: value + ...this.pageInfo + }) + } + + handleShowSizeChange(pageInfo) { + const { payrollStore: { getInfoList } } = this.props; + getInfoList({ + salarySendId:this.state.currentId, + ...pageInfo }) } @@ -163,7 +172,7 @@ export default class PayrollGrant extends React.Component { const { payrollStore: { getInfoList } } = this.props; getInfoList({ salarySendId:this.state.currentId, - current: this.state.current + ...this.pageInfo }) } @@ -217,13 +226,19 @@ export default class PayrollGrant extends React.Component {
- {this.handleDataPageChange(value)}, - total: salaryGrantPageInfo.total, - current: salaryGrantPageInfo.pageNum, - showTotal: (total) => `共 ${total} 条`, - }} + { + this.pageInfo.current = value + this.handleDataPageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} />
{ diff --git a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js index 345de372..4da037e8 100644 --- a/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js +++ b/pc4mobx/hrmSalary/pages/payroll/stepForm/showSettingForm.js @@ -76,9 +76,11 @@ export default class ShowSettingForm extends React.Component { + 插入变量: {this.handleThemeNameCllck("${companyName}")}} className="themeFormalStr">公司名称 {this.handleThemeNameCllck("${salaryMonth}")}} className="themeFormalStr">薪资所属月 + diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 821a7b4a..e5a9ddca 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -20,6 +20,7 @@ import SlideSalaryItem from './slideSalaryItem' import SlideAgent from './slideAgent' import ImportModal from '../../components/importModal' import SalaryFileViewSlide from './saralyFileViewSlide' +import CustomPaginationTable from "../../components/customPaginationTable" const { MonthPicker } = DatePicker; @@ -47,6 +48,7 @@ export default class SalaryFile extends React.Component { importResult: {}, searchValue: "" } + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -161,7 +163,13 @@ export default class SalaryFile extends React.Component { // 页面跳转 handlePageChange = (value) => { const { salaryFileStore: {getTableDatas, form}} = this.props; - getTableDatas({ current: value }) + this.pageInfo.current = value; + getTableDatas(this.pageInfo) + } + + handleShowSizeChange(pageInfo) { + const { salaryFileStore: {getTableDatas, form}} = this.props; + getTableDatas(pageInfo) } // 搜索 @@ -317,18 +325,23 @@ export default class SalaryFile extends React.Component { renderRightOperation() } /> - {this.handlePageChange(value)}, - total: pageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: pageInfo.pageNum - }} + total={pageInfo.total} + current={pageInfo.pageNum} + pageSize={this.pageInfo.pageSize} scroll={{x: 2300}} + onPageChange={(value) => { + this.handlePageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} /> diff --git a/pc4mobx/hrmSalary/pages/salaryItem/index.js b/pc4mobx/hrmSalary/pages/salaryItem/index.js index 3973f7f8..fff12e61 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/index.js @@ -16,7 +16,7 @@ import SlideModalTitle from "../../components/slideModalTitle" import CustomSalaryItemSlide from './customSalaryItemSlide' import DeleteSalaryItemModal from './deleteSalaryItemModal'; import FormalFormModal from './formalFormModal'; -import CustomTable from '../../components/customTable'; +import CustomPaginationTable from '../../components/customPaginationTable'; const { MonthPicker } = DatePicker; @@ -33,7 +33,7 @@ export default class SalaryItem extends React.Component { searchValue: "", formalModalVisible: false } - this.searchParams = {} + this.searchParams = {current: 1, pageSize: 10} columns.map(item => { if(item.dataIndex == "refere") { item.render = () => { @@ -169,6 +169,11 @@ export default class SalaryItem extends React.Component { getTableDatas(this.searchParams) } + handleShowSizeChange(searchParams) { + const { salaryItemStore: {getTableDatas}} = this.props; + getTableDatas(searchParams) + } + render() { const { salaryItemStore } = this.props; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = salaryItemStore; @@ -302,17 +307,22 @@ export default class SalaryItem extends React.Component { onOperatesClick={this.onOperatesClick.bind(this)} /> */} - {this.handlePageChnage(value)}, - total: pageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: pageInfo.pageNum - }} - /> + { + this.handlePageChnage(value) + }} + onShowSizeChange={(current, pageSize) => { + this.searchParams.current = current; + this.searchParams.pageSize = pageSize; + this.handleShowSizeChange(this.searchParams) + }} + /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js index 41888735..0e2a6d78 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js @@ -17,7 +17,7 @@ import SocialSecurityForm from './socialSecurityForm'; import AccumulationFundForm from './accumulationFundForm'; import OtherForm from './otherForm'; import { tempateColumns } from '../../payroll/columns'; -import CustomTable from '../../../components/customTable'; +import CustomPaginationTable from '../../../components/customPaginationTable'; import ImportModal from '../../../components/importModal'; const { MonthPicker } = DatePicker; @@ -40,6 +40,7 @@ export default class Archives extends React.Component { } this.record = {} + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -91,7 +92,8 @@ export default class Archives extends React.Component { handlePageChnage(value) { const { archivesStore: {form, getTableDatas}} = this.props; - getTableDatas({current: value}) + this.pageInfo.current = value + getTableDatas(this.pageInfo) } // 导入 @@ -149,6 +151,11 @@ export default class Archives extends React.Component { } this.setState({importVisible: false, step: 0}); } + + handleSearch() { + const { archivesStore: {getTableDatas}} = this.props; + getTableDatas(this.pageInfo) + } render() { const { archivesStore } = this.props; @@ -247,7 +254,7 @@ export default class Archives extends React.Component { setShowSearchAd={bool => setShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(form, toJS(condition), 2)} // 高级搜索内部数据 buttonsAd={adBtn} // 高级搜索内部按钮 - onSearch={getTableDatas} // 点搜索按钮时的回调 + onSearch={() => {this.handleSearch()}} // 点搜索按钮时的回调 onSearchChange={v => form.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={form.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 /> @@ -259,19 +266,23 @@ export default class Archives extends React.Component { // getColumns={this.getColumns} // onOperatesClick={this.onOperatesClick.bind(this)} /> */} - 0 ? this.getColumns().length * 150: 1000 }} - pagination={{ - onChange: (value) => {this.handlePageChnage(value)}, - total: pageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: pageInfo.pageNum + onPageChange={(value) => { + this.handlePageChnage(value) }} - /> + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + getTableDatas(this.pageInfo) + }} + /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index d2b20c8c..8f8abd24 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -19,6 +19,7 @@ import TipLabel from '../../../components/TipLabel' import DefaultSlideForm from './defaultSlideForm' import CustomNewModal from './customNewModal' import { welfareTypeEnum, paymentScopeEnum } from './enum'; +import CustomPaginationTable from '../../../components/customPaginationTable' import { @@ -48,6 +49,8 @@ export default class Programme extends React.Component { customNewVisible: false, customEdit: false } + + this.pageInfo = {current: 1, pageSize: 10} } componentWillMount() { @@ -186,7 +189,8 @@ export default class Programme extends React.Component { // 页面跳转 handlePageChange(value) { const { programmeStore: {form, getTableDatas, selectedKey} } = this.props; - getTableDatas(selectedKey, {current: value}) + this.pageInfo.current = value + getTableDatas(selectedKey, this.pageInfo) } render() { @@ -391,15 +395,21 @@ export default class Programme extends React.Component { renderCustomRightContent() } /> : - {this.handlePageChange(value)}, - total: tablePageInfo.total, - showTotal: (total) => `共 ${total} 条`, - current: tablePageInfo.pageNum + total={tablePageInfo.total} + current={tablePageInfo.pageNum} + onPageChange={(value) => { + this.handlePageChange(value) + }} + onShowSizeChange={(current,pageSize) => { + this.pageInfo = {current, pageSize} + const { programmeStore: {form, getTableDatas, selectedKey} } = this.props; + getTableDatas(selectedKey, this.pageInfo) }} /> diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js index eed1c2be..df3387fb 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js @@ -11,6 +11,7 @@ import CustomTab from "../../../components/customTab"; import ContentWrapper from "../../../components/contentWrapper"; import Accountdialog from "./components/accountDialog"; import AbnormalDrawer from "./components/abnormalDrawer"; +import CustomPaginationTable from '../../../components/customPaginationTable' import moment from "moment"; import _ from "lodash"; @@ -49,6 +50,7 @@ export default class StandingBook extends React.Component { }, }; this.payload = {} + this.pageInfo = {current: 1, pageSize: 10} } componentDidMount() { @@ -169,10 +171,17 @@ export default class StandingBook extends React.Component { }); } - handleGoDetail = (billMonth) => { - window.open( - `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=detail&billMonth=${billMonth}` - ); + handleGoDetail = (billMonth, detail) => { + if(detail) { + window.open( + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?type=${detail}&billMonth=${billMonth}` + ); + } else { + window.open( + `/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?billMonth=${billMonth}` + ); + } + setTimeout(() => { this.getCommonList({ ...this.state.tableParams, @@ -226,7 +235,7 @@ export default class StandingBook extends React.Component { }); break; case "view": - this.handleGoDetail(billMonth); + this.handleGoDetail(billMonth, "detail"); break; default: break; @@ -274,6 +283,22 @@ export default class StandingBook extends React.Component { }); }; + handlePageChange(value) { + this.setState({current: value}) + this.pageInfo.current = value; + this.getCommonList({ + ...this.state.tableParams, + ...this.pageInfo, + }); + } + + handleShowSizeChange(pageInfo) { + this.getCommonList({ + ...this.state.tableParams, + ...pageInfo, + }); + } + render() { const { standingBookStore } = this.props; const { @@ -394,15 +419,22 @@ export default class StandingBook extends React.Component { onChange={(val) => this.handleChangeMonth("endTime", val)} /> + it.dataIndex !== "id")} + dataSource={list} + total={total} + current={this.state.current} + pageSize={this.pageInfo.pageSize} + onPageChange={(value) => { + this.handlePageChange(value) + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = {current, pageSize} + this.handleShowSizeChange(this.pageInfo) + }} + /> - - it.dataIndex !== "id")} - dataSource={list} - loading={loading} - pagination={pagination} - /> - {dialogProps.visible && ( diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 7011635a..62805f2f 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -291,9 +291,9 @@ export class calculateStore { // 核算结果--列表 @action - acctResultList = (salaryAcctRecordId, employeeName = "", current = 1) => { + acctResultList = (salaryAcctRecordId, employeeName = "", current = 1, params = {}) => { this.loading = true - API.acctResultList({salaryAcctRecordId, employeeName, current}).then(res => { + API.acctResultList({salaryAcctRecordId, employeeName, current, ...params}).then(res => { if(res.status) { // this.acctResultListTableStore.getDatas(res.data.dataKey.datas) diff --git a/pc4mobx/hrmSalary/stores/declare.js b/pc4mobx/hrmSalary/stores/declare.js index 988f66aa..9ba334c4 100644 --- a/pc4mobx/hrmSalary/stores/declare.js +++ b/pc4mobx/hrmSalary/stores/declare.js @@ -24,6 +24,7 @@ export class DeclareStore { @observable detailTableStore = new TableStore(); @observable detailDataSource = []; @observable datailColumns = []; + @observable detailPageInfo = {} // 初始化操作 @action @@ -118,11 +119,12 @@ export class DeclareStore { // 个税申报表详情列表 @action - getDetailList = (taxDeclarationIdStr) => { - API.getDetailList({taxDeclarationIdStr}).then(res => { + getDetailList = (taxDeclarationIdStr, params = {}) => { + API.getDetailList({taxDeclarationIdStr, ...params}).then(res => { if(res.status) { this.detailDataSource = res.data.pageInfo.list ? res.data.pageInfo.list : []; this.datailColumns = res.data.pageInfo.columns + this.detailPageInfo = res.data.pageInfo // this.detailTableStore.getDatas(res.data.dataKey.datas) } else { message.error(res.errrmsg || "获取失败") diff --git a/pc4mobx/hrmSalary/stores/mySalary.js b/pc4mobx/hrmSalary/stores/mySalary.js index b3f88575..0fe8834c 100644 --- a/pc4mobx/hrmSalary/stores/mySalary.js +++ b/pc4mobx/hrmSalary/stores/mySalary.js @@ -30,7 +30,8 @@ export class MySalaryStore { // 调薪记录 @observable recordListColumns = []; @observable recordListDataSource = []; - @observable recordListPageInfo = {} + @observable recordListPageInfo = {}; + @observable myBillPageInfo = {} @action initParams = () => { @@ -99,12 +100,13 @@ export class MySalaryStore { // 我的工资单列表 @action - mySalaryBillList = (salaryYearMonth = []) => { + mySalaryBillList = (salaryYearMonth = [], params = {}) => { this.loading = true - API.mySalaryBillList({salaryYearMonth}).then(res => { + API.mySalaryBillList({salaryYearMonth, ...params}).then(res => { if(res.status) { this.myBillDataSource = res.data.datas this.myBillTableStore.getDatas(res.data.dataKey.datas) + this.myBillPageInfo = res.data.pageInfo this.loading = false } else { message.error(res.errormsg || "获取失败")