import { axios } from '@/utils/request'

//  智能补货列表  无分页
export const predictList = (params) => {
  return axios({
    url: '/predict/stockPredict/queryList',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
//  智能补货  产品范围列表  无分页
export const predictRangeList = (params) => {
  const url = `/predict/stockPredict/queryRangeList/${params.sn}`
  return axios({
    url: url,
    method: 'get',
    headers:{
        'module': encodeURIComponent('产品范围列表查询')
    }
  })
}
//  智能补货  趋势平均列表
export const predictTrendList = (params) => {
  return axios({
    url: '/predict/stockPredict/queryTrendList',
    params: params,
    method: 'get',
    headers:{
        'module': encodeURIComponent('趋势平均列表查询')
    }
  })
}
//  智能补货  保存
export const predictSave = (params) => {
  return axios({
    url: '/predict/stockPredict/save',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('新增')
    }
  })
}
//  智能补货  删除
export const predictDel = (params) => {
  const url = `/predict/stockPredict/delete/${params.sn}`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('删除')
    }
  })
}
//  智能补货  详情
export const predictDetail = (params) => {
  const url = `/predict/stockPredict/queryBySn/${params.sn}`
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('详情')
    }
  })
}
//  智能补货  产品范围 保存
export const predictRangeSave = (params) => {
  return axios({
    url: '/predict/stockPredict/saveBatchRange',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('产品范围保存')
    }
  })
}
//  智能补货  产品范围 删除
export const predictRangeDel = (params) => {
  return axios({
    url: '/predict/stockPredict/deleteRange',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('产品范围删除')
    }
  })
}
//  智能补货  计算
export const predictRun = (params) => {
  return axios({
    url: '/predict/stockPredict/run',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('计算')
    }
  })
}
//  智能补货  基础信息设置  批量插入
export const predictProductInfoInsert = (params) => {
  return axios({
    url: '/predictProductInfo/batchInsert',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('基础信息设置批量插入')
    }
  })
}
//  智能补货  基础信息设置  下载
export const predictProductInfoExport = (params) => {
  return axios({
    url: '/predictProductInfo/exportExcel',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('基础信息设置下载')
    }
  })
}
//  智能补货  基础信息设置  解析
export const predictProductInfoGoods = (params) => {
  return axios({
    url: '/predictProductInfo/parseGoods',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('基础信息设置解析')
    }
  })
}
//  智能补货  结果下载
export const predictstockPredictExport = (params) => {
  return axios({
    url: `/predict/stockPredict/exportExcel/${params.sn}`,
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('结果下载')
    }
  })
}
