import request from '@/utils/request'

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

//查看机具类型管理列表详细信息
export function getDeviceDetail(id) {
  return request({
      url: '/material/ma_machine/'+ id,
      method: 'get',
  })
}


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

// 物资名称下拉框---无companyId
export function getMaterialTypeList(query) {
  return request({
    url: '/material/ma_machine/getMaterialTypeList',
    method: 'get',
    params: query
  })
}

// 资产属性下拉框-
export function getZichanType(query) {
  return request({
    url: '/material/bm_asset_attributes/list',
    method: 'get',
    params: query
  })
}

// 仓库管理--删除
export function delDevice(id) {
  return request({
      url: '/material/ma_machine/' + id,
      method: 'delete',
  })
}

// 仓库管理--修改
export function editDevice(data) {
  return request({
      url: '/material/ma_machine',
      method: 'put',
      data: data,
  })
}
// 仓库管理--修改
export function editMachineStatus(data) {
  return request({
      url: '/material/ma_machine/editMachineStatus',
      method: 'put',
      data: data,
  })
}

// 仓库管理--新增
export function addDevice(data) {
  return request({
      url: '/material/ma_machine',
      method: 'post',
      data: data,
  })
}

export function editDeviceBatch(data) {
  return request({
    url: '/material/ma_machine/updateDate',
    method: 'post',
    data: data,
  })
}

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

// 设备管理--获取报告编号信息
export function getSynchReportCode(data) {
  return request({
      url: '/material/ma_machine/getReport',
      method: 'post',
      data: data,
  })
}

// 检验报告同步记录
export function getSynchListApi(query) {
  return request({
      url: '/material/ma_machine/getSynchList',
      method: 'get',
      params: query,
  })
}

// 检验报告同步记录详情
export function getSynchDetailsListApi(query) {
  return request({
      url: '/material/ma_machine/getSynchDetailList',
      method: 'get',
      params: query,
  })
}

// 设备管理--同步检验报告
export function synchReport(data) {
  return request({
      url: '/material/ma_machine/synchReport',
      method: 'post',
      data: data,
  })
}
export function editAssetsCode(data) {
  return request({
      url: '/material/ma_machine/editAssetsCode',
      method: 'post',
      data: data,
  })
}


//小工具编码信息列表
export function getGadgetList(query) {
  return request({
    url: '/material/wsMaInfo/getGadgetList',
    method: 'get',
    params: query,
  })
}

// 小工具编码信息列表--新增
export function addWsMaInfoData(data) {
  return request({
    url: '/material/wsMaInfo/addWsMaInfoData',
    method: 'post',
    data: data,
  })
}

// 小工具编码信息列表--删除
export function delGadget(data) {
  return request({
    url: '/material/wsMaInfo/delGadget',
    method: 'post',
    data: data,
  })
}

//查看机具类型管理列表详细信息
export function getGadgetInfo(id) {
  return request({
    url: '/material/wsMaInfo/getGadgetInfo/'+ id,
    method: 'get',
  })
}

// 小工具编码信息列表--修改
export function updateGadgetInfo(data) {
  return request({
    url: '/material/wsMaInfo/updateGadgetInfo',
    method: 'post',
    data: data,
  })
}
