import request from '@/utils/request'

// 查询编号规则列表
export function listRule(query) {
  return request({
    url: '/number/rule/list',
    method: 'get',
    params: query
  })
}

// 查询编号规则详细
export function getRule(ruleId) {
  return request({
    url: '/number/rule/' + ruleId,
    method: 'get'
  })
}

// 新增编号规则
export function addRule(data) {
  return request({
    url: '/number/rule',
    method: 'post',
    data: data
  })
}

// 修改编号规则
export function updateRule(data) {
  return request({
    url: '/number/rule',
    method: 'put',
    data: data
  })
}

// 删除编号规则
export function delRule(ruleId) {
  return request({
    url: '/number/rule/' + ruleId,
    method: 'delete'
  })
}

// 导出编号规则
export function exportRule(query) {
  return request({
    url: '/number/rule/export',
    method: 'get',
    params: query
  })
}