From f771d2eaccfc615ab7e1c940743005c83d5bab7f Mon Sep 17 00:00:00 2001
From: lys <971387674@qq.com>
Date: Wed, 4 Dec 2024 10:46:25 +0800
Subject: [PATCH] =?UTF-8?q?feature/2.17.1.2411.01-=E8=96=AA=E9=85=AC?=
=?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=96=AA=E8=B5=84=E6=98=8E=E7=BB=86=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E6=A8=A1=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/customTransferDialog.js | 49 +++++++++--
.../components/CustomBrowser/index.less | 14 ++++
.../components/salaryDetails.js | 82 ++++++++++---------
.../components/salaryTempMangerDialog.js | 22 +++++
4 files changed, 118 insertions(+), 49 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
index 25957acb..6d2a8f6f 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/components/customTransferDialog.js
@@ -8,7 +8,7 @@
* @description:
*/
import React, { Component } from "react";
-import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll } from "ecCom";
+import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaNewScroll, WeaTable } from "ecCom";
import { Button, Col, Row, Spin } from "antd";
import CustomBrowserMutiLeft from "./customBrowserMutiLeft";
import CustomBrowserMutiRight from "./customBrowserMutiRight";
@@ -22,8 +22,8 @@ class CustomTransferDialog extends Component {
constructor(props) {
super(props);
this.state = {
- loading: false, listDatas: [],
- query: { [props.searchParamsKey]: "" },
+ loading: false, listDatas: [], columns: [], selectedRowKeys: [], pageInfo: { current: 1, pageSize: 10, total: 0 },
+ query: props.searchParamsKey ? { [props.searchParamsKey]: "" } : {},
leftListSelectedKeys: [], // 左侧table选择的keys
leftListSelectedData: [], // 左侧table选择的数据
rightCheckedKeys: [], //右侧选择的keys
@@ -50,16 +50,18 @@ class CustomTransferDialog extends Component {
}
getData = (init = false, props) => {
- const { query } = this.state;
- const { completeURL, convertDatasource, dataParams = {} } = props || this.props;
+ const { query, pageInfo } = this.state;
+ const { completeURL, convertDatasource, dataParams = {}, dialogType } = props || this.props;
let payload = { ...dataParams, ...query };
+ dialogType === "table" && (payload = { ...payload, ...pageInfo });
this.setState({ loading: true });
postFetch(completeURL, payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status && data.list) {
const { pageNum: current, pageSize, total } = data;
this.setState({
- listDatas: convertDatasource ? convertDatasource(data.list) : data.list
+ listDatas: convertDatasource ? convertDatasource(data.list) : data.list, columns: data.columns,
+ pageInfo: { ...pageInfo, current, pageSize, total }
});
} else {
this.setState({
@@ -132,15 +134,18 @@ class CustomTransferDialog extends Component {
};
renderTitle = () => {
return (
-
{getLabel(111, "数据选择")}
+
{this.props.title || getLabel(111, "数据选择")}
{this.props.titleOptsComs}
);
};
render() {
- const { loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys } = this.state;
const {
- searchParamsKey, saveLoading, buttons = [
+ loading, listDatas, query, leftListSelectedKeys, rightDatas, rightCheckedKeys, pageInfo, selectedRowKeys,
+ columns
+ } = this.state;
+ const {
+ searchParamsKey, saveLoading, dialogType = "", rowKey, buttons = [
,
@@ -197,6 +202,32 @@ class CustomTransferDialog extends Component {
;
+ if (dialogType === "table") {
+ const sheight = this.dialog ? this.dialog.state.height - 116 : 260;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
+ showQuickJumper: true,
+ showSizeChanger: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onShowSizeChange: (current, pageSize) => {
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize }
+ }, () => this.getData());
+ },
+ onChange: current => {
+ this.setState({ pageInfo: { ...pageInfo, current } }, () => this.getData());
+ }
+ };
+ const rowSelection = {
+ selectedRowKeys,
+ onChange: selectedRowKeys => this.setState({ selectedRowKeys })
+ };
+ dom =
+
+
;
+ }
return (
this.dialog = dom} title={this.renderTitle()}
diff --git a/pc4mobx/hrmSalary/components/CustomBrowser/index.less b/pc4mobx/hrmSalary/components/CustomBrowser/index.less
index d4d61a16..a4818c60 100644
--- a/pc4mobx/hrmSalary/components/CustomBrowser/index.less
+++ b/pc4mobx/hrmSalary/components/CustomBrowser/index.less
@@ -3,6 +3,20 @@
display: flex;
justify-content: space-between;
align-items: center;
+
+ .wea-select, .ant-select-selection, .ant-select {
+ width: 100%;
+ }
+
+ .wea-select {
+ display: inline-block;
+ position: relative;
+ }
+
+ .ant-select-selection {
+ height: 30px;
+ border-radius: 0;
+ }
}
.wea-hr-muti-input-table {
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
index 26e67c3c..0c7f9b7d 100644
--- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js
@@ -13,11 +13,11 @@ import { getIframeParentHeight } from "../../../util";
import { sysConfCodeRule } from "../../../apis/ruleconfig";
import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
import SalaryDetailsTempDialog from "./salaryDetailsTempDialog";
+import SalaryTempMangerDialog from "./salaryTempMangerDialog";
import { MonthRangePicker } from "../../reportView/components/statisticalMicroSettingsSlide";
import AdvanceInputBtn from "../components/advanceInputBtn";
import SearchPannel from "../components/searchPannel";
import * as API from "../../../apis/statistics";
-import { resetPageListSetting } from "../../../apis/statistics";
import cs from "classnames";
import "../index.less";
@@ -42,7 +42,11 @@ class SalaryDetails extends Component {
checked: this.converCheckedCol(datas)
};
},
- type: "default"
+ dialogType: "temp"
+ },
+ tempManageDialog: { //模板管理
+ visible: false, completeURL: "", dialogType: "table",
+ dataParams: { page: "salary_details_report" }
}
};
}
@@ -172,9 +176,8 @@ class SalaryDetails extends Component {
};
handleSetDefCols = (params = {}) => this.setState({
transferDialog: {
- ...this.state.transferDialog, visible: true, type: "temp",
- dataParams: { ...this.state.transferDialog.dataParams, ...params },
- completeURL: "/api/bs/hrmsalary/common/pageList/template/get"
+ ...this.state.transferDialog, visible: true, dataParams: { ...this.state.transferDialog.dataParams, ...params },
+ completeURL: "/api/bs/hrmsalary/common/pageList/template/get", dialogType: "temp"
}
}, () => this.getPageListTemplatelist());
converCheckedCol = (data) => {
@@ -196,17 +199,20 @@ class SalaryDetails extends Component {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({
- transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
+ transferDialog: { ...this.state.transferDialog, visible: false, dialogType: "temp" }
}, () => this.getSalaryList());
} else {
message.error(errormsg);
}
});
};
- handelAddTemp = (templateId) => {
+ handelAddTemp = (templateId = "") => {
const { tempDialog, tempPageList } = this.state;
this.setState({
- tempDialog: { ...tempDialog, id: templateId, template: _.find(tempPageList, o => o.key === templateId) }
+ tempDialog: {
+ ...tempDialog, visible: true, setting: _.map(this.transferRef.state.rightDatas, o => o.id)
+ // template: _.find(tempPageList, o => o.key === templateId)
+ }
});
};
changePageListTemplate = (templateId) => {
@@ -229,23 +235,11 @@ class SalaryDetails extends Component {
});
});
};
- resetColsSetting = () => {
- resetPageListSetting({ page: "salary_details_report" }).then(({ status, errormsg }) => {
- if (status) {
- message.success(getLabel(111, "操作成功!"));
- this.setState({
- transferDialog: { ...this.state.transferDialog, visible: false, type: "default" }
- }, () => this.getSalaryList());
- } else {
- message.error(errormsg);
- }
- });
- };
render() {
- const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId } = this.state;
- const { attendanceStore: { tableStore }, dateRange, showSearchAd, salaryDetailShowType } = this.props;
- const { dataParams: { defaultSetting } } = transferDialog;
+ const { loading, dataSource, transferDialog, tempDialog, tempPageList, templateId, tempManageDialog } = this.state;
+ const { dateRange, showSearchAd } = this.props;
+ const { dialogType } = transferDialog;
return (
@@ -273,29 +267,37 @@ class SalaryDetails extends Component {
{/*/>*/}
{/*默认显示列,薪资模板列表*/}
this.transferRef = dom}
- buttons={[
- ,
-
- ]}
- titleOptsComs={
- }
onCancel={() => this.setState({
- transferDialog: {
- ...transferDialog, completeURL: "", visible: false, type: "default"
- }
- })}/>
+ transferDialog: { ...transferDialog, completeURL: "", visible: false }
+ })}
+ buttons={
+ dialogType === "temp" ? [
+ ,
+
+ ] : []
+ }
+ titleOptsComs={
+ dialogType === "temp" ?
+ : null
+ }/>
{/*薪资明细模板设置*/}
this.setState({
tempDialog: { ...tempDialog, visible: false, setting: [] }
}, () => callback && callback())}
- onSuccess={() => {
- this.getPageListTemplatelist();
- this.getSalaryList();
- }}/>
+ onSuccess={this.getPageListTemplatelist}/>
+ this.setState({
+ tempManageDialog: { ...tempManageDialog, completeURL: "", visible: false }
+ })}/>
);
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js
new file mode 100644
index 00000000..cf9ea23b
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryTempMangerDialog.js
@@ -0,0 +1,22 @@
+/*
+ * 薪酬报表-薪酬明细
+ * 模板管理弹框
+ * @Author: 黎永顺
+ * @Date: 2024/12/4
+ * @Wechat:
+ * @Email: 971387674@qq.com
+ * @description:
+*/
+import React, { Component } from "react";
+import { WeaLocaleProvider } from "ecCom";
+import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class SalaryTempMangerDialog extends Component {
+ render() {
+ return ();
+ }
+}
+
+export default SalaryTempMangerDialog;