import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listQuotation(query) {
  return request({
    url: '/business/quotation/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getQuotationDetail(id) {
  return request({
    url: '/business/quotation/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addQuotation(data) {
  return request({
    url: '/business/quotation',
    method: 'post',
    data: data
  })
}

export function copyVersion(data) {
  return request({
    url: '/business/quotation/copy',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateQuotation(data) {
  return request({
    url: '/business/quotation',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delQuotation(id) {
  return request({
    url: '/business/quotation/' + id,
    method: 'delete'
  })
}

// 根据项目id查询报价列表
export function listByProjectId(projectId) {
  return request({
    url: '/business/quotation/listByProjectId/' + projectId,
    method: 'get'
  })
}

export function getPrice(quotationId) {
  return request({
    url: '/business/quotation/price/' + quotationId,
    method: 'get'
  })
}

// 议价通过
export function auditBargain(data) {
  return request({
    url: '/business/quotation/auditBargain',
    method: 'post',
    data: data
  })
}

// 获取销售折扣价格
export function getSalesDiscount(quotationId) {
  return request({
    url: '/business/quotation/salesDiscount/' + quotationId,
    method: 'get',
  })
}
