Browse Source

心电提交逻辑优化

loki.wu 1 year ago
parent
commit
b0c9fabb7c
1 changed files with 6 additions and 10 deletions
  1. 6 10
      lib/pages/medical/controller.dart

+ 6 - 10
lib/pages/medical/controller.dart

@@ -143,6 +143,11 @@ class MedicalController extends FControllerBase {
     List<DiagnosisItem> diagnosisItems = [];
     diagnosisDataValue.forEach((key, value) {
       if (value != null) {
+        if (key == 'Heart' && value is Map) {
+          if (value.isEmpty) {
+            return;
+          }
+        }
         diagnosisItems.add(
           DiagnosisItem(
             key: key,
@@ -151,16 +156,7 @@ class MedicalController extends FControllerBase {
         );
       }
     });
-    if (diagnosisItems.any((e) => e.key == 'Heart')) {
-      ///这里是判断心电这个类目下数据是否为空
-      var heartInfo = diagnosisItems.firstWhere((e) => e.key == 'Heart');
-      if (heartInfo.diagnosisData == null ||
-          (heartInfo.diagnosisData?.isEmpty ?? false) ||
-          heartInfo.diagnosisData == '{}') {
-        PromptBox.toast('不能提交空数据');
-        return;
-      }
-    }
+
     if (diagnosisItems.isEmpty) {
       PromptBox.toast('不能提交空数据');
       return;