From 1b23ee033270d2ebffb4e8af15a7bc1610cabad8 Mon Sep 17 00:00:00 2001 From: chenyuan Date: Tue, 27 Oct 2026 23:33:55 +0800 Subject: [PATCH] fix(hardware-cost): separate step-4 save from submit with distinct toasts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit saveStepFour hardcoded saveAction SUBMIT, so the step-4 save button also submitted the task and both paths toasted '成本优化决策已保存', leaving students unsure whether they had submitted (实训4.1). The toolbar submit now goes through submitTask() -> SUBMIT + '任务提交成功', while the step save keeps a SAVE draft + the original toast. --- src/views/product/hardware-cost.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/product/hardware-cost.vue b/src/views/product/hardware-cost.vue index 6121acb..5449cbb 100644 --- a/src/views/product/hardware-cost.vue +++ b/src/views/product/hardware-cost.vue @@ -22,7 +22,7 @@
- +
@@ -743,7 +743,9 @@ async function handleCostChartUpload(event, type) { uploadingChart.value = "" } } -async function saveStepFour() { +function submitTask() { return saveStepFour(true) } + +async function saveStepFour(submit = false) { savingStepFour.value = true try { const payload = stepFourPayload() @@ -753,15 +755,15 @@ async function saveStepFour() { if (!validated.valid) { notifyError(validated.message || "请完善成本结构图和优化方案"); return } await saveStudentTrainingAnswer(TASK_KEY, { currentStep: 4, - saveAction: "SUBMIT", - submitted: true, + saveAction: submit ? "SUBMIT" : "SAVE", + submitted: submit, step4Answer: JSON.stringify({ smallBatchChart: { ...stepFour.smallBatchChart }, largeBatchChart: { ...stepFour.largeBatchChart }, optimizationPlan: payload.optimizationPlan, }), }) - notifySuccess("成本优化决策已保存") + notifySuccess(submit ? "任务提交成功" : "成本优化决策已保存") } catch (error) { notifyError(error?.message || "成本优化决策保存失败,请检查填写内容") } finally {