import request from '@/utils/request'

// 获取规则头列表
export function getRuleTypeList(params) {
  return request({
    url: '/eim/numRule/list',
    method: 'get',
    params
  })
}
export function getNoByRule(businessCode) {
  return request({
    url: `/eim/numRule/getNoByRule?businessCode=${businessCode}`,
    method: 'get',
  })
}
// 添加规则头
export function addCodeRule(data) {
  return request({
    url: '/eim/numRule/add',
    method: 'post',
    data
  })
}
// 编辑规则头
export function editCodeRule(data) {
  return request({
    url: '/eim/numRule/edit',
    method: 'put',
    data
  })
}
// 删除规则头
export function removeCodeRule(ids) {
  return request({
    url: `/eim/numRule/remove?ids=${ids}`,
    method: 'delete',
  })
}
// 获取规则头详情
export function getCodeRuleDetails(params) {
  return request({
    url: `/eim/numRule/query`,
    method: 'get',
    params
  })
}
// 获取编码规则列表
export function getCodeRuleItemList(params) {
  return request({
    url: `/eim/numRuleDetails/list`,
    method: 'get',
    params
  })
}
// 新增编码规则
export function addCodeRuleItemList(data) {
  return request({
    url: '/eim/numRuleDetails/add',
    method: 'POST',
    data
  })
}
// 编辑编码规则
export function editCodeRuleItemList(data) {
  return request({
    url: '/eim/numRuleDetails/edit',
    method: 'PUT',
    data
  })
}
// 删除编码规则
export function deleteCodeRuleItemList(ids) {
  return request({
    url: `/eim/numRuleDetails/remove?ids=${ids}`,
    method: 'DELETE',
  })
}
// 批量新增编码规则
export function addCodeRuleItemLists(data) {
  return request({
    url: '/eim/numRuleDetails/adds',
    method: 'POST',
    data
  })
}
// 获取字典类型
export function getDictionariesList(type) {
  return request({
    url: `/system/dict-data/page?pageNo=1&pageSize=100&dictType=${type}`,
    method: 'get'
  })
}


// 获取工艺流程序列规则列表
export function getRuleList(params) {
  return request({
    url: `/eim/numRule/getRuleList`,
    method: 'get',
    params
  })
}
