From b01d2806442c8bbc553f34b23a079de77e8f3ac7 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Thu, 17 Apr 2025 17:12:53 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.19.1.2501.01-=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=9F=A5=E7=9C=8B=E5=B7=A5=E8=B5=84=E5=8D=95=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/mobilePayroll/index.js | 165 +++++------------- .../pages/mobilePayroll/loginVerify.js | 2 +- .../pages/mobilePayroll/secondaryVerify.js | 5 +- .../pages/mobilePayroll/secondarypwdVerify.js | 2 +- 4 files changed, 51 insertions(+), 123 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 165253ad..389afbcd 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -1,17 +1,15 @@ import React from "react"; -import ReactDom from "react-dom"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { getQueryString } from "../../util/url"; -import { WeaDialog, WeaError, WeaInput, WeaLocaleProvider } from "ecCom"; -import { Button, message, Modal } from "antd"; +import { WeaLocaleProvider } from "ecCom"; +import { message, Modal } from "antd"; import Authority from "../mySalary/authority"; import "../payroll/templatePreview/index.less"; import * as API from "../../apis/mySalaryBenefits"; import { salaryBillGetToken } from "../../apis/mySalaryBenefits"; import { confirmSalaryBill, feedBackSalaryBill, payrollCheckType } from "../../apis/payroll"; import CaptchaModal from "../../components/captchaModal"; -import PassSetDialog from "./passSetDialog"; import { ConfirmBtns } from "../mySalary/mySalaryView"; import Content from "../../components/pcTemplate/content"; import MobileTemplate from "../../components/mobileTemplate"; @@ -21,21 +19,14 @@ import "../mySalary/index.less"; const getLabel = WeaLocaleProvider.getLabel; -@inject("mySalaryStore") -@observer +@inject("mySalaryStore") @observer export default class MobilePayroll extends React.Component { constructor(props) { super(props); this.state = { - pwdSetVisible: false, visible: false, captchaVisible: false, - authCode: "", - notSetting: false, - mySalaryBillData: { - employeeInformation: {}, - salaryTemplate: [] - }, + mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] }, salaryBillToken: {} }; this.id = ""; @@ -63,12 +54,7 @@ export default class MobilePayroll extends React.Component { API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) .then(({ status, isNeedSecondAuth }) => { if (status && isNeedSecondAuth) { - this.setState({ visible: true }, () => { - API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) - .then(({ status, notSetting }) => { - this.setState({ notSetting }); - }); - }); + this.setState({ visible: true }); } else { this.getMySalaryBill(getQueryString("id")); setInitEmVerify(); @@ -85,19 +71,7 @@ export default class MobilePayroll extends React.Component { API.isNeedSecondPwdVerify({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) .then(({ status, isNeedSecondAuth }) => { if (status && isNeedSecondAuth) { - ReactDom.render( { - setInitEmVerify(); - removeElementById("am-modal-container"); - this.getMySalaryBill(getQueryString("id")); - }}/>, document.getElementById("container")); - // return; - // this.setState({ visible: true }, () => { - // API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.state.salaryBillToken) - // .then(({ status, notSetting }) => { - // this.setState({ notSetting }); - // }); - // }); + this.setState({ visible: true }); } else { this.getMySalaryBill(getQueryString("id")); setInitEmVerify(); @@ -106,33 +80,12 @@ export default class MobilePayroll extends React.Component { }); } }; - doSecondAuth = () => { - const { salaryBillToken } = this.state; - const { mySalaryStore: { setInitEmVerify } } = this.props; - if (!this.state.authCode) { - this.refs.weaError.showError(); - return; - } - API.doSecondAuth({ - authCode: this.state.authCode, mouldCode: "HRM", itemCode: "SALARY" - }, salaryBillToken).then(({ status, checkStatus, checkMsg }) => { - if (status && checkStatus === "1") { - message.success(checkMsg); - setInitEmVerify(); - this.setState({ visible: false }); - this.getMySalaryBill(getQueryString("id")); - } else { - message.error(checkMsg); - } - }); - }; getMySalaryBill = (salaryInfoId) => { const { salaryBillToken } = this.state; const { mySalaryStore: { getMySalaryBill } } = this.props; const params = this.getUrlkey(); const payload = { - salaryInfoId, header: salaryBillToken, - ..._.pick(params, ["recipient"]) + salaryInfoId, header: salaryBillToken, ..._.pick(params, ["recipient"]) }; getMySalaryBill(payload).then(result => { this.setState({ @@ -142,10 +95,8 @@ export default class MobilePayroll extends React.Component { }; getUrlkey = () => { let url = window.location.href; - let params = {}, - arr = url.split("?"); - if (arr.length <= 1) - return params; + let params = {}, arr = url.split("?"); + if (arr.length <= 1) return params; arr = arr[1].split("&"); for (var i = 0, l = arr.length; i < l; i++) { var a = arr[i].split("="); @@ -189,77 +140,55 @@ export default class MobilePayroll extends React.Component { }; render() { - const { mySalaryStore: { clearLoading, pwdForm } } = this.props; - const { mySalaryBillData, visible, captchaVisible, notSetting, pwdSetVisible } = this.state; + const { mySalaryStore: { setInitEmVerify } } = this.props, { captchaVisible, visible } = this.state; const type = getQueryString("type"); - if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return
- this.setState({ visible: false }, () => clearLoading())} - title="请输入二次验证密码" visible={visible} initLoadCss - className="verifyWrapper" - hasScroll buttons={[ - - ]} - > - - this.setState({ authCode })}/> - - { - notSetting && -
- {getLabel("514970", "您还未设置二次验证密码,点击")} - this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")} -
- } -
- this.setState({ pwdSetVisible: false })}/> + if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return + {visible && { + setInitEmVerify(); + // removeElementById("am-modal-container"); + this.getMySalaryBill(getQueryString("id")); + }}/>} {/*发送验证码*/} this.setState({ captchaVisible: false })} onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} /> -
; + ; const { - salaryTemplate, salaryGroups, employeeInformation, - sendTime, confirmStatus, showAck, showFeedback + salaryTemplate, salaryGroups, employeeInformation, sendTime, confirmStatus, showAck, showFeedback } = toJS(this.props.mySalaryStore.mySalaryBill); const salaryProps = { - theme: salaryTemplate.theme, tip: salaryTemplate.textContent, sendTime, - background: salaryTemplate.background, tipPosi: salaryTemplate.textContentPosition || "", + theme: salaryTemplate.theme, + tip: salaryTemplate.textContent, + sendTime, + background: salaryTemplate.background, + tipPosi: salaryTemplate.textContentPosition || "", itemTypeList: [employeeInformation, ...salaryGroups] }; - return ( - - { - type === "phone" ? - - - - - - : - -
- - - -
-
- } -
- ); + return ( + {type === "phone" ? + + + + : +
+ + + +
+
} +
); } } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js index ad862dcf..33fd761b 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js @@ -37,7 +37,7 @@ class LoginVerify extends Component { RSAEcrypt("1", { ...form.getFormParams() }).then(RSAParam => { API.checkPassword({ ...RSAParam }).then(({ result }) => { if (result) { - ReactDom.render(, document.body); + ReactDom.render(, document.getElementById("container")); } else { form.showError("password", getLabel(504343, "登录密码错误")); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js index c80215a4..a92fd378 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js @@ -42,12 +42,11 @@ class SecondaryVerify extends Component { doSecondAuth = () => { form.validateForm().then(f => { if (f.isValid) { - const { mySalaryStore: { setInitEmVerify }, salaryBillToken } = this.props; + const { salaryBillToken } = this.props; API.doSecondAuth({ mouldCode: "HRM", itemCode: "SALARY", ...form.getFormParams() }, salaryBillToken) .then(({ status, checkStatus, checkMsg }) => { if (status && checkStatus === "1") { message.success(checkMsg); - setInitEmVerify(); this.props.onSuccess(); } else { form.showError("authCode", checkMsg); @@ -59,7 +58,7 @@ class SecondaryVerify extends Component { }); }; handleSetSecondaryPassword = () => { - ReactDom.render(, document.body); + ReactDom.render(, document.getElementById("container")); }; render() { diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js index 5a5d58cd..00e75d22 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js @@ -51,7 +51,7 @@ class SecondarypwdVerify extends Component { API.saveSecondaryPwd({ ...RSAParam, validatecode }).then(({ sign, message: msg }) => { if (sign === "1") { message.success(msg); - ReactDom.render(, document.body); + ReactDom.render(, document.getElementById("container")); } else { form.showError("validatecode", msg); this.setState({ num: this.state.num + 1 }, () => {