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/workreport/workreport.vue | 97 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 70 insertions(+), 27 deletions(-)
diff --git a/src/views/workreport/workreport.vue b/src/views/workreport/workreport.vue
index a955138..a33eec1 100644
--- a/src/views/workreport/workreport.vue
+++ b/src/views/workreport/workreport.vue
@@ -52,7 +52,7 @@
} from "@/api/workreport/workreport";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
-
+import { getDictionaryBiz } from "@/api/system/dict";
export default {
data() {
return {
@@ -245,39 +245,82 @@
// ? (that.deptCategory = true)
// : (that.deptCategory = false);
-
-
- //1:保安公司 2:公安 3:培训公司
- if(this.userInfo.role_name=="保安公司管理员"
- || this.userInfo.role_name=="保安"
- || this.userInfo.role_name=="未持证保安"
- ){
- const column = that.findObject(that.option.column, "category");
- column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=securityWorkReportCategory";
- const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
- columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId="+that.userInfo.dept_id;
- }
- if(this.userInfo.role_name=="公安管理员"){
- const column = that.findObject(that.option.column, "category");
- column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=workReportCategory";
- const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
- columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId="+that.userInfo.dept_id;
- }
- params["deptId"] = this.deptId;
- params["userId"] = this.userId;
- // }
- let values = {
- ...params,
+ //1:保安公司 2:公安 3:培训公司
+ if (
+ this.userInfo.role_name == "保安公司管理员" ||
+ this.userInfo.role_name == "保安"
+ ) {
+ const column = that.findObject(that.option.column, "category");
+ var code = {
+ code: "securityWorkReportCategory",
};
- this.loading = true;
- getListPage(page.currentPage, page.pageSize, values).then((res) => {
+
+ getDictionaryBiz(code).then((res) => {
+ // column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=securityWorkReportCategory";
+ column.dicData = res.data.data;
+ const columnReceivedIds = that.findObject(
+ that.option.column,
+ "receivedIds"
+ );
+ columnReceivedIds.dicUrl =
+ "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId=" +
+ that.userInfo.dept_id;
+
+ params["deptId"] = this.deptId;
+ params["userId"] = this.userId;
+ // }
+
+ let values = {
+ ...params,
+ };
+ this.loading = true;
+ getListPage(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ });
+ } else if (this.userInfo.role_name == "公安管理员") {
+ const column = that.findObject(that.option.column, "category");
+ var code1 = { code: "workReportCategory" };
+ getDictionaryBiz(code1).then((res) => {
+ // column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=workReportCategory";
+ column.dicData = res.data.data;
+ const columnReceivedIds = that.findObject(
+ that.option.column,
+ "receivedIds"
+ );
+ columnReceivedIds.dicUrl =
+ "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId=" +
+ that.userInfo.dept_id;
+
+ params["deptId"] = this.deptId;
+ params["userId"] = this.userId;
+ // }
+
+ let values = {
+ ...params,
+ };
+ this.loading = true;
+ getListPage(page.currentPage, page.pageSize, values).then((res) => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ this.selectionClear();
+ });
+ });
+ } else if (this.userInfo.role_name == "administrator") {
+ getListPage(page.currentPage, page.pageSize, params).then((res) => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
this.selectionClear();
});
- // });
+ }
},
},
};
--
Gitblit v1.9.3