2026-05-29 15:49:10 +08:00
|
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 审批流设计 API
|
|
|
|
|
|
* @author GHT
|
|
|
|
|
|
* @date 2026-05-29 for:【QH-MES审批流设计】新增审批流可视化设计
|
|
|
|
|
|
*/
|
|
|
|
|
|
enum Api {
|
|
|
|
|
|
list = '/xslmes/approvalFlow/list',
|
|
|
|
|
|
save = '/xslmes/approvalFlow/add',
|
|
|
|
|
|
edit = '/xslmes/approvalFlow/edit',
|
|
|
|
|
|
get = '/xslmes/approvalFlow/queryById',
|
|
|
|
|
|
saveDesign = '/xslmes/approvalFlow/saveDesign',
|
|
|
|
|
|
updateStatus = '/xslmes/approvalFlow/updateStatus',
|
|
|
|
|
|
delete = '/xslmes/approvalFlow/delete',
|
|
|
|
|
|
deleteBatch = '/xslmes/approvalFlow/deleteBatch',
|
|
|
|
|
|
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文-----
|
|
|
|
|
|
designContext = '/xslmes/approvalFlow/designContext',
|
2026-06-05 19:05:48 +08:00
|
|
|
|
registryStages = '/xslmes/approvalFlow/registryStages',
|
2026-05-29 15:49:10 +08:00
|
|
|
|
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文-----
|
2026-05-29 18:57:09 +08:00
|
|
|
|
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|
|
|
|
|
|
bizActions = '/xslmes/approvalFlow/bizActions',
|
|
|
|
|
|
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|
2026-05-29 15:49:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 分页列表查询
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const getApprovalFlowList = (params) => defHttp.get({ url: Api.list, params });
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 新增/编辑基本信息
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const saveOrUpdateApprovalFlow = (params, isUpdate) => {
|
|
|
|
|
|
const url = isUpdate ? Api.edit : Api.save;
|
|
|
|
|
|
return defHttp.post({ url, params });
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 通过 id 查询(含流程设计 JSON)
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const getApprovalFlowById = (params) => defHttp.get({ url: Api.get, params });
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 保存流程设计(节点树 JSON)
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const saveApprovalFlowDesign = (params) => defHttp.post({ url: Api.saveDesign, params });
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 发布 / 停用
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const updateApprovalFlowStatus = (params) => defHttp.post({ url: Api.updateStatus, params }, { joinParamsToUrl: true });
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 删除
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const deleteApprovalFlow = (params, handleSuccess) => {
|
|
|
|
|
|
return defHttp.delete({ url: Api.delete, data: params }, { joinParamsToUrl: true }).then(() => {
|
|
|
|
|
|
handleSuccess();
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 批量删除
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const batchDeleteApprovalFlow = (params, handleSuccess) => {
|
|
|
|
|
|
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
|
|
|
|
|
handleSuccess();
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文(解析阶段字段+取/建草稿流程)-----
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取当前功能页的审批流设计上下文:
|
|
|
|
|
|
* 返回 { routePath, bizTable, bizTableName, stages[], flow },
|
2026-06-05 19:05:48 +08:00
|
|
|
|
* stages 为审批注册中心已启用环节,flow 为可直接进入设计器的流程记录。
|
2026-05-29 15:49:10 +08:00
|
|
|
|
*/
|
|
|
|
|
|
export const getApprovalDesignContext = (routePath: string) => defHttp.get({ url: Api.designContext, params: { routePath } });
|
2026-06-05 19:05:48 +08:00
|
|
|
|
|
|
|
|
|
|
/** 按业务表查询审批注册中心启用环节(列表页「设计」入口用) */
|
|
|
|
|
|
export const getApprovalRegistryStages = (bizTable: string) => defHttp.get<any[]>({ url: Api.registryStages, params: { bizTable } });
|
2026-05-29 15:49:10 +08:00
|
|
|
|
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】当前页设计上下文(解析阶段字段+取/建草稿流程)-----
|
2026-05-29 18:57:09 +08:00
|
|
|
|
|
|
|
|
|
|
// update-begin---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作(后端@ApprovalBizAction注解扫描)-----
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询某业务表已标注 @ApprovalBizAction 的可选回调动作,供节点「回调接口」下拉选择。
|
|
|
|
|
|
* 返回 [{ name, url, method, table, phase, perms }]
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const getApprovalBizActions = (table: string) => defHttp.get({ url: Api.bizActions, params: { table } });
|
|
|
|
|
|
// update-end---author:GHT ---date:2026-05-29 for:【QH-MES审批流设计】业务表可选回调动作-----
|
2026-06-05 19:05:48 +08:00
|
|
|
|
|
|
|
|
|
|
// update-begin---author:GHT ---date:2026-06-05 for:【XSLMES-20260605-K8R2】流程节点绑定已发布集成方案-----
|
|
|
|
|
|
/** 查询某业务表、某触发时机下已发布的集成方案,供节点配置下拉 */
|
|
|
|
|
|
export const listPublishedIntegrationPlans = (params: { sourceTable: string; triggerPhase: string }) =>
|
|
|
|
|
|
defHttp.get({
|
|
|
|
|
|
url: '/xslmes/mesXslIntegrationPlan/list',
|
|
|
|
|
|
params: { ...params, status: '1', pageNo: 1, pageSize: 200 },
|
|
|
|
|
|
});
|
|
|
|
|
|
// update-end---author:GHT ---date:2026-06-05 for:【XSLMES-20260605-K8R2】流程节点绑定已发布集成方案-----
|