|
@@ -12,6 +12,7 @@ import 'package:vitalapp/components/appbar.dart';
|
|
|
import 'package:vitalapp/global.dart';
|
|
|
import 'package:vitalapp/helper/goto_helper.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/account.dart';
|
|
|
+import 'package:vitalapp/managers/interfaces/device.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/patient.dart';
|
|
|
import 'package:vitalapp/pages/controllers/home_nav_mixin.dart';
|
|
|
import 'package:vitalapp/pages/home/models/menu.dart';
|
|
@@ -47,8 +48,6 @@ class HomeController extends FControllerBase with HomeNavMixin {
|
|
|
|
|
|
final state = HomeState();
|
|
|
|
|
|
-
|
|
|
- int currentIndex = -1;
|
|
|
List<HomeMenuItem> homeMenuItems = [
|
|
|
HomeMenuItem(
|
|
|
key: 'ZY',
|
|
@@ -348,22 +347,30 @@ class HomeController extends FControllerBase with HomeNavMixin {
|
|
|
}
|
|
|
|
|
|
void onScanData(String code) async {
|
|
|
- print('$code');
|
|
|
- RegisterPersonInfoDTO? registerPersonInfo =
|
|
|
- await _patientManager.getRegisterPersonInfoByPhysicalExamNumberAsync(
|
|
|
- physicalExamNumber: code,
|
|
|
- );
|
|
|
- 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;
|
|
|
+ try {
|
|
|
+ print('$code');
|
|
|
+ final deviceManager = Get.find<IDeviceManager>();
|
|
|
+ deviceManager.onScanCode.emit(this, code);
|
|
|
+ Get.back();
|
|
|
+ } catch (e) {
|
|
|
+ print(e);
|
|
|
}
|
|
|
- Get.back();
|
|
|
- onScanSwitchPage(state.currentSelectMenu);
|
|
|
- print(state.currentSelectMenu);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void onScanSwitchPage(String routeName) {
|