import request from '@/utils/request'


//查询查询当前登录账套信息 年月
export function getLoginBook() {
  return request({
    url: 'api/finance/book/getLoginBook',
    method: 'get'
  })
}

//查询凭证信息列表无排序
export function voucherRelatedList(data) {
  return request({
    url: 'api/finance/voucher/listNoPage',
    method: 'get',
    params: data
  })
}

//查询凭证信息列表
export function voucherList(data) {
  return request({
    url: 'api/finance/voucher/list',
    method: 'get',
    params: data
  })
}

//删除凭证信息
export function delVoucher(id, resort) {
  return request({
    url: 'api/finance/voucher/remove/' + id,
    method: 'get',
    params: {resort}
  })
}

//审核凭证信息
export function voucherAudit(id) {
  return request({
    url: 'api/finance/voucher/audit/' + id,
    method: 'get'
  })
}

//审核全部凭证信息
export function voucherAuditAll() {
  return request({
    url: 'api/finance/voucher/allAudit/month',
    method: 'get'
  })
}

//取消审核凭证信息
export function cancelVoucherAudit(id) {
  return request({
    url: 'api/finance/voucher/cancelAudit/' + id,
    method: 'get'
  })
}

//断号重排
export function voucherResort() {
  return request({
    url: 'api/finance/voucher/resort',
    method: 'post'
  })
}

//插入排序
export const voucherInsertSort = (data) => {
  return request({
    url: 'api/finance/voucher/insertSort',
    method: 'post',
    data: data
  })
}

//导出
export const voucherExport = (data) => {
  return request({
    url: 'api/finance/voucher/export',
    method: 'post',
    data: data
  })
}

// 取消全部审核凭证信息
export function cancelAuditVoucherMonth(data) {
  return request({
    url: 'api/finance/voucher/cancelAuditVoucherMonth',
    method: 'post',
    data: data,
  })
}

//按年删除凭证
export function deleteVoucherByYear(year) {
  return request({
    url: 'api/finance/voucher/deleteByYear/' + year,
    method: 'post'
  })
}

// 多个id查询凭证
export function voucherDetails(data) {
  return request({
    url: 'api/finance/voucher/details/' + data,
    method: 'get',
  })
}

// 全部复核
export function accountAllVoucher(data) {
  return request({
    url: 'api/finance/voucher/accountAll',
    method: 'post',
    data: data,
  })
}

// 取消全部复核凭证信息
export function cancelAccountVoucherMonth(data) {
  return request({
    url: 'api/finance/voucher/cancelAccountVoucherMonth',
    method: 'post',
    data: data,
  })
}

