From e3f898bd1f4e964424b7c1a1b1aa2f7fa508ca4f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 06 Sep 2021 17:59:40 +0800
Subject: [PATCH] 成绩查看权限配置,培训公司管理员查看当前培训公司的考试成绩,报名列表同
---
src/views/trainingRegistration/index.vue | 49 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 9765753..6e0b2c5 100644
--- a/src/views/trainingRegistration/index.vue
+++ b/src/views/trainingRegistration/index.vue
@@ -129,6 +129,7 @@
addExam,
} from "@/api/trainingRegistration/trainingRegistration";
import { mapGetters } from "vuex";
+import { getRoleDetail } from "@/api/system/role";
export default {
data() {
return {
@@ -518,20 +519,42 @@
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
- params = this.search;
this.loading = true;
- getdata(
- page.currentPage,
- page.pageSize,
- Object.assign(params, this.query)
- ).then((res) => {
- // console.log(res);
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- console.log(this.data);
- this.loading = false;
- });
+ //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
+ var that = this;
+ //获取当前登录人员的角色信息
+ var roleIds = this.userInfo.role_id.split(",");
+ params = this.search;
+ roleIds.forEach((roleId) => {
+ getRoleDetail(roleId).then((res) => {
+ var roleAlias = res.data.data.roleAlias;
+ if (
+ roleAlias == "保安公司管理员" ||
+ roleAlias == "保安"
+ ) {
+ //如果是保安公司管理员
+ params["deptId"] = that.userInfo.dept_id;
+ }
+ if (
+ roleAlias == "培训公司管理员"
+ ) {
+ //如果是培训公司管理员
+ params["trainingUnitId"] = that.userInfo.dept_id;
+ }
+ getdata(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query)
+ ).then((res) => {
+ // console.log(res);
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ console.log(this.data);
+ this.loading = false;
+ });
+ })
+ })
},
handleImport() {
this.excelBox = true;
--
Gitblit v1.9.3