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 (