From 8ae325c7cbe1e4a0e8adf35aff06497baef319ab Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 26 十月 2026 14:02:38 +0800
Subject: [PATCH] feat(mes): 完善工艺路线产出配置功能
---
src/views/mes/workbench/components/WorkstationSelectDialog.vue | 67 ++++++++++++++++++++++++++++++++-
1 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/src/views/mes/workbench/components/WorkstationSelectDialog.vue b/src/views/mes/workbench/components/WorkstationSelectDialog.vue
index 6d5e41d..f066e66 100644
--- a/src/views/mes/workbench/components/WorkstationSelectDialog.vue
+++ b/src/views/mes/workbench/components/WorkstationSelectDialog.vue
@@ -8,6 +8,7 @@
import { Input, Modal, Spin } from 'ant-design-vue';
import { getWorkstationPage } from '#/api/mes/md/workstation';
+import { getPendingFeedbackCountByWorkstation } from '#/api/mes/pro/task';
defineOptions({ name: 'WorkbenchWorkstationSelectDialog' });
@@ -19,6 +20,8 @@
const loading = ref(false);
const workstations = ref<MesMdWorkstationApi.Workstation[]>([]);
const searchKeyword = ref('');
+/** 宸ヤ綔绔欏緟鎶ュ伐浠诲姟鏁帮紝key 涓哄伐浣滅珯缂栧彿锛沶ull 琛ㄧず缁熻鍔犺浇澶辫触锛屼笉灞曠ず */
+const pendingCounts = ref<null | Record<string, number>>(null);
/** 鎵撳紑寮圭獥 */
async function open() {
@@ -31,11 +34,20 @@
async function loadWorkstations() {
loading.value = true;
try {
- const result = await getWorkstationPage({ pageNo: 1, pageSize: 200 });
+ const [result, counts] = await Promise.all([
+ getWorkstationPage({ pageNo: 1, pageSize: 200 }),
+ getPendingFeedbackCountByWorkstation().catch(() => null),
+ ]);
workstations.value = result.list ?? [];
+ pendingCounts.value = counts;
} finally {
loading.value = false;
}
+}
+
+/** 璇ュ伐浣滅珯鐨勫緟瀹屾垚锛堝緟鎶ュ伐锛変换鍔℃暟 */
+function getPendingCount(ws: MesMdWorkstationApi.Workstation) {
+ return pendingCounts.value?.[String(ws.id)] ?? 0;
}
/** 杩囨护鍚庣殑宸ヤ綔绔� */
@@ -102,7 +114,18 @@
{{ ws.processName }}
</span>
</div>
- <div class="ws-card__name">{{ ws.name }}</div>
+ <div class="ws-card__name-row">
+ <span class="ws-card__name">{{ ws.name }}</span>
+ <span
+ v-if="pendingCounts"
+ class="ws-card__pending"
+ :class="{ 'ws-card__pending--empty': getPendingCount(ws) === 0 }"
+ :title="`璇ュ伐浣滅珯寰呮姤宸ヤ换鍔℃暟锛�${getPendingCount(ws)}`"
+ >
+ <IconifyIcon icon="lucide:list-todo" class="ws-card__pending-icon" />
+ 寰呭畬鎴� {{ getPendingCount(ws) }}
+ </span>
+ </div>
<div class="ws-card__info">
<div v-if="ws.workshopName" class="ws-card__info-row">
<IconifyIcon icon="lucide:building-2" class="ws-card__info-icon" />
@@ -209,11 +232,51 @@
color: #fff;
}
+.ws-card__name-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px;
+}
+
.ws-card__name {
+ flex: 1;
+ min-width: 0;
font-size: 15px;
font-weight: 600;
color: #1e3a5f;
line-height: 1.3;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.ws-card__pending {
+ display: inline-flex;
+ flex-shrink: 0;
+ align-items: center;
+ gap: 4px;
+ padding: 3px 9px;
+ border: 1px solid #fdba74;
+ border-radius: 999px;
+ background: #fff7ed;
+ color: #c2410c;
+ font-size: 12px;
+ font-weight: 700;
+ font-variant-numeric: tabular-nums;
+ line-height: 1.4;
+
+ &--empty {
+ border-color: #cbd5e1;
+ background: rgb(255 255 255 / 55%);
+ color: #64748b;
+ font-weight: 600;
+ }
+}
+
+.ws-card__pending-icon {
+ flex-shrink: 0;
+ font-size: 13px;
}
.ws-card__info {
--
Gitblit v1.9.3