import request from '@/utils/request'

// 查询商机列表
export function listBusiness(query) {
  return request({
    url: '/crm/business/list',
    method: 'get',
    params: query
  })
}

// 查询商机详细
export function getBusiness(businessId) {
  return request({
    url: '/crm/business/' + businessId,
    method: 'get'
  })
}

// 新增商机
export function addBusiness(data) {
  return request({
    url: '/crm/business',
    method: 'post',
    data: data
  })
}

// 修改商机
export function updateBusiness(data) {
  return request({
    url: '/crm/business',
    method: 'put',
    data: data
  })
}

// 删除商机
export function delBusiness(businessId) {
  return request({
    url: '/crm/business/' + businessId,
    method: 'delete'
  })
}

// 导出商机
export function exportBusiness(query) {
  return request({
    url: '/crm/business/export',
    method: 'get',
    params: query
  })
}

//捞取商机
export function gainBusiness(data) {
  return request({
    url: '/crm/business/gain',
    method: 'post',
    data: data
  })
}

// // 删除商机
// export function setBusinessPool(businessId) {
//   return request({
//     url: '/crm/business/' + businessId,
//     method: 'get'
//   })
// }
