import request from '@/utils/request'

// 创建产品价格
export function createProductPrice(data) {
  return request({
    url: '/ecw/product-price/create',
    method: 'post',
    data: data
  })
}

// 更新产品价格
export function updateProductPrice(data) {
  return request({
    url: '/ecw/product-price/update',
    method: 'put',
    data: data
  })
}

// 删除产品价格
export function deleteProductPrice(id) {
  return request({
    url: '/ecw/product-price/delete?id=' + id,
    method: 'delete'
  })
}

// 获得产品价格
export function getProductPrice(id) {
  return request({
    url: '/ecw/product-price/get?id=' + id,
    method: 'get'
  })
}

// 获得产品价格分页
export function getProductPricePage(query) {
  return request({
    url: '/ecw/product-price/page',
    method: 'get',
    params: query
  })
}

// 导出产品价格 Excel
export function exportProductPriceExcel(query) {
  return request({
    url: '/ecw/product-price/export-excel',
    method: 'get',
    timeout: 3*60*1000,
    params: query,
    responseType: 'blob'
  })
}

// 批量获得产品价格
export function getProductPriceList(query) {
  return request({
    url: '/ecw/product-price/list',
    method: 'get',
    params: query
  })
}

// 批量修改产品价格
export function batchUpdateProductPrice(query) {
  return request({
    url: '/ecw/product-price/batchUpdate',
    method: 'put',
    data: query
  })
}

// 批量拉黑
export function batchBlock(query) {
  return request({
    url: '/ecw/product-price/batchBlock',
    method: 'get',
    params: query
  })
}

// 批量下架
export function batchOff(query) {
  return request({
    url: '/ecw/product-price/batchOff',
    method: 'get',
    params: query
  })
}

export function getPriceSnapshotList(priceId){
  return request({
    url: '/ecw/product-price/priceSnapshotList',
    method: 'get',
    params: {priceId}
  })
}


// 获得路线产品
export function getProductPriceGetPrice(query) {
  return request({
    url: '/ecw/product-price/getPrice',
    method: 'get',
    params: query
  })
}

// 更新单询
export function updateOrderInquiry(data) {
  return request({
    url: '/ecw/product-price/updateOrderInquiry',
    method: 'put',
    data: data
  })
}

// 批量加价
export function batchAddPrice(data) {
  return request({
    url: '/ecw/product-price/batchAddPrice',
    method: 'put',
    data
  })
}
