Compare commits
3 Commits
master
...
custom-欧姆龙
| Author | SHA1 | Date |
|---|---|---|
|
|
f2535bb63c | |
|
|
1ba6b96128 | |
|
|
1d1829f585 |
|
|
@ -0,0 +1,7 @@
|
|||
import { postFetch } from "../../../util/request";
|
||||
|
||||
// 欧姆龙-月度薪资环比统计报表(本月、上月维度比较)
|
||||
export const getYdxzhbReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/oml/ydxzhbReportList", params);
|
||||
};
|
||||
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import React, { Component } from "react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import Content from "./content";
|
||||
import _ from "lodash";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
|
@ -18,18 +19,18 @@ class Index extends Component {
|
|||
export default Index;
|
||||
|
||||
export const dealTemplate = (itemTypeList, type) => {
|
||||
let cloneItemTypeList = _.cloneDeep(itemTypeList);
|
||||
let cloneItemTypeList = cloneDeep(itemTypeList);
|
||||
let showData = [], onlyOneGrup = false;
|
||||
cloneItemTypeList.forEach((group) => {
|
||||
const { items, groupName, groupId } = group;
|
||||
if (items.length !== 0) {
|
||||
items.forEach((item) => {
|
||||
item.salaryItemValue = !_.isNil(item.salaryItemValue) ? item.salaryItemValue : "";
|
||||
item.salaryItemValue = (item.salaryItemValue !== undefined || true) ? item.salaryItemValue : "";
|
||||
});
|
||||
if (items.length % 2 && type === "pc") items.push({});
|
||||
// 未分类不展示标题
|
||||
// if (!groupId.includes("222222222222222222")) {
|
||||
showData.push({ groupId, groupName, items });
|
||||
showData.push({ groupId, groupName, items });
|
||||
// } else {
|
||||
// showData.push({ items });
|
||||
// }
|
||||
|
|
@ -42,3 +43,23 @@ export const dealTemplate = (itemTypeList, type) => {
|
|||
}
|
||||
return { onlyOneGrup, showData };
|
||||
};
|
||||
|
||||
const cloneDeep = (obj) => {
|
||||
if (obj === null || typeof obj !== "object") {
|
||||
return obj;
|
||||
}
|
||||
if (Array.isArray(obj)) {
|
||||
let clone = [];
|
||||
for (let item of obj) {
|
||||
clone.push(cloneDeep(item));
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
let clone = {};
|
||||
for (let key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
clone[key] = cloneDeep(obj[key]);
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
};
|
||||
|
|
@ -54,6 +54,8 @@ import TopologyMap from "./pages/topologyMap";
|
|||
import SupplementaryCalc from "./pages/supplementaryCalc";
|
||||
import VariableSalary from "./pages/variableSalary";
|
||||
import Layout from "./layout";
|
||||
|
||||
import CustomRoutes from "./pages/custom-pages";
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
// 读取系统多语言配置
|
||||
|
|
@ -118,6 +120,7 @@ const Routes = (
|
|||
<Route key="topologyView" path="topologyView/:salarySobId/:salaryItemId" component={TopologyMap}/>
|
||||
<Route key="supplementaryCalc" path="supplementaryCalc" component={SupplementaryCalc}/>
|
||||
<Route key="variableSalary" path="variableSalary" component={VariableSalary}/>
|
||||
{CustomRoutes}
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
.omron_report {
|
||||
height: 100%;
|
||||
background: #f6f6f6;
|
||||
padding: 8px 16px;
|
||||
|
||||
.wea-new-table {
|
||||
background: #FFF;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 欧姆龙二开
|
||||
* 月度薪资环比统计报表(本月、上月维度比较)
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/12/17
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
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 {
|
||||
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>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import StatisticalReport from "./Omron/statisticalReport";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="customPage_statisticalReport_omron" path="customPage_statisticalReport_omron"
|
||||
component={StatisticalReport}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
Loading…
Reference in New Issue