custom/路维光电(业务线)
This commit is contained in:
parent
32162c9cba
commit
0c66ac4d8f
|
|
@ -56,6 +56,8 @@ import SupplementaryCalc from "./pages/supplementaryCalc";
|
|||
import VariableSalary from "./pages/variableSalary";
|
||||
import Datapush from "./pages/datapush";
|
||||
import Layout from "./layout";
|
||||
|
||||
import CustomRoutes from "./pages/custom-pages";
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
// 读取系统多语言配置
|
||||
|
|
@ -123,6 +125,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 @@
|
|||
import React from "react";
|
||||
import Route from "react-router/lib/Route";
|
||||
import Report from "./luwei/report";
|
||||
|
||||
const CustomRoutes = [
|
||||
<Route key="report_luwei" path="luweiReport/:reportType" component={Report}/>
|
||||
];
|
||||
|
||||
export default CustomRoutes;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import { postExportFetch, postFetch } from "../../../util/request";
|
||||
|
||||
export const getSocialReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/lwgd/socialReport/list", params);
|
||||
};
|
||||
export const getFundReportList = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/siaccount/lwgd/fundReport/list", params);
|
||||
};
|
||||
export const exportSocialReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/siaccount/lwgd/exportSocialReport", params);
|
||||
};
|
||||
export const exportFundReport = (params) => {
|
||||
return postExportFetch("/api/bs/hrmsalary/siaccount/lwgd/exportFundReport", params);
|
||||
};
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import * as API from "./api";
|
||||
|
||||
export const conditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["userName"],
|
||||
fieldcol: 18,
|
||||
label: "名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["billMonth"],
|
||||
fieldcol: 18,
|
||||
label: "月份",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
viewAttr: 2,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
conditionType: "SELECT",
|
||||
domkey: ["taxAgentIds"],
|
||||
fieldcol: 18,
|
||||
label: "单位",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
multiple: true,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const reportData = {
|
||||
social: { list: API.getSocialReportList, export: API.exportSocialReport, title: "社保报表" },
|
||||
fund: { list: API.getFundReportList, export: API.exportFundReport, title: "公积金报表" }
|
||||
};
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
.salaryReport {
|
||||
.report-body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 8px 16px 0;
|
||||
background: #f6f6f6;
|
||||
|
||||
.wea-new-table {
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.advance-custom {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
& > a {
|
||||
border-radius: 0;
|
||||
height: 28px;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
background-color: transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-left: none
|
||||
}
|
||||
}
|
||||
|
||||
.advance-report {
|
||||
display: none;
|
||||
background: #FFF;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.wea-form-item-wrapper {
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
.advance-report-btns {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 15px 0;
|
||||
border-top: 1px solid #dadada;
|
||||
|
||||
button {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-search-group, .wea-content {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.show-advance-report {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wea-input-focus {
|
||||
margin-top: -4px;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* 路维光电
|
||||
* 社保公积金报表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2025/7/30
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaDatePicker, WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaTable, WeaTools, WeaTop } from "ecCom";
|
||||
import { conditions, reportData } from "./conditions";
|
||||
import FormInfo from "../../../components/FormInfo";
|
||||
import { postFetch } from "../../../util/request";
|
||||
import { Button } from "antd";
|
||||
import { WeaForm } from "comsMobx";
|
||||
import cs from "classnames";
|
||||
import moment from "moment";
|
||||
import "./index.less";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const form = new WeaForm();
|
||||
|
||||
|
||||
class Report extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showAdvance: false, conditions: [], payload: {}, loading: false, dataSource: [], columns: [],
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const { data } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" });
|
||||
this.setState({
|
||||
conditions: _.map(conditions, item => ({
|
||||
...item, items: _.map(item.items, o => {
|
||||
o = { ...o, label: getLabel(o.lanId, o.label) };
|
||||
if (getKey(o) === "taxAgentIds") {
|
||||
return { ...o, options: _.map(data, it => ({ key: String(it.id), showname: it.name })) };
|
||||
} else if (getKey(o) === "billMonth") {
|
||||
return { ...o, value: moment(new Date()).format("YYYY-MM") };
|
||||
}
|
||||
return o;
|
||||
})
|
||||
}))
|
||||
}, () => {
|
||||
form.initFormFields(this.state.conditions);
|
||||
this.initReportList();
|
||||
});
|
||||
}
|
||||
|
||||
initReportList = () => {
|
||||
const { params: { reportType } } = this.props, { pageInfo } = this.state;
|
||||
const { taxAgentIds } = form.getFormParams();
|
||||
const payload = {
|
||||
...pageInfo, ...form.getFormParams(), taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : []
|
||||
};
|
||||
reportData[reportType].list(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { columns, pageInfo: result } = data;
|
||||
const { list: dataSource, pageNum: current, pageSize, total } = result;
|
||||
this.setState({
|
||||
dataSource, pageInfo: { current, pageSize, total }, payload,
|
||||
columns: this.traverseColumns(columns)
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleExport = () => {
|
||||
const { params: { reportType } } = this.props, { payload } = this.state;
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = reportData[reportType].export(payload);
|
||||
};
|
||||
traverseColumns = (arr) => {
|
||||
return _.map(arr, item => {
|
||||
if (!_.isEmpty(item.children)) {
|
||||
return {
|
||||
title: item.text, width: item.width + "px", dataIndex: item.column,
|
||||
children: this.traverseColumns(item.children)
|
||||
};
|
||||
} else {
|
||||
return { title: item.text, width: item.width + "px", dataIndex: item.column };
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { params: { reportType } } = this.props;
|
||||
const { showAdvance, conditions, columns, loading, dataSource, pageInfo } = this.state;
|
||||
const buttons = [<Button type="primary" onClick={this.handleExport}>{getLabel(111, "导出")}</Button>,
|
||||
<div className="advance-custom">
|
||||
<WeaDatePicker value={form.getFormParams().billMonth || moment(new Date()).format("YYYY-MM")} format="YYYY-MM"
|
||||
onChange={v => {
|
||||
form.updateFields({ billMonth: v });
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.initReportList());
|
||||
}}
|
||||
style={{ width: 200, marginRight: 10 }}/>
|
||||
<WeaInputSearch placeholder={getLabel(111, "请输入姓名")} value={form.getFormParams().userName}
|
||||
onChange={v => form.updateFields({ userName: v })}
|
||||
onSearch={() => this.setState({
|
||||
pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.initReportList())}/>
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "高级搜索")}</a>
|
||||
</div>];
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.initReportList());
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current } }, () => this.initReportList());
|
||||
}
|
||||
};
|
||||
return (<WeaTop title={reportData[reportType].title} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
||||
buttons={buttons} className="salaryReport">
|
||||
<div className="report-body">
|
||||
<div className={cs("advance-report", { "show-advance-report": showAdvance })}>
|
||||
<FormInfo center={false} itemRender={{}} form={form} formFields={conditions} colCount={2}/>
|
||||
<div className="advance-report-btns">
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({
|
||||
showAdvance: !showAdvance, pageInfo: { ...pageInfo, current: 1 }
|
||||
}, () => this.initReportList())}>{getLabel(111, "搜索")}</Button>
|
||||
<Button type="ghost" onClick={() => {
|
||||
form.resetForm();
|
||||
form.updateFields({ billMonth: moment(new Date()).format("YYYY-MM") });
|
||||
}}>{getLabel(111, "重置")}</Button>
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "取消")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
<WeaTable rowKey="id" scroll={{ x: 1200, y: "calc(100vh - 225px)" }} dataSource={dataSource} loading={loading}
|
||||
pagination={pagination} columns={columns} bordered/>
|
||||
</div>
|
||||
</WeaTop>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Report;
|
||||
Loading…
Reference in New Issue