import request from '@/utils/request'

// 查询售后记录列表
export function listSales(query) {
  return request({
    url: '/his/storeAfterSales/list',
    method: 'get',
    params: query
  })
}

// 查询售后记录详细
export function getSales(id) {
  return request({
    url: '/his/storeAfterSales/' + id,
    method: 'get'
  })
}
// 查询售后记录详细
export function itemList(id) {
  return request({
    url: '/his/storeAfterSales/itemList/' + id,
    method: 'get'
  })
}
export function codeId(id) {
  return request({
    url: '/his/storeAfterSales/codeId/' + id,
    method: 'get'
  })
}

export function logList(id) {
  return request({
    url: '/his/storeAfterSales/logList/' + id,
    method: 'get'
  })
}
// 新增售后记录
export function addSales(data) {
  return request({
    url: '/his/storeAfterSales',
    method: 'post',
    data: data
  })
}

// 修改售后记录
export function updateSales(data) {
  return request({
    url: '/his/storeAfterSales',
    method: 'put',
    data: data
  })
}
// 审核
export function auditing(data) {
  return request({
    url: '/his/storeAfterSales/auditing',
    method: 'put',
    data: data
  })
}

export function depotAuditing(data) {
  return request({
    url: '/his/storeAfterSales/depotAuditing',
    method: 'put',
    data: data
  })
}

// 财务审核
export function tuiMoney(data) {
  return request({
    url: '/his/storeAfterSales/tuiMoney',
    method: 'put',
    data: data
  })
}
// 撤销
export function noAuditing(data) {
  return request({
    url: '/his/storeAfterSales/noAuditing',
    method: 'put',
    data: data
  })
}

// 删除售后记录
export function delSales(id) {
  return request({
    url: '/his/storeAfterSales/' + id,
    method: 'delete'
  })
}

// 导出售后记录
export function exportSales(query) {
  return request({
    url: '/his/storeAfterSales/export',
    method: 'get',
    params: query
  })
}
