feat(approval): 单据查询页面与只读详情 (#25)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { ApprovalOrganization, ApprovalUser } from '../instance/model';
|
||||
import { THINK_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 启用组织(审批管理下拉)
|
||||
*/
|
||||
export async function listApprovalOrganizations() {
|
||||
const res = await request.get<ApiResult<ApprovalOrganization[]>>(
|
||||
THINK_API_URL + '/approval/directory/organizations'
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用用户远程搜索(审批管理下拉)
|
||||
*/
|
||||
export async function searchApprovalUsers(params?: {
|
||||
keywords?: string;
|
||||
organizationId?: number;
|
||||
}) {
|
||||
const res = await request.get<ApiResult<ApprovalUser[]>>(
|
||||
THINK_API_URL + '/approval/directory/users',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Reference in New Issue
Block a user