import { request } from '@/utils/request'

// 采购分析
export const analysisApi = {
  // 订单交易分析
  getOrderAnalysis: (params: any) => request.get('/analysis/order', params),
  getOrderTrend: (params: any) => request.get('/analysis/order/trend', params),
  getCategoryRatio: (params: any) => request.get('/analysis/order/category-ratio', params),
  getDailyChange: (params: any) => request.get('/analysis/order/daily-change', params),

  // 商品采购明细
  getPurchaseDetail: (params: any) => request.get('/analysis/purchase-detail', params),
  getEfficiencyAnalysis: (params: any) => request.get('/analysis/purchase-detail/efficiency', params),
  getAfterSaleAnalysis: (params: any) => request.get('/analysis/purchase-detail/after-sale', params),

  // 订单执行状态
  getOrderStatusList: (params: any) => request.get('/analysis/order-status/list', params),
  exportOrderStatus: (params: any) => request.get('/analysis/order-status/export', params, { responseType: 'blob' }),

  // 对账结算状况
  getSettlementList: (params: any) => request.get('/analysis/settlement/list', params),
  exportSettlement: (params: any) => request.get('/analysis/settlement/export', params, { responseType: 'blob' }),

  // 部门采购金额
  getDeptPurchaseList: (params: any) => request.get('/analysis/dept-purchase/list', params),
  exportDeptPurchase: (params: any) => request.get('/analysis/dept-purchase/export', params, { responseType: 'blob' })
}
