import request from '@/utils/request'

// 查询公文流转列表
export function listEhsDocTransfer(query) {
  return request({
    url: '/ehs/ehsDocTransfer/list',
    method: 'get',
    params: query
  })
}

// 查询公文流转详细
export function getEhsDocTransfer(id) {
  return request({
    url: '/ehs/ehsDocTransfer/' + id,
    method: 'get'
  })
}

// 查询公文流转记录
export function listTransferRecord(query) {
  return request({
    url: '/ehs/ehsDocTransfer/list',
    method: 'get',
    params: query
  })
}

// 新增公文流转
export function addEhsDocTransfer(data) {
  return request({
    url: '/ehs/ehsDocTransfer',
    method: 'post',
    data: data
  })
}

// 归还
export function returnEhsDoc(id) {
  return request({
    url: '/ehs/ehsDocTransfer/return/' + id,
    method: 'get'
  })
}

// 借出
export function lendEhsDoc(data) {
  return request({
    url: '/ehs/ehsDocTransfer/lend',
    method: 'post',
    data: data
  })
}

// 修改公文流转
export function updateEhsDocTransfer(data) {
  return request({
    url: '/ehs/ehsDocTransfer',
    method: 'put',
    data: data
  })
}

// 删除公文流转
export function delEhsDocTransfer(id) {
  return request({
    url: '/ehs/ehsDocTransfer/' + id,
    method: 'delete'
  })
}
