feature/2.15.1.2407.01-浮动薪酬
This commit is contained in:
parent
bbc11b0609
commit
4be61e9179
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 <div style={{ padding: "8px 16px", border: "1px solid #e5e5e5", margin: "4px 0" }}>
|
||||
<WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaDatePicker format="YYYY-MM" value={month}
|
||||
onChange={val => {
|
||||
const payload = { salaryMonth: val, hasData, taxAgentIds, ...VSalryForm.getFormParams() };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
...importDialog, salaryMonth: val,
|
||||
link: `/api/bs/hrmsalary/variableSalary/downloadTemplate?${convertToUrlString(payload)}`
|
||||
}
|
||||
});
|
||||
}}/>
|
||||
</WeaFormItem>
|
||||
</div>;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { importDialog } = this.state;
|
||||
|
|
@ -69,13 +91,15 @@ class Index extends Component {
|
|||
onResetImportResult={() => this.setState({
|
||||
importDialog: { ...importDialog, importResult: {}, imageId: "", link: null }
|
||||
})}
|
||||
importParams={this.renderFormComponent()}
|
||||
exportDataDom={
|
||||
<WeaCheckbox
|
||||
value={importDialog.hasData ? "1" : "0"}
|
||||
content={getLabel(543208, "导出现有数据")}
|
||||
helpfulTip={getLabel(111, "提示:建议先导出现有最新数据,修改后再导入")}
|
||||
onChange={val => {
|
||||
const { baseTableStore: { VSalryForm }, salaryMonth, taxAgentIds } = this.props;
|
||||
const { baseTableStore: { VSalryForm }, taxAgentIds } = this.props;
|
||||
const { salaryMonth } = importDialog;
|
||||
const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams(), hasData: val === "1" };
|
||||
this.setState({
|
||||
importDialog: {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaDatePicker, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaDatePicker, WeaLoadingGlobal, WeaLocaleProvider, WeaReqTop, WeaSelect } from "ecCom";
|
||||
import * as API from "../../apis/variableSalary";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SearchPannel from "./components/searchPannel";
|
||||
|
|
@ -18,7 +19,6 @@ import SalaryFileDialog from "./components/salaryFileDialog";
|
|||
import SalaryItemList from "./components/salaryItemList";
|
||||
import SalaryFileList from "./components/salaryFileList";
|
||||
import SalaryFileImportDialog from "./components/salaryFileImportDialog";
|
||||
import { convertToUrlString } from "../../util/url";
|
||||
import moment from "moment";
|
||||
import { Button } from "antd";
|
||||
import cs from "classnames";
|
||||
|
|
@ -56,6 +56,7 @@ class Index extends Component {
|
|||
handleAdvanceSearch = () => this.setState({ isQuery: !this.state.isQuery });
|
||||
openAdvanceSearch = () => this.setState({ showSearchAd: !this.state.showSearchAd });
|
||||
handleOperate = (type, detail = {}) => {
|
||||
const { baseTableStore: { SFTableStore, VSalryForm } } = this.props;
|
||||
switch (type) {
|
||||
case "create":
|
||||
this.setState({
|
||||
|
|
@ -69,13 +70,13 @@ class Index extends Component {
|
|||
this.setState({ SFImpDialog: { ...this.state.SFImpDialog, visible: true } });
|
||||
break;
|
||||
case "export":
|
||||
const { baseTableStore: { VSalryForm } } = this.props;
|
||||
const columns = _.map(_.filter(toJS(SFTableStore.columns), (item) => item.display === "true"), it => it.dataIndex);
|
||||
const { salaryMonth, taxAgentIds } = this.state;
|
||||
const payload = { salaryMonth, taxAgentIds, ...VSalryForm.getFormParams() };
|
||||
window.open(`/api/bs/hrmsalary/variableSalary/export?${convertToUrlString(payload)}`, "_blank");
|
||||
const payload = { salaryMonth, taxAgentIds, columns, ...VSalryForm.getFormParams() };
|
||||
WeaLoadingGlobal.start();
|
||||
const promise = API.exportVariableSalary(payload);
|
||||
break;
|
||||
case "custom_cols":
|
||||
const { baseTableStore: { SFTableStore } } = this.props;
|
||||
SFTableStore.setColSetVisible(true);
|
||||
SFTableStore.tableColSet(true);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue