import request from '@/config/axios'

/**
 * 能源消耗记录分页查询
 */
export function getEnergyConsumptionPage(params: any) {
  return request.get({ url: '/mes/energy-consumption/page', params })
}

/**
 * 获取能源消耗记录详情
 */
export function getEnergyConsumption(id: number) {
  return request.get({ url: '/mes/energy-consumption/get', params: { id } })
}

/**
 * 获取能源消耗记录列表
 */
export function getEnergyConsumptionList() {
  return request.get({ url: '/mes/energy-consumption/list' })
}

/**
 * 创建能源消耗记录
 */
export function createEnergyConsumption(data: any) {
  return request.post({ url: '/mes/energy-consumption/create', data })
}

/**
 * 更新能源消耗记录
 */
export function updateEnergyConsumption(data: any) {
  return request.put({ url: '/mes/energy-consumption/update', data })
}

/**
 * 删除能源消耗记录
 */
export function deleteEnergyConsumption(id: number) {
  return request.delete({ url: '/mes/energy-consumption/delete', params: { id } })
}

/**
 * 审核能源消耗记录
 */
export function auditEnergyConsumption(data: { id: number; auditStatus: number; auditRemark?: string }) {
  return request.post({ url: '/mes/energy-consumption/audit', data })
}

/**
 * 导出能源消耗记录 Excel
 */
export function exportEnergyConsumptionExcel(params: any) {
  return request.download({ url: '/mes/energy-consumption/export-excel', params })
}
