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

export function getHistoryList(query) {
  return request({
    url: '/shipEnergyExpend/shipEnergyExpend/list',
	method: 'get',
	params: query
  })
}
// 查询航次记录
export function getOneReport(Id) {
    return request({
        url: '/shipEnergyExpend/shipEnergyExpend/selectNow/' + Id,
        method: 'get'
    })
}
// 查询港口列表
export function getHarBor(query) {
    return request({
        url: '/harbor/harbor/list',
        method: 'get',
        params: query
    })
}
// 查询根据时间查港口
export function getHarBorByTime(query) {
    return request({
        url: '/shipEnergyExpend/shipEnergyExpend/getHarbor/'+query,
        method: 'get'
    })
}
// 导出航次记录
export function downloadOil(data) {
  downloadByimg(
      '/shipEnergyExpend/shipEnergyExpend/exportCustomize',
      data,
      `航次记录_${new Date().getTime()}.xlsx`)
}
// 导出历史航次记录
export function downloadHisOil(_id) {
  downloadByimg(
      '/shipEnergyExpend/shipEnergyExpend/exportCustomizeList',
      {
		  id: _id
	  },
      `航次记录_${new Date().getTime()}.xlsx`)
}
// 查询每日记录
export function getDayReport(Id) {
    return request({
        url: '/ShipEnergyExpendH/shipEnergyEfficiency/selectNow/' + Id,
        method: 'get'
    })
}
// 导出每日记录
export function downloadDayOil(data) {
  downloadByimg(
      '/ShipEnergyExpendH/shipEnergyEfficiency/exportCustomize',
      data,
      `每日记录_${new Date().getTime()}.xlsx`)
}
