From cd8b52bdf89a4d1101f72e0ece9f4df22a3d3f7a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 16:03:32 +0800
Subject: [PATCH] feat(mdm): 物料列表隐藏辅单位与销售价列
---
src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue | 49 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
index 0372990..7edccdf 100644
--- a/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
+++ b/src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
@@ -1,4 +1,5 @@
<script lang="ts" setup>
+import { automaticApproval } from '#/store/audit-policy';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesProFeedbackApi } from '#/api/mes/pro/feedback';
@@ -32,6 +33,7 @@
const props = defineProps<{
taskId?: number;
+ task?: Record<string, any>;
/** 澶栭儴瑙﹀彂鍒锋柊 */
refreshKey?: number;
}>();
@@ -47,7 +49,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 +90,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 +114,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 +127,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);
+ }
}
}
@@ -162,7 +191,7 @@
field: 'feedbackTime',
title: '鎶ュ伐鏃堕棿',
width: 170,
- formatter: 'formatDateTime',
+ formatter: 'formatDate',
},
{
title: '鎿嶄綔',
@@ -290,7 +319,7 @@
</Popconfirm>
<!-- 瀹℃壒涓細鏌ョ湅瀹℃壒 -->
<Button
- v-if="row.status === STATUS_APPROVING"
+ v-if="!automaticApproval && row.status === STATUS_APPROVING"
type="link"
size="small"
@click="handleViewProcess(row)"
--
Gitblit v1.9.3