From 889d8ddf4c13c1b1bdbabd04c2d80b904020151e Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期三, 19 八月 2026 12:49:24 +0800
Subject: [PATCH] 生产订单与报工模块改造汇总 (Git Commit 文档) feat(mes-pro): 生产订单及报工模块审批流与批次填报改造 1. 生产订单功能增强 (Work Order)
---
src/views/mes/workbench/index.vue | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/src/views/mes/workbench/index.vue b/src/views/mes/workbench/index.vue
index b49191b..3661475 100644
--- a/src/views/mes/workbench/index.vue
+++ b/src/views/mes/workbench/index.vue
@@ -17,6 +17,7 @@
} from '#/api/mes/pro/workrecord';
import { getPendingFeedbackPage } from '#/api/mes/pro/task';
import { router } from '#/router';
+import { useAccess } from '@vben/access';
import TaskListPanel from './components/TaskListPanel.vue';
import WorkstationPanel from './components/WorkstationPanel.vue';
@@ -33,16 +34,36 @@
// --- Tab 閰嶇疆 ---
const tabItems: WorkbenchTabItem[] = [
{ key: 'detail', label: '宸ュ崟璇︽儏', icon: 'lucide:file-text' },
- { key: 'feedback', label: '鎶ュ伐', icon: 'lucide:edit-3' },
- { key: 'history', label: '鎶ュ伐璁板綍', icon: 'lucide:history' },
+ { key: 'feedback', label: '鎶ュ伐', icon: 'lucide:edit-3', auth: ['mes:pro-feedback:create'] },
+ { key: 'history', label: '鎶ュ伐璁板綍', icon: 'lucide:history' ,auth: ['mes:pro-feedback:query']},
{ key: 'record-param', label: '鐢熶骇璁板綍鍙傛暟', icon: 'lucide:file-cog' },
{ key: 'product-issue', label: '棰嗘枡', icon: 'lucide:clipboard-list' },
{ key: 'return-issue', label: '閫�鏂�', icon: 'lucide:rotate-ccw' },
];
+const { hasAccessByCodes } = useAccess();
+
+const availableTabs = computed(() => {
+ return tabItems.filter((tab) => {
+ if (!tab.auth || tab.auth.length === 0) return true;
+ return hasAccessByCodes(tab.auth);
+ });
+});
+
const activeTab = ref<WorkbenchTabKey>('detail');
const activeTabLabel = computed(
- () => tabItems.find((t) => t.key === activeTab.value)?.label ?? '',
+ () => availableTabs.value.find((t) => t.key === activeTab.value)?.label ?? '',
+);
+
+// 褰撳彲鐢� tab 鍙樺寲鏃讹紝濡傛灉褰撳墠閫変腑鐨� tab 涓嶅彲鐢紝鍒欒嚜鍔ㄩ�夋嫨绗竴涓彲鐢ㄧ殑 tab
+watch(
+ availableTabs,
+ (tabs) => {
+ if (tabs.length > 0 && !tabs.find((t) => t.key === activeTab.value)) {
+ activeTab.value = tabs[0]!.key;
+ }
+ },
+ { immediate: true },
);
// --- 宸ヤ綔绔� ---
@@ -176,7 +197,7 @@
<nav class="workbench-nav">
<button
- v-for="tab in tabItems"
+ v-for="tab in availableTabs"
:key="tab.key"
type="button"
class="workbench-nav__item"
--
Gitblit v1.9.3