From e333c34ff4e43b92621507fac8763c2ad4135d56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Wed, 28 Aug 2024 16:25:15 +0800
Subject: [PATCH] =?UTF-8?q?custom/=E9=A2=86=E6=82=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../apis/custom-apis/lingyue/index.js | 8 +-
.../lingyue/components/conditions.js | 20 +++++
.../lingyue/components/generateDataDialog.js | 87 +++++++++++++++++++
.../custom-pages/lingyue/components/list.js | 25 ++++--
.../pages/custom-pages/lingyue/layout.js | 7 +-
.../lingyue/salarySummary/index.js | 2 +-
.../lingyue/socialFundSummary/index.js | 2 +-
.../hrmSalary/stores/custom-stores/index.js | 3 +
.../stores/custom-stores/lingyue/index.js | 7 ++
9 files changed, 148 insertions(+), 13 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js
create mode 100644 pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateDataDialog.js
create mode 100644 pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js
diff --git a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js
index fcf7f20b..b86379c8 100644
--- a/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js
+++ b/pc4mobx/hrmSalary/apis/custom-apis/lingyue/index.js
@@ -1,6 +1,9 @@
import { postExportFetch, postFetch } from "../../../util/request";
// 薪资项目调整记录列表
+export const generateSalaryReport = (params) => {
+ return postFetch("/api/bs/hrmsalary/ly/salaryReport/generate", params);
+};
export const getLYSalaryReportList = (params) => {
return postFetch("/api/bs/hrmsalary/ly/salaryReport/list", params);
};
@@ -13,9 +16,12 @@ export const batchDeleteSalaryReport = (params) => {
export const exportSalaryReport = (params) => {
return postExportFetch("/api/bs/hrmsalary/ly/salaryReport/export", params);
};
-export const getLYSIReportGenerateList = (params) => {
+export const generateSIReport = (params) => {
return postFetch("/api/bs/hrmsalary/ly/SIReport/generate", params);
};
+export const getLYSIReportList = (params) => {
+ return postFetch("/api/bs/hrmsalary/ly/SIReport/list", params);
+};
export const getLYSIReportGenerateListSum = (params) => {
return postFetch("/api/bs/hrmsalary/ly/SIReport/sum", params);
};
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js
new file mode 100644
index 00000000..6108129c
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/conditions.js
@@ -0,0 +1,20 @@
+export const conditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "MONTHPICKER",
+ domkey: ["salaryMonth"],
+ fieldcol: 18,
+ label: "薪资所属月",
+ lanId: 111,
+ labelcol: 6,
+ rules: "required|string",
+ value: "",
+ viewAttr: 3
+ }
+ ],
+ title: "",
+ defaultshow: true
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateDataDialog.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateDataDialog.js
new file mode 100644
index 00000000..3ce2cbd2
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/generateDataDialog.js
@@ -0,0 +1,87 @@
+/*
+ * 领悦报表生成数据弹窗
+ *
+ * @Author: 黎永顺
+ * @Date: 2024/8/28
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaDialog, WeaLocaleProvider } from "ecCom";
+import { Button, message } from "antd";
+import { getSearchs } from "../../../../util";
+import * as API from "../../../../apis/custom-apis/lingyue";
+import { conditions } from "./conditions";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const APIFOX = {
+ "salarySum": API.generateSalaryReport,
+ "socialFundSum": API.generateSIReport
+};
+
+@inject("LYStore")
+@observer
+class GenerateDataDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false, conditions: []
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.initLYForm();
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.LYStore.initForm();
+ }
+
+ initLYForm = () => {
+ this.setState({
+ conditions: _.map(conditions, item => ({
+ ...item, items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
+ }))
+ }, () => {
+ const { LYStore: { form } } = this.props;
+ form.initFormFields(this.state.conditions);
+ });
+ };
+
+ save = () => {
+ const { LYStore: { form }, type, onSearch } = this.props;
+ form.validateForm().then(f => {
+ if (f.isValid) {
+ this.setState({ loading: true });
+ const payload = { ...form.getFormParams() };
+ APIFOX[type](payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(30700, "操作成功!"));
+ this.props.onCancel(onSearch());
+ } else {
+ message.error(errormsg);
+ }
+ });
+ } else {
+ f.showErrors();
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+
+ render() {
+ const { conditions, loading } = this.state;
+ const { LYStore: { form } } = this.props;
+ return (
+