Initial commit
This commit is contained in:
119
src/api/tower/accessory/index.ts
Normal file
119
src/api/tower/accessory/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Accessory, AccessoryParam } from '@/api/tower/accessory/model';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageAccessory(params: AccessoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Accessory>>>(
|
||||
'/tower/tower-accessory/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listAccessory(params?: AccessoryParam) {
|
||||
const res = await request.get<ApiResult<Accessory[]>>(
|
||||
'/tower/tower-accessory',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addAccessory(data: Accessory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateAccessory(data: Accessory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindAccessory(data: Accessory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchAccessory(data: Accessory[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeAccessory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchAccessory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-accessory/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/tower/accessory/model/index.ts
Normal file
39
src/api/tower/accessory/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Accessory {
|
||||
accessoryId?: undefined;
|
||||
accessoryName?: string;
|
||||
accessoryNo?: string;
|
||||
accessoryCategory?: string;
|
||||
accessoryModel?: string;
|
||||
accessorySpecs?: string;
|
||||
accessoryPrice?: number;
|
||||
accessoryUnit?: string;
|
||||
accessoryStock?: string;
|
||||
companyNo?: string;
|
||||
companyName?: string;
|
||||
manufactor?: string;
|
||||
manufactorNo?: string;
|
||||
accessoryWeight?: string;
|
||||
lifeYear?: number;
|
||||
factoryDate?: string;
|
||||
scrapDate?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface AccessoryParam extends PageParam {
|
||||
accessoryId?: number;
|
||||
accessoryName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
136
src/api/tower/equipment/index.ts
Normal file
136
src/api/tower/equipment/index.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
TowerEquipment,
|
||||
TowerEquipmentParam
|
||||
} from '@/api/tower/equipment/model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageTowerEquipment(params: TowerEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerEquipment>>>(
|
||||
'/tower/tower-equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listTowerEquipment(params?: TowerEquipmentParam) {
|
||||
const res = await request.get<ApiResult<TowerEquipment[]>>(
|
||||
'/tower/tower-equipment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeTowerEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchTowerEquipment(data: TowerEquipment[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改设备状态
|
||||
*/
|
||||
export async function updateBatchTowerEquipment(data: TowerEquipment[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/status',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchTowerEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
src/api/tower/equipment/model/index.ts
Normal file
55
src/api/tower/equipment/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface TowerEquipment {
|
||||
equipmentId?: number;
|
||||
name?: string;
|
||||
model?: string;
|
||||
equipmentNo?: string;
|
||||
factoryNo?: string;
|
||||
factoryDate?: string;
|
||||
manufactor?: string;
|
||||
lifeYear?: number;
|
||||
surplusYear?: number;
|
||||
scrapDate?: string;
|
||||
beianNo?: string;
|
||||
licenceNo?: string;
|
||||
company?: string;
|
||||
organization?: string;
|
||||
warehouse?: string;
|
||||
source?: string;
|
||||
filingNo?: string;
|
||||
machineNo?: string;
|
||||
maxLiftingHeight?: string;
|
||||
armLength?: string;
|
||||
isOutOrg?: boolean;
|
||||
buyDate?: string;
|
||||
currentLocation?: string;
|
||||
designHeight?: number;
|
||||
height?: number;
|
||||
ratedLoad?: string;
|
||||
files?: string;
|
||||
file1?: string;
|
||||
file2?: string;
|
||||
file3?: string;
|
||||
file4?: string;
|
||||
file5?: string;
|
||||
file6?: string;
|
||||
file7?: string;
|
||||
users?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: number;
|
||||
maxRatedLoad?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface TowerEquipmentParam extends PageParam {
|
||||
equipmentId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
}
|
||||
107
src/api/tower/model/index.ts
Normal file
107
src/api/tower/model/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { TowerModel, TowerModelParam } from './model';
|
||||
// const merchantCode = String(localStorage.getItem('merchantCode'));
|
||||
|
||||
/**
|
||||
* 分页查询设备型号
|
||||
*/
|
||||
export async function pageTowerModel(params: TowerModelParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerModel>>>(
|
||||
'/tower/tower-model/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备型号列表
|
||||
*/
|
||||
export async function listTowerModel(params?: TowerModelParam) {
|
||||
const res = await request.get<ApiResult<TowerModel[]>>('/tower/tower-model', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备型号
|
||||
*/
|
||||
export async function addTowerModel(data: TowerModel) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-model',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备型号
|
||||
*/
|
||||
export async function updateTowerModel(data: TowerModel) {
|
||||
const res = await request.put<ApiResult<unknown>>('/tower/tower-model', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备型号
|
||||
*/
|
||||
export async function removeTowerModel(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-model/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备型号
|
||||
*/
|
||||
export async function removeBatchTowerModel(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-model/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-model/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/tower/model/model/index.ts
Normal file
53
src/api/tower/model/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 型号分类
|
||||
*/
|
||||
export interface TowerModel {
|
||||
// 型号分类id
|
||||
categoryId?: number;
|
||||
// 型号分类
|
||||
title?: string;
|
||||
// 型号分类图片
|
||||
image?: string;
|
||||
// 使用年限
|
||||
yearLife?: number;
|
||||
// 上级分类
|
||||
parentId?: number;
|
||||
// 是否隐藏
|
||||
hide?: number;
|
||||
// 封面图
|
||||
avatar?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 所属门店ID
|
||||
shopId?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
//
|
||||
key?: number;
|
||||
//
|
||||
merchantCode?: string;
|
||||
value?: number;
|
||||
// 子菜单
|
||||
children?: TowerModel[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 型号分类搜索条件
|
||||
*/
|
||||
export interface TowerModelParam extends PageParam {
|
||||
title?: string;
|
||||
categoryId?: string;
|
||||
yearLife?: number;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
}
|
||||
102
src/api/tower/project/index.ts
Normal file
102
src/api/tower/project/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Project, ProjectParam } from '@/api/tower/project/model';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageProject(params: ProjectParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Project>>>(
|
||||
'/tower/tower-project/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listProject(params?: ProjectParam) {
|
||||
const res = await request.get<ApiResult<Project[]>>('/tower/tower-project', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addProject(data: Project) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateProject(data: Project) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindProject(data: Project) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeProject(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchProject(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/tower/project/model/index.ts
Normal file
37
src/api/tower/project/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Project {
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
companyName?: string;
|
||||
customerName?: string;
|
||||
projectRegion?: string;
|
||||
projectAddress?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
superviseNo?: string;
|
||||
licenceNo?: string;
|
||||
securityStatus?: string;
|
||||
competentDepartment?: string;
|
||||
dismantlingCompany?: string;
|
||||
truckCraneSpecs?: string;
|
||||
contract?: string;
|
||||
director?: string;
|
||||
projectDirector?: string;
|
||||
projectStatus?: string;
|
||||
salesman?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ProjectParam extends PageParam {
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/tower/warehouse/index.ts
Normal file
105
src/api/tower/warehouse/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Warehouse, WarehouseParam } from '@/api/tower/warehouse/model';
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageWarehouse(params: WarehouseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Warehouse>>>(
|
||||
'/tower/tower-warehouse/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listWarehouse(params?: WarehouseParam) {
|
||||
const res = await request.get<ApiResult<Warehouse[]>>(
|
||||
'/tower/tower-warehouse',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addWarehouse(data: Warehouse) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-warehouse',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateWarehouse(data: Warehouse) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-warehouse',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定仓库
|
||||
*/
|
||||
export async function bindWarehouse(data: Warehouse) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-warehouse/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeWarehouse(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-warehouse/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchWarehouse(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-warehouse/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/tower/warehouse/model/index.ts
Normal file
30
src/api/tower/warehouse/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface Warehouse {
|
||||
warehouseId?: number;
|
||||
warehouseName?: string;
|
||||
warehouseKeeper?: string;
|
||||
warehousePhone?: string;
|
||||
regionName?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface WarehouseParam extends PageParam {
|
||||
warehouseId?: number;
|
||||
warehouseName?: string;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user