From 562ae0d927e8731420498c1e49cf62ebeb95f76a Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 20 Aug 2021 10:26:14 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/views/applyexam/index.vue             |   18 +++++-
 src/views/workreport/data.js              |    4 
 src/views/workreport/workreport.vue       |   36 +++++++-----
 src/views/securityGuard/securityGuard.vue |    9 +-
 src/views/desk/notice.vue                 |   45 +++-----------
 src/views/workreport/workreply.vue        |    4 
 src/views/exam/singleperformance.vue      |   14 ++++
 7 files changed, 69 insertions(+), 61 deletions(-)

diff --git a/src/views/applyexam/index.vue b/src/views/applyexam/index.vue
index 6127b2c..8ada691 100644
--- a/src/views/applyexam/index.vue
+++ b/src/views/applyexam/index.vue
@@ -65,6 +65,7 @@
                 plain
                 icon="el-icon-folder-checked"
                 @click="handleBatchExam"
+                v-if="permission.applyexam_exam"
                 >生成考试
               </el-button>
               <!-- v-if="examPersission" -->
@@ -73,7 +74,8 @@
                 size="small"
                 plain
                 icon="el-icon-folder-checked"
-                @click="handleImport"
+                v-if="permission.applyexam_import"
+               @click="handleImport"
                 >清册导入
               </el-button>
             </template>
@@ -83,6 +85,7 @@
                 :type="type"
                 size="small"
                 icon="el-icon-refresh-left"
+                v-if="permission.applyexam_cancel"
                 :disabled="row.isApply == 2"
                 @click="handleCancel(row)"
                 >取消报名
@@ -100,7 +103,7 @@
                 :type="type"
                 size="small"
                 icon="el-icon-receiving"
-                v-if="row.candidateNo != ''"
+                v-if="permission.applyexam_print && row.candidateNo!=''"
                 @click="handlePrint(row)"
                 >准考证打印
               </el-button>
@@ -176,7 +179,7 @@
   addExam,
 } from "@/api/examapi/applyexam";
 import { mapState } from "vuex";
-
+import { mapGetters } from "vuex";
 var DIC = {
   applyStatus: [
     {
@@ -754,6 +757,15 @@
     ...mapState({
       userInfo: (state) => state.user.userInfo,
     }),
+    ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(null, false),
+        viewBtn: this.vaildData(this.permission.applyexam_view, false),
+        delBtn: this.vaildData(null, false),
+        editBtn: this.vaildData(null, false),
+      };
+    },
     ids() {
       let ids = [];
       this.questionBankSelectionList.forEach((ele) => {
diff --git a/src/views/desk/notice.vue b/src/views/desk/notice.vue
index 606ee40..b203353 100644
--- a/src/views/desk/notice.vue
+++ b/src/views/desk/notice.vue
@@ -26,6 +26,7 @@
           type="danger"
           size="small"
           icon="el-icon-delete"
+          v-if="permission.notice_delete"
           plain
           @click="handleDelete"
           >删 除
@@ -36,7 +37,11 @@
         <el-tag>{{ row.categoryName }}</el-tag>
       </template>
       <template slot-scope="{ type, size, row }" slot="menu">
-        <el-button :size="size" :type="type" @click="handleUploadPage(row)"
+        <el-button 
+        :size="size" 
+        :type="type" 
+        v-if="permission.notice_upload"
+        @click="handleUploadPage(row)"
           >附件上传
         </el-button>
         <!-- <el-button
@@ -208,13 +213,13 @@
     };
   },
   computed: {
-    ...mapGetters(["permission"]),
+    ...mapGetters(["userInfo", "permission"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permissionAdd, true),
-        viewBtn: this.vaildData(this.permissionView, true),
-        delBtn: this.vaildData(this.permissionDelete, true),
-        editBtn: this.vaildData(this.permissionEdit, true),
+        addBtn: this.vaildData(this.permission.notice_add, false),
+        viewBtn: this.vaildData(this.permission.notice_view, false),
+        delBtn: this.vaildData(this.permission.notice_delete, false),
+        editBtn: this.vaildData(this.permission.notice_edit, false),
       };
     },
     ids() {
@@ -241,12 +246,6 @@
           ? (that.deptCategory = true)
           : (that.deptCategory = false);
 
-        // if (that.deptCategory) {
-        that.permissionAdd = this.permission.notice_add;
-        that.permissionView = this.permission.notice_view;
-        that.permissionDelete = this.permission.notice_delete;
-        that.permissionEdit = this.permission.notice_edit;
-        // }
       });
     },
     //跳转到附件列表页面
