From 2457f13d437016947757d4bf6d8bbc903afa14a9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 22 Jan 2026 11:43:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E7=BA=A7=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=94=A8=E6=88=B7=E5=8F=91=E5=B8=83=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=B6=E4=BD=BF=E7=94=A8=E6=99=AE=E9=80=9A=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3=EF=BC=88=E4=B8=8D=E5=A1=AB=E5=86=99?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=98=8E=E7=BB=86=E6=97=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/CreateTask.vue | 46 ++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/CreateTask.vue b/frontend/src/views/CreateTask.vue index faa217b..94200f0 100644 --- a/frontend/src/views/CreateTask.vue +++ b/frontend/src/views/CreateTask.vue @@ -1610,10 +1610,13 @@ const handleSubmit = async () => { const attachmentUrl = attachmentUrls.length > 0 ? attachmentUrls.join(',') : formData.attachmentUrl console.log('[提交任务] 最终attachmentUrl:', attachmentUrl) + // 判断是否是一级需求部门用户且不填写任务明细 + const isPrimaryDeptWithoutDetail = isPrimaryDeptUser.value && !shouldShowTaskDetail.value + // 流水线任务(固定使用顺序流水线模式) const pipelineData = { title: formData.title, - isPipeline: true, + isPipeline: !isPrimaryDeptWithoutDetail, // 一级需求部门不填明细时,不标记为流水线任务 pipelineMode: 'sequential', // 固定为顺序流水线 items: validTaskTypes.map((item, index) => ({ taskTypeId: item.taskTypeId!, @@ -1654,13 +1657,42 @@ const handleSubmit = async () => { } } else { // 新建模式 - response = await taskApi.createPipelineTask(pipelineData) + if (isPrimaryDeptWithoutDetail) { + // 一级需求部门不填写任务明细时,使用普通任务创建接口 + // 任务明细将由需求部门在审核时填写 + const taskData = { + title: formData.title, + brandId: formData.brandId, + platformId: formData.platformId, + categoryId: formData.categoryId, + spuInfo: formData.spuInfo, + taskSubType: formData.taskSubType, + attachmentUrl: attachmentUrl, + remark: formData.remark || '', + priority: formData.isUrgent ? 3 : 1, + releaseType: formData.releaseType, + productBarcodes: formData.productBarcodes, + previewImage: formData.previewImage, + isPrimaryDeptTask: true // 标记为一级需求部门任务 + } + response = await taskApi.createTask(taskData as any) + + if (response.code === 200) { + message.success('任务已提交,等待需求部门完善明细') + setTimeout(() => { + router.push('/tasks') + }, 1000) + } + } else { + // 普通流水线任务 + response = await taskApi.createPipelineTask(pipelineData) - if (response.code === 200) { - message.success('流水线任务创建成功') - setTimeout(() => { - router.push('/tasks') - }, 1000) + if (response.code === 200) { + message.success('流水线任务创建成功') + setTimeout(() => { + router.push('/tasks') + }, 1000) + } } } } catch (error: any) {