修改搜索条件

This commit is contained in:
2025-12-18 10:33:24 +08:00
parent 95c08818cb
commit 3ec56a925c
2 changed files with 13 additions and 4 deletions

View File

@@ -23,10 +23,14 @@ class HistoryController extends GetxController {
String get formattedStartDate => DateFormat('yyyy/MM/dd').format(startDate.value);
String get formattedEndDate => DateFormat('yyyy/MM/dd').format(endDate.value);
String stationName = "";
@override
void onInit() {
super.onInit();
final args = Get.arguments as Map<String, dynamic>;
stationName = args['stationName'] as String;
fetchHistoryData();
}
@@ -37,12 +41,12 @@ class HistoryController extends GetxController {
"appointment/orderAddHyd/sitOrderPage",
data: {
// --- 直接使用 DateFormat 来格式化日期 ---
'startDate': _apiDateFormat.format(startDate.value),
'endDate': _apiDateFormat.format(endDate.value),
'startTime': _apiDateFormat.format(startDate.value),
'endTime': _apiDateFormat.format(endDate.value),
'plateNumber': plateNumberController.text,
'pageNum': 1,
'pageSize': 50,
'stationName': "", // 加氢站名称
'stationName': stationName, // 加氢站名称
},
);

View File

@@ -154,7 +154,12 @@ class SitePage extends GetView<SiteController> {
),
ElevatedButton(
onPressed: () {
Get.to(() => const HistoryPage());
Get.to(
() => HistoryPage(),
arguments: {
'stationName': controller.name,
},
);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue.shade700,