Răsfoiți Sursa

1、需求变更

guanxinyi 1 an în urmă
părinte
comite
bbcda94003

+ 3 - 0
lib/components/dynamic_drawer.dart

@@ -9,6 +9,7 @@ class VDrawer extends StatelessWidget {
   final String? title;
   final GlobalKey<ScaffoldState>? scaffoldKey;
   final VoidCallback? onConfirm;
+  final VoidCallback? onCancel;
 
   const VDrawer({
     super.key,
@@ -17,6 +18,7 @@ class VDrawer extends StatelessWidget {
     this.title,
     this.scaffoldKey,
     this.onConfirm,
+    this.onCancel,
   });
 
   @override
@@ -63,6 +65,7 @@ class VDrawer extends StatelessWidget {
         TextButton(
           onPressed: () {
             scaffoldKey!.currentState?.closeEndDrawer();
+            onCancel?.call();
           },
           child: Text("取消", style: btnTextStyle),
         ),

+ 29 - 18
lib/pages/check/health_check_record/components/health_check.dart

@@ -69,24 +69,35 @@ class HealthCheckDialog extends StatelessWidget {
     );
   }
 
+  void openConfigurableCard(String key, String batchNumber, String examData) {
+    Get.to(
+      ConfigurableCard(
+        cardKey: key,
+        examData: examData,
+        callBack: (key, templateCode, data) async {
+          await controller.updateExamByBatchNumberAsync(
+            key,
+            batchNumber,
+            data,
+          );
+        },
+        patientCode: Store.user.currentSelectPatientInfo!.code,
+      ),
+      transition: Transition.rightToLeft,
+    );
+  }
+
   void changePage(String key, String batchNumber) {
-    controller.state.examRecordDTOList[index].examRecordDatas
-        ?.forEach((element) {
-      Get.to(
-        ConfigurableCard(
-          cardKey: key,
-          examData: element.examData,
-          callBack: (key, templateCode, data) async {
-            await controller.updateExamByBatchNumberAsync(
-              key,
-              batchNumber,
-              data,
-            );
-          },
-          patientCode: Store.user.currentSelectPatientInfo!.code,
-        ),
-        transition: Transition.rightToLeft,
-      );
-    });
+    List<ExamRecordDataDTO> examRecordDatas =
+        controller.state.examRecordDTOList[index].examRecordDatas ?? [];
+
+    for (ExamRecordDataDTO i in examRecordDatas) {
+      if (i.key == key) {
+        openConfigurableCard(key, batchNumber, i.examData ?? '');
+        return;
+      }
+    }
+
+    openConfigurableCard(key, batchNumber, '{}');
   }
 }

+ 20 - 20
lib/pages/home/controller.dart

@@ -89,26 +89,26 @@ class HomeController extends FControllerBase with HomeNavMixin {
         iconData: Icons.home_outlined,
         isSelected: true,
       ),
-      HomeMenuItem(
-        title: "健康档案",
-        routeName: "/patient/detail",
-        iconWidget: _buildImgIcon('healthRecord.png'),
-      ),
-      HomeMenuItem(
-        title: "医生签约",
-        routeName: "/contract/package_list",
-        iconWidget: _buildImgIcon('doctorSigning.png'),
-      ),
-      HomeMenuItem(
-        title: "健康体检",
-        routeName: "/check/form",
-        iconWidget: _buildImgIcon('healthCheckup.png'),
-      ),
-      HomeMenuItem(
-        title: "人群随访",
-        routeName: "/check/follow_up",
-        iconWidget: _buildImgIcon('populationFollowUp.png'),
-      ),
+      // HomeMenuItem(
+      //   title: "健康档案",
+      //   routeName: "/patient/detail",
+      //   iconWidget: _buildImgIcon('healthRecord.png'),
+      // ),
+      // HomeMenuItem(
+      //   title: "医生签约",
+      //   routeName: "/contract/package_list",
+      //   iconWidget: _buildImgIcon('doctorSigning.png'),
+      // ),
+      // HomeMenuItem(
+      //   title: "健康体检",
+      //   routeName: "/check/form",
+      //   iconWidget: _buildImgIcon('healthCheckup.png'),
+      // ),
+      // HomeMenuItem(
+      //   title: "人群随访",
+      //   routeName: "/check/follow_up",
+      //   iconWidget: _buildImgIcon('populationFollowUp.png'),
+      // ),
       HomeMenuItem(
         title: "健康检测",
         routeName: "/medical",

+ 15 - 8
lib/pages/medical/view.dart

@@ -114,15 +114,22 @@ class MedicalPage extends GetView<MedicalController> {
     return Expanded(
       flex: 4,
       child: Container(
-          alignment: Alignment.topCenter,
-          margin: const EdgeInsets.all(16).copyWith(top: 0),
-          child: Obx(
-            () => Image.asset(
-              _deviceImageUrl(controller.state.currentTab),
-              height: double.infinity,
-              fit: BoxFit.fitWidth, // 设置图像的适应方式
+        alignment: Alignment.topCenter,
+        margin: const EdgeInsets.all(16).copyWith(top: 0),
+        child: Obx(
+          () => ClipRect(
+            child: Align(
+              alignment: Alignment.bottomCenter,
+              heightFactor: 0.8,
+              child: Image.asset(
+                _deviceImageUrl(controller.state.currentTab),
+                height: double.infinity,
+                fit: BoxFit.contain, // 设置图像的适应方式
+              ),
             ),
-          )),
+          ),
+        ),
+      ),
     );
   }
 

+ 14 - 12
lib/pages/patient/create/controller.dart

@@ -163,19 +163,21 @@ class CreatePatientController extends FControllerBase with HomeNavMixin {
     if (state.cardNo.isEmpty) {
       return "请填写证件号";
     }
-    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 "当前居民性别为“男”,人群分类不可选择孕妇!";
-    }
+    /// 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;
   }
 }

