import { axios } from '@/utils/request'

// 财务收款分页列表
export const financeBookQueryPage = (params) => {
  const url = `/financeBook/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 统计
export const financeBookQueryCount = (params) => {
  return axios({
    url: `/financeBook/queryCount`,
    data: params,
    method: 'post'
  })
}
// 财务收款明细-分页列表
export const financeBookDetailList = (params) => {
  const url = `/financeBook/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 财务收款明细-报表分页列表
export const financeBookDetailQueryPage = (params) => {
  const url = `/report/financeBook/detail/queryPage/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 财务收款明细-统计
export const financeBookReportDetailCount = (params) => {
  return axios({
    url: `/report/financeBook/detail/queryCount`,
    data: params,
    method: 'post'
  })
}

// 财务收款明细-导出
export const financeBookDetailExport = (params) => {
  const url = `/report/financeBook/detail/export`
  return axios({
    url: url,
    data: params,
    method: 'post',
    responseType: 'blob'
  })
}

// 详情
export const financeBookFindBySn = (params) => {
  const url = `/financeBook/queryBySn/${params.bookSn}`
  return axios({
    url: url,
    method: 'get'
  })
}
// 关联备货单接口
export const queryDispatchBillListBySn = (params) => {
  const url = `/financeBook/queryDispatchBillListBySn/${params.bookSn}`
  return axios({
    url: url,
    method: 'get'
  })
}
// 删除
export const financeBookDeleteBySn = (params) => {
  const url = `/financeBook/deleteBySn/${params.bookSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 再次编辑
export const financeBookDgainEditBySn = (params) => {
  const url = `/financeBook/againEdit/${params.bookSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 保存
export const financeBookSave = (params) => {
  const url = `/financeBook/save`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 查询账户信息
export const lastPayerAccountInfo = (params) => {
  const url = `/financeBook/detail/lastPayerAccountInfo`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 提交
export const financeBookSubmit = (params) => {
  const url = `/financeBook/submit`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 明细-列表
export const financeBookDetailQueryList = (params) => {
  const url = `/financeBook/detail/queryList/${params.bookSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 明细-保存
export const financeBookDetailSave = (params) => {
  const url = `/financeBook/detail/save`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 明细-详情
export const financeBookDetailQueryBySn = (params) => {
  const url = `/financeBook/detail/queryBySn/${params.bookDetailSn}`
  return axios({
    url: url,
    method: 'get'
  })
}
// 明细-删除
export const financeBookDetailDelete = (params) => {
  const url = `/financeBook/detail/deleteBySn/${params.bookDetailSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 修改开票日期
export const updateDetailInvoiceDate = (params) => {
  const url = `/financeBook/detail/updateDetailInvoiceDate`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 修改备注信息
export const updateFinanceBookDetail = (params) => {
  const url = `/financeBook/detail/update`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 保存关联业务
export const saveSettleReceiptFinanceBook = (params) => {
  const url = `/financeBook/saveSettleReceiptFinanceBook`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 查询关联业务列表
export const querySettleReceiptFinanceBookList = (params) => {
  const url = `/financeBook/querySettleReceiptFinanceBookList/${params.bookSn}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 删除关联业务
export const deleteSettleReceiptFinanceBook = (params) => {
  const url = `/financeBook/deleteSettleReceiptFinanceBook/${params.id}`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}

// 批量获取钉钉审核信息
export const getBatchLastProcessInstance = (params) => {
  const url = `/dingTalk/getBatchLastProcessInstance`
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
