import request from "@/utils/request";

// 查询材料模板列表
export function listMaterials(query) {
  return request({
    url: '/project/configurations/listMaterial',
    method: 'get',
    params: query
  })
}

// 查询材料模板详细
export function getMaterial(materialId) {
  return request({
    url: '/project/configurations/getMaterial/' + materialId,
    method: 'get'
  })
}

// 状态修改
export function changeMaterialStatus(materialId, materialType) {
  const data = {
    materialId,
    materialType
  }
  return request({
    url: '/project/configurations/changeStatus',
    method: 'put',
    data: data
  })
}

// 新增材料模板
export function addMaterial(data) {
  return request({
    url: '/project/configurations/addMaterial',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 修改材料模板
export function updateMaterial(data) {
  return request({
    url: '/project/configurations/updateMaterial',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 删除材料模板
export function delMaterial(materialId) {
  return request({
    url: '/project/configurations/delMaterial/' + materialId,
    method: 'delete'
  })
}
