Prechádzať zdrojové kódy

submit signature_board

Melon 1 rok pred
rodič
commit
3f7bac8038

+ 3 - 3
lib/components/alert_dialog.dart

@@ -46,7 +46,7 @@ class VAlertDialog extends StatelessWidget {
     return await Get.dialog<T>(
       child,
       barrierDismissible: false,
-      barrierColor: Colors.black.withOpacity(.1),
+      barrierColor: Colors.black.withOpacity(.4),
     );
   }
 
@@ -57,7 +57,7 @@ class VAlertDialog extends StatelessWidget {
       backgroundColor: Colors.white,
       elevation: 0,
       title: title != null ? Text(title!) : null,
-      titleTextStyle: const TextStyle(fontSize: 24, color: Colors.black),
+      titleTextStyle: TextStyle(fontSize: 24, color: Colors.grey.shade700),
       actionsAlignment: actions != null && actions.length > 1
           ? MainAxisAlignment.spaceAround
           : MainAxisAlignment.center,
@@ -127,7 +127,7 @@ class _AlertActionButton extends StatelessWidget {
         onPressed: onPressed,
         child: Text(
           label,
-          style: const TextStyle(fontSize: 18),
+          style: TextStyle(fontSize: 18, color: Theme.of(context).primaryColor),
         ),
       ),
     );

+ 3 - 1
lib/components/cell.dart

