From 83607e1c0d0018cf88bf3afb3dc3434b06f026dc Mon Sep 17 00:00:00 2001
From: lys <971387674@qq.com>
Date: Tue, 15 Apr 2025 16:54:11 +0800
Subject: [PATCH] =?UTF-8?q?feature/2.19.1.2501.01-PC=E7=AB=AFToken?=
=?UTF-8?q?=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/payroll.js | 9 +-
.../checkSecondaryVerifyDialog.js | 93 +++++++++++++++++++
.../hrmSalary/pages/mobilePayroll/index.js | 63 +++++++++----
3 files changed, 147 insertions(+), 18 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js
diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js
index c322c94f..01932e6a 100644
--- a/pc4mobx/hrmSalary/apis/payroll.js
+++ b/pc4mobx/hrmSalary/apis/payroll.js
@@ -206,8 +206,13 @@ export const sendMobileCode = (params) => {
return postFetch("/api/bs/hrmsalary/salaryBill/sendMobileCode", params);
};
//工资单-验证方式
-export const payrollCheckType = params => {
- return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/payrollCheckType", "GET", params);
+export const payrollCheckType = async header => {
+ const res = await fetch(`/api/bs/hrmsalary/salaryBill/payrollCheckType`, {
+ method: "GET",
+ mode: "cors",
+ headers: { "Content-Type": "application/json", ...header }
+ });
+ return await res.json();
};
//工资单-反馈验证
export const feedBackSalaryBill = async params => {
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js
new file mode 100644
index 00000000..b7a492b5
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/checkSecondaryVerifyDialog.js
@@ -0,0 +1,93 @@
+/*
+ * 工资单查看启用二次验证弹框
+ * @Author: 黎永顺
+ * @Date: 2025/4/15
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaDialog, WeaLocaleProvider } from "ecCom";
+import { WeaForm, WeaSwitch } from "comsMobx";
+import { Button, message } from "antd";
+import * as API from "../../apis/mySalaryBenefits";
+import FormInfo from "../../components/FormInfo";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const form = new WeaForm();
+
+class CheckSecondaryVerifyDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false, conditions: [], notSetting: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.initForm();
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) form.initSecVerifyform();
+ }
+
+ initForm = () => {
+ const { salaryBillToken } = this.props;
+ API.getSecondAuthForm({ mouldCode: "HRM", itemCode: "SALARY" }, salaryBillToken)
+ .then(({ conditions, notSetting }) => {
+ this.setState({ conditions: [{ title: "", items: conditions }], notSetting }, () => {
+ form.initFormFields(this.state.conditions);
+ });
+ });
+ };
+ save = () => {
+ const { salaryBillToken } = this.props;
+ form.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = { ...form.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();
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { conditions, loading, notSetting } = this.state;
+ const itemRender = {
+ authCode: (field, textAreaProps, form, formParams) => {
+ return (