/** * 财务项目预算审批 - API服务 * * @author ruoyi * @date 2025-01-26 */ import request from '@/utils/request'; import type { AxiosPromise } from 'axios'; import type { CwProjectApplicationQuery, CwProjectApplicationVO, CwProjectApplicationForm, CwApproverConfigQuery, CwApproverConfigVO, CwApproverConfigForm, CwApplicationStatistics } from '@/api/cw/types'; // 查询项目预算申报列表 export const listProjectApplication = (query: CwProjectApplicationQuery): AxiosPromise => { return request({ url: '/cw/application/list', method: 'get', params: query }); }; // 查询项目预算申报详情 export const getProjectApplication = (id: string | number): AxiosPromise => { return request({ url: '/cw/application/' + id, method: 'get' }); }; // 新增项目预算申报 export const addProjectApplication = (data: CwProjectApplicationForm) => { return request({ url: '/cw/application', method: 'post', data: data }); }; // 修改项目预算申报 export const updateProjectApplication = (data: CwProjectApplicationForm) => { return request({ url: '/cw/application', method: 'put', data: data }); }; // 删除项目预算申报 export const delProjectApplication = (id: string | number | Array) => { return request({ url: '/cw/application/' + id, method: 'delete' }); }; // 保存草稿 export const saveDraft = (data: CwProjectApplicationForm) => { return request({ url: '/cw/application/saveDraft', method: 'post', data: data }); }; // 提交申报 export const submitApplication = (id: string | number) => { return request({ url: '/cw/application/submit/' + id, method: 'post' }); }; // 撤回申报 export const withdrawApplication = (id: string | number) => { return request({ url: '/cw/application/withdraw/' + id, method: 'put' }); }; // 取消申报 export const cancelApplication = (id: string | number) => { return request({ url: '/cw/application/cancel/' + id, method: 'put' }); }; // 查询我的申报 export const getMyApplications = (query: CwProjectApplicationQuery): AxiosPromise => { return request({ url: '/cw/application/my', method: 'get', params: query }); }; // 查询部门申报 export const getDepartmentApplications = (query: CwProjectApplicationQuery): AxiosPromise => { return request({ url: '/cw/application/dept', method: 'get', params: query }); }; // 查询待处理申报 export const getPendingApplications = (query: CwProjectApplicationQuery): AxiosPromise => { return request({ url: '/cw/application/pending', method: 'get', params: query }); }; // 导出项目预算申报 export const exportProjectApplication = (query: CwProjectApplicationQuery) => { return request({ url: '/cw/application/export', method: 'post', data: query }); }; // 获取申报统计数据 export const getApplicationStatistics = (year?: number): AxiosPromise => { return request({ url: '/cw/application/statistics', method: 'get', params: { year } }); }; // 申报数量统计 export const getApplicationCount = (): AxiosPromise => { return request({ url: '/cw/application/count', method: 'get' }); }; // 申报金额汇总 export const getApplicationAmountSum = (): AxiosPromise => { return request({ url: '/cw/application/amountSum', method: 'get' }); }; // 按部门统计 export const getStatisticsByDept = () => { return request({ url: '/cw/application/statisticsByDept', method: 'get' }); }; // 按月份统计 export const getStatisticsByMonth = (year?: number) => { return request({ url: '/cw/application/statisticsByMonth', method: 'get', params: { year } }); }; // ==================== 审批人配置相关 API ==================== // 查询审批人配置列表 export const listApproverConfig = (query: CwApproverConfigQuery): AxiosPromise => { return request({ url: '/cw/approverConfig/list', method: 'get', params: query }); }; // 查询审批人配置详情 export const getApproverConfig = (id: string | number): AxiosPromise => { return request({ url: '/cw/approverConfig/' + id, method: 'get' }); }; // 新增审批人配置 export const addApproverConfig = (data: CwApproverConfigForm) => { return request({ url: '/cw/approverConfig', method: 'post', data: data }); }; // 修改审批人配置 export const updateApproverConfig = (data: CwApproverConfigForm) => { return request({ url: '/cw/approverConfig', method: 'put', data: data }); }; // 删除审批人配置 export const delApproverConfig = (id: string | number | Array) => { return request({ url: '/cw/approverConfig/' + id, method: 'delete' }); };