|
@@ -142,13 +142,10 @@ class AppointmentListController {
|
|
|
appointmentController
|
|
|
.appointmentModelList[index].appointmentCode!,
|
|
|
);
|
|
|
- onDeleteExaminerEvent.addListener(deleteExaminer);
|
|
|
-
|
|
|
await Get.dialog(MedicalExaminer(
|
|
|
examiner: appointment,
|
|
|
- onDeleteExaminerEvent: onDeleteExaminerEvent,
|
|
|
+ onTapChangeBind: deleteExaminer,
|
|
|
));
|
|
|
- onDeleteExaminerEvent.removeListener(deleteExaminer);
|
|
|
},
|
|
|
child: Text(
|
|
|
"${rowData.appointPersons?.length ?? 0}",
|
|
@@ -269,43 +266,42 @@ class AppointmentListController {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- void deleteExaminer(sender, e) async {
|
|
|
- if (e != null) {
|
|
|
- Get.dialog(
|
|
|
- VAlertDialog(
|
|
|
- title: "提示",
|
|
|
- width: 260,
|
|
|
- content: Container(
|
|
|
- height: 32,
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
|
- alignment: Alignment.center,
|
|
|
- child: const Text(
|
|
|
- "确定解除预约?",
|
|
|
- style: TextStyle(fontSize: 20),
|
|
|
- ),
|
|
|
+ Future<bool> deleteExaminer(String e) async {
|
|
|
+ bool? result = await Get.dialog<bool>(
|
|
|
+ VAlertDialog(
|
|
|
+ title: "提示",
|
|
|
+ width: 260,
|
|
|
+ content: Container(
|
|
|
+ height: 32,
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ child: const Text(
|
|
|
+ "确定解除预约?",
|
|
|
+ style: TextStyle(fontSize: 20),
|
|
|
),
|
|
|
- onConfirm: () async {
|
|
|
- Get.back();
|
|
|
- List<HealthExamPersonDTO>? appointPersons = appointment
|
|
|
- .appointPersons
|
|
|
- ?.where((element) => element.name != e)
|
|
|
- .toList();
|
|
|
- appointment.appointPersons = appointPersons;
|
|
|
- bool result = await appointmentController.formController
|
|
|
- .saveHealthExamBooking(
|
|
|
- appointment,
|
|
|
- isEdit: true,
|
|
|
- isdelete: true,
|
|
|
- );
|
|
|
- if (result) {
|
|
|
- PromptBox.toast('解除成功');
|
|
|
- }
|
|
|
- },
|
|
|
),
|
|
|
- barrierDismissible: false,
|
|
|
- barrierColor: Colors.black.withOpacity(.4),
|
|
|
- );
|
|
|
- }
|
|
|
+ onConfirm: () async {
|
|
|
+ List<HealthExamPersonDTO>? appointPersons = appointment.appointPersons
|
|
|
+ ?.where((element) => element.identityCard != e)
|
|
|
+ .toList();
|
|
|
+ appointment.appointPersons = appointPersons;
|
|
|
+ bool result =
|
|
|
+ await appointmentController.formController.cancelHealthExam(
|
|
|
+ appointment.appointmentCode!,
|
|
|
+ e,
|
|
|
+ );
|
|
|
+ if (result) {
|
|
|
+ await appointmentController.listController
|
|
|
+ .getHealthExamBookingPageAsync();
|
|
|
+ PromptBox.toast('解除成功');
|
|
|
+ }
|
|
|
+ Get.back(result: result);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ barrierDismissible: false,
|
|
|
+ barrierColor: Colors.black.withOpacity(.4),
|
|
|
+ );
|
|
|
+ return result ?? false;
|
|
|
}
|
|
|
|
|
|
String getStartAndEndTime(DateTime? startTime, DateTime? endTime) {
|