司机预约 显示拒绝原因
This commit is contained in:
@@ -25,6 +25,7 @@ class ReservationModel {
|
|||||||
|
|
||||||
final String contacts;
|
final String contacts;
|
||||||
final String phone;
|
final String phone;
|
||||||
|
final String rejectReason;
|
||||||
final String stationName;
|
final String stationName;
|
||||||
final String startTime;
|
final String startTime;
|
||||||
final String endTime;
|
final String endTime;
|
||||||
@@ -56,6 +57,7 @@ class ReservationModel {
|
|||||||
required this.stateName,
|
required this.stateName,
|
||||||
required this.addStatus,
|
required this.addStatus,
|
||||||
required this.addStatusName,
|
required this.addStatusName,
|
||||||
|
required this.rejectReason,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// 工厂构造函数,用于从JSON创建ReservationModel实例
|
/// 工厂构造函数,用于从JSON创建ReservationModel实例
|
||||||
@@ -113,6 +115,7 @@ class ReservationModel {
|
|||||||
addStatus: statusFromServer.toString(),
|
addStatus: statusFromServer.toString(),
|
||||||
addStatusName: json['addStatusName']?.toString() ?? '',
|
addStatusName: json['addStatusName']?.toString() ?? '',
|
||||||
stateName: json['stateName']?.toString() ?? '',
|
stateName: json['stateName']?.toString() ?? '',
|
||||||
|
rejectReason: json['rejectReason']?.toString() ?? '',
|
||||||
hasEdit: true,
|
hasEdit: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -137,7 +140,8 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
renderData();
|
renderData();
|
||||||
|
//加载列表数据
|
||||||
|
fetchReservationData();
|
||||||
startAutoRefresh();
|
startAutoRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,8 +534,7 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
} else if (addStatus == 2) {
|
} else if (addStatus == 2) {
|
||||||
item.status = ReservationStatus.unadded;
|
item.status = ReservationStatus.unadded;
|
||||||
}
|
}
|
||||||
|
renderData();
|
||||||
updateUi();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
}
|
}
|
||||||
@@ -563,19 +566,19 @@ class SiteController extends GetxController with BaseControllerMixin {
|
|||||||
completedAmount = result.data["completedAmount"].toString();
|
completedAmount = result.data["completedAmount"].toString();
|
||||||
name = result.data["name"].toString();
|
name = result.data["name"].toString();
|
||||||
orderTotalAmount = result.data["orderTotalAmount"].toString();
|
orderTotalAmount = result.data["orderTotalAmount"].toString();
|
||||||
orderUnfinishedAmount = result.data["orderUnfinishedAmount"].toString() ;
|
orderUnfinishedAmount = result.data["orderUnfinishedAmount"].toString();
|
||||||
|
|
||||||
leftHydrogen = leftHydrogen.isEmpty ? "统计中" : leftHydrogen.toString();
|
leftHydrogen = leftHydrogen.isEmpty ? "统计中" : leftHydrogen.toString();
|
||||||
orderTotalAmount = orderTotalAmount.isEmpty ? "统计中" : orderTotalAmount.toString();
|
orderTotalAmount = orderTotalAmount.isEmpty ? "统计中" : orderTotalAmount.toString();
|
||||||
orderUnfinishedAmount = orderUnfinishedAmount.isEmpty
|
orderUnfinishedAmount = orderUnfinishedAmount.isEmpty
|
||||||
? "统计中"
|
? "统计中"
|
||||||
: orderUnfinishedAmount.toString();
|
: orderUnfinishedAmount.toString();
|
||||||
|
|
||||||
//加载列表数据
|
|
||||||
fetchReservationData();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showToast('数据异常');
|
showToast('数据异常');
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
} finally {
|
||||||
|
updateUi();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -428,6 +428,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
stateName: '',
|
stateName: '',
|
||||||
addStatus: '',
|
addStatus: '',
|
||||||
addStatusName: '',
|
addStatusName: '',
|
||||||
|
rejectReason: '',
|
||||||
hasEdit: true,
|
hasEdit: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -498,7 +499,9 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
final endDateTime = DateTime.parse(reservation.endTime);
|
final endDateTime = DateTime.parse(reservation.endTime);
|
||||||
|
|
||||||
// 如果当前时间在结束时间之后,则不能编辑
|
// 如果当前时间在结束时间之后,则不能编辑
|
||||||
if (now.isAfter(endDateTime)) {
|
if (now.isAfter(endDateTime) ||
|
||||||
|
plateNumber.isEmpty ||
|
||||||
|
reservation.addStatus != "0") {
|
||||||
reservation.hasEdit = false;
|
reservation.hasEdit = false;
|
||||||
} else {
|
} else {
|
||||||
reservation.hasEdit = true;
|
reservation.hasEdit = true;
|
||||||
@@ -612,7 +615,7 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
!reservation.hasEdit || plateNumber.isEmpty
|
!reservation.hasEdit
|
||||||
? SizedBox()
|
? SizedBox()
|
||||||
: GestureDetector(
|
: GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@@ -664,6 +667,9 @@ class C_ReservationController extends GetxController with BaseControllerMixin {
|
|||||||
_buildDetailRow('结束时间:', reservation.endTime),
|
_buildDetailRow('结束时间:', reservation.endTime),
|
||||||
_buildDetailRow('联系人:', reservation.contacts),
|
_buildDetailRow('联系人:', reservation.contacts),
|
||||||
_buildDetailRow('联系电话:', reservation.phone),
|
_buildDetailRow('联系电话:', reservation.phone),
|
||||||
|
reservation.addStatus == "5"
|
||||||
|
? _buildDetailRow('拒绝原因:', reservation.rejectReason)
|
||||||
|
: SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ class ReservationEditController extends GetxController with BaseControllerMixin
|
|||||||
//弹窗刷新数据
|
//弹窗刷新数据
|
||||||
Get.back(result: true);
|
Get.back(result: true);
|
||||||
} else {
|
} else {
|
||||||
showErrorToast(result.message);
|
showToast(result.error);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showErrorToast("保存失败,请稍后再试");
|
showErrorToast("保存失败,请稍后再试");
|
||||||
|
|||||||
Reference in New Issue
Block a user