feat(client): 出入库列表按原型重建(KPI/详情抽屉/详细搜索/工具栏/选中复制/窗口尺寸)
- 列表重建:KPI 卡、状态+时间列、操作改眼睛开右侧详情抽屉、重置右置 - 详情抽屉(order_detail_drawer) 100% 还原原型 + SelectionArea 可选中复制 - 详细搜索弹窗:ComboSearchField/滚轮日期、字段重构、白底盒子按钮 - 工具栏:搜索框×清除+占位精简、供应商/客户下拉取全部、状态菜单收窄 - 加载不白屏(半透明遮罩)、输入框与下拉等高、windows/macOS 默认窗口尺寸调大 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import '../core/api/api_client.dart';
|
||||
import '../core/exceptions.dart';
|
||||
import '../core/models/page_result.dart';
|
||||
import '../models/stock_in.dart';
|
||||
import '../models/stock_summary.dart';
|
||||
|
||||
class StockInRepository {
|
||||
final ApiClient _client;
|
||||
@@ -14,6 +15,7 @@ class StockInRepository {
|
||||
String? startDate,
|
||||
String? endDate,
|
||||
String? keyword,
|
||||
Map<String, String>? detail,
|
||||
int page = 1,
|
||||
int pageSize = 20,
|
||||
}) async {
|
||||
@@ -25,6 +27,7 @@ class StockInRepository {
|
||||
if (startDate != null) 'start_date': startDate,
|
||||
if (endDate != null) 'end_date': endDate,
|
||||
if (keyword != null && keyword.isNotEmpty) 'keyword': keyword,
|
||||
if (detail != null) ...detail, // 详细搜索多字段
|
||||
};
|
||||
final resp = await _client.get('/stock-in/orders', params: params);
|
||||
return PageResult.fromJson(
|
||||
@@ -39,6 +42,19 @@ class StockInRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/// 入库 KPI 汇总(本月笔数/金额 + 上月同期 + 待审核)。
|
||||
Future<StockSummary> summary() async {
|
||||
try {
|
||||
final resp = await _client.get('/stock-in/summary');
|
||||
return StockSummary.fromJson(resp.data as Map<String, dynamic>);
|
||||
} on DioException catch (e) {
|
||||
throw AppException(
|
||||
e.response?.data?['error'] as String? ?? '获取入库汇总失败',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<StockInOrder> get(int id) async {
|
||||
try {
|
||||
final resp = await _client.get('/stock-in/orders/$id');
|
||||
|
||||
@@ -3,6 +3,7 @@ import '../core/api/api_client.dart';
|
||||
import '../core/exceptions.dart';
|
||||
import '../core/models/page_result.dart';
|
||||
import '../models/stock_out.dart';
|
||||
import '../models/stock_summary.dart';
|
||||
|
||||
class StockOutRepository {
|
||||
final ApiClient _client;
|
||||
@@ -15,6 +16,7 @@ class StockOutRepository {
|
||||
String? endDate,
|
||||
String? keyword,
|
||||
String? productCode,
|
||||
Map<String, String>? detail,
|
||||
int page = 1,
|
||||
int pageSize = 20,
|
||||
}) async {
|
||||
@@ -28,6 +30,7 @@ class StockOutRepository {
|
||||
if (keyword != null && keyword.isNotEmpty) 'keyword': keyword,
|
||||
if (productCode != null && productCode.isNotEmpty)
|
||||
'product_code': productCode,
|
||||
if (detail != null) ...detail, // 详细搜索多字段
|
||||
};
|
||||
final resp = await _client.get('/stock-out/orders', params: params);
|
||||
return PageResult.fromJson(
|
||||
@@ -42,6 +45,32 @@ class StockOutRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/// 出库 KPI 汇总(本月笔数/金额 + 上月同期 + 待审核)。
|
||||
Future<StockSummary> summary() async {
|
||||
try {
|
||||
final resp = await _client.get('/stock-out/summary');
|
||||
return StockSummary.fromJson(resp.data as Map<String, dynamic>);
|
||||
} on DioException catch (e) {
|
||||
throw AppException(
|
||||
e.response?.data?['error'] as String? ?? '获取出库汇总失败',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 确认售价(先出后定价):items 为 [{item_id, sale_price}]。
|
||||
Future<void> confirmSale(int id, List<Map<String, dynamic>> items) async {
|
||||
try {
|
||||
await _client.post('/stock-out/orders/$id/confirm-sale',
|
||||
data: {'items': items});
|
||||
} on DioException catch (e) {
|
||||
throw AppException(
|
||||
e.response?.data?['error'] as String? ?? '确认售价失败',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<StockOutOrder> get(int id) async {
|
||||
try {
|
||||
final resp = await _client.get('/stock-out/orders/$id');
|
||||
|
||||
Reference in New Issue
Block a user