From ecdf3c5f26ba7336968af9a4591594aeeccd4989 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, 28 Jun 2023 15:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E8=B5=84=E6=A0=B8?= =?UTF-8?q?=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97=E7=9A=84=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=9D=83=E9=99=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/calculateDetail/compareDetail.js | 14 +++++++++++--- pc4mobx/hrmSalary/pages/calculateDetail/index.js | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index 98fcc22f..49085673 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -9,7 +9,7 @@ import CustomPaginationTable from "../../components/customPaginationTable"; import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; import Authority from "../mySalary/authority"; -@inject("calculateStore") +@inject("calculateStore", "taxAgentStore") @observer export default class CompareDetail extends React.Component { constructor(props) { @@ -40,8 +40,16 @@ export default class CompareDetail extends React.Component { } salaryacctAcctresultCheckAuth = (params) => { - salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { - this.setState({ calculateAuth: data && status }); + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ data }) => { + const { isOpenDevolution } = data; + if (isOpenDevolution) { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + } else { + this.setState({ calculateAuth: true }); + } }); }; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 63a8d2b8..da39bb6c 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -55,8 +55,16 @@ export default class CalculateDetail extends React.Component { } salaryacctAcctresultCheckAuth = (params) => { - salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { - this.setState({ calculateAuth: data && status }); + const { taxAgentStore: { getPermission } } = this.props; + getPermission().then(({ data }) => { + const { isOpenDevolution } = data; + if (isOpenDevolution) { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + } else { + this.setState({ calculateAuth: true }); + } }); };