+ 1 - 1
lib/pages/patient/create/view.dart

@@ -74,7 +74,7 @@ class CreatePatientPage extends GetView<CreatePatientController> {
       icon:
           Icon(Icons.medical_information_outlined, color: Colors.grey.shade700),
       pageBuilder: (_) => _buildInterval(
-        const PatientInfo(),
+        PatientInfo(),
       ),
       // route: VRouteSetting(
       //   "/patient_info_panel",

+ 21 - 17
lib/pages/patient/create/widgets/patient_info.dart

@@ -1,3 +1,5 @@
+// ignore_for_file: must_be_immutable
+
 import 'package:fis_jsonrpc/rpc.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
@@ -11,7 +13,8 @@ import 'package:vitalapp/consts/rpc_enum_labels.dart';
 import 'package:vitalapp/pages/patient/create/controller.dart';
 
 class PatientInfo extends GetView<CreatePatientController> {
-  const PatientInfo({super.key});
+  PatientInfo({super.key, this.isNotScanCode = true});
+  bool? isNotScanCode;
 
   @override
   Widget build(BuildContext context) {
@@ -35,22 +38,23 @@ class PatientInfo extends GetView<CreatePatientController> {
     return Obx(
       () => VListFormCellGroup(
         children: [
-          VListFormCell(
-            label: "证件类型",
-            content: RpcEnumLabels.cardType[state.cardType],
-            onTap: () async {
-              final result = await VDialogSelect<CardTypeEnum, CardTypeEnum>(
-                title: "选择证件类型",
-                source: CardTypeEnum.values,
-                valueGetter: (data) => data,
-                labelGetter: (data) => RpcEnumLabels.cardType[data] ?? "",
-                initialValue: state.cardType,
-              ).show();
-              if (result != null) {
-                controller.state.cardType = result;
-              }
-            },
-          ),
+          if (isNotScanCode!)
+            VListFormCell(
+              label: "证件类型",
+              content: RpcEnumLabels.cardType[state.cardType],
+              onTap: () async {
+                final result = await VDialogSelect<CardTypeEnum, CardTypeEnum>(
+                  title: "选择证件类型",
+                  source: CardTypeEnum.values,
+                  valueGetter: (data) => data,
+                  labelGetter: (data) => RpcEnumLabels.cardType[data] ?? "",
+                  initialValue: state.cardType,
+                ).show();
+                if (result != null) {
+                  controller.state.cardType = result;
+                }
+              },
+            ),
           VListFormCell(
             labelWidget: RichText(
               text: const TextSpan(

+ 122 - 0
lib/pages/patient/create/widgets/quick_create.dart

@@ -0,0 +1,122 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vitalapp/components/button.dart';
+import 'package:vitalapp/components/side_nav/defines.dart';
+import 'package:vitalapp/components/side_nav/side_nav.dart';
+import 'package:vitalapp/pages/patient/create/controller.dart';
+import 'package:vitalapp/pages/patient/create/widgets/area.dart';
+import 'package:vitalapp/pages/patient/create/widgets/crowd_label.dart';
+import 'package:vitalapp/pages/patient/create/widgets/patient_info.dart';
+
+class QuickCreatePatientPage extends GetView<CreatePatientController> {
+  const QuickCreatePatientPage({super.key});
+
+  @override
+  Widget build(BuildContext context) {
+    return Stack(
+      children: [
+        VSideNavView(
+          // navId: NavIds.CREATE,
+          items: _buildItems(),
+        ),
+        Positioned(
+          bottom: 8,
+          left: 200,
+          right: 200,
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.spaceAround,
+            children: [
+              VButton(
+                label: "保存",
+                onTap: () {
+                  controller.gotoPatientDetail();
+                },
+              ),
+            ],
+          ),
+        ),
+      ],
+    );
+  }
+
+  VSideNavMenuItem _buildCreateManualRecord() {
+    return VSideNavMenuItem(
+      title: "手动建档",
+      icon: Icon(Icons.edit_document, color: Colors.grey.shade700),
+      pageBuilder: (_) => _buildInterval(
+        PatientInfo(),
+      ),
+    );
+  }
+
+  VSideNavMenuItem _buildScanCodeRecord() {
+    return VSideNavMenuItem(
+      title: "扫码建档",
+      icon: Icon(Icons.edit_document, color: Colors.grey.shade700),
+      pageBuilder: (_) => _buildInterval(
+        PatientInfo(isNotScanCode: false),
+      ),
+    );
+  }
+
+  List<VSideNavMenuItem> _buildItems() {
+    final items = <VSideNavMenuItem>[];
+    items.add(_buildCreateManualRecord());
+    items.add(_buildScanCodeRecord());
+    // items.add(_buildLogOutItem());
+    // items.add(_buildSignatureItem());
+    // items.add(_buildAboutItem());
+    return items;
+  }
+
+  VSideNavMenuItem _buildSignatureItem() {
+    return VSideNavMenuItem(
+      title: "服务信息",
+      icon: Icon(Icons.edit_document, color: Colors.grey.shade700),
+      pageBuilder: (_) => _buildInterval(
+        const Area(),
+      ),
+    );
+  }
+
+  VSideNavMenuItem _buildAboutItem() {
+    return VSideNavMenuItem(
+      title: "人群分类",
+      isRequired: true,
+      icon: Icon(Icons.info_outline, color: Colors.grey.shade700),
+      pageBuilder: (_) => _buildInterval(
+        const CrowdLabelView(),
+      ),
+    );
+  }
+
+  VSideNavMenuItem _buildLogOutItem() {
+    return VSideNavMenuItem(
+      title: "个人信息",
+      icon:
+          Icon(Icons.medical_information_outlined, color: Colors.grey.shade700),
+      pageBuilder: (_) => _buildInterval(
+        PatientInfo(),
+      ),
+      // route: VRouteSetting(
+      //   "/patient_info_panel",
+      //   () => const PatientInfo(),
+      //   binding: BindingsBuilder(
+      //     () {
+      //       Get.lazyPut(() => CreatePatientController());
+      //     },
+      //   ),
+      // ),
+      // shouldRearrage: true, // TODO: 调整样式后启用
+    );
+  }
+
+  Widget _buildInterval(Widget child) {
+    return Padding(
+      padding: const EdgeInsets.symmetric(
+        horizontal: 16,
+      ),
+      child: child,
+    );
+  }
+}

+ 1 - 1
lib/pages/patient/list/controller.dart

@@ -29,7 +29,7 @@ class PatientListController extends FControllerBase {
     // String patientInfo = jsonEncode(patientInfoDto);
     Store.user.currentSelectPatientInfo = patientInfoDto;
 
-    _homeController.switchNavByName('/patient/detail');
+    _homeController.switchNavByName('/medical');
     Get.find<PatientDetailController>().loadData();
     // Get.offAllNamed('/patient/detail', id: 1001);
     _homeController.currentIndex = 1;

+ 32 - 27
lib/pages/patient/list/view.dart

@@ -11,10 +11,8 @@ import 'package:vitalapp/components/search_input.dart';
 import 'package:vitalapp/consts/rpc_enum_labels.dart';
 import 'package:vitalapp/consts/styles.dart';
 import 'package:vitalapp/managers/contract/index.dart';
-import 'package:vitalapp/pages/controllers/crowd_labels.dart';
 import 'package:vitalapp/pages/home/controller.dart';
-import 'package:vitalapp/pages/patient/create/view.dart';
-import 'package:vitalapp/pages/patient/list/widgets/crowd_select_label.dart';
+import 'package:vitalapp/pages/patient/create/widgets/quick_create.dart';
 import 'package:vitalapp/pages/patient/list/widgets/status.dart';
 import 'package:vitalapp/pages/patient/list/widgets/tab_button.dart';
 import 'package:vitalapp/pages/patient/list/widgets/tab_button_group.dart';
@@ -98,7 +96,7 @@ class PatientListPage extends GetView<PatientListController> {
           return Expanded(
             child: Container(
               color: Colors.white,
-              child: const CreatePatientPage(),
+              child: const QuickCreatePatientPage(),
             ),
           );
         } else {
@@ -133,9 +131,16 @@ class PatientListPage extends GetView<PatientListController> {
       scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
       onConfirm: () {
         controller.reloadList(isFilter: true);
-        VDynamicDrawerWrapper.hide(
-          scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
-        );
+        Get.back();
+        // VDynamicDrawerWrapper.hide(
+        //   scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
+        // );
+      },
+      onCancel: () {
+        Get.back();
+        // VDynamicDrawerWrapper.hide(
+        //   scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
+        // );
       },
       child: Scrollbar(
         controller: scrollController,
@@ -206,16 +211,16 @@ class PatientListPage extends GetView<PatientListController> {
                 const SizedBox(
                   height: 20,
                 ),
-                const Text(
-                  '人群分类:',
-                  style: TextStyle(fontSize: 20),
-                ),
-                const SizedBox(
-                  height: 20,
-                ),
-                CrowdSelectLabelView(
-                  controller: controller.crowdLabelsController,
-                ),
+                // const Text(
+                //   '人群分类:',
+                //   style: TextStyle(fontSize: 20),
+                // ),
+                // const SizedBox(
+                //   height: 20,
+                // ),
+                // CrowdSelectLabelView(
+                //   controller: controller.crowdLabelsController,
+                // ),
               ],
             ),
           ),
@@ -263,7 +268,7 @@ class PatientListPage extends GetView<PatientListController> {
                 crossAxisCount: 3,
                 mainAxisSpacing: 16,
                 crossAxisSpacing: 20,
-                childAspectRatio: 360 / 200,
+                childAspectRatio: 360 / 180,
               ),
               children: children,
             ),
@@ -339,14 +344,14 @@ class _PatientCard extends StatelessWidget {
               const SizedBox(height: 8),
               LayoutBuilder(
                 builder: (context, c) {
-                  final width = c.maxWidth - 80 - 20;
+                  final width = c.maxWidth - 80;
                   // 不和状态标签重叠,并保持一定距离
                   return SizedBox(width: width, child: _buildBaseInfoRow());
                 },
               ),
               const SizedBox(height: 12),
               // Expanded(child: _buildClassTags()),
-              _buildClassTags(),
+              // _buildClassTags(),
               const SizedBox(height: 6),
               _buildPhone(),
               const SizedBox(height: 6),
@@ -354,13 +359,13 @@ class _PatientCard extends StatelessWidget {
             ],
           ),
         ),
-        Positioned(
-          top: 0,
-          right: 0,
-          child: _PatientSignStatusTag(
-            dto: dto,
-          ),
-        ),
+        // Positioned(
+        //   top: 0,
+        //   right: 0,
+        //   child: _PatientSignStatusTag(
+        //     dto: dto,
+        //   ),
+        // ),
       ],
     );
     return Material(