From 22229c67d87f0fae4c4bc90db106b8a1e2c49b53 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 20 八月 2026 15:50:11 +0800
Subject: [PATCH] feat(permission): 为多个模块添加管理员权限控制功能

---
 src/views/productionManagement/workOrder/index.vue |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 13f0a24..d8cc499 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -508,8 +508,13 @@
   import { getCurrentInstance, reactive, toRefs } from "vue";
   import FilesDia from "./components/filesDia.vue";
   import { getDeviceLedger } from "@/api/equipmentManagement/ledger.js";
+  import useUserStore from "@/store/modules/user";
 
   const { proxy } = getCurrentInstance();
+  const userStore = useUserStore();
+  const isAdminUser = computed(() =>
+    ["admin", "鏅��2", "鏈�楂�1"].some(r => (userStore.roles || []).includes(r))
+  );
 
   const currentUserId = ref("");
   const deviceOptions = ref([]);
@@ -577,9 +582,13 @@
     return ids.includes(uid);
   };
 
-  // 鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鍙互鎶ュ伐锛堝伐鍗曟姤宸ヤ汉 鎴� 宸ュ簭鎶ュ伐浜猴級
+  // 鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鍙互鎶ュ伐锛堝伐鍗曟姤宸ヤ汉 鎴� 宸ュ簭鎶ュ伐浜猴紝绠$悊鍛樹笉鍙楅檺锛�
   const canCurrentUserReport = row => {
-    return isCurrentUserInUserIds(row) || isCurrentUserInProcessUserIds(row);
+    return (
+      isAdminUser.value ||
+      isCurrentUserInUserIds(row) ||
+      isCurrentUserInProcessUserIds(row)
+    );
   };
 
   const canOperateByReportWorker = computed(() => {
@@ -1800,6 +1809,8 @@
 
   // 鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鑳芥帓浜�
   const canScheduleByWorkOrderNo = row => {
+    // 绠$悊鍛樺彲鎺掍骇
+    if (isAdminUser.value) return true;
     if (!row) return false;
 
     const uid = String(currentUserId.value || "");

--
Gitblit v1.9.3