salary-management-front/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/overView.js

137 lines
3.8 KiB
JavaScript
Raw Normal View History

2022-04-22 14:35:51 +08:00
/*
* Author: 黎永顺
* Description: 总览
* Date: 2022-04-20 20:49:23
2022-05-09 15:10:49 +08:00
* LastEditTime: 2022-05-09 15:07:56
2022-04-22 14:35:51 +08:00
*/
2022-04-22 19:09:02 +08:00
import React, { Component } from "react";
2022-07-20 10:33:23 +08:00
import { Button, Icon, Spin, Tooltip } from "antd";
2022-04-22 19:09:02 +08:00
import { inject, observer } from "mobx-react";
2023-02-13 10:41:40 +08:00
import { WeaNewScroll, WeaTable } from "ecCom";
2022-04-22 19:09:02 +08:00
import "./index.less";
2022-04-22 14:35:51 +08:00
2022-04-22 19:09:02 +08:00
@inject("standingBookStore")
2022-04-22 14:35:51 +08:00
@observer
export default class OverViewIndex extends Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [],
current: 1,
pageSize: 10,
2022-04-22 14:35:51 +08:00
tableData: {
2022-04-22 19:09:02 +08:00
list: [],
columns: [],
2022-07-20 10:33:23 +08:00
total: 0
}
2022-04-22 19:09:02 +08:00
};
2022-04-22 14:35:51 +08:00
}
componentDidMount() {
2022-06-09 18:30:19 +08:00
const { billMonth, paymentOrganization } = this.props;
this.getOverViewList({ billMonth, paymentOrganization });
2022-04-22 14:35:51 +08:00
}
getOverViewList = (payload = {}) => {
const { getOverViewList } = this.props.standingBookStore;
2022-04-22 19:09:02 +08:00
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>
2022-07-20 10:33:23 +08:00
)
2022-04-22 19:09:02 +08:00
};
}
);
this.setState({
tableData: {
list,
columns,
2022-07-20 10:33:23 +08:00
total
}
2022-04-22 19:09:02 +08:00
});
}
);
};
2022-07-20 10:33:23 +08:00
handleExport = () => {
const { billMonth, paymentOrganization } = this.props;
const url = `${window.location
.origin}/api/bs/hrmsalary/welfare/overView/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
window.open(url, "_self");
};
2022-04-22 14:35:51 +08:00
render() {
2022-06-09 18:30:19 +08:00
const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
2022-04-22 14:35:51 +08:00
const { selectedRowKeys } = this.state;
const { loading } = this.props.standingBookStore;
let { list, columns, total } = this.state.tableData;
2022-04-22 19:09:02 +08:00
const pagination = {
total,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({ current, pageSize });
this.getOverViewList({
billMonth, current,
pageSize, paymentOrganization
});
2022-04-22 19:09:02 +08:00
},
onChange: (current) => {
this.setState({ current });
this.getOverViewList({
billMonth, current,
pageSize: this.state.pageSize, paymentOrganization
});
2022-07-20 10:33:23 +08:00
}
2022-04-22 19:09:02 +08:00
};
2022-04-22 14:35:51 +08:00
return (
2022-04-22 19:09:02 +08:00
<div className="normalWapper">
<div className="topContent">
<div className="month">
2022-04-22 14:35:51 +08:00
<span>
账单月份
2022-04-22 19:09:02 +08:00
<Tooltip
placement="topLeft"
title="提示:正常缴纳,账单月份即社保福利缴纳月份">
2022-07-20 10:33:23 +08:00
<Icon type="question-circle"/>
2022-04-22 14:35:51 +08:00
</Tooltip>
</span>
<span>{billMonth}</span>
</div>
</div>
2022-07-20 10:33:23 +08:00
<div className="tabOption">
<Button type="primary" onClick={this.handleExport}>导出全部</Button>
</div>
2022-04-22 14:35:51 +08:00
{/* table */}
2023-02-13 10:41:40 +08:00
<div className="tableWrapper">
<WeaNewScroll height="100%">
<Spin spinning={loading}>
<WeaTable
rowKey="id"
columns={columns}
dataSource={list}
loading={loading}
pagination={pagination}
scroll={{ x: 1200 }}
/>
</Spin>
</WeaNewScroll>
2022-04-22 14:35:51 +08:00
</div>
</div>
2022-04-22 19:09:02 +08:00
);
2022-04-22 14:35:51 +08:00
}
}