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

// 客户销售单
export function getFrontOrderList(params) {
  return request({
    url: `/customer/frontOrder/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 客户销售单导出
export function exportCustomerFrontOrder(data, name) {
  return postBlob({
    url: '/customer/frontOrder/list/export',
    data,
    name
  })
}

// 客户销售单
export function getFrontOrderListRefund(params) {
  return request({
    url: `/customer/frontOrder/listRefund?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

// 客户退货单导出
export function exportRefund(data, name) {
  return postBlob({
    url: '/customer/frontOrder/list/exportRefund',
    data,
    name
  })
}

///customer/frontOrder/add 新增客户销售单

export function addFrontOrder(params) {
  return request({
    url: '/customer/frontOrder/add',
    method: 'post',
    data: params
  })
}
export function addRefund(params) {
  return request({
    url: '/customer/frontOrder/addRefund',
    method: 'post',
    data: params
  })
}
export function getFrontOrderDetail(params) {
  return request({
    url: '/customer/frontOrder/detail',
    method: 'get',
    params
  })
}

export function getRegion(params) {
  return request({
    url: '/common/region/list',
    method: 'get',
    params
  })
}

export function sbumitFrontOrder(params) {
  return request({
    url: '/customer/frontOrder/send',
    method: 'post',
    params
  })
}

export function delFrontOrder(params) {
  return request({
    url: '/customer/frontOrder/delete',
    method: 'post',
    params
  })
}

export function delDeleteRefund(params) {
  return request({
    url: '/customer/frontOrder/deleteRefund',
    method: 'post',
    params
  })
}

// 修改客户销售单
export function updateFrontOrder(params) {
  return request({
    url: '/customer/frontOrder/update',
    method: 'post',
    data: params
  })
}

// 修改客户退货单
export function updateRefund(params) {
  return request({
    url: '/customer/frontOrder/updateRefund',
    method: 'post',
    data: params
  })
}

export function sendRefund(params) {
  return request({
    url: '/customer/frontOrder/sendRefund',
    method: 'post',
    params
  })
}

export function detailRefund(params) {
  return request({
    url: '/customer/frontOrder/detailRefund',
    method: 'get',
    params
  })
}

export function signIn(params) {
  return request({
    url: '/customer/frontOrder/signIn',
    method: 'post',
    params
  })
}
export function listOrder(params) {
  return request({
    url: '/customer/frontOrder/listOrder',
    method: 'post',
    data: params
  })
}
export function setSendRevoke(params) {
  return request({
    url: '/customer/frontOrder/sendRevoke',
    method: 'post',
    params
  })
}
export function sendRefundRevoke(params) {
  return request({
    url: '/customer/frontOrder/sendRefundRevoke',
    method: 'post',
    params
  })
}



// 下拉框查询
export function commonDict(params) {
  return request({
    url: "/common/dict/listDict",
    method: "get",
    params
  });
}
