diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js
index 2ffee227..b14015a7 100644
--- a/pc4mobx/hrmSalary/apis/calculate.js
+++ b/pc4mobx/hrmSalary/apis/calculate.js
@@ -568,3 +568,20 @@ export const cacheImportField = (params) => {
export const salaryacctAcctresultCheckAuth = params => {
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params);
};
+
+//薪资核算-导出核算结果前生成可选的薪资项目
+export const getExportField = params => {
+ return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/exportField", "GET", params);
+};
+
+//薪资核算-导出薪资核算添加表头字段缓存
+export const customCacheExportField = (params) => {
+ return fetch("/api/bs/hrmsalary/salaryacct/acctresult/cacheExportField", {
+ method: "POST",
+ mode: "cors",
+ headers: {
+ "Content-Type": "application/json"
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json());
+};
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js
new file mode 100644
index 00000000..601890a1
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/customExportDialog.js
@@ -0,0 +1,127 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资核算-自定义导出字段弹框
+ * Description:
+ * Date: 2023/7/17
+ */
+import React, { Component } from "react";
+import { Button, Col, message, Row } from "antd";
+import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import { customCacheExportField } from "../../apis/calculate";
+import { convertToUrlString, getQueryString } from "../../util/url";
+import "./acctResult/importModal/index.less";
+
+
+const { getLabel } = WeaLocaleProvider;
+
+class CustomExportDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ itemsCheckeds: [],
+ showOnlyChecked: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ this.setState({
+ itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : []
+ });
+ }
+ }
+
+ customExportClick = () => {
+ const { searchItemsValue } = this.props;
+ const { itemsCheckeds } = this.state;
+ customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => {
+ if (status) {
+ const { consolidatedTaxation, ...extra } = searchItemsValue;
+ const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation };
+ window.open(
+ `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${getQueryString("id")}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}`
+ );
+ } else {
+ message.error(errorMsg);
+ }
+ });
+ };
+ handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) });
+ handleSelectGroupAll = (groupId, checked) => {
+ const { itemsCheckeds } = this.state;
+ const { itemsByGroup } = this.props;
+ _.map(itemsByGroup, item => {
+ if (item.salarySobItemGroupId === groupId) {
+ if (!!Number(checked)) {
+ this.setState({
+ itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)]
+ });
+ } else {
+ this.setState({
+ itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual)
+ });
+ }
+ }
+ });
+ };
+
+ render() {
+ const { showOnlyChecked, itemsCheckeds } = this.state;
+ const { itemsByGroup } = this.props;
+ let dataSource = _.map(itemsByGroup, item => {
+ return {
+ ...item,
+ salaryItems: _.map(item.salaryItems, child => {
+ return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) };
+ })
+ };
+ });
+ if (showOnlyChecked) {
+ dataSource = _.map(dataSource, item => {
+ return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) };
+ });
+ }
+ return (
+