import request from '@/utils/request'

// 获得控货分页
export function getCargoControlOrderPage(params){
    return request({
      url:'ecw/order-cargo-control/cargo/control/order',
      method:'get',
      params
    })
}

// 发送手机验证码
export function sendSmsCode(data){
    return request({
      url: '/ecw/order-cargo-control/send-sms-code',
      method: 'post',
      data
    })
}

// 创建订单控货人信息
export function create(data){
    return request({
      url: '/ecw/order-cargo-control/create',
      method: 'post',
      data
    })
}

// 创建订单控货人放货记录
export function createPick(data){
  return request({
    url: '/ecw/order-cargo-control-pick/create',
    method: 'post',
    data
  })
}

//获得控货订单放货编辑详情
export function getRleaseInfo(orderId){
  return request({
    url:'/ecw/order-cargo-control/release/info/' + orderId,
    method:'get'
  })
}

// 获得控货订单放货详情
export function getPickRleaseInfo(orderId){
  return request({
    url:'/ecw/order-cargo-control-pick/release/info/' + orderId,
    method:'get'
  })
}

// 放货修改与反复核申请
export function updateApply(data){
  return request({
    url: '/ecw/order-cargo-control-pick/update/apply',
    method: 'put',
    data
  })
}

// 复核(放货复核)
export function review(id){
  return request({
    url: '/ecw/order-cargo-control-pick/review/' + id,
    method: 'put'
  })
}

// 取消放货
export function cancel(id){
  return request({
    url: '/ecw/order-cargo-control-pick/cancel/' + id,
    method: 'put'
  })
}

// 取消审批
export function cancelApproval(approvalId, params){
  return request({
    url: '/ecw/order-cargo-control-pick/cancel/approval/' + approvalId,
    method: 'get',
    params
  })
}

// 订单复核
export function orderReview(orderId){
  return request({
    url: '/ecw/order-cargo-control/review/' + orderId,
    method: 'put'
  })
}
