import request from '@/utils/request';

//查询可红冲的数据
export const getInvoicingList = (query) => {
  return request({
    url: '/bfs/redInvoicing/getInvoicingList',
    method: 'get',
    params: query
  });
};

export const getInvoicingApplyList = (query) => {
  return request({
    url: '/bfs/redInvoicing/getInvoicingApplyList',
    method: 'get',
    params: query
  });
};


//红冲申请
export const redInvoicingApply = (data) => {
  return request({
    url: '/bfs/redInvoicing/redInvoicingApply',
    method: 'post',
    data: data
  });
};

//查询凭证类型 by 业务号码
export const getCertificateByBusinessNo = (data) => {
  return request({
    url: '/bfs/redInvoicing/getCertificateByBusinessNo',
    method: 'post',
    data: data
  });
};

//查询待审核状态的红冲申请
export const getInvoicingReviewList = (query) => {
  return request({
    url: '/bfs/redInvoicing/getInvoicingReviewList',
    method: 'get',
    params: query
  });
};

//红冲审核
export const redInvoicingReview = (data) => {
  return request({
    url: '/bfs/redInvoicing/redInvoicingReview',
    method: 'post',
    data: data
  });
};

//查询待处理红冲数据
export const redInvoicingReloadList = (query) => {
  return request({
    url: '/bfs/redInvoicing/redInvoicingReloadList',
    method: 'get',
    params: query
  });
};

//处理待处理红冲数据
export const redInvoicingReloadDeal = (data) => {
  return request({
    url: '/bfs/redInvoicing/redInvoicingReloadDeal',
    method: 'post',
    data: data
  });
};

/**
 * 获取下拉内容
 */
export const getCacheList = () => {
  return request({
    url: '/bfs/redInvoicing/getCacheData',
    method: 'post'
  });
};

export const saveInvoicing = (data) => {
  return request({
    url: '/bfs/redInvoicing/saveInvoicing',
    method: 'post',
    data: data
  });
};

export const editInvoicing = (data) => {
  return request({
    url: '/bfs/redInvoicing/editInvoicing',
    method: 'post',
    data: data
  });
};

export const getInvoicingDetail = (invoicingId) => {
  const data = {
    invoicingId
  };
  return request({
    url: '/bfs/redInvoicing/getInvoicingDetail',
    method: 'post',
    data: data
  });
};

export const quryCertificateList = (query) => {
  return request({
    url: '/bfs/redInvoicing/getCertificateList',
    method: 'get',
    params: query
  });
};

export const addInvoicingByIds = (data) => {
  return request({
    url: '/bfs/redInvoicing/addInvoicingByIds',
    method: 'post',
    data: data
  });
};

export const quryInvoicingDetailList = (query) => {
  return request({
    url: '/bfs/redInvoicing/quryInvoicingDetailList',
    method: 'get',
    params: query
  });
};

export const applyInvoicing = (data) => {
  return request({
    url: '/bfs/redInvoicing/applyInvoicing',
    method: 'post',
    data: data
  });
};

export const invoicingAudit = (data) => {
  return request({
    url: '/bfs/redInvoicing/invoicingAudit',
    method: 'post',
    data: data
  })
};

export const quryInvoicingRedDetailList = (query) => {
  return request({
    url: '/bfs/redInvoicing/quryInvoicingRedDetailList',
    method: 'get',
    params: query
  });
};

export const redAudit = (data) => {
  return request({
    url: '/bfs/redInvoicing/redAudit',
    method: 'post',
    data: data
  });
};

