优化仓库和库区管理功能,将状态字段类型从number改为string,移除编辑表单中的状态选择项,在列表页面将状态标签改为开关组件支持直接切换状态,新增updateWarehouseStatus和updateZoneStatus接口用于批量更新状态,同时在操作列新增日志按钮并集成操作日志对话框组件,在列表中添加修改时间列,优化查询参数将name改为keyword统一搜索字段命名
This commit is contained in:
77
src/api/assets/location/index.ts
Normal file
77
src/api/assets/location/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { newService } from '/@/utils/request';
|
||||
|
||||
// 库位查询参数
|
||||
export interface LocationQueryParams {
|
||||
keyword?: string;
|
||||
warehouseId?: string;
|
||||
zoneId?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// 库位数据接口
|
||||
export interface LocationData {
|
||||
id?: string;
|
||||
locationName: string;
|
||||
locationCode?: string;
|
||||
locationType?: string;
|
||||
warehouseId?: string;
|
||||
zoneId: string;
|
||||
maxCapacity?: number;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
// 获取库位列表
|
||||
export function listLocations(params?: LocationQueryParams) {
|
||||
return newService({
|
||||
url: '/assets/location/listLocations',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取库位详情
|
||||
export function getLocation(id: string) {
|
||||
return newService({
|
||||
url: '/assets/location/getLocation',
|
||||
method: 'get',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 创建库位
|
||||
export function createLocation(data: LocationData) {
|
||||
return newService({
|
||||
url: '/assets/location/createLocation',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新库位
|
||||
export function updateLocation(data: LocationData) {
|
||||
return newService({
|
||||
url: '/assets/location/updateLocation',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除库位
|
||||
export function deleteLocation(id: string) {
|
||||
return newService({
|
||||
url: '/assets/location/deleteLocation',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 更新库位状态
|
||||
export function updateLocationStatus(data: { id: string[]; status: string }) {
|
||||
return newService({
|
||||
url: '/assets/location/updateLocationStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -2,8 +2,8 @@ import { newService } from '/@/utils/request';
|
||||
|
||||
// 仓库查询参数
|
||||
export interface WarehouseQueryParams {
|
||||
name?: string;
|
||||
status?: number;
|
||||
keyword?: string;
|
||||
status?: string;
|
||||
pageNum?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
@@ -16,7 +16,7 @@ export interface WarehouseData {
|
||||
address?: string;
|
||||
contactPerson?: string;
|
||||
contactPhone?: string;
|
||||
status?: number;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
@@ -64,3 +64,12 @@ export function deleteWarehouse(id: string) {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 更新仓库状态
|
||||
export function updateWarehouseStatus(data: { id: string[]; status: string }) {
|
||||
return newService({
|
||||
url: '/assets/warehouse/updateWarehouseStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface ZoneData {
|
||||
zoneType?: string;
|
||||
warehouseId: string;
|
||||
capacity?: number;
|
||||
status?: number;
|
||||
status?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
@@ -65,3 +65,12 @@ export function deleteZone(id: string) {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 更新库区状态
|
||||
export function updateZoneStatus(data: { id: string[]; status: string }) {
|
||||
return newService({
|
||||
url: '/assets/zone/updateZoneStatus',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user