feat: PC 端补齐直接完结通道
- taskApi.transferTask 增 finishDirectly 参数,按新 Schema 发送
{ next_tasks: [], finish_directly: true, note }
- TaskTransferPayload 支持 next_tasks / finish_directly,旧版单线字段降为可选
(后端仍兼容 next_assignees / next_task_name,存量调用不受影响)
- 共享 TransferModal 新增「🏁 直接完结(无下游,不入库)」开关:
与入库互斥,选中后下游字段禁用(保留输入便于反悔切回)、
切换独立标题/提示/预览/提交按钮,不再套用「将创建 N 个任务」模板
- 表单重置改为「展开时重置」:TransferModal 被 memo 后常驻挂载会跨次残留状态,
且原实现于提交时清空会让等待期主题从「直接完结」闪回普通转交
- TaskTreeViewer 与 AdminTasksPage 两个入口的 handleTransfer 签名对齐
This commit is contained in:
@ -114,20 +114,25 @@ export async function rejectTask(
|
||||
/**
|
||||
* 完工裂变转交 — → COMPLETED,批量创建下家任务。
|
||||
* 对应后端 POST /api/v1/tasks/{taskId}/transfer
|
||||
*
|
||||
* finishDirectly=true 时走「直接完结」通道:next_tasks 留空 + finish_directly=true,
|
||||
* 后端据此跳过分支解析,只闭环任务【不产生下游任务】、且不改产品宏观状态
|
||||
* (不会把产品误标成「待仓库收货」)。用于售后返厂直接发走 / 半成品被提走等无需入库的收官场景。
|
||||
*/
|
||||
export async function transferTask(
|
||||
taskId: string,
|
||||
nextAssignees: string[],
|
||||
nextTaskName: string,
|
||||
note?: string
|
||||
note?: string,
|
||||
finishDirectly = false
|
||||
): Promise<TaskTransferResponse> {
|
||||
const payload: TaskTransferPayload = finishDirectly
|
||||
? { next_tasks: [], finish_directly: true, note }
|
||||
: { next_assignees: nextAssignees, next_task_name: nextTaskName, note };
|
||||
|
||||
const { data } = await api.post<TaskTransferResponse>(
|
||||
`/tasks/${taskId}/transfer`,
|
||||
{
|
||||
next_assignees: nextAssignees,
|
||||
next_task_name: nextTaskName,
|
||||
note,
|
||||
} satisfies TaskTransferPayload
|
||||
payload
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user