From 90f45a3c7b088697df95c46a2d5d0dca3ff0efdf Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 28 Apr 2025 15:58:30 +0800 Subject: [PATCH] =?UTF-8?q?custom-=E8=81=94=E7=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/mobilePayroll/index.js | 22 +++-- .../pages/mobilePayroll/secondaryVerify.js | 16 +++- .../pages/mobilePayroll/secondarypwdModify.js | 91 +++++++++++++++++++ 3 files changed, 116 insertions(+), 13 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index a1756ede..ab9b34d0 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -14,8 +14,8 @@ import { ConfirmBtns } from "../mySalary/mySalaryView"; import Content from "../../components/pcTemplate/content"; import MobileTemplate from "../../components/mobileTemplate"; import SecondaryVerify from "./secondaryVerify"; +import SecondarypwdModify from "./secondarypwdModify"; import LoginVerify from "./loginVerify"; -import SecondarypwdVerify from "./secondarypwdVerify"; import "../mySalary/index.less"; const getLabel = WeaLocaleProvider.getLabel; @@ -25,8 +25,8 @@ export default class MobilePayroll extends React.Component { constructor(props) { super(props); this.state = { - visible: false, captchaVisible: false, loginVisible: false, pwdSetVisible: false, - mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] }, + visible: false, captchaVisible: false, loginVisible: false, loginModifyVisible: false, pwdSetVisible: false, + pwdModifyVisible: false, mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] }, salaryBillToken: {} }; this.id = ""; @@ -141,20 +141,26 @@ export default class MobilePayroll extends React.Component { render() { const { mySalaryStore: { setInitEmVerify } } = this.props, { - captchaVisible, visible, loginVisible, pwdSetVisible + captchaVisible, visible, loginVisible, loginModifyVisible, pwdSetVisible, pwdModifyVisible } = this.state; const type = getQueryString("type"); if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return {visible && this.setState({ visible: false, loginVisible: true })} + onSetLogin={(key) => this.setState({ visible: false, [key]: true })} onSuccess={() => { setInitEmVerify(); this.getMySalaryBill(getQueryString("id")); }}/>} {loginVisible && this.setState({ loginVisible: false, pwdSetVisible: true })}/>} - {pwdSetVisible && this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>} + onSetPwdSet={() => this.setState({ + loginVisible: false, loginModifyVisible: false, pwdSetVisible: true + })}/>} + {loginModifyVisible && this.setState({ + loginVisible: false, loginModifyVisible: false, pwdModifyVisible: true + })}/>} + {pwdModifyVisible && this.setState({ pwdModifyVisible: false }, () => this.initMobile())}/>} {/*发送验证码*/} { - notSetting && - - {getLabel(111, "您还未设置二次验证密码,点击")} - {getLabel(111, "设置")} - + notSetting ? + + {getLabel(111, "您还未设置二次验证密码,点击")} + this.props.onSetLogin("loginVisible")}>{getLabel(111, "设置")} + : + + {getLabel(111, "二次验证密码已设置,忘记密码点击")} + this.props.onSetLogin("loginModifyVisible")}>{getLabel(111, "修改")} + } ); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js new file mode 100644 index 00000000..3777ee0f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdModify.js @@ -0,0 +1,91 @@ +/* + * 联特薪酬工资单查看二开 + * 二次验证密码修改 + * @Author: 黎永顺 + * @Date: 2025/4/28 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { message } from "antd"; +import { WeaForm, WeaSwitch } from "comsMobx"; +import FormInfo from "../../components/FormInfo"; +import { secondarypwdCondition } from "./conditions"; +import * as API from "../../apis/mySalaryBenefits"; +import MobileModal from "./mobileModal"; +import { RSAEcrypt } from "../../util/RSAUtil"; + +const form = new WeaForm(); +const getLabel = WeaLocaleProvider.getLabel; + +class SecondarypwdModify extends Component { + constructor(props) { + super(props); + this.state = { + src: (window.ecologyContentPath || "") + "/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4", + num: 0 + }; + } + + componentDidMount() { + form.initFormFields(secondarypwdCondition); + } + + componentWillUnmount() { + form.resetForm(); + } + + save = async () => { + form.validateForm().then(f => { + if (f.isValid) { + const { secondaryPwd1, secondaryPwd2, validatecode } = form.getFormParams(); + if (secondaryPwd1 !== secondaryPwd2) { + form.showError("secondaryPwd2", getLabel(504376, "密码确认不正确!")); + return; + } + RSAEcrypt("1", { secondaryPwd1, secondaryPwd2 }).then(RSAParam => { + API.saveSecondaryPwd({ ...RSAParam, validatecode }, this.props.salaryBillToken) + .then(({ sign, message: msg }) => { + if (sign === "1") { + message.success(msg); + this.props.onSuccess(); + } else { + form.showError("validatecode", msg); + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + } + }); + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const itemRender = { + validatecode: (field, textAreaProps, form, formParams) => { + return ( + + { + this.setState({ num: this.state.num + 1 }, () => { + this.setState({ src: `${window.ecologyContentPath || ""}/weaver/weaver.file.MakeValidateCode?notneedvalidate=1&isView=1&validatetype=0&validatenum=4&seriesnum_=${this.state.num}` }); + }); + }} alt=""/> + ); + } + }; + return ( + + ); + } +} + +export default SecondarypwdModify;