重新整理仓库
This commit is contained in:
135
src/api/hjm/hjmCar/index.ts
Normal file
135
src/api/hjm/hjmCar/index.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { HjmCar, HjmCarParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询车辆管理
|
||||
*/
|
||||
export async function pageHjmCar(params: HjmCarParam) {
|
||||
const res = await request.get<ApiResult<PageResult<HjmCar>>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车辆管理列表
|
||||
*/
|
||||
export async function listHjmCar(params?: HjmCarParam) {
|
||||
const res = await request.get<ApiResult<HjmCar[]>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加车辆管理
|
||||
*/
|
||||
export async function addHjmCar(data: HjmCar) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆管理
|
||||
*/
|
||||
export async function updateHjmCar(data: HjmCar) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆管理
|
||||
*/
|
||||
export async function removeHjmCar(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车辆管理
|
||||
*/
|
||||
export async function removeBatchHjmCar(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询车辆管理
|
||||
*/
|
||||
export async function getHjmCar(id: number) {
|
||||
const res = await request.get<ApiResult<HjmCar>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆批量导入
|
||||
*/
|
||||
export async function importHjmCar(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code查询黄家明_车辆管理
|
||||
*/
|
||||
export async function getHjmCarByCode(code: string) {
|
||||
const res = await request.get<ApiResult<HjmCar>>(
|
||||
MODULES_API_URL + '/hjm/hjm-car/getByCode/' + code
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
92
src/api/hjm/hjmCar/model/index.ts
Normal file
92
src/api/hjm/hjmCar/model/index.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import {HjmFence} from "@/api/hjm/hjmFence/model";
|
||||
|
||||
/**
|
||||
* 车辆管理
|
||||
*/
|
||||
export interface HjmCar {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 车辆名称
|
||||
name?: string;
|
||||
// 车辆图片
|
||||
image?: string;
|
||||
// 类型 0汽车 1其他车
|
||||
type?: number;
|
||||
// 快递公司
|
||||
kuaidi?: string;
|
||||
// 管理负责人
|
||||
kuaidiAdmin?: string;
|
||||
// 车辆编号
|
||||
code?: string;
|
||||
// 绑定操作员
|
||||
driverId?: number;
|
||||
// 操作员名称
|
||||
driver?: string;
|
||||
// 操作员名称
|
||||
driverName?: string;
|
||||
// 操作员手机号
|
||||
driverPhone?: string;
|
||||
// 安装人员
|
||||
installerId?: number;
|
||||
// 安装时间
|
||||
installTime?: string;
|
||||
// 保险状态
|
||||
insuranceStatus?: string;
|
||||
// GPS设备编号
|
||||
gpsNo?: string;
|
||||
// 电子围栏ID
|
||||
fenceId?: number;
|
||||
// 电子围栏名称
|
||||
fenceName?: string;
|
||||
// 车辆是否在电子围栏内
|
||||
inFence?: boolean;
|
||||
// 电子围栏名称
|
||||
fence?: HjmFence;
|
||||
// 位置
|
||||
location?: string;
|
||||
// 经度
|
||||
longitude?: string,
|
||||
// 纬度
|
||||
latitude?: string,
|
||||
// 区域
|
||||
district?: string;
|
||||
// 地址
|
||||
address?: string,
|
||||
// 组织ID
|
||||
organizationId?: number;
|
||||
// 父级组织ID
|
||||
organizationParentId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 认领状态
|
||||
claim?: number;
|
||||
// 认领时间
|
||||
claimTime?: string;
|
||||
// 绑定用户
|
||||
toUser?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆管理搜索条件
|
||||
*/
|
||||
export interface HjmCarParam extends PageParam {
|
||||
id?: number;
|
||||
status?: number;
|
||||
organizationId?: number;
|
||||
installerId?: number;
|
||||
organizationParentId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user