custom-联特

This commit is contained in:
lys 2025-04-28 15:58:30 +08:00
parent 68663087ee
commit 90f45a3c7b
3 changed files with 116 additions and 13 deletions

View File

@ -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 <React.Fragment>
{visible && <SecondaryVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSetLogin={() => this.setState({ visible: false, loginVisible: true })}
onSetLogin={(key) => this.setState({ visible: false, [key]: true })}
onSuccess={() => {
setInitEmVerify();
this.getMySalaryBill(getQueryString("id"));
}}/>}
{loginVisible && <LoginVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSetPwdSet={() => this.setState({ loginVisible: false, pwdSetVisible: true })}/>}
{pwdSetVisible && <SecondarypwdVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSuccess={() => this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>}
onSetPwdSet={() => this.setState({
loginVisible: false, loginModifyVisible: false, pwdSetVisible: true
})}/>}
{loginModifyVisible && <LoginVerify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSetPwdSet={() => this.setState({
loginVisible: false, loginModifyVisible: false, pwdModifyVisible: true
})}/>}
{pwdModifyVisible && <SecondarypwdModify {...this.props} salaryBillToken={this.state.salaryBillToken}
onSuccess={() => this.setState({ pwdModifyVisible: false }, () => this.initMobile())}/>}
{/*发送验证码*/}
<CaptchaModal
visible={captchaVisible} id={getQueryString("id")}

View File

@ -63,11 +63,17 @@ class SecondaryVerify extends Component {
return (<React.Fragment>
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
{
notSetting &&
<div style={{ clear: "both", paddingTop: 10 }}>
{getLabel(111, "您还未设置二次验证密码,点击")}
<a href="javascript:void(0);" onClick={this.props.onSetLogin}>{getLabel(111, "设置")}</a>
</div>
notSetting ?
<div style={{ clear: "both", paddingTop: 10 }}>
{getLabel(111, "您还未设置二次验证密码,点击")}
<a href="javascript:void(0);"
onClick={() => this.props.onSetLogin("loginVisible")}>{getLabel(111, "设置")}</a>
</div> :
<div style={{ clear: "both", paddingTop: 10 }}>
{getLabel(111, "二次验证密码已设置,忘记密码点击")}
<a href="javascript:void(0);"
onClick={() => this.props.onSetLogin("loginModifyVisible")}>{getLabel(111, "修改")}</a>
</div>
}
</React.Fragment>);
}

View File

@ -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 (<React.Fragment>
<WeaSwitch fieldConfig={{ ...field, ...textAreaProps }} form={form} formParams={formParams}/>
<img
style={{ height: 30, cursor: "pointer", position: "absolute", left: "118%" }}
src={this.state.src}
onClick={() => {
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=""/>
</React.Fragment>);
}
};
return (<MobileModal title={getLabel(111, "二次验证密码设置")} onConfirm={this.save}>
<FormInfo className="secondarypwd-form" center={false} itemRender={itemRender} form={form}
formFields={secondarypwdCondition}/>
</MobileModal>);
}
}
export default SecondarypwdModify;