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

export function materialNormImport(data) {
  return handleImport('/material/norm/import', data.formdata, data.id || '')
}

export function materialNormImport2(data) {
  return handleImport('/material/norm/import2', data.formdata, data.id || '')
}


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

export function materialNormListExport(data, name) {
  return postBlob({
    url: '/material/norm/list/export',
    data,
    name
  })
}

export function materialNormAdd(data) {
  return request({
    url: '/material/norm/add',
    method: 'post',
    data: data
  })
}

export function materialNormEdit(data) {
  return request({
    url: '/material/norm/edit',
    method: 'post',
    data: data
  })
}

export function materialNormDetail(params) {
  return request({
    url: '/material/norm/detail',
    method: 'post',
    params
  })
}

export function materialNormBatchUpdateStatus(params) {
  return request({
    url: '/material/norm/batch/update/status',
    method: 'post',
    params
  })
}