feat(client): 出库列表设计语言重建(副标 + 共享 StatusPill + golden)
副标「共 N 笔出库单」+ 详情弹窗斑马行 token 化;复用已升级的共享 StatusBadge→StatusPill;整屏 golden ×三主题(桌面+移动)入回归闸。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:jiu_client/core/models/page_result.dart';
|
||||
import 'package:jiu_client/core/auth/auth_state.dart';
|
||||
import 'package:jiu_client/models/stock_out.dart';
|
||||
import 'package:jiu_client/providers/stock_out_provider.dart';
|
||||
import 'package:jiu_client/screens/stock_out/stock_out_list_screen.dart';
|
||||
|
||||
import '../support/golden_harness.dart';
|
||||
|
||||
/// design-distill 阶段4:出库列表整屏 golden × 三主题(桌面 + 移动)。
|
||||
/// 复用共享 StatusBadge → StatusPill(草稿/待审核/已审核/已拒绝)。
|
||||
/// 更新基准:flutter test --update-goldens test/golden/stock_out_list_golden_test.dart
|
||||
|
||||
const _orders = [
|
||||
StockOutOrder(
|
||||
id: 1, orderNo: 'CK-20260620-031', warehouseId: 1, warehouseName: '主仓',
|
||||
partnerName: '鼎丰超市', operatorName: '李销售', reviewerName: '张管理',
|
||||
status: 'approved', orderDate: '2026-06-20', totalAmount: 12800),
|
||||
StockOutOrder(
|
||||
id: 2, orderNo: 'CK-20260618-022', warehouseId: 1, warehouseName: '主仓',
|
||||
partnerName: '金樽酒楼', operatorName: '张前台',
|
||||
status: 'pending', orderDate: '2026-06-18', totalAmount: 5400),
|
||||
StockOutOrder(
|
||||
id: 3, orderNo: 'CK-20260615-017', warehouseId: 1, warehouseName: '二号仓',
|
||||
partnerName: '恒昌名酒行', operatorName: '李销售',
|
||||
status: 'draft', orderDate: '2026-06-15', totalAmount: 3200),
|
||||
StockOutOrder(
|
||||
id: 4, orderNo: 'CK-20260612-009', warehouseId: 1, warehouseName: '主仓',
|
||||
partnerName: '喜宴婚庆服务', operatorName: '张前台', reviewerName: '张管理',
|
||||
status: 'rejected', orderDate: '2026-06-12', totalAmount: 1960),
|
||||
];
|
||||
|
||||
class _FakeStockOutNotifier extends StockOutListNotifier {
|
||||
@override
|
||||
Future<PageResult<StockOutOrder>> build() async =>
|
||||
const PageResult(data: _orders, total: 4, page: 1, pageSize: 20);
|
||||
@override
|
||||
void setPage(int page) {}
|
||||
@override
|
||||
void setPageSize(int pageSize) {}
|
||||
@override
|
||||
void setStatus(String status) {}
|
||||
@override
|
||||
void setDateRange(String? startDate, String? endDate) {}
|
||||
@override
|
||||
void setKeyword(String keyword) {}
|
||||
@override
|
||||
void setProductCode(String code) {}
|
||||
@override
|
||||
void reload() {}
|
||||
}
|
||||
|
||||
List<Override> _overrides() => [
|
||||
stockOutListProvider.overrideWith(() => _FakeStockOutNotifier()),
|
||||
isReadonlyProvider.overrideWithValue(false),
|
||||
];
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
|
||||
goldenAcrossThemes(
|
||||
'stock-out list 整屏(桌面)',
|
||||
goldenPrefix: 'stock_out_list',
|
||||
child: () => const Scaffold(body: StockOutListScreen()),
|
||||
overrides: _overrides,
|
||||
logical: const Size(1280, 900),
|
||||
);
|
||||
|
||||
goldenAcrossThemes(
|
||||
'stock-out list 整屏(移动)',
|
||||
goldenPrefix: 'stock_out_list_mobile',
|
||||
child: () => const Scaffold(body: StockOutListScreen()),
|
||||
overrides: _overrides,
|
||||
logical: const Size(390, 1300),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user