From 4c63d5ebf30e99a917235bd7e53cc53e621beb2f Mon Sep 17 00:00:00 2001 From: userGyl Date: Mon, 8 Dec 2025 17:52:55 +0800 Subject: [PATCH] bugfix --- .../lib/pages/b_page/site/controller.dart | 40 +++++++++++-------- .../pages/c_page/reservation/controller.dart | 1 - 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ln_jq_app/lib/pages/b_page/site/controller.dart b/ln_jq_app/lib/pages/b_page/site/controller.dart index 6773838..b2bf573 100644 --- a/ln_jq_app/lib/pages/b_page/site/controller.dart +++ b/ln_jq_app/lib/pages/b_page/site/controller.dart @@ -16,7 +16,7 @@ enum ReservationStatus { class ReservationModel { final String id; final String plateNumber; - final String amount; + String amount; final String time; final String contactPerson; final String contactPhone; @@ -481,20 +481,26 @@ class SiteController extends GetxController with BaseControllerMixin { showLoading("确认中"); try { - var responseData = await HttpService.to.post( - 'appointment/orderAddHyd/completeOrder', - data: status == 0 - ? { - 'id': id, - 'addStatus': addStatus, //完成使用 完成1,未加2 - "addHydAmount": addHydAmount, - } - : { - 'id': id, - 'state': addStatus, //拒绝使用 -1 - "rejectReason": rejectReason, - }, - ); + var responseData; + if (addStatus == -1) { + responseData = await HttpService.to.post( + 'appointment/orderAddHyd/rejectOrder', + data: { + 'id': id, + 'state': -1, //拒绝使用 + "rejectReason": rejectReason, + }, + ); + } else { + responseData = await HttpService.to.post( + 'appointment/orderAddHyd/completeOrder', + data: { + 'id': id, + 'addStatus': addStatus, //完成使用 完成1,未加2 + "addHydAmount": addHydAmount, + }, + ); + } if (responseData == null && responseData!.data == null) { dismissLoading(); @@ -507,11 +513,13 @@ class SiteController extends GetxController with BaseControllerMixin { } dismissLoading(); + //addStatus 1完成 2未加 -1拒绝 if (addStatus == 1) { item.status = ReservationStatus.completed; + item.amount = "${addHydAmount}kg"; } else if (addStatus == -1) { item.status = ReservationStatus.rejected; - } else if (addStatus == -2) { + } else if (addStatus == 2) { item.status = ReservationStatus.pending; } updateUi(); diff --git a/ln_jq_app/lib/pages/c_page/reservation/controller.dart b/ln_jq_app/lib/pages/c_page/reservation/controller.dart index 3e21532..524f0ec 100644 --- a/ln_jq_app/lib/pages/c_page/reservation/controller.dart +++ b/ln_jq_app/lib/pages/c_page/reservation/controller.dart @@ -559,7 +559,6 @@ class C_ReservationController extends GetxController with BaseControllerMixin { }), preventDuplicates: false, ); - showToast("555$result"); if (result == true) { Get.back(); getReservationList();