@@ -385,18 +384,8 @@
           ? (that.deptCategory = true)
           : (that.deptCategory = false);
 
-        // if (that.deptCategory) {
-        that.permissionAdd = this.permission.notice_add;
-        that.permissionView = this.permission.notice_view;
-        that.permissionDelete = this.permission.notice_delete;
-        that.permissionEdit = this.permission.notice_edit;
-        // }
-
         const { releaseTimeRange } = this.query;
-        // if (that.deptCategory) {
-        // params["deptId"] = this.deptId;
         params["jurisdiction"] = this.jurisdiction;
-        // }
         let values = {
           ...params,
         };
@@ -414,18 +403,6 @@
           const data = res.data.data;
           this.page.total = data.total;
           this.data = data.records;
-          // this.data.forEach((item) => {
-          //   if (item.category == 2) {
-          //     that.option.addBtn = false;
-          //     that.option.editBtn = false;
-          //     that.option.delBtn = false;
-          //   }
-          //   if (item.category == 1) {
-          //     that.option.addBtn = true;
-          //     that.option.editBtn = true;
-          //     that.option.delBtn = true;
-          //   }
-          // });
           this.loading = false;
           this.selectionClear();
         });
diff --git a/src/views/exam/singleperformance.vue b/src/views/exam/singleperformance.vue
index 6528b4e..91e50c7 100644
--- a/src/views/exam/singleperformance.vue
+++ b/src/views/exam/singleperformance.vue
@@ -47,6 +47,7 @@
                 icon="el-icon-collection"
                 class="start-kaoshi"
                 :disabled="row.qualified==1"
+                v-if="permission.singleperformance_print"
                 @click="securityPrint(row)"
                 >保安证打印
               </el-button>
@@ -82,7 +83,7 @@
 
 <script>
 import { getList, update } from "@/api/examapi/performance";
