累计专项扣除页面添加一键累计的功能
This commit is contained in:
parent
824508b41a
commit
8e133ea43a
|
|
@ -123,3 +123,7 @@ export const deleteSelectAddUpDeduction = (params) => {
|
|||
export const deleteAllAddUpDeduction = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params);
|
||||
}
|
||||
//一键累计
|
||||
export const autoAddAll = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/addUpDeduction/autoAddAll', params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default class CumDeduct extends React.Component {
|
|||
addVisible: false,
|
||||
editId: {},
|
||||
saveLoading: false,
|
||||
addAllLoading: false,
|
||||
value: "",
|
||||
selectedKey: [],
|
||||
slideSelectedKey: [], //详情表格的选中项
|
||||
|
|
@ -411,9 +412,35 @@ export default class CumDeduct extends React.Component {
|
|||
});
|
||||
}
|
||||
};
|
||||
autoAddAll = () => {
|
||||
const { monthValue: declareMonth, taxAgentId } = this.state;
|
||||
const { cumDeductStore: { doSearch } } = this.props;
|
||||
this.setState({ addAllLoading: true });
|
||||
API.autoAddAll({}).then(({ status, errormsg }) => {
|
||||
this.setState({ addAllLoading: false });
|
||||
if (status) {
|
||||
message.success("操作成功");
|
||||
doSearch({
|
||||
declareMonth: [declareMonth],
|
||||
taxAgentId: taxAgentId === "All" ? "" : taxAgentId
|
||||
});
|
||||
} else {
|
||||
message.error(errormsg || "操作失败");
|
||||
}
|
||||
}).catch(() => this.setState({ addAllLoading: false }));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state;
|
||||
const {
|
||||
modalParam,
|
||||
slideSelectedKey,
|
||||
monthValue,
|
||||
taxAgentId,
|
||||
addVisible,
|
||||
editId,
|
||||
saveLoading,
|
||||
addAllLoading
|
||||
} = this.state;
|
||||
const { cumDeductStore, taxAgentStore } = this.props;
|
||||
const {
|
||||
loading,
|
||||
|
|
@ -546,7 +573,13 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
type="ghost">
|
||||
一键清空
|
||||
</Dropdown.Button>
|
||||
</Dropdown.Button>,
|
||||
<Button
|
||||
type="primary"
|
||||
loading={addAllLoading}
|
||||
onClick={this.autoAddAll}>
|
||||
一键累计
|
||||
</Button>
|
||||
];
|
||||
|
||||
const handleExportAllDetailClick = () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue