import request, { postBlob, getBlob, handleImport } from '@/utils/request'

// 获取列表
export function getList(data) {
  return request({
    url: `/oldManager/list/page?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

// 导出列表
export function listExport(data, name) {
  return postBlob({
    url: '/oldManager/pageExport',
    data,
    name
  })
}

// 详情
export function getDetail(params) {
  return request({
    url: '/oldManager/detail',
    method: 'post',
    params
  })
}

// 保存
export function addData(params) {
  return request({
    url: '/oldManager/add',
    method: 'post',
    data: params
  })
}

// 保存
export function editData(params) {
  return request({
    url: '/oldManager/update',
    method: 'post',
    data: params
  })
}

// 出库
export function outData(params) {
  return request({
    url: '/oldManager/out',
    method: 'post',
    params
  })
}

// 工单类型列表
export function getOrderTypeList(data) {
  return request({
    url: `/order/smalltype/list`,
    method: 'post',
    data
  })
}

// 获取类别列表
export function getCategoryList(params) {
  return request({
    url: '/trade/list',
    method: 'get',
    params
  })
}

// 获取规格/属性列表
export function getAttrList(data) {
  return request({
    url: `/trade/list/page`,
    method: 'post',
    data
  })
}