import request from '@/utils/request'

// 公用接口
// 查询所有角色
export function queryRoleList() {
  return request({
    url: '/user/queryRoleList',
    method: 'get'
  })
}
// 已配区域三级联动
export function getAreaList() {
  return request({
    url: '/area/getAreaList',
    method: 'get'
  })
}

// 工号下拉数据
export function getJobCodeList() {
  return request({
    url: '/userMaintain/getJobCodeList',
    method: 'get'
  })
}

// 分店下拉列表
export function branchManangeList() {
  return request({
    url: '/branchManange/list',
    method: 'get'
  })
}

// 系列下拉数据
export function getSeriesList() {
  return request({
    url: '/series/getSeriesList',
    method: 'get'
  })
}

// 根据日期获取日期对象
export function getDayMaintainByDate(params) {
  return request({
    url: '/dayMaintain/getDayMaintainByDate',
    method: 'get',
    params
  })
}

// 公用导出
export function exportApi(url, data, method) {
  let option = {
    url: url,
    method: method,
    responseType: 'blob'
  }
  if (method == 'get') {
    option.params = data
  } else {
    option.data = data
  }
  return request(option)
}

// 公用导入
export function importApi(url, data, method) {
  let option = {
    url: url,
    method: method ? method : 'get'
  }
  if (method == 'get') {
    option.params = data
  } else {
    option.data = data
  }
  return request(option)
}

// 获取Excel导入模板
export function getExcelTemplate(type) {
  return request({
    url: '/file/exportExcel/' + type,
    method: 'get',
    responseType: 'blob'
  })
}

// 首饰类别列表信息
export function jewelryList(params) {
  return request({
    url: '/jewelryCategory/jewelryList',
    method: 'get',
    params
  })
}

// ics产品系列下拉数据
export function getIcsSeriesList(params) {
  return request({
    url: '/series/getIcsSeriesList',
    method: 'get',
    params
  })
}

// 小系列下拉数据
export function getSmallSeriesList(params) {
  return request({
    url: '/smallSeries/getSmallSeriesList',
    method: 'get',
    params
  })
}

// 根据等级获取已配区域
export function getAreaListByLevel(params) {
  return request({
    url: '/area/getAreaListByLevel',
    method: 'get',
    params
  })
}
// 条码筛选
export function tataRuleColumnsList(params){
    return request ({
        url:'/tataRuleColumns/list',
        method:'get',
        params
    })
}
// 根据登录信息获取用户权限
export function getResources(params) {
  return request({
    url: '/getResources',
    method: 'get',
    params
  })
}
