This commit is contained in:
MustangDeng 2022-04-24 14:50:58 +08:00
commit 82b6c05819
5 changed files with 163 additions and 76 deletions

View File

@ -29,6 +29,7 @@ export default class StandingBook extends React.Component {
startTime: moment(new Date()).format("YYYY-MM"),
endTime: moment(new Date()).format("YYYY-MM"),
},
current: 1,
dialogProps: {
title: "",
visible: false,
@ -46,12 +47,13 @@ export default class StandingBook extends React.Component {
}
componentDidMount() {
this.getCommonList({ ...this.state.tableParams });
const { current } = this.state;
this.getCommonList({ ...this.state.tableParams, current });
}
getCommonList = (payload = {}) => {
const { getCommonList } = this.props.standingBookStore;
getCommonList({ ...payload }).then(({ list, columns, total }) => {
getCommonList({ ...payload }).then(({ list, columns, total, pageNum }) => {
columns = _.map(columns, (it) => {
if (it.dataIndex === "billMonth") {
it = {
@ -130,6 +132,7 @@ export default class StandingBook extends React.Component {
],
total,
},
current: pageNum,
});
});
};
@ -181,7 +184,10 @@ export default class StandingBook extends React.Component {
onOk: () => {
siaccountDelete({ billMonth }).then(() => {
message.success("删除成功");
this.getCommonList({ ...this.state.tableParams });
this.getCommonList({
...this.state.tableParams,
current: this.state.current,
});
});
},
onCancel: () => {},
@ -203,7 +209,10 @@ export default class StandingBook extends React.Component {
save(payload).then(() => {
message.success("核算成功");
this.handleClose();
this.getCommonList({ ...this.state.tableParams });
this.getCommonList({
...this.state.tableParams,
current: this.state.current,
});
this.handleGoDetail(moment(billMonth).format("YYYY-MM"));
});
};
@ -228,6 +237,7 @@ export default class StandingBook extends React.Component {
this.getCommonList({
...this.state.tableParams,
[type]: val,
current: this.state.current,
});
};
@ -319,6 +329,19 @@ export default class StandingBook extends React.Component {
return <div></div>;
};
const pagination = {
total,
current: this.state.current,
showTotal: (total) => `${total}`,
onChange: (current) => {
this.setState({ current });
this.getCommonList({
...this.state.tableParams,
current,
});
},
};
return (
<div className="standingbookWrapper">
<WeaRightMenu
@ -352,7 +375,7 @@ export default class StandingBook extends React.Component {
columns={_.filter(columns, (it) => it.dataIndex !== "id")}
dataSource={list}
loading={loading}
pagination={{ total }}
pagination={pagination}
/>
{dialogProps.visible && (
<Accountdialog

View File

@ -2,12 +2,12 @@
* Author: 黎永顺
* Description: 异常列表
* Date: 2022-04-20 21:00:54
* LastEditTime: 2022-04-21 17:43:31
* LastEditTime: 2022-04-22 19:07:51
*/
import React, { Component } from "react";
import { Icon, Tooltip, Button } from "antd";
import { inject, observer } from "mobx-react";
import { WeaInputSearch, WeaTable } from "ecCom";
import { WeaBrowser, WeaTable } from "ecCom";
import "./index.less";
@inject("standingBookStore")
@ -17,6 +17,7 @@ export default class AbnormalListIndex extends Component {
super(props);
this.state = {
selectedRowKeys: [],
current: 1,
tableData: {
list: [],
columns: [],
@ -27,7 +28,8 @@ export default class AbnormalListIndex extends Component {
componentDidMount() {
const { billMonth } = this.props;
this.getChangeList({ billMonth });
const { current } = this.state;
this.getChangeList({ billMonth, current });
}
getChangeList = (payload = {}) => {
@ -50,6 +52,15 @@ export default class AbnormalListIndex extends Component {
(item) => ({ ...item, width: item.oldWidth })
);
let { list, total } = this.state.tableData;
const pagination = {
total,
current: this.state.current,
showTotal: (total) => `${total}`,
onChange: (current) => {
this.setState({ current });
this.getChangeList({ billMonth, current });
},
};
return (
<div className="normalWapper">
<div className="topContent">
@ -67,7 +78,15 @@ export default class AbnormalListIndex extends Component {
</div>
<div className="tabOption">
<Button>导出全部</Button>
<WeaInputSearch placeholder={"请输入姓名"} />
<WeaBrowser
type={17}
textDecoration={true}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) =>
console.log("多人力", ids, names, datas)
}
isSingle={false}
/>
</div>
{/* table */}
<div style={{ padding: "0 16px" }}>
@ -76,7 +95,7 @@ export default class AbnormalListIndex extends Component {
columns={columns}
dataSource={list}
loading={loading}
pagination={{ total }}
pagination={pagination}
scroll={{ x: 1200 }}
/>
</div>

View File

@ -2,13 +2,13 @@
* Author: 黎永顺
* Description: 正常缴纳月份
* Date: 2022-04-20 08:56:08
* LastEditTime: 2022-04-22 14:05:50
* LastEditTime: 2022-04-22 19:06:46
*/
import React, { Component } from "react";
import { Icon, Tooltip, Button, message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import { toJS } from "mobx";
import { WeaInputSearch, WeaTable, WeaPopoverHrm, WeaDialog } from "ecCom";
import { WeaBrowser, WeaTable, WeaPopoverHrm, WeaDialog } from "ecCom";
import { getSearchs } from "../../../../util";
import _ from "lodash";
import "./index.less";
@ -20,6 +20,7 @@ export default class NormalIndex extends Component {
super(props);
this.state = {
date: "",
current: 1,
selectedRowKeys: [],
addProps: {
title: "",
@ -35,17 +36,19 @@ export default class NormalIndex extends Component {
componentDidMount() {
const { billMonth, selectedKey } = this.props;
const { current } = this.state;
selectedKey === "1"
? this.getNormalList({ billMonth })
: this.getSupplementaryList({ billMonth });
? this.getNormalList({ billMonth, current })
: this.getSupplementaryList({ billMonth, current });
}
componentWillReceiveProps(nextProps) {
if (nextProps.selectedKey != this.props.selectedKey) {
const { billMonth } = nextProps;
const { current } = this.state;
nextProps.selectedKey === "1"
? this.getNormalList({ billMonth })
: this.getSupplementaryList({ billMonth });
? this.getNormalList({ billMonth, current })
: this.getSupplementaryList({ billMonth, current });
}
}
@ -54,14 +57,15 @@ export default class NormalIndex extends Component {
this.props.standingBookStore;
const { billMonth, selectedKey } = this.props;
if (selectedKey === "1") {
const { includes } = form.getFormParams();
const { includes, excludes } = form.getFormParams();
const payload = {
billMonth,
includes: includes.split(","),
excludes: _.isEmpty(excludes) ? excludes.split(",") : [],
};
siaccountCommonSave(payload).then(() => {
message.success("添加成功");
this.getNormalList({ billMonth });
this.getNormalList({ billMonth, current: this.state.current });
this.setState({
addProps: {
...this.state.addProps,
@ -88,7 +92,10 @@ export default class NormalIndex extends Component {
};
siaccountSupplementarySave(payload).then(() => {
message.success("添加成功");
this.getSupplementaryList({ billMonth });
this.getSupplementaryList({
billMonth,
current: this.state.current,
});
this.setState({
addProps: {
...this.state.addProps,
@ -216,8 +223,11 @@ export default class NormalIndex extends Component {
message.success("删除成功");
this.setState({ selectedRowKeys: [] });
selectedKey === "1"
? this.getNormalList({ billMonth })
: this.getSupplementaryList({ billMonth });
? this.getNormalList({ billMonth, current: this.state.current })
: this.getSupplementaryList({
billMonth,
current: this.state.current,
});
});
},
onCancel: () => {},
@ -251,6 +261,20 @@ export default class NormalIndex extends Component {
selectedRowKeys,
onChange: this.onSelectChange,
};
const pagination = {
total,
current: this.state.current,
showTotal: (total) => `${total}`,
onChange: (current) => {
this.setState({ current });
selectedKey === "1"
? this.getNormalList({ billMonth, current })
: this.getSupplementaryList({
billMonth,
current,
});
},
};
return (
<div className="normalWapper">
{selectedKey === "1" && (
@ -315,7 +339,15 @@ export default class NormalIndex extends Component {
<i className="icon-coms02-coms2-export" />
</Tooltip>
{selectedKey === "1" && <Button type="primary">核算</Button>}
<WeaInputSearch placeholder={"请输入姓名"} />
<WeaBrowser
type={17}
textDecoration={true}
inputStyle={{ width: 200 }}
onChange={(ids, names, datas) =>
console.log("多人力", ids, names, datas)
}
isSingle={false}
/>
</div>
{/* table */}
<div style={{ padding: "0 16px" }}>
@ -324,7 +356,7 @@ export default class NormalIndex extends Component {
columns={columns}
dataSource={list}
loading={loading}
pagination={{ total }}
pagination={pagination}
rowSelection={rowSelection}
scroll={{ x: 1200 }}
/>

View File

@ -2,22 +2,15 @@
* Author: 黎永顺
* Description: 总览
* Date: 2022-04-20 20:49:23
* LastEditTime: 2022-04-20 21:36:46
* LastEditTime: 2022-04-22 18:35:12
*/
/*
* Author: 黎永顺
* Description: 总览月份
* Date: 2022-04-20 08:56:08
* LastEditTime: 2022-04-20 20:45:54
*/
import React, { Component } from 'react';
import { Icon, Tooltip, Button } from 'antd';
import { inject, observer } from 'mobx-react';
import { WeaInputSearch, WeaTable } from 'ecCom';
import './index.less';
import React, { Component } from "react";
import { Icon, Tooltip, Button } from "antd";
import { inject, observer } from "mobx-react";
import { WeaInputSearch, WeaTable } from "ecCom";
import "./index.less";
@inject('standingBookStore')
@inject("standingBookStore")
@observer
export default class OverViewIndex extends Component {
constructor(props) {
@ -25,75 +18,95 @@ export default class OverViewIndex extends Component {
this.state = {
selectedRowKeys: [],
tableData: {
list: [], columns: [], total: 0
}
}
list: [],
columns: [],
total: 0,
},
};
}
componentDidMount() {
const { billMonth } = this.props;
this.getOverViewList({ billMonth })
this.getOverViewList({ billMonth });
}
getOverViewList = (payload = {}) => {
const { getOverViewList } = this.props.standingBookStore;
getOverViewList({ ...payload }).then(({ list, columns = [], total }) => {
columns = _.map(_.filter(columns, it => it.dataIndex !== 'id'), it => {
// if (it.dataIndex === "employeeId") {
// it = {
// ...it,
// width: 150,
// fixed: 'left'
// }
// }
return {
...it,
title: <span dangerouslySetInnerHTML={{ __html: it.title }}></span>,
}
})
this.setState({
tableData: {
list,
columns,
total
}
})
})
}
getOverViewList({ ...payload, current: 1 }).then(
({ list, columns = [], total }) => {
columns = _.map(
_.filter(columns, (it) => it.dataIndex !== "id"),
(it) => {
// if (it.dataIndex === "employeeId") {
// it = {
// ...it,
// width: 150,
// fixed: 'left'
// }
// }
return {
...it,
title: (
<span dangerouslySetInnerHTML={{ __html: it.title }}></span>
),
};
}
);
this.setState({
tableData: {
list,
columns,
total,
},
});
}
);
};
render() {
const { remarks, billMonth, selectedKey } = this.props;
const { selectedRowKeys } = this.state;
const { loading } = this.props.standingBookStore;
let { list, columns, total } = this.state.tableData;
const pagination = {
total,
showTotal: (total) => `${total}`,
onShowSizeChange(current, pageSize) {
console.log("Current: ", current, "; PageSize: ", pageSize);
},
onChange(current) {
console.log("Current: ", current);
},
};
return (
<div className='normalWapper'>
<div className='topContent'>
<div className='month'>
<div className="normalWapper">
<div className="topContent">
<div className="month">
<span>
账单月份
<Tooltip placement="topLeft" title='提示:正常缴纳,账单月份即社保福利缴纳月份'>
<Tooltip
placement="topLeft"
title="提示:正常缴纳,账单月份即社保福利缴纳月份">
<Icon type="question-circle" />
</Tooltip>
</span>
<span>{billMonth}</span>
</div>
</div>
<div className='tabOption'>
<div className="tabOption">
<Button>导出全部</Button>
</div>
{/* table */}
<div style={{ padding: '0 16px' }}>
<div style={{ padding: "0 16px" }}>
<WeaTable
rowKey='id'
rowKey="id"
columns={columns}
dataSource={list}
loading={loading}
pagination={{ total }}
pagination={pagination}
scroll={{ x: 1200 }}
/>
</div>
</div>
)
);
}
}

View File

@ -36,9 +36,9 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
pageInfo: { list, columns, total },
pageInfo: { list, columns, total, pageNum },
} = data;
resolve({ list, columns, total });
resolve({ list, columns, total, pageNum });
} else {
message.error("接口调用失败!");
reject();