diff --git a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js index f197ba27..75e3eb73 100644 --- a/pc4mobx/hrmSalary/apis/mySalaryBenefits.js +++ b/pc4mobx/hrmSalary/apis/mySalaryBenefits.js @@ -45,11 +45,13 @@ export const doSecondAuth = (params, headers) => { export const getPasswordForm = params => { return WeaTools.callApi("/api/hrm/secondarypwd/getPasswordForm", "GET", params); }; -export const checkPassword = params => { - return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); +export const checkPassword = (params, headers) => { + return formHeaderPost("/api/hrm/secondarypwd/checkPassword", "POST", params, headers); + // return WeaTools.callApi("/api/hrm/secondarypwd/checkPassword", "POST", params); }; -export const saveSecondaryPwd = params => { - return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); +export const saveSecondaryPwd = (params, headers) => { + return formHeaderPost("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params, headers); + // return WeaTools.callApi("/api/hrm/secondarypwd/saveSecondaryPwd", "POST", params); }; export const salaryBillGetToken = params => { return postFetch("/api/bs/hrmsalary/salaryBill/getToken", params); diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 5d7b516d..98551065 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -6,7 +6,8 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom"; +import { WeaForm } from "comsMobx"; import { Button, message, Modal } from "antd"; import moment from "moment"; import CalculateQuery from "./components/calculateQuery"; @@ -15,9 +16,15 @@ import CalculateDialog from "./components/calculateDialog"; import ProgressModal from "../../components/progressModal"; import LogDialog from "../../components/logViewModal"; import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; +import FormInfo from "../../components/FormInfo"; +import { queryConditions } from "./config"; +import { getTaxAgentSelectList } from "../../apis/taxAgent"; +import cs from "classnames"; import "./index.less"; +const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; +const form = new WeaForm(); @inject("calculateStore", "taxAgentStore") @observer @@ -31,17 +38,32 @@ class Calculate extends Component { moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"), moment(new Date()).endOf("year").format("YYYY-MM") ] - }, isRefresh: false, logDialogVisible: false, + }, isRefresh: false, logDialogVisible: false, conditions: [], progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, - calcDaialog: { visible: false, title: "" } + calcDaialog: { visible: false, title: "" }, showAdvance: false }; this.timer = null; this.handleDebounce = null; } + async componentDidMount() { + const { data } = await getTaxAgentSelectList(); + this.setState({ + conditions: _.map(queryConditions, item => ({ + ...item, items: _.map(item.items, o => { + o = { ...o, label: getLabel(o.lanId, o.label) }; + if (getKey(o) === "taxAgentIds") { + return { ...o, options: _.map(data, k => ({ key: k.id, showname: k.content })) }; + } + return { ...o }; + }) + })) + }, () => form.initFormFields(this.state.conditions)); + } + renderCalculateOpts = () => { const { taxAgentStore: { PageAndOptAuth } } = this.props; - const { queryParams, isRefresh } = this.state; + const { queryParams, isRefresh, showAdvance } = this.state; const admin = PageAndOptAuth.opts.includes("admin"); let calculateOpts = [ , - this.setState({ - isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, - queryParams: { ...queryParams, ...v } - })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> + this.setState({ showAdvance: !showAdvance })} + onChange={v => this.setState({ + isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, + queryParams: { ...queryParams, ...v } + })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; return !admin ? calculateOpts.slice(1) : calculateOpts; }; @@ -189,7 +212,9 @@ class Calculate extends Component { }; render() { - const { queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions } = this.state; + const { + queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance + } = this.state; return ( } iconBgcolor="#F14A2D" buttons={this.renderCalculateOpts()} className="calculate-main-layout" showDropIcon @@ -201,7 +226,18 @@ class Calculate extends Component { } ]}>
- +
+ +
+ + + +
+
+ this.setState({ calcDaialog: { ...calcDaialog, visible: false }, diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js index 00cd202d..0c74ccd5 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateQuery/index.js @@ -21,11 +21,14 @@ class Index extends Component { this.props.onChange({ dateRange: v })}/>
- this.props.onChange({ name: v })} - onSearch={this.props.onSearch} - /> +
+ this.props.onChange({ name: v })} + onSearch={this.props.onSearch} + /> + {getLabel(111, "高级搜索")} +
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index 5059017f..0b4ea0a0 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -29,12 +29,14 @@ class Index extends Component { } getSalaryAcctList = (props) => { - const { pageInfo } = this.state; - const { queryParams } = props; + const { pageInfo } = this.state, { queryParams, form } = props; + const { taxAgentIds } = form.getFormParams(); const { dateRange, ...extra } = queryParams; const [startMonthStr, endMonthStr] = dateRange || []; const params = { startMonthStr, endMonthStr, ...extra }; - const payload = { ...pageInfo, ...params }; + const payload = { + ...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : [] + }; this.setState({ loading: true }); getSalaryAcctList(payload).then(({ status, data }) => { this.setState({ loading: false }); diff --git a/pc4mobx/hrmSalary/pages/calculate/config.js b/pc4mobx/hrmSalary/pages/calculate/config.js new file mode 100644 index 00000000..02da5b10 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/config.js @@ -0,0 +1,19 @@ +export const queryConditions = [ + { + items: [ + { + conditionType: "SELECT", + domkey: ["taxAgentIds"], + fieldcol: 14, + label: "个税扣缴义务人", + lanI: 111, + multiple: true, + options: [], + labelcol: 6, + value: "", + viewAttr: 2 + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less index 045f4b8c..2e73f6b2 100644 --- a/pc4mobx/hrmSalary/pages/calculate/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/index.less @@ -62,6 +62,24 @@ } } + .advance-custom { + display: flex; + align-items: center; + + & > a { + border-radius: 0; + height: 28px; + position: relative; + color: #474747; + padding: 4px 15px; + background-color: transparent; + display: flex; + align-items: center; + border: 1px solid #d9d9d9; + border-left: none + } + } + .wea-input-focus { margin-top: -4px; } @@ -72,6 +90,32 @@ overflow-y: hidden; } + .advance-calc { + display: none; + background: #FFF; + margin-bottom: 8px; + + .advance-calc-btns { + display: flex; + justify-content: center; + align-items: center; + padding: 15px 0; + border-top: 1px solid #dadada; + + button { + margin-right: 15px; + } + } + + .wea-search-group, .wea-content { + padding: 0; + } + } + + .show-advance-calc { + display: block; + } + .calculate-body { height: 100%; width: 100%; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/conditions.js b/pc4mobx/hrmSalary/pages/mobilePayroll/conditions.js new file mode 100644 index 00000000..3462cb08 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/conditions.js @@ -0,0 +1,87 @@ +export const secondaryVerifyConditions = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["authCode"], + fieldcol: 14, + label: "二次验证密码", + labelcol: 10, + value: "", + otherParams: { + type: "password" + }, + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; +export const loginCondition = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["password"], + fieldcol: 14, + label: "登录密码", + labelcol: 10, + value: "", + otherParams: { + type: "password" + }, + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; +export const secondarypwdCondition = [ + { + items: [ + { + conditionType: "INPUT", + domkey: ["secondaryPwd1"], + fieldcol: 14, + label: "密码", + labelcol: 10, + value: "", + otherParams: { + type: "password", + passwordStrength: true + }, + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["secondaryPwd2"], + fieldcol: 14, + label: "确认密码", + labelcol: 10, + value: "", + otherParams: { + type: "password" + }, + rules: "required|string", + viewAttr: 3 + }, + { + conditionType: "INPUT", + domkey: ["validatecode"], + fieldcol: 14, + label: "验证码", + labelcol: 10, + value: "", + rules: "required|string", + viewAttr: 3 + } + ], + title: "", + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 69d84928..a1756ede 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -2,37 +2,31 @@ import React from "react"; 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"; +import SecondaryVerify from "./secondaryVerify"; +import LoginVerify from "./loginVerify"; +import SecondarypwdVerify from "./secondarypwdVerify"; 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: [] - }, + visible: false, captchaVisible: false, loginVisible: false, pwdSetVisible: false, + mySalaryBillData: { employeeInformation: {}, salaryTemplate: [] }, salaryBillToken: {} }; this.id = ""; @@ -60,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(); @@ -82,12 +71,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(); @@ -96,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({ @@ -132,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("="); @@ -179,76 +140,61 @@ 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, loginVisible, pwdSetVisible + } = 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 && this.setState({ visible: false, loginVisible: true })} + onSuccess={() => { + setInitEmVerify(); + this.getMySalaryBill(getQueryString("id")); + }}/>} + {loginVisible && this.setState({ loginVisible: false, pwdSetVisible: true })}/>} + {pwdSetVisible && this.setState({ pwdSetVisible: false }, () => this.initMobile())}/>} + {/*发送验证码*/} + 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" ? - - - - - - : - -
- - - -
-
- } - this.setState({ captchaVisible: false })} - onConfirm={() => this.props.mySalaryStore.setInitEmVerify()} - /> -
- ); + return ( + {type === "phone" ? + + + + : +
+ + + +
+
} +
); } } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less index 923d3d82..9fd7d4d6 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.less +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.less @@ -39,3 +39,132 @@ } } } + +.am-modal-mask { + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + height: 100%; + z-index: 999; + background-color: rgba(0, 0, 0, .4); +} + +.am-modal-transparent { + width: 80%; +} + +.am-modal-transparent .am-modal-content { + border-radius: 7px; + padding-top: 15px; +} + +.am-modal-content { + position: relative; + background-color: #fff; + border: 0; + background-clip: padding-box; + text-align: center; + height: 100%; + overflow: hidden; +} + +.am-modal-header { + padding: 15px; +} + +.am-modal-title { + margin: 0; + letter-spacing: -.1px; + color: #333; + font-size: 14px; + line-height: 20px; + text-align: center; + height: auto; + max-height: 150px; + overflow-y: auto; +} + +.am-modal-body { + font-size: 14px; + color: #868686; + height: 100%; + line-height: 1.5; + overflow: auto; + padding: 0 15px 30px; + + .wea-search-group, .wea-content, .wea-form-cell { + padding: 0; + } + + .secondarypwd-form { + .wea-form-cell-wrapper { + & > div:last-child { + .ant-col-16 { + width: 37.5% !important; + } + } + } + } +} + +.am-modal-wrap { + position: fixed; + overflow: auto; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: 100%; + z-index: 999; + -webkit-overflow-scrolling: touch; + outline: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-transform: translateZ(1px); + transform: translateZ(1px); +} + +.am-modal-button-group-h { + position: relative; + border-top: 1px solid #ddd; + display: flex; +} + +.am-modal-button-group-h .am-modal-button { + -webkit-touch-callout: none; + flex: 1 1; + box-sizing: border-box; + text-align: center; + text-decoration: none; + outline: none; + color: #55b1f9; + height: 50px; + line-height: 50px; + display: block; + width: auto; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 14px; +} + +.am-modal-button-group-h .am-modal-button:first-child { + color: #333; +} + +.am-modal-button-group-h .am-modal-button:last-child { + position: relative; + border-left: 1px solid #ddd; +} diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js new file mode 100644 index 00000000..90d231ca --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/loginVerify.js @@ -0,0 +1,59 @@ +/* + * 登录密码验证 + * + * @Author: 黎永顺 + * @Date: 2025/4/17 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { WeaForm } from "comsMobx"; +import FormInfo from "../../components/FormInfo"; +import { loginCondition } from "./conditions"; +import MobileModal from "./mobileModal"; +import * as API from "../../apis/mySalaryBenefits"; +import { RSAEcrypt } from "../../util/RSAUtil"; + +const form = new WeaForm(); +const getLabel = WeaLocaleProvider.getLabel; + +class LoginVerify extends Component { + + componentDidMount() { + form.initFormFields(loginCondition); + } + + componentWillUnmount() { + form.resetForm(); + } + + save = async () => { + form.validateForm().then(f => { + if (f.isValid) { + RSAEcrypt("1", { ...form.getFormParams() }, this.props.salaryBillToken) + .then(RSAParam => { + API.checkPassword({ ...RSAParam }).then(({ result }) => { + if (result) { + this.props.onSetPwdSet(); + } else { + form.showError("password", getLabel(504343, "登录密码错误")); + } + }); + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const itemRender = {}; + return ( + + ); + } +} + +export default LoginVerify; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js b/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js new file mode 100644 index 00000000..b6f388db --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/mobileModal.js @@ -0,0 +1,65 @@ +/* + * 自定义移动端弹框组件 + * + * @Author: 黎永顺 + * @Date: 2025/4/16 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { removeElementById } from "../../util"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +class MobileModal extends Component { + componentDidMount() { + this.setMetaViewport(); + } + + setMetaViewport = () => { + // 检查是否已存在 viewport meta 标签 + let viewportMeta = document.querySelector("meta[name=\"viewport\"]"); + if (!viewportMeta) { + // 如果不存在,创建一个新的 meta 标签 + viewportMeta = document.createElement("meta"); + viewportMeta.setAttribute("name", "viewport"); + document.head.appendChild(viewportMeta); + } + // 设置或更新 viewport 的 content 属性 + const content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"; + viewportMeta.setAttribute("content", content); + }; + + render() { + return ( +
+
+
+
+
+
+
+
{this.props.title}
+
+
{this.props.children}
+ +
+
+
+
+
+ ); + } +} + +export default MobileModal; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js new file mode 100644 index 00000000..b5310466 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondaryVerify.js @@ -0,0 +1,82 @@ +/* + * 二次验证密码 + * + * @Author: 黎永顺 + * @Date: 2025/4/16 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { WeaForm, WeaSwitch } from "comsMobx"; +import { message } from "antd"; +import FormInfo from "../../components/FormInfo"; +import { secondaryVerifyConditions } from "./conditions"; +import * as API from "../../apis/mySalaryBenefits"; +import MobileModal from "./mobileModal"; + +const form = new WeaForm(); +const getLabel = WeaLocaleProvider.getLabel; + +class SecondaryVerify extends Component { + constructor(props) { + super(props); + this.state = { notSetting: false }; + } + + componentDidMount() { + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, this.props.salaryBillToken) + .then(({ notSetting }) => { + this.setState({ notSetting }); + }); + form.initFormFields(secondaryVerifyConditions); + } + + componentWillUnmount() { + this.setState({ notSetting: false }, () => form.resetForm()); + } + + doSecondAuth = () => { + form.validateForm().then(f => { + if (f.isValid) { + const { salaryBillToken } = this.props; + API.doSecondAuth({ mouldCode: "HRM", itemCode: "SALARY", ...form.getFormParams() }, salaryBillToken) + .then(({ status, checkStatus, checkMsg }) => { + if (status && checkStatus === "1") { + message.success(checkMsg); + this.props.onSuccess(); + } else { + form.showError("authCode", checkMsg); + } + }); + } else { + f.showErrors(); + } + }); + }; + + render() { + const { notSetting } = this.state; + const itemRender = { + authCode: (field, textAreaProps, form, formParams) => { + return ( + + { + notSetting && +
+ {getLabel(111, "您还未设置二次验证密码,点击")} + {getLabel(111, "设置")} +
+ } +
); + } + }; + return ( + + ); + } +} + +export default SecondaryVerify; diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js new file mode 100644 index 00000000..a8f84027 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/secondarypwdVerify.js @@ -0,0 +1,91 @@ +/* + * 二次验证密码设置 + * + * @Author: 黎永顺 + * @Date: 2025/4/17 + * @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 SecondarypwdVerify 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 SecondarypwdVerify; diff --git a/pc4mobx/hrmSalary/pages/mySalary/authority.js b/pc4mobx/hrmSalary/pages/mySalary/authority.js index 00a74712..ec098fc2 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/authority.js +++ b/pc4mobx/hrmSalary/pages/mySalary/authority.js @@ -9,7 +9,6 @@ export default class Authority extends React.Component { render() { const { store } = this.props; const { loading, hasRight } = store; - const style = { position: "absolute", top: "50%", diff --git a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less index 7eae1948..9a7c033c 100644 --- a/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less +++ b/pc4mobx/hrmSalary/pages/payroll/templatePreview/index.less @@ -173,8 +173,8 @@ .ph-switch { height: 100%; - margin: 0 auto; - text-align: center; + display: flex; + justify-content: center; .active, .phs-btn:hover { background-color: rgba(0, 0, 0, .15); @@ -184,8 +184,9 @@ .phs-btn { height: 50px; min-width: 88px; - line-height: 50px; - display: inline-block; + display: flex; + justify-content: center; + align-items: center; color: #fff; padding: 0 15px; cursor: pointer; diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js index 11be8705..337096c1 100644 --- a/pc4mobx/hrmSalary/util/index.js +++ b/pc4mobx/hrmSalary/util/index.js @@ -152,3 +152,7 @@ export const getIframeParentHeight = (selector, total, extraHeight) => { } return height; }; +export const removeElementById = (id) => { + const element = document.getElementById(id); + if (element) element.remove(); +};