feature/2.19.1.2501.01-薪酬批量操作
This commit is contained in:
parent
c4963d138c
commit
2f649ecae6
|
|
@ -14,6 +14,10 @@ export const saveBasic = params => {
|
|||
export const batSaveBasic = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/basic/batSave", params);
|
||||
};
|
||||
// 薪资记录--批量新建并核算
|
||||
export const batSaveAndAcct = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/batSaveAndAcct", params);
|
||||
};
|
||||
|
||||
// 薪资记录--薪资核算详情
|
||||
export const salaryacctGetForm = params => {
|
||||
|
|
|
|||
|
|
@ -80,10 +80,15 @@ class Calculate extends Component {
|
|||
let calculateOpts = [
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
calcDaialog: {
|
||||
visible: true,
|
||||
visible: true, type: "acct",
|
||||
title: getLabel(538780, "核算")
|
||||
}
|
||||
})}>{getLabel(538780, "核算")}</Button>,
|
||||
<Button type="primary" onClick={() => this.setState({
|
||||
calcDaialog: {
|
||||
visible: true, title: getLabel(538780, "批量新建并核算"), type: "batSaveAndAcct"
|
||||
}
|
||||
})}>{getLabel(111, "批量新建并核算")}</Button>,
|
||||
<React.Fragment>
|
||||
<Button type="primary" onClick={() => this.onDropMenuClick("batArchiving")} className="cust-dropdown-btn"
|
||||
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量归档")}</Button>
|
||||
|
|
@ -98,7 +103,7 @@ class Calculate extends Component {
|
|||
queryParams: { ...queryParams, ...v }
|
||||
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
|
||||
];
|
||||
return !showOperateBtn ? calculateOpts.slice(2) : calculateOpts;
|
||||
return !showOperateBtn ? calculateOpts.slice(3) : calculateOpts;
|
||||
};
|
||||
handleCalcOpts = ({ key }, record) => {
|
||||
const { isRefresh, progressModule } = this.state, { id } = record;
|
||||
|
|
|
|||
|
|
@ -9,12 +9,17 @@ import { inject, observer } from "mobx-react";
|
|||
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
|
||||
import { Button, message } from "antd";
|
||||
import { getSearchs } from "../../../../util";
|
||||
import { batSaveBasic, salaryacctGetForm } from "../../../../apis/calculate";
|
||||
import { batSaveAndAcct, batSaveBasic, salaryacctGetForm } from "../../../../apis/calculate";
|
||||
import { calculateConditions } from "./condition";
|
||||
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
const API = {
|
||||
"batSaveAndAcct": batSaveAndAcct,
|
||||
"acct": batSaveBasic
|
||||
};
|
||||
|
||||
@inject("calculateStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
|
|
@ -53,12 +58,12 @@ class Index extends Component {
|
|||
});
|
||||
};
|
||||
save = () => {
|
||||
const { calculateStore: { calculateForm } } = this.props;
|
||||
const { calculateStore: { calculateForm }, type = "acct" } = this.props;
|
||||
calculateForm.validateForm().then(f => {
|
||||
if (f.isValid) {
|
||||
const { salarySobId, salaryMonthStr, ...payload } = calculateForm.getFormParams();
|
||||
this.setState({ loading: true });
|
||||
batSaveBasic({ ...payload, salaryMonth: `${salaryMonthStr}-01`, salarySobIds: salarySobId.split(",") })
|
||||
API[type]({ ...payload, salaryMonth: `${salaryMonthStr}-01`, salarySobIds: salarySobId.split(",") })
|
||||
.then(({ status, data, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue