feat(approval): 员工端派单选人页与详情派单入口 (#24)
This commit is contained in:
@@ -173,3 +173,15 @@ export interface ApprovalOrganization {
|
||||
organizationCode?: string;
|
||||
leaderId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批目录用户(派单候选池)
|
||||
*/
|
||||
export interface ApprovalUser {
|
||||
userId: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user