From c4e67a8942e514b65ab41bb19781d50576c15725 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 19:56:52 +0800
Subject: [PATCH] 用户
---
src/views/trainingRegistration/index.vue | 51 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/src/views/trainingRegistration/index.vue b/src/views/trainingRegistration/index.vue
index 9765753..372c962 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;
@@ -562,7 +585,7 @@
if(row.number!=((row.serialEnd-row.serialStart)+1)){
this.$message({
type: "error",
- message: "考试人数也序号不匹配!",
+ message: "考试人数与序号不匹配!",
});
done();
return;
--
Gitblit v1.9.3