feat: 商品追踪页面 + 出库提交库存校验
后端: - feat(backend): 重命名 Batches→Products 接口,新增库存状态(在售/已卖出)和买家信息 - feat(backend): 出库单创建/提交时校验仓库库存,不足则返回明确错误信息 - fix(backend): 出库创建 status 判断逻辑修复(空值默认 draft) 前端: - feat(client): 批次追踪改为商品追踪,新增状态列(在售/已卖出)和买家/时间列 - fix(client): 无批次号时显示"无批次"而非空 - refactor(client): BatchRecord → ProductTrackingRecord,repository 接口更新 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class InventoryRepository {
|
||||
}
|
||||
}
|
||||
|
||||
Future<PageResult<BatchRecord>> listBatches({
|
||||
Future<PageResult<ProductTrackingRecord>> listProducts({
|
||||
int? productId,
|
||||
int? warehouseId,
|
||||
int page = 1,
|
||||
@@ -60,14 +60,14 @@ class InventoryRepository {
|
||||
if (productId != null) 'product_id': productId,
|
||||
if (warehouseId != null) 'warehouse_id': warehouseId,
|
||||
};
|
||||
final resp = await _client.get('/inventory/batches', params: params);
|
||||
final resp = await _client.get('/inventory/products', params: params);
|
||||
return PageResult.fromJson(
|
||||
resp.data as Map<String, dynamic>,
|
||||
BatchRecord.fromJson,
|
||||
ProductTrackingRecord.fromJson,
|
||||
);
|
||||
} on DioException catch (e) {
|
||||
throw AppException(
|
||||
e.response?.data?['error'] as String? ?? '获取批次数据失败',
|
||||
e.response?.data?['error'] as String? ?? '获取商品追踪数据失败',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user