Преглед изворни кода

心电提交时添加正常或异常选择

finlay пре 8 месеци
родитељ
комит
8c2071687d
1 измењених фајлова са 60 додато и 0 уклоњено
  1. 60 0
      lib/pages/medical/controller.dart

+ 60 - 0
lib/pages/medical/controller.dart

@@ -403,6 +403,11 @@ class MedicalController extends FControllerBase {
     super.dispose();
   }
 
+  RxBool _isNormalcy = RxBool(true);
+
+  bool get isNormalcy => _isNormalcy.value;
+  set isNormalcy(bool value) => _isNormalcy.value = value;
+
   /// 【TODO 接口需要变更】 心电
   Future<void> createHeart(
     String physicalExamNumber,
@@ -415,6 +420,61 @@ class MedicalController extends FControllerBase {
         PromptBox.toast('不能提交空数据');
         return;
       }
+
+      await Get.dialog(
+        VAlertDialog(
+          title: '提示',
+          content: Container(
+              margin: const EdgeInsets.only(bottom: 20),
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: [
+                  const Text(
+                    '当前心电检测结果是否正常:',
+                    style: TextStyle(fontSize: 20),
+                    textAlign: TextAlign.center,
+                  ),
+                  SizedBox(
+                    width: 10,
+                  ),
+                  Obx(
+                    () => Row(
+                      children: [
+                        Radio(
+                          onChanged: (v) {
+                            isNormalcy = v ?? false;
+                          },
+                          value: true,
+                          groupValue: isNormalcy,
+                        ),
+                        Text(
+                          "正常",
+                          style: TextStyle(fontSize: 20),
+                        ),
+                        Radio(
+                          onChanged: (v) {
+                            isNormalcy = v ?? false;
+                          },
+                          value: false,
+                          groupValue: isNormalcy,
+                        ),
+                        Text(
+                          "异常",
+                          style: TextStyle(fontSize: 20),
+                        ),
+                      ],
+                    ),
+                  )
+                ],
+              )),
+          showCancel: false,
+          onConfirm: () {
+            diagnosisDataValue["TwelveHeart"]["isHeartNormalcy"] = isNormalcy;
+            Get.back();
+          },
+        ),
+      );
+
       for (var entry in input.entries) {
         var key = entry.key;
         var value = entry.value;