diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 013bddee..2ffee227 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -564,3 +564,7 @@ export const cacheImportField = (params) => { body: JSON.stringify(params) }).then(res => res.json()); }; +//薪资核算-页面查看权限 +export const salaryacctAcctresultCheckAuth = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/acctresult/checkAuth", "GET", params); +}; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index 8641697c..98fcc22f 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -6,6 +6,8 @@ import CustomTab from "../../components/customTab"; import { inject, observer } from "mobx-react"; import CompareDetailImportModal from "./compareDetailImportModal"; import CustomPaginationTable from "../../components/customPaginationTable"; +import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; +import Authority from "../mySalary/authority"; @inject("calculateStore") @observer @@ -17,7 +19,8 @@ export default class CompareDetail extends React.Component { onlyDiffEmployee: true, onlyDiffSalaryItem: true, importModalVisible: false, - searchValue: "" + searchValue: "", + calculateAuth: false }; this.pageInfo = { current: 1, pageSize: 10 }; } @@ -33,8 +36,15 @@ export default class CompareDetail extends React.Component { current: 1 }; fetchComparisonResultList(params); + this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: getQueryString("id") }) } + salaryacctAcctresultCheckAuth = (params) => { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + }; + getColumns = (columns) => { let newColumns = [...columns]; newColumns.map(item => { @@ -169,7 +179,7 @@ export default class CompareDetail extends React.Component { comparisonResultColumns } } = this.props; - const { importModalVisible, searchValue } = this.state; + const { importModalVisible, searchValue, calculateAuth } = this.state; const renderRightOperation = () => { return (
@@ -203,60 +213,63 @@ export default class CompareDetail extends React.Component { ); }; return ( -
- -
-
- 公式= - 系统值;线下值;差值 + +
+ +
+
+ 公式= + 系统值;线下值;差值 +
-
-
- { - this.pageInfo.current = value; - this.handleDataPageChange(value); - }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleShowSizeChange(this.pageInfo); - }} - /> -
+
+ { + this.pageInfo.current = value; + this.handleDataPageChange(value); + }} + onShowSizeChange={(current, pageSize) => { + this.pageInfo = { current, pageSize }; + this.handleShowSizeChange(this.pageInfo); + }} + /> +
- { - importModalVisible && { - this.handleComparisonFinish(); - }} - onCancel={() => { - this.setState({ - importModalVisible: false - }); - }} - /> - } -
+ { + importModalVisible && { + this.handleComparisonFinish(); + }} + onCancel={() => { + this.setState({ + importModalVisible: false + }); + }} + /> + } +
+ ); } } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 25b9dcc3..63a8d2b8 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -7,8 +7,10 @@ import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchG import { convertToUrlString, getQueryString } from "../../util/url"; import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal"; import ProgressModal from "../../components/progressModal"; +import { salaryacctAcctresultCheckAuth } from "../../apis/calculate"; import Authority from "../mySalary/authority"; + const { ButtonSelect } = WeaDropdown; @inject("calculateStore", "salaryFileStore", "taxAgentStore") @@ -33,23 +35,31 @@ export default class CalculateDetail extends React.Component { progressVisible: false, progress: 0, accountIds: [], - accountExceptInfo: "" + accountExceptInfo: "", + calculateAuth: false }; this.id = ""; this.timer = null; } - componentWillMount() { + async componentWillMount() { let id = getQueryString("id"); this.id = id; const { calculateStore: { checkTaxAgent }, salaryFileStore } = this.props; const { commonEnumList } = salaryFileStore; + this.salaryacctAcctresultCheckAuth({ salaryAcctRecordId: id }); checkTaxAgent(this.id); let modalParam = { ...this.state.modalParam, salaryAcctRecordId: id }; this.setState({ modalParam }); commonEnumList("user", { enumClass: "com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum" }); } + salaryacctAcctresultCheckAuth = (params) => { + salaryacctAcctresultCheckAuth(params).then(({ status, data }) => { + this.setState({ calculateAuth: data && status }); + }); + }; + Input = (value, key) => { const { employeeName, workcode } = this.state.searchItemsValue; return ( @@ -263,7 +273,7 @@ export default class CalculateDetail extends React.Component { }; render() { - const { selectedKey, acctResultImportVisiable, showSearchAd } = this.state; + const { selectedKey, acctResultImportVisiable, showSearchAd, calculateAuth } = this.state; const { taxAgentStore: { payrollPermission } } = this.props; const menu = ( @@ -346,7 +356,7 @@ export default class CalculateDetail extends React.Component { return ( + store={{ loading: false, hasRight: payrollPermission && calculateAuth }}>