|
@@ -1,8 +1,10 @@
|
|
|
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';
|
|
|
import 'package:vitalapp/components/table/table_column.dart';
|
|
|
+import 'package:vitalapp/managers/interfaces/registration.dart';
|
|
|
import 'package:vitalapp/pages/medical_checkup_station/registration/controller.dart';
|
|
|
import 'package:vitalapp/pages/medical_checkup_station/registration/state/list.dart';
|
|
|
import 'package:vitalapp/pages/medical_checkup_station/registration/widgets/form/index.dart';
|
|
@@ -15,6 +17,8 @@ class RegistrationListController {
|
|
|
}
|
|
|
final state = ListState();
|
|
|
|
|
|
+ final _registrationManager = Get.find<IRegistrationManager>();
|
|
|
+
|
|
|
Future<void> getRegisterInfoPage({
|
|
|
int? pageSize = 10,
|
|
|
int? pageIndex = 1,
|
|
@@ -81,7 +85,7 @@ class RegistrationListController {
|
|
|
),
|
|
|
TableColumn<ResidentModel>(
|
|
|
headerText: "年龄",
|
|
|
- maxWidth: 100,
|
|
|
+ maxWidth: 80,
|
|
|
render: (rowData, index) => Text(
|
|
|
rowData.age != null ? rowData.age.toString() : "",
|
|
|
style: textStyle,
|
|
@@ -106,7 +110,7 @@ class RegistrationListController {
|
|
|
// ),
|
|
|
TableColumn<ResidentModel>(
|
|
|
headerText: "手机号",
|
|
|
- maxWidth: 150,
|
|
|
+ maxWidth: 100,
|
|
|
render: (rowData, index) => Center(
|
|
|
child: Text(
|
|
|
rowData.phone ?? '',
|
|
@@ -116,7 +120,7 @@ class RegistrationListController {
|
|
|
),
|
|
|
TableColumn<ResidentModel>(
|
|
|
headerText: "体检状态",
|
|
|
- // maxWidth: 150,
|
|
|
+ maxWidth: 150,
|
|
|
render: (rowData, index) => Center(
|
|
|
child: Text(
|
|
|
"已登记",
|
|
@@ -131,11 +135,12 @@ class RegistrationListController {
|
|
|
render: (rowData, index) => Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: [
|
|
|
- TextButton(
|
|
|
- onPressed: () {
|
|
|
- PromptBox.toast("功能开发中");
|
|
|
- },
|
|
|
- child: const Text("打印")),
|
|
|
+ if (!kIsWeb)
|
|
|
+ TextButton(
|
|
|
+ onPressed: () {
|
|
|
+ PromptBox.toast("功能开发中");
|
|
|
+ },
|
|
|
+ child: const Text("打印标签")),
|
|
|
TextButton(
|
|
|
onPressed: () async {
|
|
|
final PatientDTO? patient = PatientDTO(
|
|
@@ -153,6 +158,15 @@ class RegistrationListController {
|
|
|
);
|
|
|
},
|
|
|
child: const Text("编辑")),
|
|
|
+ TextButton(
|
|
|
+ onPressed: () {
|
|
|
+ Get.dialog(
|
|
|
+ _buildEditingExcepting(rowData),
|
|
|
+ barrierDismissible:
|
|
|
+ false, // Prevent dialog from closing on outside tap
|
|
|
+ );
|
|
|
+ },
|
|
|
+ child: const Text("健康指导")),
|
|
|
TextButton(
|
|
|
onPressed: () async {
|
|
|
List<ReportDTO2>? reportList = await registrationController
|
|
@@ -179,4 +193,39 @@ class RegistrationListController {
|
|
|
),
|
|
|
];
|
|
|
}
|
|
|
+
|
|
|
+ Widget _buildEditingExcepting(ResidentModel rowData) {
|
|
|
+ return Dialog(
|
|
|
+ backgroundColor: Colors.white, // 设置对话框背景颜色为白色
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.all(16.0),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: TextField(
|
|
|
+ expands: true,
|
|
|
+ maxLines: null,
|
|
|
+ decoration: InputDecoration(
|
|
|
+ hintText: 'Enter your text here',
|
|
|
+ border: InputBorder.none,
|
|
|
+ ),
|
|
|
+ onChanged: (value) {
|
|
|
+ state.resultsAndSuggestions = value;
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ElevatedButton(
|
|
|
+ onPressed: () async {
|
|
|
+ await _registrationManager.updateResultsAndSuggestionsAsync(
|
|
|
+ rowData.physicalExamNumber ?? "",
|
|
|
+ state.resultsAndSuggestions ?? '');
|
|
|
+ Get.back(); // Close the dialog
|
|
|
+ },
|
|
|
+ child: Text('提交'),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|