|
@@ -0,0 +1,120 @@
|
|
|
+
|
|
|
+
|
|
|
+import 'package:fis_i18n/i18n.dart';
|
|
|
+import 'package:fis_jsonrpc/rpc.dart';
|
|
|
+import 'package:fis_ui/index.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:get/get.dart';
|
|
|
+import 'package:vitalapp/components/table/table.dart';
|
|
|
+import 'package:vitalapp/managers/interfaces/patient.dart';
|
|
|
+import 'package:vitalapp/pages/medical/widgets/health_heart_check/health_check_list/controller.dart';
|
|
|
+import 'package:vitalapp/pages/medical_checkup_station/registration/state/list.dart';
|
|
|
+import 'package:vitalapp/store/store.dart';
|
|
|
+
|
|
|
+class HeartCheckTable extends GetView<HeartCheckListController> {
|
|
|
+ HeartCheckTable({
|
|
|
+ super.key,
|
|
|
+ required this.onRowTap,
|
|
|
+ });
|
|
|
+
|
|
|
+ ValueCallback<ResidentModel> onRowTap;
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: GetBuilder<HeartCheckListController>(
|
|
|
+ id: "healthCheck_table",
|
|
|
+ builder: (_) {
|
|
|
+ return VitalTable<ResidentModel>(
|
|
|
+ autoHeight: false,
|
|
|
+ noDataHintText: "暂无数据",
|
|
|
+ columns: controller.buildTableColumns(),
|
|
|
+ source: controller.residentList,
|
|
|
+ loading: controller.tableLoading,
|
|
|
+ onRowSelected: (value, index, idxs) {},
|
|
|
+ onRowTap: (index) async {
|
|
|
+ ResidentModel resident = controller.residentList[index];
|
|
|
+ await changeHeartCheck(resident);
|
|
|
+ onRowTap.call(resident);
|
|
|
+ },
|
|
|
+ onAllRowsSelected: (value, idxs) => {},
|
|
|
+ headerTextStyle: const TextStyle(
|
|
|
+ fontSize: 20,
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ HeartCheckTablePagination(),
|
|
|
+ SizedBox(
|
|
|
+ height: 16,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Future<void> changeHeartCheck(ResidentModel resident) async {
|
|
|
+ final _patientManager = Get.find<IPatientManager>();
|
|
|
+
|
|
|
+ RegisterPersonInfoDTO? registerPersonInfo =
|
|
|
+ await _patientManager.getRegisterPersonInfoByPhysicalExamNumberAsync(
|
|
|
+ physicalExamNumber: resident.physicalExamNumber ?? '',
|
|
|
+ );
|
|
|
+ PatientDTO? patientInfo = PatientDTO();
|
|
|
+ if (registerPersonInfo != null &&
|
|
|
+ registerPersonInfo.physicalExamNumber != null) {
|
|
|
+ patientInfo.code = registerPersonInfo.code;
|
|
|
+ patientInfo.patientName = registerPersonInfo.name;
|
|
|
+ Store.user.currentSelectRegisterPersonInfo = registerPersonInfo;
|
|
|
+ Store.user.currentSelectPatientInfo = patientInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class HeartCheckTablePagination extends GetView<HeartCheckListController> {
|
|
|
+ const HeartCheckTablePagination({
|
|
|
+ super.key,
|
|
|
+ });
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return GetBuilder<HeartCheckListController>(
|
|
|
+ id: "healthCheck_table_pagination",
|
|
|
+ builder: (_) {
|
|
|
+ return Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ children: [
|
|
|
+ FTablePagination(
|
|
|
+ currListLength: controller.appointmentModelListLength,
|
|
|
+ currPageIndex: controller.currPageIndex,
|
|
|
+ pageSize: 10,
|
|
|
+ onChangePage: (pageIndex, listLength) {
|
|
|
+ controller.getRegisterInfoPage(
|
|
|
+ pageIndex: pageIndex,
|
|
|
+ pageSize: listLength,
|
|
|
+ );
|
|
|
+
|
|
|
+ },
|
|
|
+ totalItemNumText: i18nBook.common.ofTerm
|
|
|
+ .translate(['${controller.appointmentModelListLength}']),
|
|
|
+ previousFivePageText: i18nBook.common.previousFivePageText.t,
|
|
|
+ nextFivePageText: i18nBook.common.nextFivePageText.t,
|
|
|
+ ),
|
|
|
+ SizedBox(
|
|
|
+ width: 20,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|