@@ -37,6 +37,7 @@ class VListFormCellGroup extends StatelessWidget {
 class VListFormCell extends StatelessWidget {
   final String? label;
   final Widget? labelWidget;
+  final double? labelWidth;
   final String? content;
   final Widget? contentWidget;
   final VoidCallback? onTap;
@@ -46,6 +47,7 @@ class VListFormCell extends StatelessWidget {
     super.key,
     this.label,
     this.labelWidget,
+    this.labelWidth,
     this.content,
     this.contentWidget,
     this.onTap,
@@ -106,7 +108,7 @@ class VListFormCell extends StatelessWidget {
         style: const TextStyle(color: Colors.black, fontSize: 20),
       );
     }
-    return SizedBox(width: 200, child: widget);
+    return SizedBox(width: labelWidth ?? 200, child: widget);
   }
 
   Widget? _buildContent() {

+ 20 - 9
lib/components/checkbox_button.dart

@@ -45,16 +45,26 @@ class _VCheckBoxGroupState<T, TValue>
       final e = widget.source[i];
       final value = widget.valueGetter(e);
       final isChecked = _checkedValues.contains(value);
+      // children.add(
+      //   SizedBox(
+      //     width: widget.itemWidth ?? 160,
+      //     child: VCheckBoxButton(
+      //       label: widget.labelGetter(e),
+      //       isChecked: isChecked,
+      //       onChanged: (status) {
+      //         _onItemChanged(value, status);
+      //       },
+      //     ),
+      //   ),
+      // );
+      // TODO:
       children.add(
-        SizedBox(
-          width: widget.itemWidth ?? 160,
-          child: VCheckBoxButton(
-            label: widget.labelGetter(e),
-            isChecked: isChecked,
-            onChanged: (status) {
-              _onItemChanged(value, status);
-            },
-          ),
+        VCheckBoxButton(
+          label: widget.labelGetter(e),
+          isChecked: isChecked,
+          onChanged: (status) {
+            _onItemChanged(value, status);
+          },
         ),
       );
     }
@@ -128,6 +138,7 @@ class _VCheckBoxState extends State<VCheckBoxButton> {
             padding: const EdgeInsets.only(left: 0, right: borderRadius),
             alignment: Alignment.center,
             height: height,
+            // constraints: const BoxConstraints(minWidth: 160),
             decoration: BoxDecoration(
               color: _isChecked ? primaryColor : Colors.grey.shade200,
               borderRadius: BorderRadius.circular(borderRadius),

+ 1 - 0
lib/components/dialog_select.dart

@@ -70,6 +70,7 @@ class VDialogSelect<T, TValue> extends StatelessWidget {
       final widget = Container(
         alignment: Alignment.centerLeft,
         height: 56,
+        padding: const EdgeInsets.symmetric(horizontal: 8),
         color: isSelected ? Theme.of(context).secondaryHeaderColor : null,
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,

+ 8 - 5
lib/components/dynamic_drawer.dart.dart

@@ -41,7 +41,7 @@ class VDrawer extends StatelessWidget {
 
   List<Widget> _buildChildren(BuildContext context) {
     final children = <Widget>[];
-    final header = _buildHeader();
+    final header = _buildHeader(context);
     if (header != null) {
       children.add(header);
     }
@@ -51,16 +51,19 @@ class VDrawer extends StatelessWidget {
     return children;
   }
 
-  Widget? _buildHeader() {
+  Widget? _buildHeader(BuildContext context) {
     final children = <Widget>[];
-    const btnTextStyle = TextStyle(fontSize: 20);
+    final btnTextStyle = TextStyle(
+      fontSize: 20,
+      color: Theme.of(context).primaryColor,
+    );
     if (scaffoldKey != null) {
       children.add(
         TextButton(
           onPressed: () {
             scaffoldKey!.currentState?.closeEndDrawer();
           },
-          child: const Text("取消", style: btnTextStyle),
+          child: Text("取消", style: btnTextStyle),
         ),
       );
     }
@@ -76,7 +79,7 @@ class VDrawer extends StatelessWidget {
           onPressed: () {
             onConfirm?.call();
           },
-          child: const Text("确定", style: btnTextStyle),
+          child: Text("确定", style: btnTextStyle),
         ),
       );
     }

+ 4 - 0
lib/main.dart

@@ -34,7 +34,10 @@ class _App extends StatelessWidget {
       title: "家医一体机",
       theme: ThemeData(
         // primaryColor: const Color.fromRGBO(0, 178, 237, 1),
+        // TODO:
         primaryColor: Colors.blue,
+        colorScheme:
+            ColorScheme.fromSeed(seedColor: Color(Colors.blue.value - 40)),
         // colorScheme: ColorScheme.fromSeed(
         //   // seedColor: const Color.fromRGBO(44, 119, 229, 1),
         //   // seedColor: Colors.lightBlue,
@@ -47,6 +50,7 @@ class _App extends StatelessWidget {
       getPages: Routes.routes,
       initialRoute: "splash",
       // initialRoute: "/patient/create",
+      // initialRoute: "/contract/signature",
       // initialRoute: "/",
       builder: EasyLoading.init(
         builder: (context, widget) {

+ 5 - 1
lib/pages/contract/signature_board/state.dart

@@ -1 +1,5 @@
-class SignatureBoardState {}
+import 'package:get/get.dart';
+
+class SignatureBoardState {
+  final aaa = 1.obs;
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 2 - 0
lib/pages/contract/signature_board/value.dart


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 8 - 1
lib/pages/contract/signature_board/view.dart


+ 275 - 51
lib/pages/patient/create/view_new.dart

@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:vnoteapp/components/cell.dart';
 import 'package:vnoteapp/components/checkbox_button.dart';
+import 'package:vnoteapp/components/dialog_input.dart';
+import 'package:vnoteapp/components/dialog_select.dart';
 import 'package:vnoteapp/components/dynamic_drawer.dart.dart';
 import 'package:vnoteapp/pages/controllers/crowd_labels.dart';
 import 'package:vnoteapp/pages/patient/create/controller.dart';
@@ -12,29 +14,187 @@ class CreatePatientPageNew extends GetView<CreatePatientController> {
 
   @override
   Widget build(BuildContext context) {
-    return Container(
-      alignment: Alignment.topCenter,
-      child: SizedBox(
-        width: 800,
-        child: Scrollbar(
-          child: ListView(
-            shrinkWrap: true,
-            children: [
-              _CrowdLabelPanel(),
-            ],
+    return Stack(
+      children: [
+        Scrollbar(
+          thumbVisibility: true,
+          child: SingleChildScrollView(
+            child: Container(
+              alignment: Alignment.topCenter,
+              margin: const EdgeInsets.only(bottom: 24),
+              child: SizedBox(
+                width: 800,
+                child: Column(
+                  children: [
+                    _AreaPanel(),
+                    const SizedBox(height: 12),
+                    _PatientInfoPanel(),
+                    const SizedBox(height: 12),
+                    _AddressPanel(),
+                    const SizedBox(height: 12),
+                    _CrowdLabelPanel(),
+                  ],
+                ),
+              ),
+            ),
           ),
         ),
-      ),
+        Positioned(
+          top: 20,
+          right: 20,
+          child: SizedBox(
+            width: 90,
+            height: 90,
+            child: ElevatedButton(
+              style: ButtonStyle(
+                shape: MaterialStatePropertyAll(
+                  RoundedRectangleBorder(
+                    borderRadius: BorderRadius.circular(45),
+                    side: BorderSide(color: Theme.of(context).primaryColor),
+                  ),
+                ),
+              ),
+              onPressed: () {
+                Get.snackbar(
+                  "提示",
+                  "此功能尚未开发",
+                  duration: const Duration(seconds: 2),
+                );
+              },
+              child: const Text(
+                "读卡",
+                style: TextStyle(fontWeight: FontWeight.bold),
+              ),
+            ),
+          ),
+        ),
+      ],
+    );
+  }
+}
+
+class _PatientInfoPanel extends GetView<CreatePatientController> {
+  @override
+  Widget build(BuildContext context) {
+    return VListFormCellGroup(
+      children: [
+        VListFormCell(
+          label: "证件类型",
+        ),
+        VListFormCell(
+          label: "证件号",
+        ),
+        VListFormCell(
+          label: "姓名",
+        ),
+        VListFormCell(
+          label: "性别",
+        ),
+        VListFormCell(
+          label: "民族",
+        ),
+        VListFormCell(
+          label: "出生日期",
+        ),
+        VListFormCell(
+          label: "年龄",
+        ),
+        VListFormCell(
+          label: "手机号码",
+        ),
+      ],
+    );
+  }
+}
+
+class _AddressPanel extends GetView<CreatePatientController> {
+  @override
+  Widget build(BuildContext context) {
+    return VListFormCellGroup(
+      children: [
+        VListFormCell(
+          label: "同步户籍地址到现住地址",
+          labelWidth: 250,
+          contentWidget: Container(
+            child: Obx(
+              () => Switch(
+                onChanged: (value) {
+                  controller.state.isSyncAddresses = value;
+                },
+                value: controller.state.isSyncAddresses,
+              ),
+            ),
+          ),
+        ),
+        VListFormCell(
+          label: "户籍地址",
+          content: controller.state.censusRegister,
+          onTap: () {},
+        ),
+        VListFormCell(
+          label: "现住地址",
+          content: controller.state.address,
+          onTap: () {},
+        ),
+      ],
+    );
+  }
+}
+
+class _AreaPanel extends GetView<CreatePatientController> {
+  @override
+  Widget build(BuildContext context) {
+    String area = "阳光社区";
+    return VListFormCellGroup(
+      children: [
+        VListFormCell(
+          label: "签约区域",
+          content: "重庆市沙坪坝区童家桥街道",
+        ),
+        VListFormCell(
+          label: "所在村",
+          content: area,
+          onTap: () async {
+            final result = await VDialogSelect<String, String>(
+              title: "选择签约所在村",
+              source: const ["阳光社区", "磁器口社区", "烈士墓社区"],
+              valueGetter: (data) => data,
+              labelGetter: (data) => data,
+              initialValue: area,
+            ).show();
+            if (result != null) {
+              // TODO:
+              area = result;
+            }
+          },
+        ),
+      ],
     );
   }
 }
 
 class _CrowdLabelPanel extends GetView<CrowdLabelsController> {
+  final createController = Get.find<CreatePatientController>();
   @override
   Widget build(BuildContext context) {
-    final createController = Get.find<CreatePatientController>();
     return VListFormCellGroup(
       children: [
+        Obx(
+          () => VListFormCell(
+            label: "个人编号",
+            content: createController.state.personalNo,
+            onTap: () async {
+              final result = await VDialogInput(
+                title: "个人编号",
+                initialValue: createController.state.personalNo,
+                placeholder: "请填写个人编号",
+              ).show();
+              if (result != null) {
+                createController.state.personalNo = result;
+              }
+            },
+          ),
+        ),
         VListFormCell(
           label: "人群分类",
           contentWidget: _buildContent(context),
@@ -51,51 +211,115 @@ class _CrowdLabelPanel extends GetView<CrowdLabelsController> {
 
   Widget _buildDrawer() {
     final state = controller.state;
+    List<String> selectedNormalCodes = state.selectedNormalCodes;
+    List<String> selectedDiseaseCodes = state.selectedDiseaseCodes;
+    List<String> selectedSpecialCareCodes = state.selectedSpecialCareCodes;
+    final scrollController = ScrollController();
     return VDrawer(
-      width: 800,
-      child: Column(
-        children: [
-          VCheckBoxButtonGroup<LabelDTO, String>(
-            source: state.normalOptions,
-            values: state.selectedNormalCodes,
-            labelGetter: (LabelDTO data) => data.labelName!,
-            valueGetter: (LabelDTO data) => data.code!,
-            onChanged: (value) {
-              state.selectedNormalCodes = value;
-            },
+      width: 600,
+      title: "设置人群分类",
+      scaffoldKey: createController.homeScaffoldKey,
+      onConfirm: () {
+        VDynamicDrawerWrapper.hide(
+          scaffoldKey: createController.homeScaffoldKey,
+        );
+        state.selectedNormalCodes = selectedNormalCodes;
+        state.selectedDiseaseCodes = selectedDiseaseCodes;
+        state.selectedSpecialCareCodes = selectedSpecialCareCodes;
+      },
+      child: Scrollbar(
+        controller: scrollController,
+        thumbVisibility: true,
+        child: SingleChildScrollView(
+          controller: scrollController,
+          child: Padding(
+            padding: const EdgeInsets.symmetric(horizontal: 50),
+            child: Column(
+              children: [
+                const SizedBox(height: 24),
+                VCheckBoxButtonGroup<LabelDTO, String>(
+                  source: state.normalOptions,
+                  values: state.selectedNormalCodes,
+                  labelGetter: (LabelDTO data) => data.labelName!,
+                  valueGetter: (LabelDTO data) => data.code!,
+                  onChanged: (value) {
+                    selectedNormalCodes = value;
+                  },
+                ),
+                const SizedBox(height: 8),
+                Divider(
+                  indent: 32,
+                  endIndent: 32,
+                  thickness: 1,
+                  color: Colors.grey.shade300,
+                ),
+                const SizedBox(height: 8),
+                VCheckBoxButtonGroup<LabelDTO, String>(
+                  source: state.diseaseOptions,
+                  values: state.selectedDiseaseCodes,
+                  labelGetter: (LabelDTO data) => data.labelName!,
+                  valueGetter: (LabelDTO data) => data.code!,
+                  onChanged: (value) {
+                    selectedDiseaseCodes = value;
+                  },
+                ),
+                const SizedBox(height: 8),
+                Divider(
+                  indent: 32,
+                  endIndent: 32,
+                  thickness: 1,
+                  color: Colors.grey.shade300,
+                ),
+                const SizedBox(height: 8),
+                VCheckBoxButtonGroup<LabelDTO, String>(
+                  source: state.specialCareOptions,
+                  values: state.selectedSpecialCareCodes,
+                  labelGetter: (LabelDTO data) => data.labelName!,
+                  valueGetter: (LabelDTO data) => data.code!,
+                  onChanged: (value) {
+                    selectedSpecialCareCodes = value;
+                  },
+                ),
+              ],
+            ),
           ),
-        ],
+        ),
       ),
     );
   }
 
   Widget _buildContent(BuildContext context) {
-    return Obx(() {
-      final themeData = Theme.of(context);
-      final color = themeData.secondaryHeaderColor;
-      final names = controller.state.selectedNames;
-      const itemHeight = 32.0;
-      const itemRadius = itemHeight / 2;
-      final itemTextStyle = TextStyle(
-        color: themeData.primaryColor,
-        fontSize: 14,
-      );
-      return Wrap(
-        children: names.map(
-          (e) {
-            return Container(
-              height: itemHeight,
-              alignment: Alignment.center,
-              decoration: BoxDecoration(
-                color: color,
-                border: Border.all(style: BorderStyle.none),
-                borderRadius: BorderRadius.circular(itemRadius),
-              ),
-              child: Text(e, style: itemTextStyle),
-            );
-          },
-        ).toList(),
-      );
-    });
+    return Obx(
+      () {
+        final themeData = Theme.of(context);
+        final color = themeData.secondaryHeaderColor;
+        final names = controller.state.selectedNames;
+        const itemHeight = 32.0;
+        const itemRadius = itemHeight / 2;
+        final itemTextStyle = TextStyle(
+          color: themeData.primaryColor,
+          fontSize: 14,
+        );
+        return Wrap(
+          spacing: 16,
+          runSpacing: 16,
+          children: names.map(
+            (e) {
+              return Container(
+                height: itemHeight,
+                alignment: Alignment.center,
+                padding: const EdgeInsets.symmetric(horizontal: 12),
+                decoration: BoxDecoration(
+                  color: color,
+                  border: Border.all(style: BorderStyle.none),
+                  borderRadius: BorderRadius.circular(itemRadius),
+                ),
+                child: Text(e, style: itemTextStyle),
+              );
+            },
+          ).toList(),
+        );
+      },
+    );
   }
 }

+ 1 - 1
lib/routes/routes.dart

@@ -141,7 +141,7 @@ class Routes {
     ),
     GetPage(
       name: "/contract/signature",
-      page: () => const SignatureBoardPage(),
+      page: () => SignatureBoardPage(),
       binding: BindingsBuilder(
         () {
           Get.put(SignatureBoardController());

+ 40 - 0
pubspec.lock

@@ -1,6 +1,14 @@
 # Generated by pub
 # See https://dart.dev/tools/pub/glossary#lockfile
 packages:
+  archive:
+    dependency: transitive
+    description:
+      name: archive
+      sha256: e0902a06f0e00414e4e3438a084580161279f137aeb862274710f29ec10cf01e
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "3.3.9"
   args:
     dependency: transitive
     description:
@@ -184,6 +192,14 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "3.0.3"
+  flutter_inappwebview:
+    dependency: "direct main"
+    description:
+      name: flutter_inappwebview
+      sha256: f73505c792cf083d5566e1a94002311be497d984b5607f25be36d685cf6361cf
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "5.7.2+3"
   flutter_lints:
     dependency: "direct dev"
     description:
@@ -242,6 +258,14 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "4.0.2"
+  image:
+    dependency: "direct main"
+    description:
+      name: image
+      sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "4.0.17"
   intl:
     dependency: "direct main"
     description:
@@ -354,6 +378,14 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "2.2.1"
+  petitparser:
+    dependency: transitive
+    description:
+      name: petitparser
+      sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "5.4.0"
   platform:
     dependency: transitive
     description:
@@ -559,6 +591,14 @@ packages:
       url: "https://pub.flutter-io.cn"
     source: hosted
     version: "1.0.2"
+  xml:
+    dependency: transitive
+    description:
+      name: xml
+      sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
+      url: "https://pub.flutter-io.cn"
+    source: hosted
+    version: "6.3.0"
 sdks:
   dart: ">=3.0.7 <4.0.0"
   flutter: ">=3.7.0"

+ 1 - 0
pubspec.yaml

@@ -52,6 +52,7 @@ dependencies:
   date_format: 2.0.7
   intl: 0.17.0
   flutter_inappwebview: ^5.3.2
+  image: ^4.0.17
 
 dependencies_overrides:
   dio: 5.3.2

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov