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

export function materialReferPriceSave(data) {
  return request({
    url: `/material/refer/price/save`,
    method: 'post',
    data
  })
}

export function materialReferPriceDetail(params) {
  return request({
    url: `/material/refer/price/detail`,
    method: 'post',
    params
  })
}

export function materialReferPriceDelete(params) {
  return request({
    url: `/material/refer/price/delete`,
    method: 'post',
    params
  })
}

export function materialReferPriceList(params) {
  return request({
    url: `/material/refer/price/list?moduleId=${params.moduleId}`,
    method: 'post',
    data: params
  })
}

export function materialReferPriceListExport(data, name) {
  return postBlob({
    url: '/material/refer/price/list/export',
    data,
    name
  })
}


export function materialReferPriceDownload(data, name) {
  return getBlob({
    url: 'material/refer/price/download',
    data,
    name
  })
}

export function materialReferPriceImport(data) {
  return handleImport('/material/refer/price/import', data.formdata, data.id || '')
}

export function stockManagerAllPrice(params) {
  return request({
    url: `/stock/manager/allPrice`,
    method: 'post',
    params
  })
}
