diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js
index 38c0c08b..0abda464 100644
--- a/pc4mobx/hrmSalary/apis/calculate.js
+++ b/pc4mobx/hrmSalary/apis/calculate.js
@@ -258,3 +258,12 @@ export const saveExportTemplate = (params) => {
export const getExportTemplateList = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/exportTemplateList", params);
};
+//薪资核算-删除自定义导出模板列表
+export const deleteExportTemplate = (params) => {
+ return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/deleteExportTemplate", params);
+};
+//薪资核算-获取导出模板详细信息
+export const getExportTemplateForm = (params) => {
+ return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
+};
+
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
index 2a4f2390..d90e5830 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
@@ -10,7 +10,12 @@ import { Button, Col, message, Row } from "antd";
import { inject, observer } from "mobx-react";
import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
import ExpTempManagementDialog from "../expTempManagementDialog";
-import { customCacheExportField } from "../../../../../apis/calculate";
+import {
+ customCacheExportField,
+ getExportField,
+ getExportTemplateForm,
+ getExportTemplateList
+} from "../../../../../apis/calculate";
import { convertToUrlString } from "../../../../../util/url";
import "./index.less";
import TempDialog from "../expFieldsSetDialog/tempDialog";
@@ -24,18 +29,43 @@ class Index extends Component {
super(props);
this.state = {
itemsCheckeds: [], showOnlyChecked: false, tempMangeDialog: { visible: false, salaryAcctRecordId: "" },
- tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] }
+ tempDialog: { visible: false, salaryAcctRecordId: "", id: "", salaryItemIds: [] },
+ tempOptions: [
+ { key: "", showname: "" },
+ { key: "system", showname: getLabel(111, "系统模板") }
+ ]
};
}
- componentWillReceiveProps(nextProps, nextContext) {
+ async componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
this.setState({
itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : []
+ }, () => this.getExportTemplateList(nextProps));
+ } else {
+ this.setState({
+ tempOptions: [
+ { key: "", showname: "" },
+ { key: "system", showname: getLabel(111, "系统模板") }
+ ]
});
}
}
+ getExportTemplateList = (props) => {
+ const { salaryAcctRecordId } = props;
+ getExportTemplateList({ salaryAcctRecordId }).then(({ status, data }) => {
+ if (status) {
+ const { pageInfo: { list } } = data;
+ this.setState({
+ tempOptions: [
+ ...this.state.tempOptions, ..._.map(list, o => ({ key: String(o.id), showname: o.templateName }))
+ ]
+ });
+ }
+ });
+ };
+
customExportClick = () => {
const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props;
const { itemsCheckeds } = this.state;
@@ -69,9 +99,25 @@ class Index extends Component {
}
});
};
+ handleChangeExpTemp = async (id) => {
+ switch (id) {
+ case "system":
+ const { salaryAcctRecordId } = this.props;
+ const { data: { checkItems: checkeds } } = await getExportField({ salaryAcctRecordId });
+ this.setState({ itemsCheckeds: checkeds });
+ break;
+ case "":
+ this.setState({ itemsCheckeds: "" });
+ break;
+ default:
+ const { data: { checkItems } } = await getExportTemplateForm({ id });
+ this.setState({ itemsCheckeds: _.map(checkItems, o => parseInt(o)) });
+ break;
+ }
+ };
render() {
- const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog } = this.state;
+ const { showOnlyChecked, itemsCheckeds, tempMangeDialog, tempDialog, tempOptions } = this.state;
const { itemsByGroup, salaryAcctRecordId } = this.props;
let dataSource = _.map(itemsByGroup, item => {
return {
@@ -88,7 +134,7 @@ class Index extends Component {
}
const titleComp =
{getLabel(111, "选择字段")}
-
+
;
return (
{getLabel(17416, "导出")},
,
);