import request from '@/utils/request'

// 分页查询单据编号表列表
export function pageListNumber(query) {
  return request({
    url: '/bill/number/pageList',
    method: 'get',
    params: query
  })
}

// 查询单据编号表列表
export function listNumber(query) {
  return request({
    url: '/bill/number/list',
    method: 'get',
    params: query
  })
}

// 查询单据编号表详细
export function getNumber(id) {
  return request({
    url: '/bill/number/' + id,
    method: 'get'
  })
}

// 新增单据编号表
export function addNumber(data) {
  return request({
    url: '/bill/number',
    method: 'post',
    data: data
  })
}

// 修改单据编号表
export function updateNumber(data) {
  return request({
    url: '/bill/number',
    method: 'put',
    data: data
  })
}

// 删除单据编号表
export function delNumber(id) {
  return request({
    url: '/bill/number/' + id,
    method: 'delete'
  })
}

// 导出单据编号表
export function exportNumber(query) {
  return request({
    url: '/bill/number/' + 'export',
    method: 'post',
    params: query
  })
}

export function getBillNumber(billPrefix) {
  return request({
    url: '/bill/number/getBillNo/' + billPrefix,
    method: 'get'
  })
}
