From b88232bdda6394bbb6709ccaee0557c236cd462d Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 11 Nov 2025 18:03:27 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E8=A5=BF=E9=83=A8=E4=BF=A1=E6=89=980401?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-pages/xbxt/personalSalaryReport.js | 25 +++++++-- .../components/payrollTable/index.js | 48 +++------------- .../hrmSalary/pages/mySalaryBenefits/index.js | 55 ++++++++++++++++--- .../pages/mySalaryBenefits/index.less | 6 +- 4 files changed, 80 insertions(+), 54 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js index 30e8cbc5..bd77c193 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js @@ -34,6 +34,10 @@ class PersonalSalaryReport extends Component { window.addEventListener("message", this.handleReceive, false); } + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.dateRange !== this.props.dateRange) this.getSalaryReport(nextProps); + } + componentWillUnmount() { window.removeEventListener("message", this.handleReceive, false); } @@ -60,8 +64,9 @@ class PersonalSalaryReport extends Component { const childFrameObj = document.getElementById("atdTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; - getSalaryReport = () => { - const { pageInfo, dateRange } = this.state, [startDateStr, endDateStr] = dateRange; + getSalaryReport = (props) => { + const { pageInfo, dateRange: pageDateRange } = this.state, { dateRange } = props || this.props; + const [startDateStr, endDateStr] = dateRange || pageDateRange; const payload = { startDateStr, endDateStr, ...pageInfo }; this.setState({ loading: true }); postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryReport", payload).then(({ status, data }) => { @@ -89,13 +94,25 @@ class PersonalSalaryReport extends Component { render() { - const { dataSource, loading, dateRange } = this.state; - const dom = document.querySelector(".wea-new-top-content"); + const { dataSource, loading, dateRange } = this.state, { isCom = false } = this.props; + const dom = document.querySelector(".wea-new-top-content") || document.querySelector(".wea-new-top-req-content"); let height = 280; if (dataSource.length > 0 && dom) { const tableHeight = dataSource.length * 39 + 127; height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight; } + if (isCom) return ( +
+ +