import request from '@/utils/request'

// 状态修改
export function changeUserStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/business/info/update-open-status',
    method: 'put',
    data: data
  })
}

//获取编号
export function getOpportunityCode() {
  return request({
    url: '/customer/business-opportunity/getOpportunityCode',
    method: 'get'
  })
}

// 查询列表
export function listBusiness(query) {
  return request({
    url: '/customer/business-opportunity/page',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getBusiness(dictId) {
  return request({
    url: '/customer/business-opportunity/get?id=' + dictId,
    method: 'get'
  })
}

// 新增
export function addBusiness(data) {
  return request({
    url: '/customer/business-opportunity/create',
    method: 'post',
    data: data
  })
}

// 修改
export function updateBusiness(data) {
  return request({
    url: '/customer/business-opportunity/update',
    method: 'put',
    data: data
  })
}

// 删除
export function delBusiness(dictId) {
  return request({
    url: '/customer/business-opportunity/delete?id=' + dictId,
    method: 'delete'
  })
}

// 导出
export function exportBusiness(query) {
  return request({
    url: '/customer/business-opportunity/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}