import request from '@/utils/request'

// 创建单号配置
export function createOrderCode(data) {
  return request({
    url: '/ecw/order-code/create',
    method: 'post',
    data: data
  })
}

// 更新单号配置
export function updateOrderCode(data) {
  return request({
    url: '/ecw/order-code/update',
    method: 'put',
    data: data
  })
}

// 删除单号配置
export function deleteOrderCode(id) {
  return request({
    url: '/ecw/order-code/delete?id=' + id,
    method: 'delete'
  })
}

// 获得单号配置
export function getOrderCode(id) {
  return request({
    url: '/ecw/order-code/get?id=' + id,
    method: 'get'
  })
}

// 获得单号配置分页
export function getOrderCodePage(query) {
  return request({
    url: '/ecw/order-code/page',
    method: 'get',
    params: query
  })
}

// 导出单号配置 Excel
export function exportOrderCodeExcel(query) {
  return request({
    url: '/ecw/order-code/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
