import request from '@/utils/request';

/**
 * 项目台账报表查询参数
 */
export interface ProjectLedgerReportQuery {
  pageNum?: number;
  pageSize?: number;
  projectCode?: string;
  projectName?: string;
  businessDirection?: string;
  projectStatus?: string;
  deptId?: number | string;
  projectTypeId?: number | string;
  projectPhases?: string;
}

/**
 * 项目台账报表 VO
 */
export interface ProjectLedgerReportVO {
  projectId: number;
  contractId: number;
  projectCode: string;
  customerName: string;
  projectName: string;
  managerName: string;
  deptName: string;
  typeName: string;
  productAmount: number;
  projectPhases: string;
  projectCategory: string;
  projectStatus: string;
  acceptanceDate: string;
  contractDate: string;
  contractAmount: number;
  contractManagerName: string;
  paymentMethod: string;
  budgetCost: number;
  budgetRate: number;
  reduceBudgetCost: number;
  reduceBudgetRate: number;
  revenue: number;
  totalHours: number;
}

/**
 * 查询项目台账报表列表
 */
export function listProjectLedgerReport(query: ProjectLedgerReportQuery) {
  return request({
    url: '/oa/erp/projectLedgerReport/list',
    method: 'get',
    params: query
  });
}

/**
 * 导出项目台账报表
 */
export function exportProjectLedgerReport(query: ProjectLedgerReportQuery) {
  return request({
    url: '/oa/erp/projectLedgerReport/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  });
}
