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

// 查询物料管理-物料目录列表
export function listImpa(query) {
  return request({
    url: '/tongzhou/impa/impa/list',
    method: 'get',
    params: query
  })
}

// 查询物料管理-物料目录详细
export function getImpa(id) {
  return request({
    url: '/tongzhou/impa/impa/' + id,
    method: 'get'
  })
}

// 新增物料管理-物料目录
export function addImpa(data) {
  return request({
    url: '/tongzhou/impa/impa',
    method: 'post',
    data: data
  })
}

// 修改物料管理-物料目录
export function updateImpa(data) {
  return request({
    url: '/tongzhou/impa/impa',
    method: 'put',
    data: data
  })
}

// 删除物料管理-物料目录
export function delImpa(id) {
  return request({
    url: '/tongzhou/impa/impa/' + id,
    method: 'delete'
  })
}


// 导出物料管理-物料目录
export function downloadImpa(data) {
  download(
      '/tongzhou/impa/impa/export',
      data,
      `impa_${new Date().getTime()}.xlsx`)
}

