From 27c8277d717b34b55f3ea967027b53b067f77df3 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 16:58:49 +0800
Subject: [PATCH] feat 功能变更
---
src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
index 9c9cad4..8620c70 100644
--- a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
+++ b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
@@ -16,6 +16,7 @@
import {
approveFeedback,
deleteFeedback,
+ getBatchRequirements,
getFeedbackPage,
rejectFeedback,
submitFeedback,
@@ -23,6 +24,7 @@
import { $t } from '#/locales';
import FeedbackForm from '../../../pro/feedback/modules/form.vue';
+import BatchInputDialog from '../../../pro/feedback/modules/batch-input-dialog.vue';
defineOptions({ name: 'WorkbenchFeedbackHistoryTab' });
@@ -38,6 +40,19 @@
connectedComponent: FeedbackForm,
destroyOnClose: true,
});
+
+const batchDialogRef = ref<InstanceType<typeof BatchInputDialog>>();
+const approvingRow = ref<MesProFeedbackApi.Feedback>();
+
+/** 鎵ц瀹℃壒锛堝惈鎵规灞炴�э級 */
+async function doApprove(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
+ const finished = await approveFeedback({ id: row.id!, ...batchFields });
+ message.success(
+ finished ? '鎶ュ伐鍗曞凡瀹℃壒瀹屾垚' : '鎶ュ伐鎴愬姛锛岃绛夊緟璐ㄩ噺妫�楠屽畬鎴愶紒',
+ );
+ refreshGrid();
+ emit('reported');
+}
/** 鏌ョ湅璇︽儏 */
function handleDetail(row: MesProFeedbackApi.Feedback) {
@@ -67,12 +82,24 @@
/** 瀹℃壒閫氳繃锛堜粎瀹℃壒涓級 */
async function handleApprove(row: MesProFeedbackApi.Feedback) {
- const finished = await approveFeedback(row.id!);
- message.success(
- finished ? '鎶ュ伐鍗曞凡瀹℃壒瀹屾垚' : '鎶ュ伐鎴愬姛锛岃绛夊緟璐ㄩ噺妫�楠屽畬鎴愶紒',
- );
- refreshGrid();
- emit('reported');
+ try {
+ const checkResult = await getBatchRequirements(row.id!);
+ if (checkResult?.needBatchInput) {
+ approvingRow.value = row;
+ batchDialogRef.value?.open({ checkResult });
+ } else {
+ await doApprove(row);
+ }
+ } catch {
+ await doApprove(row);
+ }
+}
+
+/** 鎵规寮圭獥纭鍥炶皟 */
+function handleBatchConfirm(batchData: Record<string, unknown>) {
+ if (approvingRow.value) {
+ doApprove(approvingRow.value, batchData);
+ }
}
/** 椹冲洖锛堜粎瀹℃壒涓級 */
@@ -100,7 +127,7 @@
width: 160,
slots: { default: 'code' },
},
- { field: 'workOrderCode', title: '宸ュ崟缂栫爜', width: 140 },
+ { field: 'taskCode', title: '浠诲姟缂栫爜', width: 140 },
{ field: 'processName', title: '宸ュ簭', width: 100 },
{ field: 'itemName', title: '浜у搧', minWidth: 120 },
{ field: 'feedbackQuantity', title: '鎶ュ伐鏁伴噺', width: 100 },
@@ -202,6 +229,7 @@
<template>
<div class="feedback-history-tab">
<FormModal @success="refreshGrid" />
+ <BatchInputDialog ref="batchDialogRef" @confirm="handleBatchConfirm" />
<div v-if="!taskId" class="feedback-history-tab__empty">
璇蜂粠宸︿晶宸ュ崟鍒楄〃閫夋嫨涓�鏉′换鍔℃煡鐪嬫姤宸ヨ褰�
--
Gitblit v1.9.3