fix: 设计师可看到直接分配的普通任务 + 审核卡片显示加急图标

This commit is contained in:
Your Name 2026-01-08 09:36:08 +08:00
parent 9f62f4ba9c
commit 69815945a1
2 changed files with 39 additions and 13 deletions

View File

@ -223,7 +223,7 @@ public class TaskItemService {
// 检查用户部门或其父部门是否在允许列表中(子部门继承父部门权限)
String[] allowedIds = allowedDeptIds.split(",");
Set<Long> allowedDeptIdSet = new HashSet<>();
for (String allowedId : allowedIds) {
for (String allowedId : allowedIds) {
try {
allowedDeptIdSet.add(Long.parseLong(allowedId.trim()));
} catch (NumberFormatException e) {
@ -236,9 +236,9 @@ public class TaskItemService {
Long currentDeptId = user.getDeptId();
while (currentDeptId != null) {
if (allowedDeptIdSet.contains(currentDeptId)) {
isAllowed = true;
break;
}
isAllowed = true;
break;
}
// 向上查找父部门
com.designhub.entity.Department currentDept = departmentMapper.selectById(currentDeptId);
if (currentDept != null && currentDept.getParentId() != null) {
@ -248,8 +248,8 @@ public class TaskItemService {
}
}
if (!isAllowed) {
throw new BusinessException(ResultCode.FORBIDDEN, "您的部门无权接收此类型的任务");
if (!isAllowed) {
throw new BusinessException(ResultCode.FORBIDDEN, "您的部门无权接收此类型的任务");
}
}
}
@ -880,8 +880,8 @@ public class TaskItemService {
// 格式化工时显示(与第一轮一致)
String hoursDisplay = formatEstimatedHours(item.getEstimatedHours());
content.append(" \n");
content.append(" \n");
content.append("▸ **").append(deptName).append("** | ")
.append(item.getTotalScore()).append("分 | ")
.append(hoursDisplay).append(" \n");
@ -901,7 +901,7 @@ public class TaskItemService {
content.append("  └ ").append(typeName)
.append(" ×").append(qty)
.append(" = ").append(score).append("分 \n");
}
}
} catch (Exception e) {
log.warn("解析任务类型明细失败: {}", e.getMessage());
}

View File

@ -540,6 +540,11 @@
<Icon name="file-text" size="sm" color="#31f08b" style="margin-right: 4px; vertical-align: middle;" />
待审核
</span>
<!-- 加急图标 -->
<span v-if="task.isUrgent" class="badge badge-urgent">
<Icon name="fire" size="sm" color="#ff4d4f" style="margin-right: 4px; vertical-align: middle;" />
加急
</span>
</div>
</div>
@ -3717,12 +3722,33 @@ const loadInProgressTasks = async () => {
totalCount = allTasks.length
}
} else {
// 接单部门用户(设计师):只看子任务卡片
const itemResponse = await taskApi.getInProgressTaskItems(params)
// 接单部门用户(设计师):看子任务卡片 + 直接分配给自己的普通任务
const [itemResponse, taskResponse] = await Promise.all([
taskApi.getInProgressTaskItems(params),
// 获取直接分配给当前用户的普通任务(非流水线任务)
taskApi.getTasks({
...params,
role: 'receiver' // 以接单人身份查询
})
])
// 处理子任务
if (itemResponse.data && itemResponse.data.records) {
const items = itemResponse.data.records.map((item: any) => mapTaskItemToTask(item))
allTasks = items
totalCount = itemResponse.data.total || 0
allTasks = [...allTasks, ...items]
totalCount += itemResponse.data.total || 0
}
// 处理直接分配的普通任务(排除流水线任务,因为流水线任务由子任务显示)
if (taskResponse.data && taskResponse.data.records) {
const normalTasks = taskResponse.data.records
.filter((task: any) => task.isPipeline !== 1) // 排除流水线任务
.map((task: any) => ({
...task,
isSubTask: false
}))
allTasks = [...allTasks, ...normalTasks]
totalCount += normalTasks.length
}
}