| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- import { axiosInstance } from '/@/utils/axios-utils';
- const BASE = '/api';
- // ── 流程定义扩展 ──
- export function publishFlow(id: number) {
- return axiosInstance.post(`${BASE}/approvalFlow/publish`, { id });
- }
- export function getBizTypes() {
- return axiosInstance.get<any>(`${BASE}/approvalFlow/bizTypes`);
- }
- // ── 业务类型管理 ──
- export function getBizTypeList() {
- return axiosInstance.get<any>(`${BASE}/bizType/list`);
- }
- export function getBizTypePage(data: { page: number; pageSize: number; code?: string; name?: string }) {
- return axiosInstance.post<any>(`${BASE}/bizType/page`, data);
- }
- export function addBizType(data: { code: string; name: string; remark?: string; isEnabled?: boolean }) {
- return axiosInstance.post<any>(`${BASE}/bizType/add`, data);
- }
- export function updateBizType(data: { id: number; code: string; name: string; remark?: string; isEnabled?: boolean }) {
- return axiosInstance.post(`${BASE}/bizType/update`, data);
- }
- export function deleteBizType(data: { id: number }) {
- return axiosInstance.post(`${BASE}/bizType/delete`, data);
- }
- // ── 流程实例 ──
- export function startFlow(data: { bizType: string; bizId: number; bizNo?: string; title?: string; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowInstance/start`, data);
- }
- export function getInstanceDetail(id: number) {
- return axiosInstance.get<any>(`${BASE}/flowInstance/detail`, { params: { id } });
- }
- export function getInstanceByBiz(bizType: string, bizId: number) {
- return axiosInstance.get<any>(`${BASE}/flowInstance/getByBiz`, { params: { bizType, bizId } });
- }
- export function getTimeline(instanceId: number) {
- return axiosInstance.get<any>(`${BASE}/flowInstance/timeline`, { params: { instanceId } });
- }
- // ── 审批任务 ──
- export function myPendingPage(data: { page: number; pageSize: number; bizType?: string }) {
- return axiosInstance.post<any>(`${BASE}/flowTask/myPendingPage`, data);
- }
- export function myDonePage(data: { page: number; pageSize: number; bizType?: string }) {
- return axiosInstance.post<any>(`${BASE}/flowTask/myDonePage`, data);
- }
- export function myInitiatedPage(data: { page: number; pageSize: number; bizType?: string; status?: number }) {
- return axiosInstance.post<any>(`${BASE}/flowTask/myInitiatedPage`, data);
- }
- export function myPendingCount() {
- return axiosInstance.get<any>(`${BASE}/flowTask/myPendingCount`);
- }
- export function approveTask(data: { taskId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/approve`, data);
- }
- export function rejectTask(data: { taskId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/reject`, data);
- }
- export function transferTask(data: { taskId: number; targetUserId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/transfer`, data);
- }
- export function withdrawFlow(data: { instanceId: number }) {
- return axiosInstance.post(`${BASE}/flowTask/withdraw`, data);
- }
- export function returnToPrev(data: { taskId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/returnToPrev`, data);
- }
- export function addSign(data: { taskId: number; targetUserId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/addSign`, data);
- }
- export function urgeFlow(data: { instanceId: number }) {
- return axiosInstance.post(`${BASE}/flowTask/urge`, data);
- }
- export function escalateTask(data: { taskId: number; comment?: string }) {
- return axiosInstance.post(`${BASE}/flowTask/escalate`, data);
- }
- export function getEscalationConfig(taskId: number) {
- return axiosInstance.get<any>(`${BASE}/flowTask/getEscalationConfig`, { params: { taskId } });
- }
- export function batchApprove(data: { taskIds: number[]; comment?: string }) {
- return axiosInstance.post<any>(`${BASE}/flowTask/batchApprove`, data);
- }
- export function batchReject(data: { taskIds: number[]; comment?: string }) {
- return axiosInstance.post<any>(`${BASE}/flowTask/batchReject`, data);
- }
- // ── 版本管理 ──
- export function getVersionHistory(flowId: number) {
- return axiosInstance.get<any>(`${BASE}/approvalFlow/versionHistory`, { params: { flowId } });
- }
- export function getVersionDetail(versionId: number) {
- return axiosInstance.get<any>(`${BASE}/approvalFlow/versionDetail`, { params: { versionId } });
- }
- export function revertVersion(data: { id: number }) {
- return axiosInstance.post(`${BASE}/approvalFlow/revertVersion`, data);
- }
- // ── 意见模板 ──
- export function getCommentTemplates() {
- return axiosInstance.get<any>(`${BASE}/flowCommentTemplate/myList`);
- }
- export function addCommentTemplate(data: { content: string; orderNo?: number }) {
- return axiosInstance.post<any>(`${BASE}/flowCommentTemplate/add`, data);
- }
- export function deleteCommentTemplate(data: { id: number }) {
- return axiosInstance.post(`${BASE}/flowCommentTemplate/delete`, data);
- }
- // ── 审批代理 ──
- export function getMyDelegates() {
- return axiosInstance.get<any>(`${BASE}/flowDelegate/myList`);
- }
- export function addDelegate(data: { delegateUserId: number; startTime: string; endTime: string; bizType?: string; remark?: string }) {
- return axiosInstance.post<any>(`${BASE}/flowDelegate/add`, data);
- }
- export function updateDelegate(data: { id: number; delegateUserId: number; startTime: string; endTime: string; bizType?: string; remark?: string; isEnabled: boolean }) {
- return axiosInstance.post(`${BASE}/flowDelegate/update`, data);
- }
- export function deleteDelegate(data: { id: number }) {
- return axiosInstance.post(`${BASE}/flowDelegate/delete`, data);
- }
|