|
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:vnoteapp/components/cell.dart';
|
|
|
import 'package:vnoteapp/components/checkbox_button.dart';
|
|
|
+import 'package:vnoteapp/components/dialog_input.dart';
|
|
|
+import 'package:vnoteapp/components/dialog_select.dart';
|
|
|
import 'package:vnoteapp/components/dynamic_drawer.dart.dart';
|
|
|
import 'package:vnoteapp/pages/controllers/crowd_labels.dart';
|
|
|
import 'package:vnoteapp/pages/patient/create/controller.dart';
|
|
@@ -12,29 +14,187 @@ class CreatePatientPageNew extends GetView<CreatePatientController> {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return Container(
|
|
|
- alignment: Alignment.topCenter,
|
|
|
- child: SizedBox(
|
|
|
- width: 800,
|
|
|
- child: Scrollbar(
|
|
|
- child: ListView(
|
|
|
- shrinkWrap: true,
|
|
|
- children: [
|
|
|
- _CrowdLabelPanel(),
|
|
|
- ],
|
|
|
+ return Stack(
|
|
|
+ children: [
|
|
|
+ Scrollbar(
|
|
|
+ thumbVisibility: true,
|
|
|
+ child: SingleChildScrollView(
|
|
|
+ child: Container(
|
|
|
+ alignment: Alignment.topCenter,
|
|
|
+ margin: const EdgeInsets.only(bottom: 24),
|
|
|
+ child: SizedBox(
|
|
|
+ width: 800,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ _AreaPanel(),
|
|
|
+ const SizedBox(height: 12),
|
|
|
+ _PatientInfoPanel(),
|
|
|
+ const SizedBox(height: 12),
|
|
|
+ _AddressPanel(),
|
|
|
+ const SizedBox(height: 12),
|
|
|
+ _CrowdLabelPanel(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
+ Positioned(
|
|
|
+ top: 20,
|
|
|
+ right: 20,
|
|
|
+ child: SizedBox(
|
|
|
+ width: 90,
|
|
|
+ height: 90,
|
|
|
+ child: ElevatedButton(
|
|
|
+ style: ButtonStyle(
|
|
|
+ shape: MaterialStatePropertyAll(
|
|
|
+ RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(45),
|
|
|
+ side: BorderSide(color: Theme.of(context).primaryColor),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onPressed: () {
|
|
|
+ Get.snackbar(
|
|
|
+ "提示",
|
|
|
+ "此功能尚未开发",
|
|
|
+ duration: const Duration(seconds: 2),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ child: const Text(
|
|
|
+ "读卡",
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class _PatientInfoPanel extends GetView<CreatePatientController> {
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return VListFormCellGroup(
|
|
|
+ children: [
|
|
|
+ VListFormCell(
|
|
|
+ label: "证件类型",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "证件号",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "姓名",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "性别",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "民族",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "出生日期",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "年龄",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "手机号码",
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class _AddressPanel extends GetView<CreatePatientController> {
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return VListFormCellGroup(
|
|
|
+ children: [
|
|
|
+ VListFormCell(
|
|
|
+ label: "同步户籍地址到现住地址",
|
|
|
+ labelWidth: 250,
|
|
|
+ contentWidget: Container(
|
|
|
+ child: Obx(
|
|
|
+ () => Switch(
|
|
|
+ onChanged: (value) {
|
|
|
+ controller.state.isSyncAddresses = value;
|
|
|
+ },
|
|
|
+ value: controller.state.isSyncAddresses,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "户籍地址",
|
|
|
+ content: controller.state.censusRegister,
|
|
|
+ onTap: () {},
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "现住地址",
|
|
|
+ content: controller.state.address,
|
|
|
+ onTap: () {},
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class _AreaPanel extends GetView<CreatePatientController> {
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ String area = "阳光社区";
|
|
|
+ return VListFormCellGroup(
|
|
|
+ children: [
|
|
|
+ VListFormCell(
|
|
|
+ label: "签约区域",
|
|
|
+ content: "重庆市沙坪坝区童家桥街道",
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
+ label: "所在村",
|
|
|
+ content: area,
|
|
|
+ onTap: () async {
|
|
|
+ final result = await VDialogSelect<String, String>(
|
|
|
+ title: "选择签约所在村",
|
|
|
+ source: const ["阳光社区", "磁器口社区", "烈士墓社区"],
|
|
|
+ valueGetter: (data) => data,
|
|
|
+ labelGetter: (data) => data,
|
|
|
+ initialValue: area,
|
|
|
+ ).show();
|
|
|
+ if (result != null) {
|
|
|
+ // TODO:
|
|
|
+ area = result;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class _CrowdLabelPanel extends GetView<CrowdLabelsController> {
|
|
|
+ final createController = Get.find<CreatePatientController>();
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- final createController = Get.find<CreatePatientController>();
|
|
|
return VListFormCellGroup(
|
|
|
children: [
|
|
|
+ Obx(
|
|
|
+ () => VListFormCell(
|
|
|
+ label: "个人编号",
|
|
|
+ content: createController.state.personalNo,
|
|
|
+ onTap: () async {
|
|
|
+ final result = await VDialogInput(
|
|
|
+ title: "个人编号",
|
|
|
+ initialValue: createController.state.personalNo,
|
|
|
+ placeholder: "请填写个人编号",
|
|
|
+ ).show();
|
|
|
+ if (result != null) {
|
|
|
+ createController.state.personalNo = result;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
VListFormCell(
|
|
|
label: "人群分类",
|
|
|
contentWidget: _buildContent(context),
|
|
@@ -51,51 +211,115 @@ class _CrowdLabelPanel extends GetView<CrowdLabelsController> {
|
|
|
|
|
|
Widget _buildDrawer() {
|
|
|
final state = controller.state;
|
|
|
+ List<String> selectedNormalCodes = state.selectedNormalCodes;
|
|
|
+ List<String> selectedDiseaseCodes = state.selectedDiseaseCodes;
|
|
|
+ List<String> selectedSpecialCareCodes = state.selectedSpecialCareCodes;
|
|
|
+ final scrollController = ScrollController();
|
|
|
return VDrawer(
|
|
|
- width: 800,
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- VCheckBoxButtonGroup<LabelDTO, String>(
|
|
|
- source: state.normalOptions,
|
|
|
- values: state.selectedNormalCodes,
|
|
|
- labelGetter: (LabelDTO data) => data.labelName!,
|
|
|
- valueGetter: (LabelDTO data) => data.code!,
|
|
|
- onChanged: (value) {
|
|
|
- state.selectedNormalCodes = value;
|
|
|
- },
|
|
|
+ width: 600,
|
|
|
+ title: "设置人群分类",
|
|
|
+ scaffoldKey: createController.homeScaffoldKey,
|
|
|
+ onConfirm: () {
|
|
|
+ VDynamicDrawerWrapper.hide(
|
|
|
+ scaffoldKey: createController.homeScaffoldKey,
|
|
|
+ );
|
|
|
+ state.selectedNormalCodes = selectedNormalCodes;
|
|
|
+ state.selectedDiseaseCodes = selectedDiseaseCodes;
|
|
|
+ state.selectedSpecialCareCodes = selectedSpecialCareCodes;
|
|
|
+ },
|
|
|
+ child: Scrollbar(
|
|
|
+ controller: scrollController,
|
|
|
+ thumbVisibility: true,
|
|
|
+ child: SingleChildScrollView(
|
|
|
+ controller: scrollController,
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 50),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ const SizedBox(height: 24),
|
|
|
+ VCheckBoxButtonGroup<LabelDTO, String>(
|
|
|
+ source: state.normalOptions,
|
|
|
+ values: state.selectedNormalCodes,
|
|
|
+ labelGetter: (LabelDTO data) => data.labelName!,
|
|
|
+ valueGetter: (LabelDTO data) => data.code!,
|
|
|
+ onChanged: (value) {
|
|
|
+ selectedNormalCodes = value;
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 8),
|
|
|
+ Divider(
|
|
|
+ indent: 32,
|
|
|
+ endIndent: 32,
|
|
|
+ thickness: 1,
|
|
|
+ color: Colors.grey.shade300,
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 8),
|
|
|
+ VCheckBoxButtonGroup<LabelDTO, String>(
|
|
|
+ source: state.diseaseOptions,
|
|
|
+ values: state.selectedDiseaseCodes,
|
|
|
+ labelGetter: (LabelDTO data) => data.labelName!,
|
|
|
+ valueGetter: (LabelDTO data) => data.code!,
|
|
|
+ onChanged: (value) {
|
|
|
+ selectedDiseaseCodes = value;
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 8),
|
|
|
+ Divider(
|
|
|
+ indent: 32,
|
|
|
+ endIndent: 32,
|
|
|
+ thickness: 1,
|
|
|
+ color: Colors.grey.shade300,
|
|
|
+ ),
|
|
|
+ const SizedBox(height: 8),
|
|
|
+ VCheckBoxButtonGroup<LabelDTO, String>(
|
|
|
+ source: state.specialCareOptions,
|
|
|
+ values: state.selectedSpecialCareCodes,
|
|
|
+ labelGetter: (LabelDTO data) => data.labelName!,
|
|
|
+ valueGetter: (LabelDTO data) => data.code!,
|
|
|
+ onChanged: (value) {
|
|
|
+ selectedSpecialCareCodes = value;
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
Widget _buildContent(BuildContext context) {
|
|
|
- return Obx(() {
|
|
|
- final themeData = Theme.of(context);
|
|
|
- final color = themeData.secondaryHeaderColor;
|
|
|
- final names = controller.state.selectedNames;
|
|
|
- const itemHeight = 32.0;
|
|
|
- const itemRadius = itemHeight / 2;
|
|
|
- final itemTextStyle = TextStyle(
|
|
|
- color: themeData.primaryColor,
|
|
|
- fontSize: 14,
|
|
|
- );
|
|
|
- return Wrap(
|
|
|
- children: names.map(
|
|
|
- (e) {
|
|
|
- return Container(
|
|
|
- height: itemHeight,
|
|
|
- alignment: Alignment.center,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: color,
|
|
|
- border: Border.all(style: BorderStyle.none),
|
|
|
- borderRadius: BorderRadius.circular(itemRadius),
|
|
|
- ),
|
|
|
- child: Text(e, style: itemTextStyle),
|
|
|
- );
|
|
|
- },
|
|
|
- ).toList(),
|
|
|
- );
|
|
|
- });
|
|
|
+ return Obx(
|
|
|
+ () {
|
|
|
+ final themeData = Theme.of(context);
|
|
|
+ final color = themeData.secondaryHeaderColor;
|
|
|
+ final names = controller.state.selectedNames;
|
|
|
+ const itemHeight = 32.0;
|
|
|
+ const itemRadius = itemHeight / 2;
|
|
|
+ final itemTextStyle = TextStyle(
|
|
|
+ color: themeData.primaryColor,
|
|
|
+ fontSize: 14,
|
|
|
+ );
|
|
|
+ return Wrap(
|
|
|
+ spacing: 16,
|
|
|
+ runSpacing: 16,
|
|
|
+ children: names.map(
|
|
|
+ (e) {
|
|
|
+ return Container(
|
|
|
+ height: itemHeight,
|
|
|
+ alignment: Alignment.center,
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: color,
|
|
|
+ border: Border.all(style: BorderStyle.none),
|
|
|
+ borderRadius: BorderRadius.circular(itemRadius),
|
|
|
+ ),
|
|
|
+ child: Text(e, style: itemTextStyle),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ).toList(),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ );
|
|
|
}
|
|
|
}
|