import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL, VITE_WORKORDER_REAL, VITE_PURCHASE_REAL } = loadEnv();


const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
const newApi = VITE_WORKORDER_REAL

//发票回票列表
export const httpList = (data: object): any => {
  return http.request("post", `${newApi}cxinv/payinv/list`, { data });
};

//发票回票添加
export const httpAdd = (data: object): any => {
  return http.request("post", `${newApi}cxinv/payinv/create`, { data });
};

//发票回票审核状态
export const httpStatus = (data: object): any => {
  return http.request("post", `${newApi}cxinv/payinv/status`, { data });
};


export const httpSupplierInfo = (data: object): any => {
  return http.request("post", `${VITE_PURCHASE_REAL}/admin/supplerlist`, { data });
};

//发票回票详情
export const httpInfo = (data: object): any => {
  return http.request("post", `${newApi}cxinv/payinv/info`, { data });
};

export const httpDetail = (data: object): any => {
  return http.request("post", `${newApi}cxinv/invoice/info`, { data });
};


//发票回票删除
export const httpDelete = (data: object): any => {
  return http.request("post", `${yewuApi}invdel`, { data });
};

//发票回票批量审核
export const httpBatchimport = (data: object): any => {
  return http.request("post", `${yewuApi}hpbatchimport`, { data });
};


export const httpInvoiceBatch = (data: object): any => {
  return http.request("post", `${newApi}cxinv/invoiceItem/importOrder`, { data });
};

//发票回票批量添加
export const httpBatchAdd = (data: object): any => {
  return http.request("post", `${yewuApi}invAddBatchByImport`, { data });
};
