From c6ce881a26895edc9e89aea8317be15572f48b23 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期六, 29 八月 2026 02:26:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue | 44 ++++++++++++++++++++++++++++++++++++--------
1 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
index 0372990..2f7092e 100644
--- a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
+++ b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
@@ -32,6 +32,7 @@
const props = defineProps<{
taskId?: number;
+ task?: Record<string, any>;
/** 澶栭儴瑙﹀彂鍒锋柊 */
refreshKey?: number;
}>();
@@ -47,7 +48,16 @@
const router = useRouter();
const batchDialogRef = ref<InstanceType<typeof BatchInputDialog>>();
-const approvingRow = ref<MesProFeedbackApi.Feedback>();
+const batchActionType = ref<'submit' | 'approve'>('approve');
+const actionRow = ref<MesProFeedbackApi.Feedback>();
+
+/** 鎵ц鎻愪氦锛堝惈鎵规灞炴�э級 */
+async function doSubmit(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
+ await submitFeedback({ id: row.id!, ...batchFields });
+ message.success('鎶ュ伐鍗曞凡鎻愪氦');
+ refreshGrid();
+ emit('reported');
+}
/** 鎵ц瀹℃壒锛堝惈鎵规灞炴�э級 */
async function doApprove(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
@@ -79,10 +89,23 @@
/** 鎻愪氦锛堜粎鑽夌锛� */
async function handleSubmit(row: MesProFeedbackApi.Feedback) {
- await submitFeedback({ id: row.id! });
- message.success('鎶ュ伐鍗曞凡鎻愪氦');
- refreshGrid();
- emit('reported');
+ if (props.task?.feedbackApprove) {
+ await doSubmit(row);
+ return;
+ }
+
+ try {
+ const checkResult = await getBatchRequirements(row.id!);
+ if (checkResult?.needBatchInput) {
+ batchActionType.value = 'submit';
+ actionRow.value = row;
+ batchDialogRef.value?.open({ checkResult });
+ } else {
+ await doSubmit(row);
+ }
+ } catch {
+ await doSubmit(row);
+ }
}
/** 瀹℃壒閫氳繃锛堜粎瀹℃壒涓級 */
@@ -90,7 +113,8 @@
try {
const checkResult = await getBatchRequirements(row.id!);
if (checkResult?.needBatchInput) {
- approvingRow.value = row;
+ batchActionType.value = 'approve';
+ actionRow.value = row;
batchDialogRef.value?.open({ checkResult });
} else {
await doApprove(row);
@@ -102,8 +126,12 @@
/** 鎵规寮圭獥纭鍥炶皟 */
function handleBatchConfirm(batchData: Record<string, unknown>) {
- if (approvingRow.value) {
- doApprove(approvingRow.value, batchData);
+ if (actionRow.value) {
+ if (batchActionType.value === 'approve') {
+ doApprove(actionRow.value, batchData);
+ } else if (batchActionType.value === 'submit') {
+ doSubmit(actionRow.value, batchData);
+ }
}
}
--
Gitblit v1.9.3