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())}/>]}>
+
+
+
+
+
+ );
+ }
+}
+
+export default PersonalSalaryReport;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
index 372ede86..f5601850 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
@@ -35,8 +35,13 @@ export default class MobilePayroll extends React.Component {
async componentWillMount() {
const type = getQueryString("type");
this.id = getQueryString("id");
- const { mySalaryStore: { init, setMySalaryBill } } = this.props;
+ const { mySalaryStore: { init, setMySalaryBill, setInitEmVerify } } = this.props;
setMySalaryBill({});
+ // 西部信托-改造
+ setInitEmVerify();
+ this.getMySalaryBill(getQueryString("id"));
+ return
+ // 结束
const { data, status } = await payrollCheckType();
if (status && data === "PWD") {
type !== "phone" ? init(false, () => this.getMySalaryBill(this.id)) : await this.initMobile();
@@ -200,4 +205,4 @@ export default class MobilePayroll extends React.Component {
}
);
}
-}
+}
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js
index 90d231ca..40246792 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js
@@ -49,11 +49,12 @@ class LoginVerify extends Component {
};
render() {
- const itemRender = {};
- return (
+ const itemRender = {}, { isSalaryMobile, onCancel } = this.props;
+ return (
);
}
}
-export default LoginVerify;
+export default LoginVerify;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js b/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js
index b6f388db..45a47054 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js
@@ -34,6 +34,7 @@ class MobileModal extends Component {
};
render() {
+ const { isSalaryMobile, onCancel } = this.props;
return (
@@ -48,7 +49,9 @@ class MobileModal extends Component {
@@ -62,4 +65,4 @@ class MobileModal extends Component {
}
}
-export default MobileModal;
+export default MobileModal;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js
index b5310466..ad86c294 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js
@@ -57,7 +57,7 @@ class SecondaryVerify extends Component {
};
render() {
- const { notSetting } = this.state;
+ const { notSetting } = this.state, { isSalaryMobile, onCancel } = this.props;
const itemRender = {
authCode: (field, textAreaProps, form, formParams) => {
return (
@@ -72,11 +72,13 @@ class SecondaryVerify extends Component {
);
}
};
- return (
-
- );
+ return (
+
+
+ );
}
}
-export default SecondaryVerify;
+export default SecondaryVerify;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js
index a8f84027..0a7a5f67 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js
@@ -66,6 +66,7 @@ class SecondarypwdVerify extends Component {
};
render() {
+ const { isSalaryMobile, onCancel } = this.props;
const itemRender = {
validatecode: (field, textAreaProps, form, formParams) => {
return (
@@ -81,11 +82,12 @@ class SecondarypwdVerify extends Component {
);
}
};
- return (
+ return (
);
}
}
-export default SecondarypwdVerify;
+export default SecondarypwdVerify;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
index e8b7cc58..3dc763be 100644
--- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
+++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
@@ -13,7 +13,6 @@ import Content from "../../components/pcTemplate/content";
import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll";
import CaptchaModal from "../../components/captchaModal";
import "./index.less";
-import { getQueryString } from "../../util/url";
const isIPhone = new RegExp("\\biPhone\\b|\\biPod\\b", "i").test(window.navigator.userAgent);
const isEm = window.navigator.userAgent.indexOf("E-Mobile7") >= 0;
@@ -31,17 +30,19 @@ class MySalaryView extends Component {
}
async componentDidMount() {
+ // 西部信托取消权限验证
+
const { mySalaryStore: { init, getMySalaryBill }, params: { salaryInfoId } } = this.props;
- const { data, status } = await payrollCheckType();
- if (status && data === "PWD") {
- init(false, () => {
+ // const { data, status } = await payrollCheckType();
+ // if (status && data === "PWD") {
+ // init(false, () => {
getMySalaryBill(Number(salaryInfoId)).then(data => {
this.setState({ mySalaryStore: data });
});
- });
- } else {
- this.setState({ captchaVisible: true });
- }
+ // });
+ // } else {
+ // this.setState({ captchaVisible: true });
+ // }
}
confirmSalaryBill = () => {
@@ -104,10 +105,11 @@ class MySalaryView extends Component {
background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "",
itemTypeList: [employeeInformation, ...salaryGroups]
};
+ // this.props.mySalaryStore -西部信托取消验证
return (
+ store={{ loading: false, hasRight: true }}>
{
}
;
-};
+};
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
index 16f992b3..e5acc97f 100644
--- a/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
+++ b/pc4mobx/hrmSalary/pages/mySalaryBenefits/components/payrollTable/index.js
@@ -5,27 +5,49 @@
* Date: 2023/11/13
*/
import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu } from "antd";
import { mySalaryBillList, mySalaryBillList4Card } from "../../../../apis/mySalaryBenefits";
-import moment from "moment";
+import { payrollCheckType } from "../../../../apis/payroll";
+import Authority from "../../../mySalary/authority";
+import CaptchaModal from "../../../../components/captchaModal";
const getLabel = WeaLocaleProvider.getLabel;
const API = {
mySalaryBillList, mySalaryBillList4Card
};
+@inject("mySalaryStore")
+@observer
class Index extends Component {
constructor(props) {
super(props);
this.state = {
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
- loading: false
+ loading: false, store: { loading: true, hasRight: false }, captchaVisible: false
};
}
- componentDidMount() {
- this.getMySalaryBillList(this.props);
+ async componentDidMount() {
+ const { data, status } = await payrollCheckType();
+ if (status && data === "PWD") {
+ if (window.doCheckSecondaryVerify4ec && !this.props.type) {
+ window.doCheckSecondaryVerify4ec({ mouldCode: "HRM", itemCode: "SALARY" }, (data) => {
+ const { status } = data;
+ if (status === "1") {
+ this.setState({ store: { loading: false, hasRight: true } });
+ this.getMySalaryBillList(this.props);
+ } else {
+ this.setState({ store: { loading: false, hasRight: false } });
+ }
+ });
+ } else {
+ this.getMySalaryBillList(this.props);
+ }
+ } else {
+ this.setState({ captchaVisible: true });
+ }
}
componentWillReceiveProps(nextProps, nextContext) {
@@ -35,7 +57,7 @@ class Index extends Component {
getMySalaryBillList = (props) => {
this.setState({ loading: true });
const { pageInfo } = this.state;
- const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props;
+ const { salaryYearMonth, employeeId, type = "mySalaryBillList" } = props || this.props;
API[type]({ salaryYearMonth, employeeId, ...pageInfo }).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
@@ -59,7 +81,7 @@ class Index extends Component {
};
render() {
- const { dataSource, loading, columns, pageInfo } = this.state;
+ const { dataSource, loading, columns, pageInfo, store, captchaVisible } = this.state;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@@ -77,7 +99,18 @@ class Index extends Component {
}, () => this.getMySalaryBillList(this.props));
}
};
- return (
+ {/*发送验证码*/
+ }
+ if (captchaVisible) {
+ return this.setState({ captchaVisible: false, store: { loading: false, hasRight: false } })}
+ onConfirm={() => {
+ this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList(this.props));
+ }}
+ />;
+ }
+ return (
)
}]}
/>
- );
+ );
}
}
-export default Index;
+export default Index;
\ No newline at end of file
diff --git a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js
index 0ce6b908..e3ed4432 100644
--- a/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js
+++ b/pc4mobx/hrmSalary/pages/mySalaryMobile/index.js
@@ -5,12 +5,18 @@
* Date: 2023/11/10
*/
import React, { Component } from "react";
-import { WeaLocaleProvider, WeaTab } from "ecCom";
+import { WeaLocaleProvider, WeaTab, WeaTools } from "ecCom";
import moment from "moment";
import MobileDatePicker from "./components/mobileDatePicker";
import PayrollList from "./components/payrollList";
import { mySalaryBillList } from "../../apis/mySalaryBenefits";
+import { payrollCheckType } from "../../apis/payroll";
+import CaptchaModal from "../../components/captchaModal";
+import Authority from "../mySalary/authority";
import "./index.less";
+import SecondaryVerify from "../mobilePayroll/secondaryVerify";
+import LoginVerify from "../mobilePayroll/loginVerify";
+import SecondarypwdVerify from "../mobilePayroll/secondarypwdVerify";
const getLabel = WeaLocaleProvider.getLabel;
@@ -19,17 +25,32 @@ class Index extends Component {
super(props);
this.state = {
dataSource: [], loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
+ store: { loading: true, hasRight: false }, captchaVisible: false,
+ visible: false, loginVisible: false, pwdSetVisible: false,
salaryYearMonth: [
- moment(new Date()).subtract(1, 'year').startOf("year").format("YYYY-MM"),
+ moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment().endOf("year").format("YYYY-MM")],
isMore: true //是否还有更多数据
};
}
- componentDidMount() {
- this.getMySalaryBillList();
+ async componentDidMount() {
+ const { data, status } = await payrollCheckType();
+ if (status && data === "PWD") {
+ WeaTools.callApi("/api/encrypt/secondauthsetting/isNeedSecondAuth", "POST", {
+ mouldCode: "HRM", itemCode: "SALARY"
+ }).then(({ status, isNeedSecondAuth }) => {
+ if (status && isNeedSecondAuth) {
+ this.setState({ visible: true });
+ } else {
+ this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList());
+ }
+ });
+ } else {
+ this.setState({ captchaVisible: true });
+ }
const mySalaryMobile = document.getElementById("mySalaryMobile");
- mySalaryMobile.addEventListener("scroll", this.handleScroll, true);
+ mySalaryMobile && mySalaryMobile.addEventListener("scroll", this.handleScroll, true);
}
handleScroll = () => {
@@ -78,9 +99,51 @@ class Index extends Component {
};
render() {
- const { salaryYearMonth, dataSource, isMore, loading } = this.state;
+ const {
+ salaryYearMonth, dataSource, isMore, loading, store, captchaVisible, visible, loginVisible, pwdSetVisible
+ } = this.state;
const [salaryStartYearMonth, salaryEndYearMonth] = salaryYearMonth;
- return (
+ if (visible) {
+ return ( this.setState({ visible: false, loginVisible: true })}
+ onCancel={() => this.setState({
+ visible: false, store: { loading: false, hasRight: false }
+ })}
+ onSuccess={() => {
+ this.setState({
+ visible: false, store: { loading: false, hasRight: true }
+ }, () => this.getMySalaryBillList());
+ }}/>);
+ }
+ if (loginVisible) {
+ return ( this.setState({
+ loginVisible: false, store: { loading: false, hasRight: false }
+ })}
+ onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>);
+ }
+ if (pwdSetVisible) {
+ return ( this.setState({
+ pwdSetVisible: false, store: { loading: false, hasRight: false }
+ })}
+ onSuccess={() => this.setState({
+ pwdSetVisible: false,
+ store: { loading: false, hasRight: true }
+ }, () => this.getMySalaryBillList())}/>);
+ }
+ {/*发送验证码*/
+ }
+ if (captchaVisible) {
+ return this.setState({ captchaVisible: false, store: { loading: false, hasRight: false } })}
+ onConfirm={() => {
+ this.setState({ store: { loading: false, hasRight: true } }, () => this.getMySalaryBillList());
+ }}
+ />;
+ }
+ return (
- );
+ );
}
}
-export default Index;
+export default Index;
\ No newline at end of file