diff --git a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js index 6217fba0..ac41e93e 100644 --- a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js +++ b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js @@ -82,3 +82,33 @@ export const getSIReportGmgsList = (params) => { export const getFundReportGmgsList = (params) => { return postFetch("/api/bs/hrmsalary/ly/FundReport/gmgsList", params); }; +export const getffgsAllList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/salaryReport/ffgsAllList", params); +}; +export const getSalaryDepartmentReportList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/list", params); +}; +export const getSalaryDepartmentReportListSum = (params) => { + return postFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/sum", params); +}; +export const exportSalaryDepartmentReportList = (params) => { + return postExportFetch("/api/bs/hrmsalary/ly/salaryDepartmentReport/export", params); +}; +export const getffReportList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/ffReport/list", params); +}; +export const getffReportListSum = (params) => { + return postFetch("/api/bs/hrmsalary/ly/ffReport/sum", params); +}; +export const exportffReportList = (params) => { + return postExportFetch("/api/bs/hrmsalary/ly/ffReport/export", params); +}; +export const getbsReportList = (params) => { + return postFetch("/api/bs/hrmsalary/ly/bsReport/list", params); +}; +export const getbsReportListSum = (params) => { + return postFetch("/api/bs/hrmsalary/ly/bsReport/sum", params); +}; +export const exportbsReportList = (params) => { + return postExportFetch("/api/bs/hrmsalary/ly/bsReport/export", params); +}; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/index.js b/pc4mobx/hrmSalary/pages/custom-pages/index.js index aefaad67..45dead26 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/index.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/index.js @@ -5,6 +5,9 @@ import CustomSISummary from "./lingyue/socialSummary"; import CustomFundSummary from "./lingyue/fundSummary"; import VouncherSummary from "./lingyue/vouncherSummary"; import HistoryVouncherSummary from "./lingyue/historyVouncherSummary"; +import SalaryStatisticsReport from "./lingyue/salaryStatisticsReport"; +import SalaryPaymentReport from "./lingyue/salaryPaymentReport"; +import SalaryTaxReturnForm from "./lingyue/salaryTaxReturnForm"; const CustomRoutes = [ , , + component={HistoryVouncherSummary}/>, + , + , + ]; export default CustomRoutes; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js new file mode 100644 index 00000000..5bb4dc76 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/baseLayout.js @@ -0,0 +1,79 @@ +/* + * 薪酬二开项目 + * 统一报表基础 + * @Author: 黎永顺 + * @Date: 2025/4/7 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; +import FormInfo from "../../../components/FormInfo"; +import { getffgsAllList } from "../../../apis/custom-apis/lingyue"; +import { baseConditions } from "./components/conditions"; +import CustomSelect from "../../../components/CustomSelect"; +import { WeaSwitch } from "comsMobx"; +import moment from "moment"; +import { Button } from "antd"; +import "./index.less"; + +const getKey = WeaTools.getKey; +const getLabel = WeaLocaleProvider.getLabel; + +class Layout extends Component { + constructor(props) { + super(props); + this.state = { conditions: [] }; + } + + componentDidMount() { + this.init(); + } + + init = () => { + getffgsAllList().then(({ status, data }) => { + if (status) this.setState({ + conditions: _.map(baseConditions, item => ({ + ...item, items: _.map(item.items, o => { + if (getKey(o) === "fycdgsqc") { + return { ...o, options: _.map(data, o => ({ ...o, name: o.content })) }; + } + return { ...o, label: getLabel(o.lanId, o.label), value: moment().format("YYYY-MM") }; + }) + })) + }, () => this.props.form.initFormFields(this.state.conditions)); + }); + }; + + render() { + const { title, form, onChange, onExport } = this.props, { conditions } = this.state; + const buttons = [ + + ]; + const itemRender = { + fycdgsqc: (field, textAreaProps, form, formParams) => { + return ( { + v && form.updateFields({ fycdgsqc: { value: v } }); + onChange(); + }}/>); + }, + salaryMonth: (field, textAreaProps, form, formParams) => { + return (); + } + }; + return ( + } buttons={buttons} showDropIcon={false} + iconBgcolor="#F14A2D" className="custom_salary_lingyue"> +
+ + {this.props.children} +
+
); + } +} + +export default Layout; diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js new file mode 100644 index 00000000..3f4ce131 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/baseReportList.js @@ -0,0 +1,140 @@ +/* + * 领悦业务线报表二开 + * + * @Author: 黎永顺 + * @Date: 2025/4/7 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { message, Spin } from "antd"; +import * as API from "../../../../apis/custom-apis/lingyue"; +import { traverseCols } from "./list"; + +const getLabel = WeaLocaleProvider.getLabel; +const interfaceType = { + "salaryStatistic": { + list: API.getSalaryDepartmentReportList, + sum: API.getSalaryDepartmentReportListSum + }, "paymentReport": { + list: API.getffReportList, + sum: API.getffReportListSum + }, "taxReturn": { + list: API.getbsReportList, + sum: API.getbsReportListSum + } +}; + +export default class BaseReportList extends Component { + constructor(props) { + super(props); + this.state = { + dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false, + voucherDialog: { visible: false, ffgsqcLabel: props.ffgsqcLabel, type: props.type } + }; + this.handleDebounce = null; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.setState({ + pageInfo: { ...this.state.pageInfo, current: 1 } + }, () => this.getLYList()); + } + + handleReceive = ({ data }) => { + const { pageInfo } = this.state; + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getLYList(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getLYList(true)); + break; + case "CHECKBOX": + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); + break; + default: + break; + } + } + }; + postMessageToChild = (payload = {}) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("unitTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + + getLYList = (updateSum = false) => { + const { form, type } = this.props, { pageInfo, selectedRowKeys } = this.state; + const payload = { + ...pageInfo, ...form.getFormParams(), + fycdgsqc: form.getFormParams().fycdgsqc ? form.getFormParams().fycdgsqc.split(",") : [] + }; + this.setState({ loading: true }); + interfaceType[type]["list"](payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status) { + const { columns, data: result } = data; + const { list: dataSource = [], pageNum: current, pageSize, total } = result; + this.setState({ + pageInfo: { current, pageSize, total }, dataSource, columns, payload + }, () => { + this.postMessageToChild({ + dataSource, pageInfo: this.state.pageInfo, selectedRowKeys, unitTableType: "custom_lingyue", + columns: traverseCols(columns), showTotalCell: true, sumDataSource: {}, + scrollHeight: !_.isEmpty(dataSource) ? 195 : 0 + }); + }); + !updateSum && this.getLYListSum({ + dataSource, pageInfo: { current, pageSize, total }, selectedRowKeys, unitTableType: "custom_lingyue", + columns: traverseCols(columns), showTotalCell: true, sumDataSource: {}, + scrollHeight: !_.isEmpty(dataSource) ? 195 : 0 + }, payload); + } else { + message.warning(errormsg); + } + }); + }; + getLYListSum = (result = {}, payload) => { + const { type } = this.props; + interfaceType[type]["sum"](payload).then(({ status, data }) => { + if (status) this.postMessageToChild({ ...result, sumDataSource: data.sumRow }); + }); + }; + + render() { + const { loading, dataSource } = this.state; + const dom = document.querySelector(".wea-new-top-content"); + let height = 307.53; + if (dom && dataSource.length > 0) { + height = (parseFloat(dom.style.height) > 620 && dataSource.length === 10) ? dataSource.length * 47 + 204.53 : dataSource.length < 10 ? dataSource.length * 47 + 204.53 : parseFloat(dom.style.height) - 32; + } + return (
+ +