import {main, dict, file} from '@/api'
import request from '@/utils/require'

//列表页
export function selectList(data) {
    return request({
      url: `${main}/manager/transferBarnReview/selectPageByEntity?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
      method: 'post',
      data: data
    })
}


//详情
export function detailsInfo(data) {
  return request({
    url: `${main}/manager/transferBarnReview/selectById`,
    method: 'post',
    data: data
  })
}


// 通过
export function passItemInfo(data) {
  return request({
    url: `${main}/manager/transferBarnReview/updateReview`,
    method: 'post',
    data: data
  })
}

//驳回
export function turnDownInfo(data) {
  return request({
    url: `${main}/manager/transferBarnReview/updateRefused`,
    method: 'post',
    data: data
  })
}


//确认
// export function saveInfo(data) {
//   return request({
//     url: `${main}/manager/transferBarnReview/updateByEntitySelective`,
//     method: 'post',
//     data: data
//   })
// }
export function saveInfo(data) {
  return request({
    url: `${main}/manager/transferBarnReview/updateStatusManager`,
    method: 'post',
    data: data
  })
}

//文件回显
export function fileInfo(data) {
  return request({
    url: `${file}/file/findByIds?ids=${data}`,
    method: 'get',
  })
}

// 导出
export function exportWarehouseApproval(data) {
  return request({
    url: `${main}/manager/transferBarnReview/exportPageByEntity?` + data,
    method: 'get',
    data,
    responseType:"blob",
    headers:{
      'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' // 设置完以后 传入的params对象就会时候用formdata传参的方式
    }
  })
}
