From e563871312e934fedf153c4b83ca5ba3b147c36c Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 17 一月 2025 11:47:42 +0800
Subject: [PATCH] 流程推进详情,办理按钮的权限判断完善,转办传递项目id、流程实例id

---
 src/views/flowable/task/myProcess/send/index.vue |    6 +++++-
 src/store/modules/user.js                        |    5 +++++
 src/views/projectProcess/detail/index.vue        |    2 +-
 src/plugins/auth.js                              |    1 +
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/plugins/auth.js b/src/plugins/auth.js
index 6c6bc24..799b1ba 100644
--- a/src/plugins/auth.js
+++ b/src/plugins/auth.js
@@ -15,6 +15,7 @@
 function authRole(role) {
   const super_admin = "admin";
   const roles = store.getters && store.getters.roles
+  console.log("褰撳墠鐢ㄦ埛瑙掕壊", roles)
   if (role && role.length > 0) {
     return roles.some(v => {
       return super_admin === v || v === role
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 115cb18..7906a53 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -9,6 +9,7 @@
     avatar: '',
     deptId: null,
     roles: [],
+    roleIds: [],
     permissions: []
   },
 
@@ -27,6 +28,9 @@
     },
     SET_ROLES: (state, roles) => {
       state.roles = roles
+    },
+    SET_ROLE_IDS: (state, roleIds) => {
+      state.roleIds = roleIds
     },
     SET_DEPT: (state, deptId) => {
       state.deptId = deptId
@@ -67,6 +71,7 @@
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_ID', user.userId)
+          commit('SET_ROLE_IDS', user.roles.map(role => role.roleId))
           commit('SET_NAME', user.userName)
           commit('SET_DEPT', user.deptId)
           commit('SET_AVATAR', avatar)
diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue
index 52bda98..b3eaa13 100644
--- a/src/views/flowable/task/myProcess/send/index.vue
+++ b/src/views/flowable/task/myProcess/send/index.vue
@@ -217,7 +217,9 @@
         taskId: '',
         peopleType: '',
         targetId: '',
-        taskName: ''
+        taskName: '',
+        processInsId: '',
+        projectId: '',
       },
       delegationShow: false, // 杞姙鏄剧ず
       rejectShow: false, // 椹冲洖鏄剧ず
@@ -313,6 +315,8 @@
             cancelButtonText: '鍙栨秷',
             type: 'warning'
           }).then(() => {
+            this.delegationForm.projectId = this.goBackParams.projectId
+            this.delegationForm.processInsId = this.procInsId
             this.delegationButLoading = true
             taskDelegation(this.delegationForm).then(res => {
               this.$message.success("宸插彂璧疯浆鍔炵敵璇�")
diff --git a/src/views/projectProcess/detail/index.vue b/src/views/projectProcess/detail/index.vue
index 3c05cf5..2929716 100644
--- a/src/views/projectProcess/detail/index.vue
+++ b/src/views/projectProcess/detail/index.vue
@@ -198,7 +198,7 @@
           return row.handlerUnitId.indexOf(this.$store.state.user.deptId) !== -1
           // return this.$store.state.user.name === '甯傚彂灞曟敼闈╁' || this.$store.state.user.name === '甯備綇寤哄眬'
         } else if (row.handlerType === "ROLE") {
-          return this.$auth.hasRole(row.handlerUnitName)
+          return row.handlerUnitId.some(roleId => this.$store.state.user.roleIds.indexOf(roleId) !== -1)
         }
       } else {
         return false

--
Gitblit v1.8.0