import request from '@/config/axios' export type InullyApplyFormType = { id: string nickname?: string nullyApplyUserId: string flowInstanceId: string voidFlowInstanceId: string iNullied: string voidFlowCode: string voidFlowDesc: string voidFlowName: string nullyApplyTime: string nullyReason: string } export type CallbackFormType = { flowInsId: string currentActInsId: string currentActTempId: string participantId: string position: string callbackRemark: string iBranchReturn?: string } const jsonToFormData = (json: Object) => { const formData = new FormData() const keys = Object.keys(json) keys.forEach((key) => { if (json[key] instanceof Object) { formData.append(key, JSON.stringify(json[key])) } else { formData.append(key, json[key]) } }) return formData } // 获取办件中心Tab列表 export const officeCenterModule = async () => { return await request.postOriginal( { url: '/HandlerCaseCenter/officeCenterModule', headersType: 'application/form-data' }, '/workflow' ) } // 获取办件中心列表 export const getHandlerCaseCenterList = async (data) => { return await request.postOriginal( { url: '/HandlerCaseCenter/list', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } // 获取办件中心模板列表 export const getFlowTemplateTree = async () => { return await request.postOriginal( { url: '/TFlowTemplateApi/selectFlowTemplateTree' }, '/workflow' ) } // 发起流程 export const addTProcessEngine = async (templateId: string) => { const formData = new FormData() formData.append('templateId', templateId) return await request.postOriginal( { url: '/TProcessEngine/add', data: formData, headersType: 'application/form-data' }, '/workflow' ) } // 获取办件中心汇总数据 export const getHandlerCaseCenterCount = async (data) => { return await request.postOriginal( { url: '/HandlerCaseCenter/count', data: data, headersType: 'application/form-data' }, '/workflow' ) } // 获取流程模版列表 export const GetFlowTemplateTreeData = async () => { return await request.postOriginal( { url: '/TFlowTemplate/GetFlowTemplateTreeData', data: null, headersType: 'application/form-data' }, '/workflow' ) } // 获取办件中心新建办件模板 export const getFlowTemplateTreeDataByUser = async (data) => { return await request.postOriginal( { url: '/TFlowTemplate/GetFlowTemplateTreeDataByUser', data: data, headersType: 'application/form-data' }, '/workflow' ) } //办件中心“追回”操作 export const recoverActivity = async (data: { activityInstanceId: string participantId: string }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/recoverActivity', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //办件中心“解挂”操作 export const addIHangUp = async (data: { activityInstanceId: string; isRecover: number }) => { return await request.postOriginal( { url: '/IHangUp/add', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //办件中心“恢复作废”操作 export const addINullyApply = async (data: { activityInstanceId: string voidFlowInstanceId: string isRecover: number }) => { return await request.postOriginal( { url: '/INullyApply/add', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //办件中心“彻底作废”操作 export const completelyVoidINullyApply = async (data: { flowInstanceId: string }) => { return await request.postOriginal( { url: '/INullyApply/completelyVoid', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //办件中心“挂起”操作 export const isHangUp = async (data: { activityInstanceId: string }) => { // {"activityInstanceId": rowObj.ACTIVITYINSID} return await request.postOriginal( { url: '/Transfer/isHangUp', data: data, headersType: 'application/form-data' }, '/workflow' ) } //效验该流程是否已经作废 export const isFlowVoid = async (data: { flowInstanceId: string }) => { return await request.postOriginal( { url: '/Transfer/isVoid', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //获取提交作废的参数 export const getINullyApplyExample = async (data: { voidFlowInstanceId: string isRecover: number }) => { return await request.postOriginal( { url: '/INullyApply/getExample', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //办件中心“作废”操作 export const saveINullyApply = async (data: { nullyApply: InullyApplyFormType }) => { return await request.postOriginal( { url: '/INullyApply/save', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //获取退回所在流程信息 export const getCalBackActivityNew = async (data: { activityInstanceId: string flowInsId: string }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/getCalBackActivityNew', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //检查退件 export const checkReturnMethod = async (data: { paramMap: { flowInsId: string currentActInsId: string currentActTempId: string participantId: string position: string callbackRemark: string } backToActivitys: { callbackActTempId: string callbackActInsId: string }[] }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/checkReturnMethod', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //发起退回操作 export const callbackActivitySure = async (data: { paramMap: CallbackFormType backToActivitys: { callbackActTempId: string callbackActInsId: string }[] }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/callbackActivity', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //公共待办件提示 export const openOfficeTip = async (data: { activityInsId: string particiPantId: string isView: boolean }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/openOfficeTip', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) } //转流程办理页面 export const saveAndGetUrl = async (data: { activityInsId: string flowInsId: string participantId: string status: string userId: string | null isView: boolean }) => { return await request.postOriginal( { url: '/HandlerCaseCenter/saveAndGetUrl', data: jsonToFormData(data), headersType: 'application/form-data' }, '/workflow' ) }