import {
  RokeVehicleInboundPageModel,
  RokeVehicleInboundPageParams,
  RokeVehicleInboundPageResult,
} from './model/BfcrkdjbModel';
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';

enum Api {
  Page = '/ckgl/bfcrkdjb/page',
  List = '/ckgl/bfcrkdjb/list',
  Info = '/ckgl/bfcrkdjb/info',
  RokeVehicleInbound = '/ckgl/bfcrkdjb',
  Export = '/ckgl/bfcrkdjb/export',
}

/**
 * @description: 查询RokeVehicleInbound分页列表
 */
export async function getRokeVehicleInboundPage(
  params: RokeVehicleInboundPageParams,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.get<RokeVehicleInboundPageResult>(
    {
      url: Api.Page,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 获取RokeVehicleInbound信息
 */
export async function getRokeVehicleInbound(id: String, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<RokeVehicleInboundPageModel>(
    {
      url: Api.Info,
      params: { id },
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 新增RokeVehicleInbound
 */
export async function addRokeVehicleInbound(
  rokeVehicleInbound: Recordable,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.post<boolean>(
    {
      url: Api.RokeVehicleInbound,
      params: rokeVehicleInbound,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 更新RokeVehicleInbound
 */
export async function updateRokeVehicleInbound(
  rokeVehicleInbound: Recordable,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.put<boolean>(
    {
      url: Api.RokeVehicleInbound,
      params: rokeVehicleInbound,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 删除RokeVehicleInbound（批量删除）
 */
export async function deleteRokeVehicleInbound(ids: string[], mode: ErrorMessageMode = 'modal') {
  return defHttp.delete<boolean>(
    {
      url: Api.RokeVehicleInbound,
      data: ids,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description: 导出RokeVehicleInbound
 */
export async function exportRokeVehicleInbound(params?: object, mode: ErrorMessageMode = 'modal') {
  return defHttp.download(
    {
      url: Api.Export,
      method: 'GET',
      params,
      responseType: 'blob',
    },
    {
      errorMessageMode: mode,
    },
  );
}
