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

//  通用产品 列表  有分页
export const productUniversalCodeList = (params) => {
  const url = `/productUniversalCode/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('列表查询')
    }
  })
}
//  通用产品 删除
export const productUniversalCodeDel = (params) => {
  const url = `/productUniversalCode/delete/${params.id}`
  return axios({
    url: url,
    method: 'get',
    headers:{
        'module': encodeURIComponent('删除')
    }
  })
}
//  通用产品 保存
export const productUniversalCodeSave = (params) => {
  return axios({
    url: '/productUniversalCode/save',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent(params.id?'编辑':'新增')
    }
  })
}
//  通用产品 详情
export const productUniversalCodeDetail = (params) => {
  const url = `/productUniversalCode/findById/${params.id}`
  return axios({
    url: url,
    method: 'get'
  })
}
//  产品编码模糊搜索  有分页  产品编码
export const productCodeQueryList = (params) => {
  const url = `/productUniversalCode/productListPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('产品编码模糊搜索')
    }
  })
}
// 导出 
export const productUniversalExport = (params) => {
  return axios({
    url: '/productUniversalCode/exportExcel',
    data: params,
    method: 'post',
    responseType: 'blob',
    headers:{
        'module': encodeURIComponent('导出')
    }
  })
}