From 5e094c32ab1733d303f74d0b59edeb3b4047505d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 15 四月 2026 17:54:44 +0800
Subject: [PATCH] 中兴实强 1.报工列表展示报工人,非本订单报工人不可报工 其他

---
 src/views/productionManagement/workOrder/index.vue |   39 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 162dd91..6bd3d2b 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -237,6 +237,21 @@
   import { getCurrentInstance, reactive, toRefs } from "vue";
   import FilesDia from "./components/filesDia.vue";
   const { proxy } = getCurrentInstance();
+  const currentLoginUserId = ref("");
+
+  const normalizeId = value => String(value ?? "").trim();
+
+  const parseReportUserIds = reportUserIds =>
+    String(reportUserIds ?? "")
+      .split(",")
+      .map(item => item.trim())
+      .filter(Boolean);
+
+  const canCurrentUserReport = row => {
+    const currentUserId = normalizeId(currentLoginUserId.value);
+    if (!currentUserId) return false;
+    return parseReportUserIds(row?.reportUserIds).includes(currentUserId);
+  };
 
   const tableColumn = ref([
     {
@@ -270,6 +285,11 @@
     {
       label: "宸ュ簭鍚嶇О",
       prop: "processName",
+    },
+    {
+      label: "鎶ュ伐浜�",
+      prop: "reportUserNames",
+      width: "140",
     },
     {
       label: "闇�姹傛暟閲�",
@@ -338,7 +358,7 @@
           clickFun: row => {
             showReportDialog(row);
           },
-          disabled: row => row.planQuantity <= 0,
+          disabled: row => row.planQuantity <= 0 || !canCurrentUserReport(row),
         },
       ],
     },
@@ -595,6 +615,10 @@
   };
 
   const showReportDialog = row => {
+    if (!canCurrentUserReport(row)) {
+      proxy.$modal.msgWarning("褰撳墠鐧诲綍鐢ㄦ埛娌℃湁璇ュ伐鍗曠殑鎶ュ伐鏉冮檺");
+      return;
+    }
     currentReportRowData.value = row;
     reportForm.planQuantity = row.planQuantity;
     reportForm.quantity =
@@ -718,6 +742,18 @@
   };
 
   // 鐢ㄦ埛閫夋嫨鍙樺寲鏃舵洿鏂� userName
+  const getCurrentLoginUser = () => {
+    getUserProfile()
+      .then(res => {
+        if (res.code === 200) {
+          currentLoginUserId.value = normalizeId(res.data?.userId);
+        }
+      })
+      .catch(err => {
+        console.error("鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛澶辫触", err);
+      });
+  };
+
   const handleUserChange = userId => {
     if (userId) {
       const selectedUser = userOptions.value.find(user => user.userId === userId);
@@ -730,6 +766,7 @@
   };
 
   onMounted(() => {
+    getCurrentLoginUser();
     getList();
     getUserList();
   });

--
Gitblit v1.9.3