import request, { postBlob, handleImport, getBlob } from '@/utils/request'

export function getRetaillListV2(data) {
  return request({
    url: `/retail/list/v2?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}


export function exportRetaillListV2(data, name) {
  return postBlob({
    url: '/retail/list/v2/export',
    method: 'post',
    data,
    name
  })
}
// 获取列表
export function getList(params) {
  return request({
    url: '/retail/list',
    method: 'get',
    params
  })
}
 
// 获取详情
export function getDetail(params) {
  return request({
    url: '/retail/detail',
    method: 'get',
    params
  })
}
// 获取仓位列表
export function getPositionList(params) {
  return request({
    url: '/stock/manager/listStock',
    method: 'get',
    params
  })
}

// 关闭
export function closeData(params) {
  return request({
    url: '/retail/close',
    method: 'post',
    params
  })
}

// 删除
export function deleteData(params) {
  return request({
    url: '/retail/delete',
    method: 'post',
    params
  })
}

// 弃审
export function abandonData(params) {
  return request({
    url: '/retail/abandon',
    method: 'post',
    params
  })
}

// 审批
export function examineData(params) {
  return request({
    url: '/retail/examine',
    method: 'post',
    params
  })
}

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

// 撤回
export function withdrawData(params) {
  return request({
    url: '/retail/submit/cancel',
    method: 'post',
    params
  })
}

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

// 编辑
export function editData(params) {
  return request({
    url: '/retail/update',
    method: 'post',
    data: params
  })
}

// 退订
export function returnData(params) {
  return request({
    url: '/retail/tuiding',
    method: 'post',
    data: params
  })
}

// 获取销售类型列表
export function getSalesTypeList(params) {
  return request({
    url: '/sale/type/list',
    method: 'get',
    params
  })
}

// 获取产品列表
export function getGoodsList(params) {
  return request({
    url: '/retail/product/list',
    method: 'get',
    params
  })
}

// 获取钱包列表
export function getWalletList(params) {
  return request({
    url: '/wallet/customer/list',
    method: 'get',
    params
  })
}

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

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

// 直调发货
export function adjustDeliver(params) {
  return request({
    url: '/invoice/rak/addRak',
    method: 'post',
    data: params
  })
}

// 直调完成
export function finishData(params) {
  return request({
    url: '/retail/transfer/over',
    method: 'post',
    params
  })
}

// 提前开票
export function directOrder(params) {
  return request({
    url: '/requisition/add',
    method: 'post',
    data: params
  })
}
