import request from '@/utils/request'

//新购到货-列表
export function getListNewBuy(query) {
  return request({
      url: '/material/purchase_check_info/list',
      method: 'get',
      params: query,
  })
}

//新购到货-二级列表详情
export function getPurchaseCheckInfo(query) {
  return request({
      url: '/material/purchase_check_info/getInfo',
      method: 'get',
      params: query,
  })
}

// 新购到货-新增
export function addPurchaseCheckInfo(data) {
  return request({
      url: '/material/purchase_check_info',
      method: 'post',
      data: data,
  })
}

// 新购到货-编辑
export function updatePurchaseCheckInfo(data) {
  return request({
      url: '/material/purchase_check_info',
      method: 'put',
      data: data,
  })
}
// 新购到货-编辑
export function updatePurchaseCheckInfoApi(data) {
  return request({
      url: '/material/purchase_check_info/update',
      method: 'post',
      data,
  })
}
export function updatePurchaseFileApi(data) {
  return request({
      url: '/material/purchase_check_info/updateFile',
      method: 'post',
      data,
  })
}

// 新购到货--删除
export function purchaseCheckInfoRemove(ids) {
  return request({
      url: '/material/purchase_check_info/' + ids,
      method: 'delete',
  })
}

//通知人员列表
export function getNoticePeople(query) {
  return request({
      url: '/material/purchase_notice_person/list',
      method: 'get',
      params: query,
  })
}

// 人员管理--新增
export function addNoticeUser(data) {
  return request({
      url: '/material/purchase_notice_person/batchAddNoticePerson',
      method: 'post',
      data: data,
  })
}

 // 人员通知-通知
export function bmNoticeInfo(data) {
  return request({
      url: '/material/purchase_notice_person/batchSendSms',
      method: 'put',
      data: data,
  })
}


//通知-添加人员-未选择人员
export function getListUnSelected(params) {
  return request({
      url: '/material/purchase_notice_person/listUnSelected',
      method: 'get',
      params,
  })
}
// 通知人员--删除
export function delPeople(ids) {
  return request({
      url: '/material/purchase_notice_person/' + ids,
      method: 'delete',
  })
}

//获取机具类型树
export function equipmentTypeTree(query) {
  return request({
      url: '/material/ma_type/equipmentType',
      method: 'get',
      params: query,
  })
}

export function equipmentTypeLease(query) {
  return request({
    url: '/material/ma_type/equipmentTypeLease',
    method: 'get',
    params: query,
  })
}

// 上传报告附件
export function uploadPurchaseFile(data) {
  return request({
    url: '/material/bm_file_info',
    method: 'post',
    data: data
  })
}