-
+import { mapGetters } from "vuex";
 export default {
   data() {
     var validatePass = (rule, value, callback) => {
@@ -412,6 +413,17 @@
       questionBankSelectionList: [],
     };
   },
+  computed:{
+    ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.user_add, false),
+        viewBtn: this.vaildData(null, false),
+        delBtn: this.vaildData(null, false),
+        editBtn: this.vaildData(this.permission.user_edit, false),
+      };
+    },
+  },
   created() {},
   mounted() {},
   methods: {
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index a03a4e2..1a13380 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -43,6 +43,7 @@
               size="small"
               plain
               icon="el-icon-upload2"
+              v-if="permission.securityGuard_import"
               @click="handleImport1"
               >批量导入
             </el-button>
@@ -52,7 +53,6 @@
               size="small"
               plain
               icon="el-icon-delete"
-              v-if="permission.user_delete"
               @click="handleDelete"
               >注 销
             </el-button>
@@ -121,6 +121,7 @@
               icon="el-icon-edit"
               :size="size"
               :type="type"
+              v-if="permission.securityGuard_delete"
               @click.stop="rowDel(row)"
               >离职登记
             </el-button>
@@ -908,10 +909,10 @@
     ...mapGetters(["userInfo", "permission"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permission.user_add, false),
+        addBtn: this.vaildData(this.permission.securityGuard_add, false),
         viewBtn: this.vaildData(null, false),
-        delBtn: this.vaildData(null, false),
-        editBtn: this.vaildData(this.permission.user_edit, false),
+        delBtn: this.vaildData(this.permission.securityGuard_delete, false),
+        editBtn: this.vaildData(this.permission.securityGuard_edit, false),
       };
     },
     platformPermissionList() {
diff --git a/src/views/workreport/data.js b/src/views/workreport/data.js
index f6c663c..b089e58 100644
--- a/src/views/workreport/data.js
+++ b/src/views/workreport/data.js
@@ -21,7 +21,7 @@
         label: "汇报类别",
         prop: "category",
         type: "select",
-        dicUrl: "/api/blade-system/dict-biz/dictionary?code=workReportCategory",
+        // dicUrl: "/api/blade-system/dict-biz/dictionary?code=workReportCategory",
         cascaderItem: ["receivedIds"],
         props: {
             label: "dictValue",
@@ -78,7 +78,7 @@
         span: 24,
         type: "tree",
         // lazy: true,
-        dicUrl: "/api/blade-system/dept/lazy-tree-user-app?type={{key}}",
+        // dicUrl: "/api/blade-system/dept/lazy-tree-user-app?type={{key}}",
         hide: true,
         props: {
             label: "title",
diff --git a/src/views/workreport/workreply.vue b/src/views/workreport/workreply.vue
index d247fc5..ca07a8c 100644
--- a/src/views/workreport/workreply.vue
+++ b/src/views/workreport/workreply.vue
@@ -99,9 +99,9 @@
     permissionList() {
       return {
         addBtn: this.vaildData(null, false),
-        viewBtn: this.vaildData(this.permission.notice_view, false),
+        viewBtn: this.vaildData(this.permission.workreply_view, false),
         delBtn: this.vaildData(null, false),
-        editBtn: this.vaildData(this.permission.notice_edit, false),
+        editBtn: this.vaildData(this.permission.workreply_edit, false),
       };
     },
     ids() {
diff --git a/src/views/workreport/workreport.vue b/src/views/workreport/workreport.vue
index c4906c2..4a9c1dd 100644
--- a/src/views/workreport/workreport.vue
+++ b/src/views/workreport/workreport.vue
@@ -42,6 +42,7 @@
 
 <script>
 import { workreportColumn } from "./data";
+import { mapState } from "vuex";
 import {
   getListPage,
   remove,
@@ -98,10 +99,10 @@
     ...mapGetters(["permission"]),
     permissionList() {
       return {
-        addBtn: this.vaildData(this.permission.notice_add, false),
-        viewBtn: this.vaildData(this.permission.notice_view, false),
-        delBtn: this.vaildData(this.permission.notice_delete, false),
-        editBtn: this.vaildData(this.permission.notice_edit, false),
+        addBtn: this.vaildData(this.permission.workreport_add, false),
+        viewBtn: this.vaildData(this.permission.workreport_view, false),
+        delBtn: this.vaildData(this.permission.workreport_delete, false),
+        editBtn: this.vaildData(this.permission.workreport_edit, false),
       };
     },
     ids() {
@@ -111,6 +112,9 @@
       });
       return ids.join(",");
     },
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
   },
   mounted() {},
   methods: {
@@ -241,23 +245,25 @@
           ? (that.deptCategory = true)
           : (that.deptCategory = false);
 
-        // const { releaseTimeRange } = this.query;
-        // if (that.deptCategory) {
+        //1:保安公司  2:公安  3:培训公司
+        if(deptCategory == 1 || deptCategory == 3){
+             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(deptCategory == 2){
+             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,
         };
-        // if (releaseTimeRange) {
-        //   values = {
-        //     ...params,
-        //     startTime: releaseTimeRange[0],
-        //     endTime: releaseTimeRange[1],
-        //     ...this.query,
-        //   };
-        //   values.releaseTimeRange = null;
-        // }
         this.loading = true;
         getListPage(page.currentPage, page.pageSize, values).then((res) => {
           const data = res.data.data;

--
Gitblit v1.9.3