huangxiaoqiang
16 小时以前 e483ac11616ffc9260d8f491fcc0d66f480b5443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/**
 * 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)
}