import request from '@/utils/request'

//机具类型管理
export function getMaTypeList(query) {
  return request({
      url: '/material/ma_type/getMaTypeTreeSelect',
      method: 'get',
      params: query,
  })
}

//机具类型管理列表信息
export function getListByMaType(query) {
  return request({
      url: '/material/ma_type/getListByMaType',
      method: 'get',
      params: query,
  })
}

//查看机具类型管理列表详细信息
export function getMaType(id) {
  return request({
      url: '/material/ma_type/'+ id,
      method: 'get',
  })
}
// 仓库信息下拉框-
export function queryKeeperDataApi(query) {
  return request({
    url: '/material/wh_house_info/listNoPage',
    method: 'get',
    params: query
  })
}
// 施工类型下拉框-
export function queryKeeperProApi(query) {
  return request({
    url: '/material/ma_type/selectMaTypeListByHouseId',
    method: 'get',
    params: query
  })
}

// 物资类型下拉框-
export function queryKeeperMatApi(query) {
  return request({
    url: '/material/ma_type/selectMaTypeListByTypeId',
    method: 'get',
    params: query
  })
}

// 物资名称下拉框-
export function queryKeeperNameApi(query) {
  return request({
    url: '/material/ma_type/selectMaTypeListByTypeId',
    method: 'get',
    params: query
  })
}

// // 导出
// export function exportMaterial(query) {
//   return request({
//       url: '/material/ma_type/export',
//       method: 'post',
//       responseType: 'blob',
//       params: query
//   })
// }

// 物资类型管理--删除
export function delMaType(typeId) {
  return request({
      url: '/material/ma_type/' + typeId,
      method: 'delete',
  })
}

// 物资类型管理--修改
export function updateMaType(data) {
  return request({
      url: '/material/ma_type',
      method: 'put',
      data: data,
  })
}
// 配件类型管理--一级修改
export function updatePartType(data) {
  return request({
      url: '/material/wh_house_info',
      method: 'put',
      data: data,
  })
}

// 物资类型管理--新增
export function addMaType(data) {
  return request({
      url: '/material/ma_type',
      method: 'post',
      data: data,
  })
}
// 物资类型管理--新增
export function updateStorageNumApi(data) {
  return request({
      url: '/material/ma_type/updateStorageNum',
      method: 'post',
      data: data,
  })
}

// 工程项目-列表
export function getProjectList(query) {
  return request({
    url: '/material/base/bmProjectInfo/projectInfoAll',
    method: 'get',
    params: query
  })
}


//库管员维修员
export function getUserTypeList(roleIds) {
  return request({
    url: '/system/user/list?roleIds='+roleIds+'&pageNum=1&pageSize=100',//框架接口有分页
    method: 'get',
  })
}

// 租赁价格历史-列表
export function getMaTypeHistoryList(query) {
  return request({
    url: '/material/ma_type/getMaTypeHistoryList',
    method: 'get',
    params: query
  })
}

// 标准配置清单-tree
export function getConfigTreeSelect(query) {
  return request({
    url: '/material/standardConfig/getConfigTreeSelect',
    method: 'get',
    params: query
  })
}

// 标准配置清单-tree新增
export function addConfig(data) {
  return request({
    url: '/material/standardConfig/add',
    method: 'post',
    data,
  })
}

// 标准配置清单-tree修改
export function editConfig(data) {
  return request({
    url: '/material/standardConfig/edit',
    method: 'post',
    data,
  })
}

// 标准配置清单-tree删除
export function delConfig(data) {
  return request({
    url: '/material/standardConfig/del',
    method: 'post',
    data
  })
}

// 标准配置清单-列表
export function getListByConfigId(query) {
  return request({
    url: '/material/standardConfig/getListByConfigId',
    method: 'get',
    params: query
  })
}

// 标准配置清单-select
export function getConfigList(data = {}) {
  return request({
    url: '/material/standardConfig/getConfigLevelTwoList',
    method: 'post',
    data
  })
}

// 物资名称-tree
export function getEquipmentThreeType(query) {
  return request({
    url: '/material/ma_type/equipmentThreeType',
    method: 'get',
    params: query
  })
}

// 物资名称-tree-3
export function getEquipmentThreeTypeThree() {
  return request({
    url: '/material/leaseTask/equipmentThreeType',
    method: 'get',
  })
}

export function equipmentThreeTypeLease() {
  return request({
    url: '/material/leaseTask/equipmentThreeTypeLease',
    method: 'get',
  })
}

// 规格型号-select
export function getMaTypeOpt(data) {
  return request({
    url: '/material/select/getMaType',
    method: 'post',
    data
  })
}

// 新增配置明细
export function addConfigDetails(data) {
  return request({
    url: '/material/standardConfig/addConfigDetails',
    method: 'post',
    data
  })
}

// 修改配置明细
export function editConfigDetails(data) {
  return request({
    url: '/material/standardConfig/editConfigDetails',
    method: 'post',
    data
  })
}

// 删除配置明细
export function delConfigDetails(data) {
  return request({
    url: '/material/standardConfig/delConfigDetails',
    method: 'post',
    data
  })
}

// 配件1-2级树
export function getPartTreeApi(data) {
  return request({
    url: '/material/ma_part_type/getPartTree',
    method: 'get',
    params: data
  })
}

// 班组长列表
export function getUserListApi() {
  return request({
    url: '/material/ma_type/getUserList',
    method: 'get',
  })
}
