custom-欧姆龙
This commit is contained in:
parent
1d1829f585
commit
1ba6b96128
|
|
@ -0,0 +1,7 @@
|
|||
import { postFetch } from "../../../util/request";
|
||||
|
||||
// 欧姆龙-月度薪资环比统计报表(本月、上月维度比较)
|
||||
export const getYdxzhbReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/oml/ydxzhbReportList", params);
|
||||
};
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
.omron_report {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,17 +8,56 @@
|
|||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { WeaDatePicker, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
|
||||
import * as API from "../../../../apis/custom-apis/omron";
|
||||
import { Button } from "antd";
|
||||
import moment from "moment";
|
||||
import "./index.css";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
year: moment().format("YYYY"), dataSource: [], columns: [], loading: false
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getYdxzhbReportList();
|
||||
}
|
||||
|
||||
getYdxzhbReportList = () => {
|
||||
const { year } = this.state;
|
||||
this.setState({ loading: true });
|
||||
API.getYdxzhbReportList({ year }).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { columns, data: dataSource } = data;
|
||||
this.setState({
|
||||
columns: _.map(columns, o => ({ dataIndex: o.column, title: o.text })), dataSource
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { year, dataSource, columns, loading } = this.state;
|
||||
const buttons = [
|
||||
<WeaDatePicker value={year} format="YYYY"
|
||||
onChange={year => this.setState({ year }, () => this.getYdxzhbReportList())}/>,
|
||||
<Button type="primary"
|
||||
onClick={() => window.open(`/api/bs/hrmsalary/salaryacct/oml/exportYdxzhbReport?year=${year}`, "_blank")}>{getLabel(111, "导出")}</Button>
|
||||
];
|
||||
return (
|
||||
<WeaTop title={getLabel(111, "月度薪资环比统计报表")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} showDropIcon={false}>
|
||||
<div className="omron_report">
|
||||
<WeaTable pagination={false} columns={columns} dataSource={dataSource} loading={loading} bordered
|
||||
scroll={{ y: "calc(100vh - 106px)" }}/>
|
||||
</div>
|
||||
);
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue