invoice.ts 2.28 KB
import { defHttp } from '/@/utils/http/axios';

enum Api {
  REFUND_DATE = '/order/erp/invoice_bill/get_back_refund_date', //最后汇款日期
  INVOICE_CREATE = '/order/erp/invoice_bill/create', //创建Invoice
  INVOICE = '/order/erp/invoice_bill/list_by_page', //分页查询列表
  BASE_INVOICE = '/order/erp/invoice_bill/list_base_order_info_by', //基础订单查询
  INVOICE_ANALYSIS = '/order/erp/invoice_bill/list_analysis_by', //分析列表
  EXPORT_ANALYSIS = '/order/erp/invoice_bill/export', //导出分析列表
  UPDATE_DEDUCT = '/order/erp/invoice_bill/update_deduct_info', //更新扣款信息
  UPDATE_AMOUNT = '/order/erp/invoice_bill/update_amount_info', //更新其他金额信息
  INVOICE_DELETE = '/order/erp/invoice_bill/delete_by_id', //删除数据
  COMMIT = '/order/erp/invoice_bill/commit_apply', //提交审核
}

export const getRefundDate = async (params: any) => {
  const res = await defHttp.post<any>({
    url: Api.REFUND_DATE,
    params,
  });
  return res;
};

export const createInvoice = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.INVOICE_CREATE,
    params,
  });
};

export const getInvoice = async (params: any) => {
  const res = await defHttp.post<any>({
    url: Api.INVOICE,
    params,
  });
  console.log(res, 5656);
  return res.records;
};
export const getBaseInvoice = async (params: any) => {
  const res = await defHttp.post<any>({
    url: Api.BASE_INVOICE,
    params,
  });
  return res;
};
export const invoiceAnalysis = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.INVOICE_ANALYSIS,
    params,
  });
};
export const exportAnalysis = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.EXPORT_ANALYSIS,
    params,
  });
};
export const updateDeduct = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.UPDATE_DEDUCT,
    params,
  });
};
export const updateAmount = async (params: any, p0?: { id: any; bgUrl: any }) => {
  return await defHttp.post<any>({
    url: Api.UPDATE_AMOUNT,
    params,
  });
};
export const deleteInvoice = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.INVOICE_DELETE,
    params,
  });
};
export const commit = async (params: any) => {
  return await defHttp.post<any>({
    url: Api.COMMIT,
    params,
  });
};