lex 2 anni fa
parent
commit
d746549213
1 ha cambiato i file con 43 aggiunte e 31 eliminazioni
  1. 43 31
      src/views/process/list/handle.vue

+ 43 - 31
src/views/process/list/handle.vue

@@ -309,6 +309,7 @@ import {
   asyncPlayLog,
   queryUserInfo,
   queryAllOrgan,
+  queryTeacherOrgan,
   orderComment
 } from "@/api/process/work-order";
 import store from "@/store";
@@ -372,6 +373,7 @@ export default {
       },
       userIds: null,
       tenantId: 1,
+      userType: "SYSTEM",
       btn_group: [],
       is_end: 0, // 是否结束
       remoteFunc: {
@@ -511,6 +513,7 @@ export default {
         if (res.code == 200) {
           this.userIds = res.data.id;
           this.tenantId = res.data.tenantId;
+          this.userType = res.data.userType;
         } else {
           this.$message.error(res.data);
         }
@@ -986,37 +989,46 @@ export default {
     //   })
     // },
     async getAllOrgan() {
-      await queryAllOrgan({ tenantId: this.tenantId }).then(res => {
-        if (res.code == 200) {
-          const result = res.data;
-          const filterOrganId = [
-            36,
-            39,
-            41,
-            42,
-            43,
-            44,
-            45,
-            46,
-            47,
-            48,
-            49,
-            50,
-            52,
-            54,
-            55,
-            56
-          ];
-          let tempOrgan = [];
-          // 过滤不会显示的分部
-          result.forEach(item => {
-            if (!filterOrganId.includes(item.id)) {
-              tempOrgan.push(item);
-            }
-          });
-          this.organList = tempOrgan;
-        }
-      });
+      // 获取分部
+      console.log(this.tenantId, "tenantId");
+      if (this.userType.indexOf("SYSTEM") != -1) {
+        queryAllOrgan({ tenantId: this.tenantId }).then((res) => {
+          if (res.code == 200) {
+            const result = res.data;
+            const filterOrganId = [
+              36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
+            ];
+            let tempOrgan = [];
+            // 过滤不会显示的分部
+            result.forEach((item) => {
+              if (!filterOrganId.includes(item.id)) {
+                tempOrgan.push(item);
+              }
+            });
+            this.organList = tempOrgan;
+          }
+        });
+      } else {
+        queryTeacherOrgan({ tenantId: this.tenantId }).then((res) => {
+          if (res.code == 200) {
+            const result = res.data;
+            const filterOrganId = [
+              36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56,
+            ];
+            let tempOrgan = [];
+            // 过滤不会显示的分部
+            result.forEach((item) => {
+              if (!filterOrganId.includes(item.key)) {
+                tempOrgan.push({
+                  id: item.key,
+                  name: item.value,
+                });
+              }
+            });
+            this.organList = tempOrgan;
+          }
+        });
+      }
     },
     dataModelFormatBr(str) {
       return str ? str.replace(/\n/g, "<br />") : str;