From acec519086d3698141bd3c3f1fb171fff41a4a5e Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 6 Jan 2026 20:51:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=86=E7=BB=84=E9=80=BB=E8=BE=91=EF=BC=8C=E4=B8=89?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E7=B1=BB=E6=AD=A3=E7=A1=AE=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB=E7=9A=84=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/CreateTask.vue | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/CreateTask.vue b/frontend/src/views/CreateTask.vue index cbeabbc..177527e 100644 --- a/frontend/src/views/CreateTask.vue +++ b/frontend/src/views/CreateTask.vue @@ -1019,6 +1019,24 @@ const formatDeadline = (date: Date) => { return `${year}-${month}-${day} ${hour}:${minute}` } +// 获取任务类型的部门配置(三级分类从二级父类继承) +const getTypeAllowedDeptIds = (typeInfo: any): string => { + // 如果当前类型有配置,直接返回 + if (typeInfo.allowedDeptIds) { + return typeInfo.allowedDeptIds + } + + // 如果有父级ID,查找父级的配置(三级分类继承二级分类) + if (typeInfo.parentId) { + const parentInfo = findTaskTypeById(typeInfo.parentId, hierarchicalTaskTypes.value) + if (parentInfo && parentInfo.allowedDeptIds) { + return parentInfo.allowedDeptIds + } + } + + return '' +} + // 计算流水线分组 const pipelineGroups = computed(() => { if (formData.taskTypes.length === 0) { @@ -1047,8 +1065,8 @@ const pipelineGroups = computed(() => { const typeInfo = getTaskTypeInfo(taskType.taskTypeId) if (!typeInfo) continue - // 获取接单部门配置 - const deptIds = typeInfo.allowedDeptIds || '' + // 获取接单部门配置(三级分类从二级父类继承) + const deptIds = getTypeAllowedDeptIds(typeInfo) const deptName = getDeptNameFromIds(deptIds) // 判断是否需要创建新分组