From ea9359c728654993e4a98e1eef47bdf2e488d6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 16 Nov 2022 17:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=85=8D=E7=A8=8E=E6=89=A3?= =?UTF-8?q?=E9=99=A4=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=B2=BF=E7=94=A8?= =?UTF-8?q?=E4=B8=8A=E6=9C=88=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/otherDeduct.js | 4 ++ .../dataAcquisition/otherDeduct/index.js | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) 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 }