From cca940a6460bc4ec4266df4e413b05921d1f2e1d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 16 四月 2026 09:55:16 +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