import {main,User,loginUrl,files} from '@/api'
import request from '@/utils/require'
// 物质储备管理制度
// 分页//查询列表
export function selectList(data) {
  return request({
    url: `${main}/client/MaterialManagement/selectList?pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
    method: 'post',
    data: data.orgCode
  })
}
// 查询文件信息
export function downloadFile(id) {
  return request({
    url: `${files}/file/findById?id=${id}`,
    method: 'post',
  })
}
//下载
export function downLoads(id){
  return request({
    url:`${files}/file/download?id=${id}`,
    method:'get'
  })
}
//查看
export function showMaterialInfo(zdbm) {
  return request({
    url: `${main}/client/MaterialManagement/getInformation/${zdbm}`,
    method: 'get',
  })
}
//保存
export function saveMaterialInfo(data) {
  return request({
    url: `${main}/client/MaterialManagement/save`,
    method: 'post',
    data: data
  })
}
//编辑
export function updateEditor(data) {
  return request({
    url: `${main}/client/MaterialManagement/update`,
    method: 'post',
    data: data
  })
}

//删除
export function deleteList(zdbm) {
  return request({
    url: `${main}/client/MaterialManagement/delete/${zdbm}`,
    method: 'get',
  })
}
//下发
export function onSend(data) {
  return request({
    url: `${main}/client/MaterialManagement/issue`,
    method: 'post',
    data: data
  })
}
// http://192.168.80.230:8002/myuser/org/tree
export function tre(data) {
  return request({
    url: `${loginUrl}/org/tree`,
    method: 'post',
    data: data
  })
}
//下发过后的回显
export function cha(zdbm){
  return request({
    url:`${main}/client/MaterialManagement/getJsbm/${zdbm}`,
    method: 'get'
  })
}

//下载
// export function downLoad(realPath) {
//   return request({
//     url: `${main}/MaterialManagement/download/${realPath}`,
//     method: 'post',
//     data: realPath
//   })
// }
