import request from '@/utils/request'


// 查询报废台账审核列表
export function getTotalList(query) {
  return request({
    url: '/material/scrap_apply_details/getTotalList',
    method: 'get',
    params: query
  })
}

// 查询待审核周期和审核金额
export function getTotalPrice(query) {
  return request({
    url: '/material/scrap_apply_details/getTotalPrice',
    method: 'get',
    params: query
  })
}

// 通过
export function ledgerApprove(data) {
  return request({
    url: '/material/scrap_apply_details/ledgerApprove',
    method: 'post',
    data: data,
  })
}

// 驳回
export function ledgerReject(data) {
  return request({
    url: '/material/scrap_apply_details/ledgerReject',
    method: 'post',
    data: data,
  })
}

//盘带报废编码获取下拉框
export function getMachineListByCode(query) {
  return request({
    url: '/material/ma_machine/getMachineList',
    method: 'get',
    params: query
  })
}

//盘带报废列表查询
export function getInventoryList(query) {
  return request({
    url: '/material/scrap_apply_details/inventoryList',
    method: 'get',
    params: query
  })
}

//盘带报废新增
export function addScrapInfo(query) {
  return request({
    url: '/material/scrap_apply_details/addList',
    method: 'post',
    data: query
  })
}

//盘带报废编辑 
export function editScrapInfo(query) {
  return request({
    url: '/material/scrap_apply_details/updateList',
    method: 'post',
    data: query
  })
}


//盘带报废查看接口
export function getScrapInfo(query) {
  return request({
    url: '/material/scrap_apply_details/getDetailsList',
    method: 'get',
    params: query
  })
}

//报废台账列表
export function getScrapList(query) {
  return request({
    url: '/material/scrap_apply_details/getScrapList',
    method: 'get',
    params: query
  })
}

//报废台账详情列表
export function getScrapDetailsList(query) {
  return request({
    url: '/material/scrap_apply_details/getScrapDetailsList',
    method: 'get',
    params: query
  })
}

//盘点报废通过与驳回
export function inventoryPass(data) {
  return request({
      url: '/material/scrap_apply_details/inventoryApprove',
      method: 'post',
      data: data
  })
}

// 删除-报废
export function applyDetailApi(data) {
  return request({
    url: '/material/scrap_apply_details/delete',
    method: 'post',
    data
  })
}