Browse Source

随访时间与下次随访时间排除最小时间

finlay 1 year ago
parent
commit
7ff9515225

+ 2 - 2
lib/pages/check/follow_up/widgets/follow_up_from.dart

@@ -102,8 +102,8 @@ class FollowUpFrom extends GetView<FollowUpController> {
   }
 
   String getFollowUpTime(DateTime? time) {
-    // print(time);
-    if (time != null && time.toString() != "0001-01-01 00:00:00.000Z") {
+    print(time);
+    if (time != null && !time.toString().contains('0001-01-01')) {
       return DateFormat('yyyy-MM-dd').format(time);
     }
     return '';

+ 13 - 0
lib/pages/check/follow_up_record/controller.dart

@@ -117,4 +117,17 @@ class FollowUpRecordController extends FControllerBase {
         return Colors.blue;
     }
   }
+
+  String getFollowUpMode(FollowUpModeEnum? modeEnum) {
+    switch (modeEnum) {
+      case FollowUpModeEnum.Outpatient:
+        return "门诊";
+      case FollowUpModeEnum.Phone:
+        return "电话";
+      case FollowUpModeEnum.Visit:
+        return "家庭";
+      default:
+        return "";
+    }
+  }
 }

+ 12 - 3
lib/pages/check/follow_up_record/view.dart

@@ -163,8 +163,11 @@ class _followUpRecordCard extends StatelessWidget {
                             fontSize: 18,
                           ),
                         ),
-                        const SizedBox(
-                          width: 20,
+                        RecordCommonItem(
+                          itemName: '随访类型',
+                          itemValue:
+                              controller.getFollowUpMode(dataDto.followUpMode),
+                          fontSize: 18,
                         ),
                       ],
                     ),
@@ -172,6 +175,9 @@ class _followUpRecordCard extends StatelessWidget {
                       height: 20,
                     ),
                     Wrap(
+                      alignment: WrapAlignment.start,
+                      spacing: 20,
+                      runSpacing: 8,
                       children: [
                         SizedBox(
                           width: 300,
@@ -183,7 +189,10 @@ class _followUpRecordCard extends StatelessWidget {
                         ),
                         RecordCommonItem(
                           itemName: '随访时间',
-                          itemValue: dto.followUpTime != null
+                          itemValue: dataDto.followUpTime != null &&
+                                  !dataDto.followUpTime
+                                      .toString()
+                                      .contains('0001-01-01')
                               ? DateFormat("yyyy-MM-dd")
                                   .format(dto.followUpTime!.toLocal())
                               : "",