import request from '@/utils/request';

/**
 * 查询对账单列表
 */
export function getStatementList(params?: any) {
  return request({
    url: '/bill/pcStatementOrder/list',
    method: 'get',
    params: params
  });
}

/**
 * 查询对账单详情
 */
export function getStatementInfo(id: number | string) {
  return request({
    url: `/bill/pcStatementOrder/${id}`,
    method: 'get'
  });
}

/**
 * 查询对账单明细列表
 */
export function getStatementDetails(params?: any) {
  return request({
    url: '/bill/pcStatementOrder/details',
    method: 'get',
    params: params
  });
}

/**
 * 确认对账单
 */
export function confirmStatement(data: { id: number; remark?: string }) {
  return request({
    url: '/bill/pcStatementOrder/confirm',
    method: 'put',
    data: data
  });
}

/**
 * 驳回对账单
 */
export function rejectStatement(data: { id: number; rejectRemark?: string }) {
  return request({
    url: '/bill/pcStatementOrder/reject',
    method: 'put',
    data: data
  });
}

/**
 * 查询对账单明细列表
 */
export function getStatementDetailList(params?: any) {
  return request({
    url: '/bill/pcStatementDetail/list',
    method: 'get',
    params: params
  });
}

/**
 * 查询对账单商品列表
 */
export function getStatementProductList(params?: any) {
  return request({
    url: '/bill/pcStatementProduct/list',
    method: 'get',
    params: params
  });
}

/**
 * 查询对账单发票列表
 */
export function getStatementInvoiceList(params?: any) {
  return request({
    url: '/bill/pcStatementInvoice/list',
    method: 'get',
    params: params
  });
}

/**
 * 申请开票
 */
export function applyForInvoice(data: any) {
  return request({
    url: '/bill/pcStatementInvoice',
    method: 'post',
    data: data
  });
}
