fix(pre-planting): 修复编译错误(getMerges→getMyMerges、RoutePaths 缺失导入、Future.wait 类型)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b9b23c36d7
commit
7bad0a8935
|
|
@ -114,7 +114,7 @@ class ContractCheckService {
|
||||||
/// 查找第一个待签署的预种合并合同编号
|
/// 查找第一个待签署的预种合并合同编号
|
||||||
Future<String?> _getPendingPrePlantingMergeNo() async {
|
Future<String?> _getPendingPrePlantingMergeNo() async {
|
||||||
try {
|
try {
|
||||||
final merges = await _prePlantingService.getMerges();
|
final merges = await _prePlantingService.getMyMerges();
|
||||||
final pending = merges.where(
|
final pending = merges.where(
|
||||||
(m) => m.contractStatus == PrePlantingContractStatus.pending,
|
(m) => m.contractStatus == PrePlantingContractStatus.pending,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -45,13 +45,10 @@ class _PendingContractsPageState extends ConsumerState<PendingContractsPage> {
|
||||||
final prePlantingService = ref.read(prePlantingServiceProvider);
|
final prePlantingService = ref.read(prePlantingServiceProvider);
|
||||||
|
|
||||||
// 并行加载:普通认种未签合同 + 预种待签合并
|
// 并行加载:普通认种未签合同 + 预种待签合并
|
||||||
final results = await Future.wait([
|
final tasksFuture = contractService.getUnsignedTasks();
|
||||||
contractService.getUnsignedTasks(),
|
final mergesFuture = prePlantingService.getMyMerges();
|
||||||
prePlantingService.getMerges(),
|
final tasks = await tasksFuture;
|
||||||
]);
|
final allMerges = await mergesFuture;
|
||||||
|
|
||||||
final tasks = results[0] as List<ContractSigningTask>;
|
|
||||||
final allMerges = results[1] as List<PrePlantingMerge>;
|
|
||||||
final pendingMerges = allMerges
|
final pendingMerges = allMerges
|
||||||
.where((m) => m.contractStatus == PrePlantingContractStatus.pending)
|
.where((m) => m.contractStatus == PrePlantingContractStatus.pending)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:city_pickers/city_pickers.dart';
|
||||||
import '../../../../core/di/injection_container.dart';
|
import '../../../../core/di/injection_container.dart';
|
||||||
import '../../../../core/services/pre_planting_service.dart';
|
import '../../../../core/services/pre_planting_service.dart';
|
||||||
import '../../../../core/services/tree_pricing_service.dart';
|
import '../../../../core/services/tree_pricing_service.dart';
|
||||||
|
import '../../../../routes/route_paths.dart';
|
||||||
|
|
||||||
// ============================================
|
// ============================================
|
||||||
// [2026-02-17] 预种计划购买页面
|
// [2026-02-17] 预种计划购买页面
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue