feat(approval): 员工端派单选人页与详情派单入口 (#24)

This commit is contained in:
2026-10-30 21:42:04 +08:00
parent 2e774ea064
commit 0f68108574
5 changed files with 308 additions and 2 deletions
+28 -1
View File
@@ -1,6 +1,6 @@
import request from '@/utils/request';
import type { ApiResult } from '@/api';
import type { ApprovalInstance } from '../model';
import type { ApprovalInstance, ApprovalUser } from '../model';
import { THINK_API_URL } from '@/config/setting';
/**
@@ -70,6 +70,33 @@ export async function archiveTask(id: number) {
return Promise.reject(new Error(res.data.message));
}
/**
* 派单候选池(仅派单节点、本人待办)
*/
export async function listDispatchCandidates(id: number) {
const res = await request.get<ApiResult<ApprovalUser[]>>(
THINK_API_URL + '/approval/task/' + id + '/candidates'
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 派单(选定 1 人即完成派单节点)
*/
export async function dispatchTask(id: number, targetUserId: number) {
const res = await request.post<ApiResult<ApprovalInstance>>(
THINK_API_URL + '/approval/task/' + id + '/dispatch',
{ targetUserId }
);
if (res.data.code === 0 && res.data.data) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 撤回
*/