import request, { postBlob, handleImport, getBlob } from '@/utils/request'

// 删除
export function getBusPriceDelete(params) {
  return request({
    url: '/bus/price/delete',
    method: 'post',
    params
  })
}
// 详情
export function getBusPriceDetail(params) {
  return request({
    url: '/bus/price/detail',
    method: 'get',
    params
  })
}
// 下载商用工程产品价格模板
export function getBusPriceDownload() {
  return request({
    url: '/bus/price/download',
    method: 'get'
  })
}
// 商用工程产品价格-导出
export function getBusPriceExport(params) {
  return request({
    url: '/bus/price/export',
    method: 'get',
    params
  })
}
// 商用工程产品价格-列表
export function v2BusPriceList(data) {
  return request({
    url: `/v2/bus/price/list?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

//工程信息单-导出
export function v2BusPriceListExport(data, name) {
  return postBlob({
    url: '/v2/bus/price/list/export',
    method: 'post',
    data,
    name
  })
}

//下载商用工程产品价格模板
export function v2BusPriceListExcel(data, name) {
  return getBlob({
    url: 'bus/price/download',
    data,
    name
  })
}
//商用工程产品价格-导入
export function v2BusPriceListImport(data) {
  return handleImport('/bus/price/import', data.formdata, data.id || '')
}

// 商用工程产品价格列表
export function getBusPriceList(params) {
  return request({
    url: '/bus/price/list',
    method: 'get',
    params
  })
}
// 修改
export function getBusPriceUpdate(data) {
  return request({
    url: '/bus/price/update',
    method: 'post',
    data
  })
}
