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 }); + } }); };