From 7e7450af07e92faa11c6bfbc164af8fd37cec7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 18 May 2023 09:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=E9=A1=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculateDetail/index.js | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index f0cf2f8d..d5342d86 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -30,10 +30,11 @@ export default class CalculateDetail extends React.Component { acctResultImportVisiable: false, progressVisible: false, progress: 0, - accountIds: [] + accountIds: [], + accountExceptInfo: "" }; this.id = ""; - this.timer; + this.timer = null; } componentWillMount() { @@ -160,7 +161,8 @@ export default class CalculateDetail extends React.Component { this.timer = null; this.setState({ progressVisible: false, - accountIds: [] + accountIds: [], + accountExceptInfo: data.message }); message.success("核算完成"); // acctResultList({ salaryAcctRecordId: this.id }); @@ -181,7 +183,8 @@ export default class CalculateDetail extends React.Component { this.timer = null; this.setState({ progressVisible: false, - accountIds: [] + accountIds: [], + accountExceptInfo: data.message }); message.error(data.message); } @@ -189,8 +192,6 @@ export default class CalculateDetail extends React.Component { }); }, 1000); }); - }, - onCancel() { } }); }; @@ -249,6 +250,15 @@ export default class CalculateDetail extends React.Component { } } + downloadTxtfile = (value) => { + const element = document.createElement("a"); + const file = new Blob([value], { type: "text/plain" }); + element.href = URL.createObjectURL(file); + element.download = "核算异常信息.txt"; + document.body.appendChild(element); + element.click(); + }; + render() { const { selectedKey, acctResultImportVisiable, showSearchAd } = this.state; const menu = ( @@ -260,7 +270,8 @@ export default class CalculateDetail extends React.Component { ); const renderRightOperation = () => { - return [ + const { accountExceptInfo } = this.state; + let buttons = [ ]; + accountExceptInfo && buttons.unshift(