Browse Source

Merge branch 'master' of http://git.ius.plus/Project-Vital/VitalApp

loki.wu 1 year ago
parent
commit
46580731e2

+ 1 - 0
lib/architecture/utils/json_rpc_ex_interceptor.dart

@@ -384,6 +384,7 @@ class JsonRpcExInterceptor extends JsonRpcInterceptor {
     "errorCode7076": "学生已在班级中",
     "errorCode7077": "用户所属机构和设备所属机构不在同一组织下",
     "errorCode7079": "设备不支持",
+    "errorCode8001": "登记重复,请确认登记信息是否正确",
     "errorCode9001": "当前账号未设置团队,无法保存数据",
     "errorCode9011": "当前版本为最新版本",
     "errorCode9013": "当前账号已在其他设备登录",

+ 3 - 1
lib/main.dart

@@ -1,5 +1,6 @@
 import 'dart:async';
 
+import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:fis_common/logger/logger.dart';
 import 'package:flutter_easyloading/flutter_easyloading.dart';
@@ -77,7 +78,8 @@ class _AppState extends State<_App> with WidgetsBindingObserver {
       // initialRoute: "/",
       builder: EasyLoading.init(
         builder: (context, widget) {
-          const designWidth = 1280.0; // 设计尺寸宽度:1280
+          double designWidth = 1280.0; // 设计尺寸宽度:1280
+          if (kIsWeb) designWidth = 1460.0;
           final size = MediaQuery.of(context).size;
           final scale = size.width / designWidth; // 计算缩放比例
           return FittedBox(

+ 5 - 5
lib/managers/patient.dart

@@ -112,11 +112,11 @@ class PatientManager implements IPatientManager {
             }
           } else {
             int localCount = 0;
-            if (!kIsWeb) {
-              localCount = await db.repositories.diagnosis
-                  .getNotUploadedCountByPatientCode(
-                      element.code!, Store.user.userCode!);
-            }
+            localCount = await db.repositories.diagnosis
+                .getNotUploadedCountByPatientCode(
+              element.code!,
+              Store.user.userCode!,
+            );
 
             if (localCount > 0) {
               patientModel.isExistLocalData = true;

+ 1 - 1
lib/managers/registration.dart

@@ -61,7 +61,7 @@ class RegistrationManager implements IRegistrationManager {
     required UpdateRegiterInfoRequest request,
   }) async {
     try {
-      // request.token = Store.user.token;
+      request.token = Store.user.token;
       final getExamBookingByIDCard =
           await rpc.vitalHealthExamBooking.updateRegiterInfoAsync(
         request,

+ 92 - 89
lib/pages/home/view.dart

@@ -61,98 +61,12 @@ class HomePage extends GetView<HomeController> {
   }
 
   Widget _buildBody(BuildContext context) {
-    final menuScrollController = ScrollController();
+    Widget leftMenus = SizedBox();
+    if (controller.state.menuItems.length != 1) leftMenus = _buildMenu(context);
     return Row(
       mainAxisSize: MainAxisSize.max,
       children: [
-        controller.state.menuItems.length != 1
-            ? Container(
-                width: 120,
-                // color: const Color.fromRGBO(10, 32, 48, .8),
-                decoration: BoxDecoration(
-                  gradient: LinearGradient(
-                    colors: [
-                      // Color.fromRGBO(59, 188, 255, 1),
-                      // Color.fromRGBO(44, 120, 229, 1),
-                      Theme.of(context).primaryColor,
-                      FColorHelper.mixColor(
-                          Colors.black, Theme.of(context).primaryColor, 50),
-                    ],
-                    begin: Alignment.bottomRight,
-                    end: Alignment.topLeft,
-                  ),
-                ),
-                child: Stack(
-                  children: [
-                    Positioned(
-                      bottom: 0,
-                      left: 0,
-                      right: 0,
-                      child: Opacity(
-                        opacity: 0.5,
-                        child: Image.asset(
-                          "assets/images/e_hospital.png",
-                          fit: BoxFit.fitWidth,
-                        ),
-                      ),
-                    ),
-                    Column(
-                      mainAxisSize: MainAxisSize.max,
-                      children: [
-                        SizedBox(
-                          height: 90,
-                          child: Column(
-                            mainAxisAlignment: MainAxisAlignment.center,
-                            children: [
-                              Obx(
-                                () => HomeAvatarWidget(
-                                  size: 40,
-                                  headImageToken:
-                                      controller.state.headImageToken,
-                                ),
-                              ),
-                              const SizedBox(
-                                height: 8,
-                              ),
-                              Obx(
-                                () => Text(
-                                  controller.state.doctorName,
-                                  style: const TextStyle(
-                                    color: Colors.white,
-                                    fontSize: 16,
-                                  ),
-                                ),
-                              ),
-                            ],
-                          ),
-                        ),
-                        Divider(
-                          color: Colors.white.withOpacity(.4),
-                          height: 1,
-                          indent: 30,
-                          endIndent: 30,
-                        ),
-                        const SizedBox(
-                          height: 8,
-                        ),
-                        Expanded(
-                          child: Obx(
-                            () {
-                              return HomeMenuListViewWidget(
-                                source: controller.state.menuItems,
-                                scrollerController: menuScrollController,
-                                currentSelectMenu:
-                                    controller.state.currentSelectMenu,
-                              );
-                            },
-                          ),
-                        ),
-                      ],
-                    ),
-                  ],
-                ),
-              )
-            : SizedBox(),
+        leftMenus,
         Container(
           color: Theme.of(context).primaryColor,
           child: VerticalDivider(
@@ -183,6 +97,95 @@ class HomePage extends GetView<HomeController> {
     );
   }
 
+  Widget _buildMenu(BuildContext context) {
+    final menuScrollController = ScrollController();
+
+    return Container(
+      width: kIsWeb ? 100 : 120,
+      decoration: BoxDecoration(
+        gradient: LinearGradient(
+          colors: [
+            Theme.of(context).primaryColor,
+            FColorHelper.mixColor(
+              Colors.black,
+              Theme.of(context).primaryColor,
+              50,
+            ),
+          ],
+          begin: Alignment.bottomRight,
+          end: Alignment.topLeft,
+        ),
+      ),
+      child: Stack(
+        children: [
+          Positioned(
+            bottom: 0,
+            left: 0,
+            right: 0,
+            child: Opacity(
+              opacity: 0.5,
+              child: Image.asset(
+                "assets/images/e_hospital.png",
+                fit: BoxFit.fitWidth,
+              ),
+            ),
+          ),
+          Column(
+            mainAxisSize: MainAxisSize.max,
+            children: [
+              SizedBox(
+                height: 90,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    Obx(
+                      () => HomeAvatarWidget(
+                        size: 40,
+                        headImageToken: controller.state.headImageToken,
+                      ),
+                    ),
+                    const SizedBox(
+                      height: 8,
+                    ),
+                    Obx(
+                      () => Text(
+                        controller.state.doctorName,
+                        style: const TextStyle(
+                          color: Colors.white,
+                          fontSize: 16,
+                        ),
+                      ),
+                    ),
+                  ],
+                ),
+              ),
+              Divider(
+                color: Colors.white.withOpacity(.4),
+                height: 1,
+                indent: 30,
+                endIndent: 30,
+              ),
+              const SizedBox(
+                height: 8,
+              ),
+              Expanded(
+                child: Obx(
+                  () {
+                    return HomeMenuListViewWidget(
+                      source: controller.state.menuItems,
+                      scrollerController: menuScrollController,
+                      currentSelectMenu: controller.state.currentSelectMenu,
+                    );
+                  },
+                ),
+              ),
+            ],
+          ),
+        ],
+      ),
+    );
+  }
+
   Widget _buildContent() {
     return Padding(
       padding: EdgeInsets.all(8),

+ 20 - 3
lib/pages/medical_checkup_station/registration/controller/form.dart

@@ -30,14 +30,31 @@ class RegistrationFormController {
     addRegiterInfo.iDCardNo = patient?.cardNo;
     addRegiterInfo.name = patient?.patientName;
     addRegiterInfo.phone = patient?.phone;
-    addRegiterInfo.sex = "男";
-    // addRegiterInfo.orgUniqueCode = "012";
-    // addRegiterInfo.organizationCode = Store.user.organizationCode;
+    addRegiterInfo.sex = patient?.patientGender == GenderEnum.Male ? "男" : "女";
+    addRegiterInfo.birthday = patient?.birthday?.toLocal();
     await registrationController.registrationManager.addRegiterInfoAsync(
       request: addRegiterInfo,
     );
   }
 
+  /// 编辑登记
+  Future<void> editResident(PatientDTO? patient) async {
+    UpdateRegiterInfoRequest editRegiterInfo = UpdateRegiterInfoRequest();
+    editRegiterInfo.adress = patient?.patientAddress;
+    editRegiterInfo.age = DataTimeUtils.calculateAge(
+      patient?.birthday ?? DateTime.now(),
+    );
+    editRegiterInfo.birthday = patient?.birthday;
+    editRegiterInfo.iDCardNo = patient?.cardNo;
+    editRegiterInfo.name = patient?.patientName;
+    editRegiterInfo.phone = patient?.phone;
+    editRegiterInfo.sex = patient?.patientGender == GenderEnum.Male ? "男" : "女";
+    editRegiterInfo.code = patient?.code;
+    await registrationController.registrationManager.updateRegiterInfoAsync(
+      request: editRegiterInfo,
+    );
+  }
+
   /// 创建登记之前查看有没有预约
   Future<HealthExamPersonDTO?> getExamBookingByIDCard(String idCard) async {
     return await registrationController.appointmentManager

File diff suppressed because it is too large
+ 3 - 18
lib/pages/medical_checkup_station/registration/controller/list.dart


+ 4 - 0
lib/pages/medical_checkup_station/registration/state/list.dart

@@ -47,6 +47,8 @@ class ResidentModel {
 
   /// 当前已完成的体检项目
   final List<String>? finishedExamKeys;
+  final DateTime? birthDay;
+  final String? sex;
 
   ResidentModel({
     this.name,
@@ -59,6 +61,8 @@ class ResidentModel {
     this.physicalExamStatus,
     this.phone,
     this.finishedExamKeys,
+    this.birthDay,
+    this.sex,
   });
 }
 

+ 20 - 22
lib/pages/medical_checkup_station/registration/view/index.dart

@@ -1,3 +1,4 @@
+import 'dart:convert';
 import 'dart:ui';
 
 import 'package:fis_i18n/i18n.dart';
@@ -62,7 +63,7 @@ class RegistrationList extends GetView<RegistrationController> {
           ),
         ),
         Container(
-          width: 180,
+          width: 160,
           decoration: BoxDecoration(
             border: Border(
               left: BorderSide(
@@ -78,16 +79,7 @@ class RegistrationList extends GetView<RegistrationController> {
                   child: Column(
                     children: [
                       if (controller.listController.examList().length != 0)
-                        Container(
-                          alignment: Alignment.centerLeft,
-                          child: Text(
-                            "未做体检项",
-                            style: TextStyle(color: Colors.white, fontSize: 20),
-                          ),
-                          height: 40,
-                          color: Colors.blue,
-                          width: double.maxFinite,
-                        ),
+                        _buildTitle("未做体检项"),
                       Column(
                         children: controller.listController
                             .examList()
@@ -102,16 +94,7 @@ class RegistrationList extends GetView<RegistrationController> {
                                   [])
                               .length !=
                           0)
-                        Container(
-                          alignment: Alignment.centerLeft,
-                          child: Text(
-                            "已做体检项",
-                            style: TextStyle(color: Colors.white, fontSize: 20),
-                          ),
-                          height: 40,
-                          color: Colors.blue,
-                          width: double.maxFinite,
-                        ),
+                        _buildTitle("已做体检项"),
                       Column(
                         children: (controller.listController.currentResident
                                     .finishedExamKeys ??
@@ -131,6 +114,20 @@ class RegistrationList extends GetView<RegistrationController> {
     );
   }
 
+  Widget _buildTitle(String titleName) {
+    return Container(
+      alignment: Alignment.centerLeft,
+      padding: EdgeInsets.only(left: 8),
+      child: Text(
+        titleName,
+        style: TextStyle(color: Colors.white, fontSize: 20),
+      ),
+      height: 40,
+      color: Colors.blue,
+      width: double.maxFinite,
+    );
+  }
+
   Map<String, String> _currentExam = {
     "HEIBasic": "基础检查",
     "HEIUrinalysis": "尿常规检查",
@@ -151,7 +148,8 @@ class RegistrationList extends GetView<RegistrationController> {
     final printTypeEnum = printTask.printTypeEnum;
 
     final imageBytes =
-        await data.convertUint8List(imageByteFormat: ImageByteFormat.rawRgba);
+        await data.convertUint8List(imageByteFormat: ImageByteFormat.png);
+    String base64Image = base64Encode(imageBytes!);
     //也可以使用 ImageByteFormat.png
     final argbWidth = data.imageWidth;
     final argbHeight = data.imageHeight;

+ 4 - 3
lib/pages/medical_checkup_station/registration/widgets/floating_action_button/index.dart

@@ -1,4 +1,5 @@
 import 'package:fis_jsonrpc/rpc.dart';
+import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:vitalapp/architecture/utils/prompt_box.dart';
@@ -79,14 +80,14 @@ class RegistrationActionButton extends GetView<RegistrationController> {
           onPressed: () => _showAction(context, 0),
           icon: const Icon(
             Icons.chrome_reader_mode,
-            size: 36,
+            size: kIsWeb ? 26 : 36,
           ),
         ),
         ActionButton(
           onPressed: () => _showAction(context, 1),
           icon: const Icon(
             Icons.perm_contact_cal_rounded,
-            size: 36,
+            size: kIsWeb ? 26 : 36,
           ),
         ),
         ActionButton(
@@ -95,7 +96,7 @@ class RegistrationActionButton extends GetView<RegistrationController> {
           },
           icon: const Icon(
             Icons.edit_document,
-            size: 36,
+            size: kIsWeb ? 26 : 36,
           ),
         ),
       ],

+ 6 - 0
lib/pages/medical_checkup_station/registration/widgets/form/index.dart

@@ -51,6 +51,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
           onTap: () async {
             var result = await VDialogInput(
               initialValue: widget.patient?.cardNo ?? '',
+              title: "身份证号",
             ).show();
             if (result != null) {
               widget.patient?.cardNo = result;
@@ -65,6 +66,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
           onTap: () async {
             var result = await VDialogInput(
               initialValue: widget.patient?.patientName ?? '',
+              title: "姓名",
             ).show();
             if (result != null) {
               widget.patient?.patientName = result;
@@ -85,6 +87,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
               labelGetter: (data) => data.name,
               valueGetter: (data) => data.code.index.toString(),
               initialValue: widget.patient?.patientGender.index.toString(),
+              title: "性别",
             ).show();
             if (result != null) {
               widget.patient?.patientGender =
@@ -103,6 +106,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
           onTap: () async {
             var result = await VDialogDate(
               initialValue: widget.patient?.birthday,
+              title: "生日",
               // maxValue: appointment?.appointmentEndTime,
             ).show();
             if (result != null) {
@@ -121,6 +125,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
           onTap: () async {
             var result = await VDialogInput(
               initialValue: widget.patient?.phone ?? '',
+              title: "手机号",
             ).show();
             if (result != null) {
               widget.patient?.phone = result;
@@ -134,6 +139,7 @@ class _RegistrationFormDialogState extends State<RegistrationFormDialog> {
           onTap: () async {
             var result = await VDialogInput(
               initialValue: widget.patient?.patientAddress ?? '',
+              title: "家庭住址",
             ).show();
             if (result != null) {
               widget.patient?.patientAddress = result;

+ 2 - 2
pubspec.yaml

@@ -47,7 +47,7 @@ dependencies:
   fis_jsonrpc:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_jsonrpc.git
-      ref: dea144d
+      ref: 1ebb280
   vnote_device_plugin:
     git:
       url: http://git.ius.plus/Project-Vital/FlutterDevicePlugin.git
@@ -153,7 +153,7 @@ dependency_overrides:
   fis_jsonrpc:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_jsonrpc.git
-      ref: f9b819a
+      ref: 1ebb280
     #path: ../fis_lib_jsonrpc
   fis_theme:
     git:

BIN
web/favicon.png


+ 10 - 0
web/index.html

@@ -43,8 +43,18 @@
       rel="icon"
       type="image/png"
       href="favicon.png" />
+    <!-- <link rel="shortcut icon" type="image/x-icon" href="flyinsono.ico?v=202112020857" /> -->
 
     <title>vital_app</title>
+    <link
+      rel="stylesheet"
+      media="screen and (min-width: 600px)"
+      href="style/index.css?v=202112020857" />
+    <link
+      rel="stylesheet"
+      media="screen and (max-width: 600px)"
+      href="style/mobile.css?v=202112020857" />
+
     <link
       rel="manifest"
       href="manifest.json" />

+ 105 - 0
web/style/index.css

@@ -0,0 +1,105 @@
+body {
+    background-color: #3d92fb;
+    -ms-overflow-style: none;
+}
+
+body::-webkit-scrollbar {
+    display: none;
+}
+
+.splash {
+    display: block;
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100vw;
+    height: 100vh;
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-position: center;
+    overflow: hidden;
+    z-index: 2;
+}
+
+.splash_cn {
+    background-image: url(../img/splash_zh.jpg);
+}
+
+.splash_ru {
+    background-image: url(../img/splash_ru.jpg);
+}
+
+.splash_en {
+    background-image: url(../img/splash_en.jpg);
+}
+
+.fis_anim {
+    -webkit-animation-duration: 0.3s;
+    -webkit-animation-fill-mode: both;
+    animation-duration: 0.3s;
+    animation-fill-mode: both;
+}
+
+@-webkit-keyframes fis-fadeout {
+    0% {
+        opacity: 1;
+    }
+
+    100% {
+        opacity: 0;
+    }
+}
+
+@keyframes fis-fadeout {
+    0% {
+        opacity: 1;
+    }
+
+    100% {
+        opacity: 0;
+    }
+}
+
+.fis_anim-fadeout {
+    -webkit-animation-name: fis-fadeout;
+    animation-name: fis-fadeout;
+}
+
+#loader {
+    border: 5px solid #f3f3f3;
+    border-top: 5px solid #3d92fb;
+    border-radius: 50%;
+    width: 50px;
+    height: 50px;
+    display: inline-block;
+    animation: spin 2s linear infinite;
+}
+
+@keyframes spin {
+    0% {
+        transform: rotate(0deg);
+    }
+
+    100% {
+        transform: rotate(360deg);
+    }
+}
+
+.full-screen-center {
+    width: 100vw;
+    height: 100vh;
+    background: white;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    z-index: 1002;
+}
+
+/*当屏幕尺寸小于600px时,应用下面的CSS样式*/
+/* 
+@media screen and (max-width: 600px) {
+    
+    .splash {
+        background: url(../img/splash_m.jpg) no-repeat 50%;
+    }
+} */

+ 51 - 0
web/style/mobile.css

@@ -0,0 +1,51 @@
+body {
+    background-color: #3d92fb;
+}
+.splash {
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background-size: cover;
+    overflow: hidden;
+    z-index: 1001;
+}
+.splash_cn {
+    /* background: url(../img/splash_m.jpg) no-repeat 50%; */
+}
+
+.splash_en {
+    /* background: url(../img/splash_m.jpg) no-repeat 50%; */
+}
+.fis_anim {
+    -webkit-animation-duration: 0.3s;
+    -webkit-animation-fill-mode: both;
+    animation-duration: 0.3s;
+    animation-fill-mode: both;
+}
+
+@-webkit-keyframes fis-fadeout {
+    0% {
+        opacity: 1;
+    }
+
+    100% {
+        opacity: 0;
+    }
+}
+
+@keyframes fis-fadeout {
+    0% {
+        opacity: 1;
+    }
+
+    100% {
+        opacity: 0;
+    }
+}
+
+.fis_anim-fadeout {
+    -webkit-animation-name: fis-fadeout;
+    animation-name: fis-fadeout;
+}

Some files were not shown because too many files changed in this diff