import request from '@/utils/request'

// 查询出库列表
export function listCkOrders(query) {
  return request({
    url: '/system/ckOrders/list',
    method: 'get',
    params: query
  })
}

// 查询出库详细
export function getCkOrders(id) {
  return request({
    url: '/system/ckOrders/' + id,
    method: 'get'
  })
}

// 新增出库
export function addCkOrders(data) {
  return request({
    url: '/system/ckOrders',
    method: 'post',
    data: data
  })
}

// 新增出库
export function updateTckOrderDetails(data) {
  return request({
    url: '/system/ckOrders/updateTckOrderDetails',
    method: 'post',
    data: data
  })
}
export function create(data) {
  return request({
    url: '/system/ckOrders/create',
    method: 'post',
    data: data
  })
}




// 创建出库任务
export function confirmOut(data) {
  return request({
    url: '/system/ckOrders/confirmOut',
    method: 'post',
    data: data
  })
}

export function sendOrderNotice(data) {
  return request({
    url: '/system/ckOrders/sendOrderNotice',
    method: 'post',
    data: data
  })
}

export function sendiwms(data) {
  return request({
    url: '/system/ckOrders/sendiwms',
    method: 'post',
    data: data
  })
}

// 修改出库
export function updateCkOrders(data) {
  return request({
    url: '/system/ckOrders',
    method: 'put',
    data: data
  })
}

// 删除出库
export function delCkOrders(id) {
  return request({
    url: '/system/ckOrders/' + id,
    method: 'delete'
  })
}
// 删除出库
export function delCkOrderDetails(id) {
  return request({
    url: '/system/ckOrders/details/' + id,
    method: 'delete'
  })
}
// 启用
export function enabled(id) {
  return request({
    url: '/system/ckOrders/enable/' + id,
    method: 'delete'
  })
}

// 审核
export function auditCkOrders(id) {
  return request({
    url: '/system/ckOrders/auditCkOrders/' + id,
    method: 'delete'
  })
}
// 禁用
export function disabled(id) {
  return request({
    url: '/system/ckOrders/disable/' + id,
    method: 'delete'
  })
}

// 状态修改
export function changeStatus(id, status,isAudit,auditPerson1,auditPerson2,auditPerson3,why) {
  const data = {
    id,
    status,
    isAudit,
    auditPerson1,
    auditPerson2,
    auditPerson3,
    why
  }
  return request({
    url: '/system/ckOrders/changeStatus',
    method: 'put',
    data: data
  })
}

export function listOrder(query) {
  return request({
    url: '/system/order/list',
    method: 'get',
    params: query
  })
}
//统计出库审核后的数量
export function statisticCallShelvesNum(query) {
  return request({
    url: '/system/ckOrders/statisticCallShelvesNum',
    method: 'get',
    params: query
  })
}
