From 8c3c4ee52028859f62bf59faad07f43a82978a4b Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 11 Nov 2025 17:14:14 +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 --- .../components/captchaModal/index.js | 12 +- pc4mobx/hrmSalary/index.js | 5 +- pc4mobx/hrmSalary/pages/custom-pages/index.js | 9 ++ .../pages/custom-pages/xbxt/index.less | 11 ++ .../custom-pages/xbxt/personalSalaryReport.js | 118 ++++++++++++++++++ .../hrmSalary/pages/mobilePayroll/index.js | 9 +- .../pages/mobilePayroll/loginVerify.js | 7 +- .../pages/mobilePayroll/mobileModal.js | 7 +- .../pages/mobilePayroll/secondaryVerify.js | 14 ++- .../pages/mobilePayroll/secondarypwdVerify.js | 6 +- .../hrmSalary/pages/mySalary/mySalaryView.js | 22 ++-- .../components/payrollTable/index.js | 51 ++++++-- .../hrmSalary/pages/mySalaryMobile/index.js | 81 ++++++++++-- 13 files changed, 304 insertions(+), 48 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/xbxt/index.less create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js diff --git a/pc4mobx/hrmSalary/components/captchaModal/index.js b/pc4mobx/hrmSalary/components/captchaModal/index.js index ac98046b..2614895e 100644 --- a/pc4mobx/hrmSalary/components/captchaModal/index.js +++ b/pc4mobx/hrmSalary/components/captchaModal/index.js @@ -51,15 +51,17 @@ class Index extends Component { }; handleConfirm = async () => { const type = getQueryString("type"), f = await form.validateForm(); - if (!this.state.captcha && type !== "phone") { + if (!this.state.captcha && type !== "phone" && !this.props.isSalaryMobile) { this.refs.weaError.showError(); return; - } else if (!f.isValid && type === "phone") { + } else if (!f.isValid && (type === "phone" || this.props.isSalaryMobile)) { f.showErrors(); return; } checkMobileCode({ id: this.props.id, mobileCode: this.state.captcha }).then(({ status, errormsg }) => { if (status) { + clearInterval(this.timeRef); + this.setState({ captcha: "", time: 60 }); this.props.onCancel(); this.props.onConfirm(); } else { @@ -69,7 +71,7 @@ class Index extends Component { }; render() { - const { captcha, time } = this.state, type = getQueryString("type"); + const { captcha, time } = this.state, { isSalaryMobile } = this.props, type = getQueryString("type"); const itemRender = { mobileCode: (field, textAreaProps, form, formParams) => { return (
@@ -85,7 +87,9 @@ class Index extends Component { }; return ( { - type === "phone" ? + (type === "phone" || isSalaryMobile) ? + : + {CustomRoutes} ); module.exports = { Route: Routes, store: stores -}; +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/custom-pages/index.js b/pc4mobx/hrmSalary/pages/custom-pages/index.js index e69de29b..5d0c4fa7 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 PersonalSalaryReport from "./xbxt/personalSalaryReport"; + +const CustomRoutes = [ + +]; + +export default CustomRoutes; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/index.less b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/index.less new file mode 100644 index 00000000..cdf2597d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/index.less @@ -0,0 +1,11 @@ +.xbxt_report { + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } + + .wea-new-top-content { + background: #f6f6f6; + padding: 8px 16px 0 16px; + } + +} \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js new file mode 100644 index 00000000..30e8cbc5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/custom-pages/xbxt/personalSalaryReport.js @@ -0,0 +1,118 @@ +/* + * 西部信托 + * 个人薪资报表 + * @Author: 黎永顺 + * @Date: 2025/11/11 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ + +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide"; +import { postFetch } from "../../../util/request"; +import moment from "moment"; +import { Spin } from "antd"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class PersonalSalaryReport extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, + dateRange: [ + moment(new Date()).subtract(12, "months").format("YYYY-MM"), + moment(new Date()).format("YYYY-MM") + ] + }; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + handleReceive = ({ data }) => { + const { type, payload: { id, params } = {} } = data; + const { pageInfo } = this.state; + if (type === "init") { + this.getSalaryReport(); + } else if (type === "turn") { + if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = params; + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getSalaryReport()); + } + } + }; + postMessageToChild = (payload) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + getSalaryReport = () => { + const { pageInfo, dateRange } = this.state, [startDateStr, endDateStr] = dateRange; + const payload = { startDateStr, endDateStr, ...pageInfo }; + this.setState({ loading: true }); + postFetch("/api/bs/hrmsalary/report/statistics/employee/salaryReport", payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, pageInfo: pageparams } = data; + const { list: dataSource, pageNum: current, total, pageSize } = pageparams; + this.setState({ + columns, dataSource, pageInfo: { ...pageInfo, current, total, pageSize } + }, () => { + const { columns, dataSource, pageInfo } = this.state; + this.postMessageToChild({ + dataSource, pageInfo, showTotalCell: false, calcDetail: true, tableScrollHeight: 107, + columns: _.map(columns, (it, idx) => ({ + dataIndex: it.column, title: it.text, calcDetail: true, showSee: false, + width: (it.dataIndex === "taxAgent" || it.dataIndex === "salarySob") ? 176 : it.width, + fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", + ellipsis: true + })) + }); + }); + } + }).catch(() => this.setState({ loading: false })); + }; + + + render() { + const { dataSource, loading, dateRange } = this.state; + const dom = document.querySelector(".wea-new-top-content"); + let height = 280; + if (dataSource.length > 0 && dom) { + const tableHeight = dataSource.length * 39 + 127; + height = dom.offsetHeight > tableHeight ? tableHeight : dom.offsetHeight; + } + return (} iconBgcolor="#F14A2D" + buttons={[ this.setState({ dateRange: v }, () => this.getSalaryReport())}/>]}> +
+ +