From 2d50c51214f0ced8c992a415c72ea33b519fff59 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 03 Sep 2021 15:53:05 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory

---
 src/views/workreport/workreport.vue |   52 ++++++++++++++++++++++------------------------------
 1 files changed, 22 insertions(+), 30 deletions(-)

diff --git a/src/views/workreport/workreport.vue b/src/views/workreport/workreport.vue
index da90e2b..09342f1 100644
--- a/src/views/workreport/workreport.vue
+++ b/src/views/workreport/workreport.vue
@@ -27,6 +27,7 @@
           size="small"
           icon="el-icon-delete"
           plain
+          v-if="permission.workreport_delete"
           @click="handleDelete"
           >删 除
         </el-button>
@@ -41,7 +42,6 @@
 </template>
 
 <script>
-import { workreportColumn } from "./data";
 import {
   getListPage,
   remove,
@@ -51,6 +51,8 @@
 } from "@/api/workreport/workreport";
 import { getDept } from "@/api/system/dept";
 import { mapGetters } from "vuex";
+import { mapState } from "vuex";
+import { workreportColumn } from "./data";
 
 export default {
   data() {
@@ -89,7 +91,7 @@
         excelBtn: false,
         menuWidth: 320,
         dialogClickModal: false,
-        column: workreportColumn,
+        column:workreportColumn,
       },
       data: [],
     };
@@ -98,10 +100,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 +113,9 @@
       });
       return ids.join(",");
     },
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
   },
   mounted() {},
   methods: {
@@ -139,6 +144,7 @@
     rowUpdate(row, index, done, loading) {
       row.deptId = this.deptId;
       row.userId = this.userId;
+      row.category = 3;
       // row.receivedIds = row.receivedIds.join(",");
       update(row).then(
         () => {
@@ -238,36 +244,22 @@
       ).content.user_id;
 
       var that = this;
-      getDept(this.deptId).then((res) => {
-        var deptCategory = res.data.data.deptCategory;
-        deptCategory == 1
-          ? (that.deptCategory = true)
-          : (that.deptCategory = false);
+      getDept(this.deptId).then(() => {
+        const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
+        columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type=3&deptId="+that.deptId;
+        params["deptId"] = that.deptId;
+        params["userId"] = that.userId;
 
-        // const { releaseTimeRange } = this.query;
-        // if (that.deptCategory) {
-        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;
+        that.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();
+          that.page.total = data.total;
+          that.data = data.records;
+          that.loading = false;
+          that.selectionClear();
         });
       });
     },

--
Gitblit v1.9.3