diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js index 47283643..29aad32b 100644 --- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js +++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/ly_checkSecondaryVerifyDialog.js @@ -10,12 +10,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider } from "ecCom"; +import { WeaSwitch } from "comsMobx"; import { Button, message } from "antd"; -import { vouchersConditions } from "./conditions"; -import { commonEnumList } from "../../../../apis/ruleconfig"; -import { convertToUrlString } from "../../../../util/url"; -import { getSearchs } from "../../../../util"; -import "../index.less"; +import FormInfo from "../../../../components/FormInfo"; +import * as API from "../../../../apis/mySalaryBenefits"; const getLabel = WeaLocaleProvider.getLabel; @@ -25,7 +23,7 @@ class LyCheckSecondaryVerifyDialog extends Component { constructor(props) { super(props); this.state = { - loading: false, conditions: [] + loading: false, conditions: [], notSetting: false }; } @@ -35,45 +33,29 @@ class LyCheckSecondaryVerifyDialog extends Component { } initLYForm = () => { - const { type } = this.props; - commonEnumList({ enumClass: "com.engine.salary.enums.ly.LyPZTypeEnum" }) - .then(({ status, data }) => { - type === "salarySum" && (data = data.filter(item => !["SBJTPZ", "SBFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum))); - type === "socialFundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ", "GJJJTPZ", "GJJFFPZ"].includes(item.enum))); - type === "fundSum" && (data = data.filter(item => !["XZJTPZ", "XZFFPZ", "SBJTPZ", "SBFFPZ"].includes(item.enum))); - if (status) { - this.setState({ - conditions: _.map(vouchersConditions, item => ({ - ...item, items: _.map(item.items, o => ({ - ...o, label: getLabel(o.lanId, o.label), - options: _.map(data, item => ({ key: String(item.value), showname: item.defaultLabel })) - })) - })) - }, () => { - const { LYStore: { form } } = this.props; - form.initFormFields(this.state.conditions); - }); - } + const { salaryBillToken } = this.props; + API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken) + .then(({ conditions, notSetting }) => { + this.setState({ conditions: [{ title: "", items: conditions }], notSetting }, () => { + const { LYStore: { secVerifyform } } = this.props; + secVerifyform.initFormFields(this.state.conditions); + }); }); }; save = () => { - const { LYStore: { form }, ffgsqc, salaryMonth, ffgsqcLabel } = this.props; - let payload = { ...form.getFormParams(), salaryMonth, ffgsqc }; - if (!salaryMonth) { - message.warning(getLabel(111, "薪资所属月参数不能为空")); - return; - } - if (!ffgsqc) { - message.warning(getLabel(111, `${ffgsqcLabel}参数不能为空`)); - return; - } - form.validateForm().then(f => { + const { LYStore: { secVerifyform }, salaryBillToken } = this.props; + secVerifyform.validateForm().then(f => { if (f.isValid) { - const { ffgsqc } = payload; - _.forEach(ffgsqc.split(","), item => { - payload = { ...payload, ffgsqc: item }; - window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/customPage_vouchers_lingyue?${convertToUrlString(payload)}`, "_blank"); - }); + const payload = { ...secVerifyform.getFormParams() }; + API.doSecondAuth({ ...payload, mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken) + .then(({ status, checkStatus, checkMsg }) => { + if (status && checkStatus === "1") { + message.success(checkMsg); + this.props.onCancel(this.props.onSuccess); + } else { + message.error(checkMsg); + } + }); } else { f.showErrors(); } @@ -81,16 +63,32 @@ class LyCheckSecondaryVerifyDialog extends Component { }; render() { - const { conditions, loading } = this.state; - const { LYStore: { form } } = this.props; + const { conditions, loading, notSetting } = this.state, { LYStore: { secVerifyform } } = this.props; + const itemRender = { + authCode: (field, textAreaProps, form, formParams) => { + return ( + + { + notSetting &&
+ {getLabel("111", "您还未设置二次验证密码,请先在系统中设置验证密码")} + {/* this.setState({ pwdSetVisible: true })}>{getLabel("30747", "设置")}*/} +
+ } +
); + } + }; return ( {getLabel(111, "确定")} - ]} - > -
{getSearchs(form, conditions, 1, false)}
+ {...this.props} style={{ width: 550, height: notSetting ? 80 + 26 : 80 }} initLoadCss + title={getLabel(111, "身份验证")} buttons={[ + + ]}> +
+ + +
); } diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js index 466a5f4c..0f072dca 100644 --- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js +++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js @@ -49,9 +49,9 @@ export default class MobilePayroll extends React.Component { if (type !== "phone") { const { data, status } = await payrollCheckType(); if (status && data === "PWD") { - init(false, () => this.getMySalaryBill(this.id)); + // init(false, () => this.getMySalaryBill(this.id)); //领悦二开 - // await this.initLY(); + await this.initLY(); } else { this.setState({ captchaVisible: true }); } @@ -60,6 +60,7 @@ export default class MobilePayroll extends React.Component { } initLY = async () => { + const { mySalaryStore: { setInitEmVerify } } = this.props; const params = this.getUrlkey(); const { data } = await salaryBillGetToken({ id: _.pick(params, ["id"]).id, @@ -201,7 +202,7 @@ export default class MobilePayroll extends React.Component { }; render() { - const { mySalaryStore: { clearLoading, pwdForm } } = this.props; + const { mySalaryStore: { clearLoading, pwdForm, setInitEmVerify } } = this.props; const { salaryBillToken, visible, captchaVisible, notSetting, pwdSetVisible, LYCheckSecVerify } = this.state; const type = getQueryString("type"); if (_.isEmpty(toJS(this.props.mySalaryStore.mySalaryBill))) return
@@ -229,7 +230,11 @@ export default class MobilePayroll extends React.Component { this.setState({ pwdSetVisible: false })}/> {/*领悦二开*/} this.setState({ LYCheckSecVerify: false })}/> + onCancel={(callback) => this.setState({ LYCheckSecVerify: false }, () => callback && callback())} + onSuccess={() => { + this.getMySalaryBill(getQueryString("id")); + setInitEmVerify(); + }}/>
; const { salaryTemplate, salaryGroups, employeeInformation,