import request from '@/utils/request'

// 获取列表
export function getList(params) {
  return request({
    url: '/displace-order/list',
    method: 'get',
    params
  })
}

// 获取详情
export function getDetail(params) {
  return request({
    url: '/displace-order/detail',
    method: 'get',
    params
  })
}

// 查询引用单明细
export function queryRefDetail(params) {
  return request({
    url: '/displace-order/query-ref-detail',
    method: 'get',
    params
  })
}

// 新增
export function addData(params) {
  return request({
    url: '/displace-order/add',
    method: 'post',
    data: params
  })
}

// 编辑
export function editData(params) {
  return request({
    url: '/displace-order/edit',
    method: 'post',
    data: params
  })
}

// 提交审核
export function submitData(params) {
  return request({
    url: '/displace-order/submit',
    method: 'post',
    params
  })
}

// 撤回
export function revokeOrder(params) {
  return request({
    url: '/displace-order/revoke',
    method: 'post',
    params
  })
}

// 删除
export function deleteOrder(params) {
  return request({
    url: '/displace-order/del',
    method: 'post',
    params
  })
}

// 审批
export function examineOrder(params) {
  return request({
    url: '/displace-order/examine',
    method: 'post',
    data: params
  })
}

// 退订
export function returnOrder(params) {
  return request({
    url: '/displace-order/refund',
    method: 'post',
    data: params
  })
}

// 获取物料列表
export function getGoodsList(params) {
  return request({
    url: '/k3/material/list',
    method: 'get',
    params
  })
}

// 获取订单列表
export function getOrderList(params) {
  return request({
    url: '/retail/exec/list/total',
    method: 'get',
    params
  })
}

// 添加置换单
export function addDisplace(params) {
  return request({
    url: '/displace/order/v2/add',
    method: 'post',
    data: params
  })
}

// 获取置换详情
export function getDisplaceDetail(params) {
  return request({
    url: '/displace/order/v2/record/list',
    method: 'get',
    params
  })
}
