diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 42d08cee..becc56ed 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -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 = ( + {CustomRoutes} ); diff --git a/pc4mobx/hrmSalary/pages/custom-pages/index.js b/pc4mobx/hrmSalary/pages/custom-pages/index.js index e69de29b..c9c8b883 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/index.js @@ -0,0 +1,9 @@ +import React from "react"; +import Route from "react-router/lib/Route"; +import Report from "./luwei/report"; + +const CustomRoutes = [ + +]; + +export default CustomRoutes; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/luwei/api.js b/pc4mobx/hrmSalary/pages/custom-pages/luwei/api.js new file mode 100644 index 00000000..5bf70139 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/luwei/api.js @@ -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); +}; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/luwei/conditions.js b/pc4mobx/hrmSalary/pages/custom-pages/luwei/conditions.js new file mode 100644 index 00000000..62c42873 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/luwei/conditions.js @@ -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: "公积金报表" } +}; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/luwei/index.less b/pc4mobx/hrmSalary/pages/custom-pages/luwei/index.less new file mode 100644 index 00000000..919c53a4 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/luwei/index.less @@ -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; + } +} diff --git a/pc4mobx/hrmSalary/pages/custom-pages/luwei/report.js b/pc4mobx/hrmSalary/pages/custom-pages/luwei/report.js new file mode 100644 index 00000000..dbb428e7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/luwei/report.js @@ -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 = [, +
+ { + form.updateFields({ billMonth: v }); + this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.initReportList()); + }} + style={{ width: 200, marginRight: 10 }}/> + form.updateFields({ userName: v })} + onSearch={() => this.setState({ + pageInfo: { ...pageInfo, current: 1 } + }, () => this.initReportList())}/> + this.setState({ showAdvance: !showAdvance })}>{getLabel(111, "高级搜索")} +
]; + 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 (} iconBgcolor="#F14A2D" + buttons={buttons} className="salaryReport"> +
+
+ +
+ + + +
+
+ +
+
); + } +} + +export default Report;