/**
|
* API 接口统一管理
|
* 所有接口都在这里定义,方便维护
|
*/
|
import { http } from '@/utils/http'
|
|
// ==================== 用户相关 ====================
|
export const userApi = {
|
// 获取用户信息
|
getUserInfo: () => http.get('/user/info'),
|
|
// 获取用户列表
|
getUserList: (params) => http.get('/user/list', params)
|
}
|
|
// ==================== 仓库相关 ====================
|
export const warehouseApi = {
|
// 获取仓库状态概览
|
getWarehouseStatus: () => http.get('/wms/warehouse/status'),
|
|
// 获取仓库区域信息
|
getAreas: () => http.get('/wms/warehouse/areas'),
|
|
// 获取库位信息
|
getLocations: (params) => http.get('/wms/warehouse/locations', params),
|
|
// 获取温湿度数据
|
getEnvData: () => http.get('/wms/warehouse/env')
|
}
|
|
// ==================== 库存相关 ====================
|
export const inventoryApi = {
|
// 获取库存概览
|
getInventoryOverview: () => http.get('/wms/inventory/overview'),
|
|
// 获取库存列表
|
getInventoryList: (params) => http.get('/wms/inventory/list', params),
|
|
// 库存预警列表
|
getLowStockAlerts: (params) => http.get('/wms/inventory/low-stock', params),
|
|
// 库存积压列表
|
getOverStockAlerts: (params) => http.get('/wms/inventory/over-stock', params),
|
|
// 即将过期物料
|
getExpiringItems: (params) => http.get('/wms/inventory/expiring', params),
|
|
// 库存周转率
|
getTurnoverRate: (params) => http.get('/wms/inventory/turnover', params),
|
|
// ABC分类统计
|
getABCStats: () => http.get('/wms/inventory/abc-stats')
|
}
|
|
// ==================== 作业任务相关 ====================
|
export const taskApi = {
|
// 获取任务列表
|
getTaskList: (params) => http.get('/wms/task/list', params),
|
|
// 创建任务
|
createTask: (data) => http.post('/wms/task/create', data),
|
|
// 更新任务状态
|
updateTaskStatus: (taskId, data) => http.put(`/wms/task/${taskId}/status`, data),
|
|
// 获取任务详情
|
getTaskDetail: (taskId) => http.get(`/wms/task/${taskId}`)
|
}
|
|
// ==================== 出入库相关 ====================
|
export const ioApi = {
|
// 入库单列表
|
getInboundList: (params) => http.get('/wms/inbound/list', params),
|
|
// 出库单列表
|
getOutboundList: (params) => http.get('/wms/outbound/list', params),
|
|
// 创建入库单
|
createInbound: (data) => http.post('/wms/inbound/create', data),
|
|
// 创建出库单
|
createOutbound: (data) => http.post('/wms/outbound/create', data),
|
|
// 出入库统计
|
getIOStats: (params) => http.get('/wms/io/stats', params)
|
}
|
|
// ==================== 生产相关 ====================
|
export const productionApi = {
|
// 获取生产线状态
|
getProductionLines: () => http.get('/wms/production/lines'),
|
|
// 获取设备状态
|
getDeviceStatus: (lineId) => http.get(`/wms/production/line/${lineId}/devices`),
|
|
// 获取生产任务列表
|
getProductionTasks: (params) => http.get('/wms/production/tasks', params),
|
|
// 产量统计
|
getProductionStats: (params) => http.get('/wms/production/stats', params),
|
|
// 良品率统计
|
getQualityStats: (params) => http.get('/wms/production/quality', params),
|
|
// 设备OEE
|
getDeviceOEE: (params) => http.get('/wms/production/oee', params)
|
}
|
|
// ==================== 报表相关 ====================
|
export const reportApi = {
|
// 综合看板数据
|
getDashboardData: () => http.get('/wms/report/dashboard'),
|
|
// 出入库趋势
|
getTrendData: (params) => http.get('/wms/report/trend', params),
|
|
// 分类占比
|
getCategoryStats: () => http.get('/wms/report/category'),
|
|
// 作业效率统计
|
getEfficiencyStats: (params) => http.get('/wms/report/efficiency', params)
|
}
|
|
// ==================== 物料相关 ====================
|
export const materialApi = {
|
// 获取物料列表
|
getMaterialList: (params) => http.get('/wms/material/list', params),
|
|
// 获取物料详情
|
getMaterialDetail: (materialId) => http.get(`/wms/material/${materialId}`),
|
|
// 获取物料库存历史
|
getMaterialHistory: (materialId, params) => http.get(`/wms/material/${materialId}/history`, params)
|
}
|
|
// ==================== 系统配置相关 ====================
|
export const configApi = {
|
// 获取系统配置
|
getConfig: () => http.get('/wms/system/config'),
|
|
// 更新系统配置
|
updateConfig: (data) => http.put('/wms/system/config', data)
|
}
|