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 (
+ {getLabel(537558, "保存")}
+ ]}
+ >
+ {getSearchs(form, conditions, 1, false)}
+
+ );
+ }
+}
+
+export default GenerateDataDialog;
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
index 4515b509..9b827c7d 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/components/list.js
@@ -10,8 +10,8 @@
import React, { Component } from "react";
import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom";
import { message, Modal, Spin } from "antd";
-import { getIframeParentHeight } from "../../../../util";
import * as API from "../../../../apis/custom-apis/lingyue";
+import GenerateDataDialog from "./generateDataDialog";
const getLabel = WeaLocaleProvider.getLabel;
const interfaceType = {
@@ -22,7 +22,7 @@ const interfaceType = {
batchDel: API.batchDeleteSalaryReport
},
"socialFundSum": {
- list: API.getLYSIReportGenerateList,
+ list: API.getLYSIReportList,
sum: API.getLYSIReportGenerateListSum,
export: API.exportSIReport,
batchDel: API.batchDeleteSIReport
@@ -34,7 +34,7 @@ class List extends Component {
super(props);
this.state = {
dataSource: [], columns: [], pageInfo: { current: 1, pageSize: 10, total: 0 }, loading: false,
- selectedRowKeys: [], sumDataSource: {}, payload: {}
+ selectedRowKeys: [], sumDataSource: {}, payload: {}, visible: false
};
this.handleDebounce = null;
}
@@ -87,7 +87,7 @@ class List extends Component {
this.setState({ loading: false });
if (status) {
const { data: { sumRow: sumDataSource } } = isSum ?
- await interfaceType[type]["sum"](payload) : { data: this.state.sumDataSource };
+ await interfaceType[type]["sum"](payload) : { data: { sumRow: this.state.sumDataSource } };
const { columns, data: result } = data;
const { list: dataSource, pageNum: current, pageSize, total } = result;
this.setState({
@@ -96,7 +96,7 @@ class List extends Component {
}, () => {
onInit();
this.postMessageToChild({
- scrollHeight: 108, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
+ scrollHeight: 195, dataSource, pageInfo: this.state.pageInfo, selectedRowKeys,
unitTableType: "custom_lingyue", columns: traverseCols(columns), showTotalCell: true,
sumDataSource: this.state.sumDataSource
});
@@ -108,6 +108,9 @@ class List extends Component {
const { payload, selectedRowKeys } = this.state;
const { type } = this.props;
switch (key) {
+ case "GENERATE":
+ this.setState({ visible: true });
+ break;
case "EXPORTALL":
WeaLoadingGlobal.start();
const promise = interfaceType[type]["export"](payload);
@@ -137,10 +140,16 @@ class List extends Component {
};
render() {
- const { loading, dataSource } = this.state;
+ const { loading, visible } = this.state;
+ const { type } = this.props;
+ const dom = document.querySelector(".wea-new-top-content");
return (
+ style={{
+ height: dom ? `calc(${parseFloat(dom.style.height)}px - 32px)` : 0,
+ maxHeight: "678px",
+ minHeight: "307.53px"
+ }}>
+ this.setState({ visible: false })}
+ onSearch={this.getLYList}/>
);
}
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
index d02a3caa..e9a2398b 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/layout.js
@@ -16,10 +16,11 @@ const getLabel = WeaLocaleProvider.getLabel;
class Layout extends Component {
render() {
- const { title, query, onChange, listRef } = this.props;
- const { salaryMonth, ffgsqc, isQuery } = query;
+ const { title, query, onChange, listRef, isQuery } = this.props;
+ const { salaryMonth, ffgsqc } = query;
const buttons = [
- ,
+ ,
+ ,
onChange({ ...query, salaryMonth: value, isQuery: !isQuery })}/>,
onChange({ ...query, ffgsqc: value })}
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
index e9033936..16683ca9 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/salarySummary/index.js
@@ -31,7 +31,7 @@ class Index extends Component {
const { query, isQuery } = this.state;
return (
+ listRef={this.listRef} isQuery={isQuery}>
this.listRef = dom}
onInit={() => this.forceUpdate()}/>
diff --git a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
index 74810651..84079dce 100644
--- a/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
+++ b/pc4mobx/hrmSalary/pages/custom-pages/lingyue/socialFundSummary/index.js
@@ -30,7 +30,7 @@ class Index extends Component {
const { query, isQuery } = this.state;
return (
+ listRef={this.listRef} isQuery={isQuery}>
this.listRef = dom}
onInit={() => this.forceUpdate()}/>
diff --git a/pc4mobx/hrmSalary/stores/custom-stores/index.js b/pc4mobx/hrmSalary/stores/custom-stores/index.js
index 7be35b6b..4f9e541f 100644
--- a/pc4mobx/hrmSalary/stores/custom-stores/index.js
+++ b/pc4mobx/hrmSalary/stores/custom-stores/index.js
@@ -1,2 +1,5 @@
+import { LYStore } from "./lingyue";
+
module.exports = {
+ LYStore: new LYStore() //领悦
};
diff --git a/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js b/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js
new file mode 100644
index 00000000..9bce3ac6
--- /dev/null
+++ b/pc4mobx/hrmSalary/stores/custom-stores/lingyue/index.js
@@ -0,0 +1,7 @@
+import { action, observable } from "mobx";
+import { WeaForm } from "comsMobx";
+
+export class LYStore {
+ @observable form = new WeaForm();
+ @action initForm = () => this.form = new WeaForm();
+}