import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}
// 添加
export const httpAdd = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvadd`, { data });
};
// 列表
export const httpList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvlist`, { data });
};
// 详情
export const httpDetail = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvinfo`, { data });
};
// 状态
export const httpStatus = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvstatus`, { data });
};
// 订单列表
export const httpOrderList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderlist`, { data });
};

export const httpBatchOrderList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderquery`, { data });
};

//设置物流
export const httpSetPost = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}invsetpost`, { data });
};

//
export const httpInvoiceList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}invoicelist`, { data });
};

export const httpCompanyList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}companylist`, { data });
};

export const httpUpload = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvimport`, { data });
};

export const httpBatchApproval = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderinvbatch`, { data });
};

export const httpBack = (data: object): any => {
  return http.request("post", `${yewuApi}ticketedit`, { data });
};
