Переглянути джерело

0017905: 【新建档案】按照规范文档,关于联系人姓名和联系人电话字段需做相应调整,截图中已说明

finlay 1 рік тому
батько
коміт
9a70890129

+ 2 - 0
lib/mock/services/patient.dart

@@ -172,6 +172,7 @@ abstract class ModelConverter {
     dto.code = request.code;
     dto.patientName = request.patientName;
     dto.phone = request.phone;
+    dto.emergencyName = request.emergencyName;
     dto.emergencyPhone = request.emergencyPhone;
     dto.cardNo = request.cardNo;
     dto.nationality = request.nationality;
@@ -198,6 +199,7 @@ abstract class ModelConverter {
     dto.patientName = request.patientName;
     dto.phone = request.phone;
     dto.cardNo = request.cardNo;
+    dto.emergencyName = request.emergencyName;
     dto.emergencyPhone = request.emergencyPhone;
     dto.nationality = request.nationality;
     dto.birthday = request.birthday;

+ 1 - 0
lib/pages/patient/create/controller.dart

@@ -409,6 +409,7 @@ class CreatePatientController extends FControllerBase
     final request = CreatePatientRequest2(
       patientName: patientInfomationState.name,
       phone: patientInfomationState.phoneNo,
+      emergencyName: patientInfomationState.emergencyName,
       emergencyPhone: patientInfomationState.emergencyPhone,
       patientGender: patientInfomationState.gender ?? GenderEnum.Unspecified,
       nationality: patientInfomationState.nation,

+ 1 - 0
lib/pages/patient/detail/controller.dart

@@ -190,6 +190,7 @@ class PatientDetailController extends FControllerBase with HomeNavMixin {
         code: dto.code,
         patientName: dto.patientName,
         phone: dto.phone,
+        emergencyName: dto.emergencyName,
         emergencyPhone: dto.emergencyPhone,
         cardNo: dto.cardNo,
         nationality: dto.nationality,

+ 1 - 0
lib/pages/patient/info/controller.dart

@@ -69,6 +69,7 @@ class PatientInfoController extends FControllerBase {
       code: patientInfomationState.code,
       patientName: patientInfomationState.name,
       phone: patientInfomationState.phoneNo,
+      emergencyName: patientInfomationState.emergencyName,
       emergencyPhone: patientInfomationState.emergencyPhone,
       cardNo: patientInfomationState.cardNo,
       nationality: patientInfomationState.nation,

+ 0 - 6
lib/pages/patient/info/widgets/ext_model.dart

@@ -7,8 +7,6 @@ class PatientDetailInfoModel {
 
   ///详细信息
   String? workUnit; //工作单位
-  String? contactName; //联系人姓名
-  String? contactPhone; //联系人电话
   String? permanentlyResideType; //常住类型
   String? bloodType; //血型
   String? rh; //RH
@@ -25,8 +23,6 @@ class PatientDetailInfoModel {
   Map<String, dynamic> toJson() {
     final jsonMap = <String, dynamic>{};
     jsonMap["workUnit"] = workUnit;
-    jsonMap["contactName"] = contactName;
-    jsonMap["contactPhone"] = contactPhone;
     jsonMap["permanentlyResideType"] = permanentlyResideType;
     jsonMap["bloodType"] = bloodType;
     jsonMap["rh"] = rh;
@@ -41,8 +37,6 @@ class PatientDetailInfoModel {
   void _loadFromMap(Map<String, dynamic> jsonMap) {
     final e = jsonMap;
     workUnit = e["workUnit"];
-    contactName = e["contactName"];
-    contactPhone = e["contactPhone"];
     permanentlyResideType = e["permanentlyResideType"];
     bloodType = e["bloodType"];
     rh = e["rh"];

+ 6 - 0
lib/pages/patient_info/state.dart

@@ -21,6 +21,7 @@ class PatientInfomationState {
   final Rx<DateTime?> _birthday = Rx<DateTime?>(null);
   final RxString _age = RxString("");
   final RxString _phoneNo = RxString("");
+  final RxString _emergencyName = RxString("");
   final RxString _emergencyPhone = RxString("");
   final RxString _address = RxString("");
   final RxString _permanentResidenceAddress = RxString("");
@@ -96,6 +97,10 @@ class PatientInfomationState {
   String get phoneNo => _phoneNo.value;
   set phoneNo(String val) => _phoneNo.updateValue(val);
 
+  String get emergencyName => _emergencyName.value;
+
+  set emergencyName(String val) => _emergencyName.updateValue(val);
+
   /// 紧急联系手机号
   String get emergencyPhone => _emergencyPhone.value;
   set emergencyPhone(String val) => _emergencyPhone.updateValue(val);
@@ -217,6 +222,7 @@ class PatientInfomationState {
     nation = dto.nationality ?? "";
     birthday = dto.birthday ?? DateTime(1970, 1, 1);
     phoneNo = dto.phone ?? "";
+    emergencyName = dto.emergencyName ?? '';
     emergencyPhone = dto.emergencyPhone ?? "";
     address = dto.patientAddress ?? "";
     permanentResidenceAddress = dto.permanentResidenceAddress ?? "";

+ 17 - 0
lib/pages/patient_info/view.dart

@@ -155,6 +155,23 @@ class PatientInfomationPage extends GetView<PatientInfomationController> {
           endIcon: _buildEndIcon(),
         ),
       ),
+      Obx(
+        () => VListFormCell(
+          label: "联系人姓名",
+          content: controller.state.emergencyName,
+          onTap: () async {
+            final result = await VDialogInput(
+              title: "联系人姓名",
+              initialValue: controller.state.emergencyName,
+              placeholder: "请填写联系人姓名",
+            ).show();
+            if (result != null) {
+              controller.state.emergencyName = result;
+            }
+          },
+          endIcon: _buildEndIcon(),
+        ),
+      ),
       Obx(
         () => VListFormCell(
           label: "联系人电话",

+ 32 - 32
lib/pages/patient_info/widgets/detail_infos.dart

@@ -35,38 +35,38 @@ class DetailInfomations extends GetView<PatientInfomationController> {
             },
             endIcon: _buildEndIcon(),
           ),
-          VListFormCell(
-            label: "联系人姓名",
-            content: data.contactName,
-            onTap: () async {
-              final result = await VDialogInput(
-                      title: "联系人姓名",
-                      initialValue: data.contactName,
-                      placeholder: '请输入')
-                  .show();
-              if (result != null) {
-                data.contactName = result;
-                state.refreshDetailInfo();
-              }
-            },
-            endIcon: _buildEndIcon(),
-          ),
-          VListFormCell(
-            label: "联系人电话",
-            content: data.contactPhone,
-            onTap: () async {
-              final result = await VDialogInput(
-                      title: "联系人电话",
-                      initialValue: data.contactPhone,
-                      placeholder: '请输入')
-                  .show();
-              if (result != null) {
-                data.contactPhone = result;
-                state.refreshDetailInfo();
-              }
-            },
-            endIcon: _buildEndIcon(),
-          ),
+          // VListFormCell(
+          //   label: "联系人姓名",
+          //   content: data.contactName,
+          //   onTap: () async {
+          //     final result = await VDialogInput(
+          //             title: "联系人姓名",
+          //             initialValue: data.contactName,
+          //             placeholder: '请输入')
+          //         .show();
+          //     if (result != null) {
+          //       data.contactName = result;
+          //       state.refreshDetailInfo();
+          //     }
+          //   },
+          //   endIcon: _buildEndIcon(),
+          // ),
+          // VListFormCell(
+          //   label: "联系人电话",
+          //   content: data.contactPhone,
+          //   onTap: () async {
+          //     final result = await VDialogInput(
+          //             title: "联系人电话",
+          //             initialValue: data.contactPhone,
+          //             placeholder: '请输入')
+          //         .show();
+          //     if (result != null) {
+          //       data.contactPhone = result;
+          //       state.refreshDetailInfo();
+          //     }
+          //   },
+          //   endIcon: _buildEndIcon(),
+          // ),
           VListFormCell(
             label: "常住类型",
             content: data.permanentlyResideType.isNotNullOrEmpty