Browse Source

修正无法创建体检记录

loki.wu 9 months ago
parent
commit
a797902853
1 changed files with 13 additions and 7 deletions
  1. 13 7
      lib/pages/medical_checkup_station/registration/controller/form.dart

+ 13 - 7
lib/pages/medical_checkup_station/registration/controller/form.dart

@@ -208,17 +208,23 @@ class RegistrationFormController {
         if (patientDto != null) {
           patient.phone = patientDto.phone;
         }
-
-        ///若未预约也未录入则需要更新手机号
-        PatientDTO? currentPatient = await fillInIdentityInfo(patient);
-        if (currentPatient != null) {
-          patient = currentPatient;
+        if (patient.phone.isNullOrEmpty) {
+          ///若未预约也未录入则需要更新手机号
+          PatientDTO? currentPatient = await fillInIdentityInfo(patient);
+          if (currentPatient != null) {
+            patient = currentPatient;
+            await createResidentInList(
+              patient: patient,
+              isVital: isVital,
+            );
+          } else {
+            return;
+          }
+        } else {
           await createResidentInList(
             patient: patient,
             isVital: isVital,
           );
-        } else {
-          return;
         }
       } else {
         PatientDTO? currentPatient = await fillInIdentityInfo(patient);