diff --git a/pc4mobx/hrmSalary/apis/variableSalary.js b/pc4mobx/hrmSalary/apis/variableSalary.js index d172c984..8cd818b5 100644 --- a/pc4mobx/hrmSalary/apis/variableSalary.js +++ b/pc4mobx/hrmSalary/apis/variableSalary.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //浮动薪酬项目列表 export const getVariableSalaryItemList = params => { @@ -46,3 +46,8 @@ export const getVariableSalaryDetail = params => { export const getAdminTaxAgentList = () => { return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {}); }; +// 浮动薪酬档案导出 +export const exportVariableSalary = (params) => { + return postExportFetch("/api/bs/hrmsalary/variableSalary/export", params); +}; + diff --git a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js index 30268183..c8917e45 100644 --- a/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js +++ b/pc4mobx/hrmSalary/pages/variableSalary/components/salaryFileImportDialog/index.js @@ -8,7 +8,7 @@ * @description: */ import React, { Component } from "react"; -import { WeaCheckbox, WeaLocaleProvider } from "ecCom"; +import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaLocaleProvider } from "ecCom"; import ImportDialog from "../../../../components/importDialog"; import * as API from "../../../../apis/variableSalary"; import { convertToUrlString } from "../../../../util/url"; @@ -21,7 +21,7 @@ class Index extends Component { this.state = { importDialog: { nextloading: false, link: "/api/bs/hrmsalary/variableSalary/downloadTemplate", - importResult: {}, imageId: "", hasData: false, + importResult: {}, imageId: "", hasData: false, salaryMonth: "", previewUrl: "/api/bs/hrmsalary/variableSalary/preview" } }; @@ -34,20 +34,23 @@ class Index extends Component { const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: importDialog.hasData }; - this.setState({ importDialog: { ...importDialog, link: `${importDialog.link}?${convertToUrlString(payload)}` } }); + this.setState({ + importDialog: { ...importDialog, salaryMonth, link: `${importDialog.link}?${convertToUrlString(payload)}` } + }); } else { this.setState({ importDialog: { nextloading: false, link: "/api/bs/hrmsalary/variableSalary/downloadTemplate", hasData: false, - importResult: {}, imageId: "", previewUrl: "/api/bs/hrmsalary/variableSalary/preview" + importResult: {}, imageId: "", previewUrl: "/api/bs/hrmsalary/variableSalary/preview", salaryMonth: "" } }); } } handleImport = (payload) => { - const { salaryMonth, taxAgentIds } = this.props; + const { taxAgentIds } = this.props; const { importDialog } = this.state; + const { salaryMonth } = importDialog; this.setState({ importDialog: { ...importDialog, nextloading: true } }); API.importVariableSalary({ ...payload, salaryMonth, taxAgentIds: _.isEmpty(taxAgentIds) ? [] : taxAgentIds.split(",") @@ -60,6 +63,25 @@ class Index extends Component { } }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } })); }; + renderFormComponent = () => { + const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props; + const { importDialog } = this.state; + const { salaryMonth: month, hasData } = importDialog; + return