From d59e72d7892e4513f5772ca18d16a37e5603543c Mon Sep 17 00:00:00 2001
From: lys <971387674@qq.com>
Date: Fri, 21 Mar 2025 11:23:37 +0800
Subject: [PATCH] =?UTF-8?q?custom-=E9=93=B6=E7=9B=9B=E7=A7=91=E6=8A=80?=
=?UTF-8?q?=E6=9C=8D=E5=8A=A1=E9=9B=86=E5=9B=A2=E6=9C=89=E9=99=90=E5=85=AC?=
=?UTF-8?q?=E5=8F=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/attendance.js | 4 ++++
.../components/attendanceDataComp.js | 4 ++--
.../components/attendanceDataViewSlide.js | 3 ++-
.../attendance/components/fieldMangComp.js | 2 +-
.../pages/dataAcquisition/attendance/index.js | 24 ++++++++++++-------
5 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/pc4mobx/hrmSalary/apis/attendance.js b/pc4mobx/hrmSalary/apis/attendance.js
index 6a475eb3..1f4142e7 100644
--- a/pc4mobx/hrmSalary/apis/attendance.js
+++ b/pc4mobx/hrmSalary/apis/attendance.js
@@ -82,3 +82,7 @@ export const getSalaryCycleAndAttendCycle = (params) => {
export const exportAttendQuote = params => {
return postExportFetch("/api/bs/hrmsalary/attendQuote/batch/export", params);
};
+// 银盛二开-考勤引用数据操作权限
+export const getYSKqyyPermission = params => {
+ return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/ysKqyyPermission", "GET", params);
+};
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
index 7f91540e..ffb1eaa5 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataComp.js
@@ -313,7 +313,7 @@ class AttendanceDataComp extends Component {
this.handleViewAttendanceData(record)}>查看
- {showOperateBtn &&
+ {showOperateBtn.canOperate &&
this.handleDeleteAttendanceData(record)}>删除
@@ -331,7 +331,7 @@ class AttendanceDataComp extends Component {
}
{
- !showOperateBtn &&
+ !showOperateBtn.canOperate &&
this.props.onFilterLog("log", record.id)}>{getLabel(545781, "操作日志")}
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
index 7dd3f24d..c750615f 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/components/attendanceDataViewSlide.js
@@ -78,7 +78,7 @@ class AttendanceDataViewSlide extends Component {
}, () => this.viewAttendQuote({}, this.props));
}
};
- const btns = [
+ let btns = [
,
this.viewAttendQuote({ current: 1 }, this.props)}
/>
];
+ !showOperateBtn.canExport && (btns = btns.slice(-1));
return (
this.handleAttendanceFieldSwitch(record, value)}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
index f1d71f23..252f3dc4 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js
@@ -8,7 +8,7 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, DatePicker } from "antd";
import { WeaFormItem, WeaInputSearch, WeaLoadingGlobal, WeaLocaleProvider, WeaNewScroll, WeaReqTop } from "ecCom";
-import { exportAttendQuote } from "../../../apis/attendance";
+import { exportAttendQuote, getYSKqyyPermission } from "../../../apis/attendance";
import AttendanceDataComp from "./components/attendanceDataComp";
import FieldMangComp from "./components/fieldMangComp";
import LogDialog from "../../../components/logViewModal";
@@ -25,10 +25,16 @@ class Index extends Component {
super(props);
this.state = {
fieldName: "", selectedKey: "DATA", salaryMonth: [], selectedRowKeys: [],
- logDialogVisible: false, filterConditions: "[]"
+ logDialogVisible: false, filterConditions: "[]", PageAndOptAuth: { canOperate: false, canExport: false }
};
}
+ componentDidMount() {
+ getYSKqyyPermission().then(({ status, data }) => {
+ if (status) this.setState({ PageAndOptAuth: { ...this.state.PageAndOptAuth, ...data } });
+ });
+ }
+
/*
* Author: 黎永顺
* Description: 考勤数据删选条件
@@ -82,9 +88,9 @@ class Index extends Component {
};
render() {
- const { selectedKey, salaryMonth, fieldName, logDialogVisible, filterConditions, selectedRowKeys } = this.state;
- const { taxAgentStore: { PageAndOptAuth } } = this.props;
- const showOperateBtn = PageAndOptAuth.isChief || PageAndOptAuth.isAdminEnable;
+ const {
+ selectedKey, salaryMonth, fieldName, logDialogVisible, filterConditions, selectedRowKeys, PageAndOptAuth
+ } = this.state;
const topTab = [
{ title: "考勤数据", key: "DATA" },
{ title: "字段管理", key: "FIELD" }
@@ -100,7 +106,9 @@ class Index extends Component {
value={fieldName} onChange={fieldName => this.setState({ fieldName })}
onSearch={() => this.fieldMangRef.getAttendanceFieldList({ fieldName, current: 1 })}/>
];
- !showOperateBtn && (buttons = buttons.slice(-1));
+ selectedKey === "DATA" && !PageAndOptAuth.canOperate && (buttons = buttons.filter(o => o.props.children !== getLabel(111, "引用") && o.props.children !== getLabel(111, "导入")));
+ selectedKey === "DATA" && !PageAndOptAuth.canExport && (buttons = buttons.filter(o => o.props.children !== getLabel(111, "导出")));
+ selectedKey === "FIELD" && !PageAndOptAuth.canOperate && (buttons = buttons.filter(o => o.props.children !== getLabel(111, "新建")));
return (
this.attendanceTableRef = dom}
- showOperateBtn={showOperateBtn}
+ showOperateBtn={PageAndOptAuth}
salaryYearMonth={salaryMonth}
selectedRowKeys={selectedRowKeys}
onRowSelection={selectedRowKeys => this.setState({ selectedRowKeys })}
@@ -132,7 +140,7 @@ class Index extends Component {
/> :
this.fieldMangRef = dom}
- showOperateBtn={showOperateBtn}
+ showOperateBtn={PageAndOptAuth}
fieldName={fieldName}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
/>