diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index b7f2ad31..edf7211d 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -127,3 +127,7 @@ export const deleteSelectData = (params) => { export const deleteAllData = (params) => { return postFetch('/api/bs/hrmsalary/otherDeduction/deleteAllData', params); } +//沿用上月 +export const extendToLastMonth = (params) => { + return postFetch('/api/bs/hrmsalary/otherDeduction/extendToLastMonth', params); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 4534eafa..15229dc6 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -13,6 +13,7 @@ import EditSlideContent from "./editSlideContent"; import { optionAddAll } from "../../../util/options"; import * as API from "../../../apis/otherDeduct"; import "./index.less"; +import { extendToLastMonth } from "../../../apis/otherDeduct"; @inject("otherDeductStore", "taxAgentStore") @@ -22,6 +23,7 @@ export default class OtherDeduct extends React.Component { super(props); this.state = { saveLoading: false, + lastLoading: false, addVisible: false, editId: {}, value: "", @@ -383,6 +385,30 @@ export default class OtherDeduct extends React.Component { }); }; + //沿用上月 + extendToLastMonth= ()=>{ + const { monthValue: declareMonth, taxAgentId } = this.state; + const { otherDeductStore: { doSearch } } = this.props; + const payload= { + declareMonth, + taxAgentId: taxAgentId === "All" ? "" : taxAgentId, + } + this.setState({ lastLoading: true }); + API.extendToLastMonth(payload).then(({ status, data, errormsg })=>{ + this.setState({ lastLoading: false }); + if (status) { + message.success(data || "操作成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "操作失败"); + } + }).catch(() => this.setState({ lastLoading: false })); + } + + render() { const { otherDeductStore, taxAgentStore } = this.props; const { @@ -416,7 +442,7 @@ export default class OtherDeduct extends React.Component { setPageObj } = otherDeductStore; const selectedRowKeys = toJS(tableStore.selectedRowKeys) || []; - const { modalParam, monthValue, taxAgentId, slideSelectedKey, addVisible, editId, saveLoading } = this.state; + const { modalParam, monthValue, taxAgentId, slideSelectedKey, addVisible, editId, saveLoading, lastLoading } = this.state; const detailSelectedRowKeys = toJS(slideTableStore.selectedRowKeys) || []; @@ -529,9 +555,16 @@ export default class OtherDeduct extends React.Component { } type="ghost"> 一键清空 - + , + ]; + const handleExportAllDetailClick = () => { const { otherDeductStore: { currentRecord }