import request from '@/utils/request'

// 获取摘要列表
export const summaryListData = () => {
  return request({
    url: 'api/finance/summary/listData',
    method: 'get'
  })
}
// 获取会计科目列表
export const subjectData = (query) => {
  return request({
    url: 'api/finance/subject/listByUser',
    method: 'get',
    params: query,
  })
}

// 获取会计科目列表
export const subjectDataListAll = (params) => {
  return request({
    url: 'api/finance/subject/listAll',
    method: 'get',
    params: params,
  })
}

//保存或新增品凭证
export function voucherSaveOrUpdate(data) {
  return request({
    url: 'api/finance/voucher/saveOrUpdate',
    method: 'post',
    data: data
  })
}

export function relateVoucher(path, data) {
  return request({
    // url: 'api/finance/voucher/relateAssetToVoucher',
    url: path,
    method: 'post',
    data: data
  })
}

//获取最大凭证号
export function voucherGetCurrentNum() {
  return request({
    url: 'api/finance/voucher/getCurrentNum',
    method: 'get'
  })
}

// 保存或新增凭证模板信息
export const mouldSaveOrUpdate = (data) => {
  return request({
    url: 'api/finance/voucher/mould/saveOrUpdate',
    method: 'post',
    data: data
  })
}
// 模板凭证列表
export const voucherMouldList = () => {
  return request({
    url: 'api/finance/voucher/mould/list',
    method: 'get'
  })
}

//查询凭证信息明细
export const voucherDetail = (data) => {
  return request({
    url: 'api/finance/voucher/detail',
    method: 'get',
    params: data
  })
}

//查询凭证归档动作
export const archiveVoucher = (data) => {
  return request({
    url: 'api/finance/voucher/archiveVoucher',
    method: 'post',
    data: data
  })
}

//查询辅助核算列表
export const assistListByAssist = (data) => {
  return request({
    url: 'api/finance/assist/listByAssist',
    method: 'get',
    params: data
  })
}

//通过科目id获取科目余额
export const getBySubjectId = (data) => {
  return request({
    url: 'api/finance/balance/getBySubjectId',
    method: 'get',
    params: data
  })
}

//上一步
export const voucherPre = (data) => {
  return request({
    url: 'api/finance/voucher/pre',
    method: 'get',
    params: data
  })
}

//下一步
export const voucherNext = (data) => {
  return request({
    url: 'api/finance/voucher/next',
    method: 'get',
    params: data
  })
}

//删除附件
export const voucherDelFile = (data) => {
  return request({
    url: 'api/finance/voucher/delFile',
    method: 'post',
    data: data
  })
}

//模板下载
export const importTemplate = () => {
  return request({
    url: 'api/finance/voucher/importTemplate',
    method: 'get',
  })
}

//转入凭证动作
export const billinVoucher = (data) => {
  return request({
    url: 'api/finance/voucher/billinVoucher',
    method: 'post',
    data: data
  })
}

//转出动作凭证
export const billoutVoucher = (data) => {
  return request({
    url: 'api/finance/voucher/billoutVoucher',
    method: 'post',
    data: data
  })
}

//获取凭证位置信息
export const voucherOperatorStatistics = (data) => {
  return request({
    url: 'api/finance/voucher/voucherOperatorStatistics',
    method: 'get',
    params: data
  })
}
//凭证贴票统计
export const voucherDetailStick = (id) => {
  return request({
    url: 'api/finance/voucher/voucherDetail/' + id,
    method: 'get'
  })
}


//凭证打印模板
export const financePrintQuery = (data) => {
  return request({
    url: 'api/finance/print/query',
    method: 'get',
    params: data
  })
}

export const generateBalanceVoucher = (data) => {
  return request({
    url: 'api/finance/voucher/generateBalanceVoucher',
    method: 'get',
    params: data
  })
}
// 模板凭证列表
export const subjectDatalistByYear = () => {
  return request({
    url: 'api/finance/subject/listByYear',
    method: 'get'
  })
}

// 查询级联账套下拉
export function listByDeptId(query) {
  return request({
    url: 'api/finance/book/listByDeptId',
    method: 'get',
    params: query
  })
}


// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: 'api/system/user/profile/get',
    method: 'get'
  })
}
