Parcourir la source

1、撰写报告页面报错

guanxinyi il y a 1 an
Parent
commit
b805ee1555

+ 64 - 0
lib/pages/medical_checkup_station/registration/controller/form.dart

@@ -48,6 +48,70 @@ class RegistrationFormController {
       );
     }
   }
+  // Future<bool?> _validateForm(PatientDTO? patient) async {
+  //   if (state.name.isEmpty) {
+  //     return "请填写姓名";
+  //   }
+  //   // else {
+  //   //   if (!isAlphaNumericChineseWithSpace(state.name) ||
+  //   //       state.name.length >= 20) {
+  //   //     return "姓名只能由中文、字母或数字组成,并且小于20个字符";
+  //   //   }
+  //   // }
+  //   if (state.cardNo.isEmpty) {
+  //     return "请填写证件号";
+  //   }
+
+  //   if (state.phoneNo.isNotEmpty) {
+  //     if (state.phoneNo.length != 11 || !isNumeric(state.phoneNo)) {
+  //       return "请填写正确的手机号";
+  //     }
+  //   }
+  //   if (state.emergencyPhone.isNotEmpty) {
+  //     if (state.emergencyPhone.length != 11 ||
+  //         !isNumeric(state.emergencyPhone)) {
+  //       return "请填写正确的紧急联系手机号";
+  //     }
+  //   }
+  //   if (state.cardType == CardTypeEnum.Identity) {
+  //     bool isNotIDCard = IdCardHelper.validateIDCard(state.cardNo);
+  //     if (!isNotIDCard) {
+  //       return "请填写正确的证件号";
+  //     }
+  //   }
+
+  //   if (state.cardType == CardTypeEnum.SocialInsurance) {
+  //     if (state.cardNo.length != 18 || !isNumeric(state.cardNo)) {
+  //       return "请填写正确的社保号";
+  //     }
+  //   }
+
+  //   if (state.cardType == CardTypeEnum.Passport) {
+  //     if (state.cardNo.length != 9 || !isAlphaNumeric(state.cardNo)) {
+  //       return "请填写正确的护照号";
+  //     }
+  //   }
+
+  //   if (state.gender == null) {
+  //     return "请选择性别";
+  //   }
+
+  //   /// TODO 需求变更暂时删除
+  //   // final selectedNormalCodes = crowdLabelsController.state.selectedNormalCodes;
+
+  //   // if (selectedNormalCodes.length > 1) {
+  //   //   return "人群分类:一般人群、儿童、孕妇、老年人,只可选择其一!";
+  //   // }
+  //   // final crowdLabelCodes = crowdLabelsController.state.selectedCodes;
+  //   // if (crowdLabelCodes.isEmpty) {
+  //   //   return "请选择人群分类";
+  //   // }
+  //   // if (state.gender == GenderEnum.Male &&
+  //   //     crowdLabelCodes.contains('RQFL_YF')) {
+  //   //   return "当前居民性别为“男”,人群分类不可选择孕妇!";
+  //   // }
+  //   return null;
+  // }
 
   Future<String?> saveCachedBatchNumber(PatientDTO? patient) async {
     String batchNumber = const Uuid().v4().replaceAll('-', '');

+ 12 - 14
lib/pages/report_edit/view.dart

@@ -8,8 +8,6 @@ import 'package:fis_lib_report/report_edit.dart';
 import 'package:fis_theme/theme.dart';
 import 'package:fis_ui/base_define/page.dart';
 import 'package:fis_ui/index.dart';
-import 'package:fis_ui/usual/tab_button.dart';
-import 'package:fis_ui/usual/tab_button_group.dart';
 import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
@@ -17,6 +15,8 @@ import 'package:fis_common/index.dart';
 import 'package:fis_measure/process/workspace/rpc_bridge.dart';
 import 'package:vitalapp/pages/consultation_record_view/widgets/button_group.dart';
 import 'package:vitalapp/pages/image_report_inner_view/widgets/cloud_image_item.dart';
+import 'package:vitalapp/pages/patient/list/widgets/tab_button.dart';
+import 'package:vitalapp/pages/patient/list/widgets/tab_button_group.dart';
 import 'package:vitalapp/pages/report_edit/controller.dart';
 import 'package:vitalapp/pages/report_edit/widgets/vocabulary_entry_report.dart';
 import 'package:vitalapp/store/store.dart';
@@ -51,11 +51,15 @@ class _DesktopLayoutState extends State<_DesktopLayout> {
     if (kIsMobile) {
       _scrollSensitivityFactor = 10.0;
     }
-    final theme = AppTheme(themeMode: ThemeMode.system);
-    FTheme.init(theme);
+    initFTheme();
     super.initState();
   }
 
+  void initFTheme() async {
+    final theme = AppTheme(themeMode: ThemeMode.system);
+    await FTheme.init(theme);
+  }
+
   @override
   Widget build(BuildContext context) {
     if (Store.user.token?.isEmpty ?? true) {
@@ -621,12 +625,10 @@ class _DesktopLayoutState extends State<_DesktopLayout> {
                 Container(
                   child: Obx(
                     () {
-                      return FTabButtonGroup(
+                      return TabButtonGroup(
                         [
-                          FTabButton(
-                            name: "cloudImage",
+                          TabButton(
                             padding: padding,
-                            businessParent: widget.businessParent,
                             tabTitle: i18nBook.remedical.cloudImageShort.t,
                             index: 0,
                             activeIndex: controller.state.selectImageTabIndex,
@@ -636,9 +638,7 @@ class _DesktopLayoutState extends State<_DesktopLayout> {
                             },
                           ),
                           FSizedBox(width: 10),
-                          FTabButton(
-                            name: "measureImage",
-                            businessParent: widget.businessParent,
+                          TabButton(
                             padding: padding,
                             tabTitle: i18nBook.measure.measureImageShort.t,
                             index: 1,
@@ -651,9 +651,7 @@ class _DesktopLayoutState extends State<_DesktopLayout> {
                           ),
                           if (controller.state.consultationCode.isNotEmpty) ...[
                             FSizedBox(width: 10),
-                            FTabButton(
-                              name: "consultationImage",
-                              businessParent: widget.businessParent,
+                            TabButton(
                               padding: padding,
                               tabTitle: i18nBook.realTimeConsultation
                                   .consultationImageShort.t,