From 9ed8b79e64078cc0f679a82a7ddb3ffc661ad4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 27 Jun 2023 17:11:52 +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 --- pc4mobx/hrmSalary/apis/calculate.js | 4 + .../pages/calculateDetail/compareDetail.js | 119 ++++++++++-------- .../hrmSalary/pages/calculateDetail/index.js | 18 ++- pc4mobx/hrmSalary/stores/taxAgent.js | 1 + 4 files changed, 85 insertions(+), 57 deletions(-) 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 }}>