From 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 12 Jan 2022 10:59:40 +0800
Subject: [PATCH] 新增公司注册机公司注册审核

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

diff --git a/src/views/workreport/workreport.vue b/src/views/workreport/workreport.vue
index 94deb65..5dd2525 100644
--- a/src/views/workreport/workreport.vue
+++ b/src/views/workreport/workreport.vue
@@ -1,5 +1,7 @@
 <template>
-  <basic-container class="workreply">
+  <basic-container
+    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
+  >
     <avue-crud
       :option="option"
       :table-loading="loading"
@@ -42,6 +44,7 @@
 
 <script>
 import { workreportColumn } from "./data";
+import { mapState } from "vuex";
 import {
   getListPage,
   remove,
@@ -51,7 +54,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 {
@@ -69,6 +72,7 @@
         pageSize: 10,
         currentPage: 1,
         total: 0,
+        ...this.$store.state.control.changePageSize,
       },
       selectionList: [],
       option: {
@@ -80,6 +84,8 @@
         searchMenuSpan: 6,
         border: true, //liu
         addBtnText: "发起",
+        saveBtnText: "发起",
+        addTitle: "发起",
         index: true,
         stripe: true,
         viewBtn: true,
@@ -88,6 +94,7 @@
         menuWidth: 320,
         dialogClickModal: false,
         column: workreportColumn,
+        ...this.$store.state.control.clearOtherBut,
       },
       data: [],
     };
@@ -96,10 +103,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() {
@@ -109,6 +116,9 @@
       });
       return ids.join(",");
     },
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
   },
   mounted() {},
   methods: {
@@ -233,38 +243,88 @@
       ).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((res) => {
+      //   var deptCategory = res.data.data.deptCategory;
+      //   deptCategory == 1
+      //     ? (that.deptCategory = true)
+      //     : (that.deptCategory = false);
 
-        // const { releaseTimeRange } = this.query;
-        // if (that.deptCategory) {
-        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",
         };
-        // 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) => {
+
+        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