import request from '@/utils/request'

// 零售发货申请单 - 获取列表
export function getApplyList(params) {
  return request({
    url: '/invoice/list',
    method: 'get',
    params
  })
}

// 零售发货申请单 - 获取详情
export function getApplyDetail(params) {
  return request({
    url: '/invoice/detail',
    method: 'get',
    params
  })
}

// 零售发货申请单 - 审批
export function examineApply(params) {
  return request({
    url: '/invoice/approvalInvoice',
    method: 'post',
    data: params
  })
}

// 零售发货申请单 - 弃审
export function abandonApply(params) {
  return request({
    url: '/invoice/giveUp',
    method: 'post',
    params
  })
}

// 获取仓位列表
export function getPositionList(params) {
  return request({
    url: '/stock/listPosition',
    method: 'get',
    params
  })
}

// 检查库存
export function checkStock(params) {
  return request({
    url: '/invoice/stockNumber',
    method: 'get',
    params
  })
}

// 零售发货申请单 - 申请/撤回
export function submitApply(params) {
  return request({
    url: '/invoice/submit',
    method: 'post',
    params
  })
}

// 零售发货申请单 - 删除
export function deleteApply(params) {
  return request({
    url: '/invoice/delete',
    method: 'post',
    params
  })
}

// 零售发货申请单 - 批量审批
export function examineBatchApply(params) {
  return request({
    url: '/invoice/allApprovalInvoice',
    method: 'post',
    params
  })
}

// 零售发货申请单 - 新增
export function addApply(params) {
  return request({
    url: '/invoice/add',
    method: 'post',
    data: params
  })
}

// 零售发货申请单 - 编辑
export function editApply(params) {
  return request({
    url: '/invoice/update',
    method: 'post',
    data: params
  })
}

// 获取仓库列表
export function getWarehouseList(params) {
  return request({
    url: '/stock/manager/listStock',
    method: 'get',
    params
  })
}

// 零售发货申请单 - 获取产品列表
export function getGoodsList(params) {
  return request({
    url: '/invoice/listOrder',
    method: 'get',
    params
  })
}

// 获取经销商列表
export function getDealerList(params) {
  return request({
    url: '/customer/list',
    method: 'get',
    params
  })
}

// 工程发货申请单 - 获取列表
export function getEnginList(params) {
  return request({
    url: '/invoice/listProject',
    method: 'get',
    params
  })
}

// 工程发货申请单 - 获取详情
export function getEnginDetail(params) {
  return request({
    url: '/invoice/detailProject',
    method: 'get',
    params
  })
}

// 工程发货申请单 - 获取产品列表
export function getEnginGoodsList(params) {
  return request({
    url: '/invoice/listProjectOrder',
    method: 'get',
    params
  })
}

// 工程发货申请单 - 获取产品详情
export function getEnginGoodsDetail(params) {
  return request({
    url: '/invoice/listProjectOrderDetail',
    method: 'get',
    params
  })
}

// 工程发货申请单 - 新增
export function addEngin(params) {
  return request({
    url: '/invoice/addProject',
    method: 'post',
    data: params
  })
}

// 工程发货申请单 - 编辑
export function editEngin(params) {
  return request({
    url: '/invoice/updateProject',
    method: 'post',
    data: params
  })
}

// 工程发货申请单 - 审批
export function examineEngin(params) {
  return request({
    url: '/invoice/approvalInvoiceProject',
    method: 'post',
    data: params
  })
}

// 工程发货申请单 - 弃审
export function abandonEngin(params) {
  return request({
    url: '/invoice/projectGiveUp',
    method: 'post',
    params
  })
}

// 工程发货申请单 - 申请/撤回
export function submitEngin(params) {
  return request({
    url: '/invoice/submitProject',
    method: 'post',
    params
  })
}

// 工程发货申请单 - 删除
export function deleteEngin(params) {
  return request({
    url: '/invoice/deleteProject',
    method: 'post',
    params
  })
}

// 工程发货申请单 - 批量审批
export function examineBatchEngin(params) {
  return request({
    url: '/invoice/allApprovalInvoiceProject',
    method: 'post',
    params
  })
}

// 零售退货申请单 - 新增
export function addApplyReturn(params) {
  return request({
    url: '/invoice/refund/add',
    method: 'post',
    data: params
  })
}

// 零售退货申请单 - 获取产品列表
export function getSalesGoodsList(params) {
  return request({
    url: '/invoice/refund/list',
    method: 'get',
    params
  })
}
