123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- import 'package:flutter/material.dart';
- import 'package:flutter/src/widgets/framework.dart';
- import 'package:get/get.dart';
- import 'package:vitalapp/components/cell.dart';
- import 'package:vitalapp/components/dialog_input.dart';
- import 'package:vitalapp/components/dialog_select.dart';
- import 'package:vitalapp/pages/patient/info/controller.dart';
- import 'package:fis_common/index.dart';
- import 'package:vitalapp/pages/patient_info/controller.dart';
- import '../entitys/patientInfo_record.dart';
- class DetailInfomations extends GetView<PatientInfomationController> {
- @override
- Widget build(BuildContext context) {
- return Obx(() {
- final data = controller.state.detailInfo;
- final state = controller.state;
- return VListFormCellGroup(
- formTitle: "详细信息",
- children: [
- VListFormCell(
- label: "工作单位",
- content: data.workUnit ?? '',
- onTap: () async {
- final result = await VDialogInput(
- title: "工作单位",
- initialValue: data.workUnit,
- placeholder: '请输入')
- .show();
- if (result != null) {
- data.workUnit = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- VListFormCell(
- label: "常住类型",
- content: data.permanentlyResideType.isNotNullOrEmpty
- ? PatientInfoRecord.permanentlyResideTypeList
- .firstWhere(
- (element) => element.key == data.permanentlyResideType)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "常住类型",
- source: PatientInfoRecord.permanentlyResideTypeList.toList(),
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.permanentlyResideType,
- ).show();
- if (result != null) {
- data.permanentlyResideType = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "血型",
- content: data.bloodType.isNotNullOrEmpty
- ? PatientInfoRecord.bloodTypeList
- .firstWhere((element) => element.key == data.bloodType)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "血型",
- source: PatientInfoRecord.bloodTypeList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.bloodType,
- ).show();
- if (result != null) {
- data.bloodType = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "RH",
- content: data.rh.isNotNullOrEmpty
- ? PatientInfoRecord.rhList
- .firstWhere((element) => element.key == data.rh)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "RH",
- source: PatientInfoRecord.rhList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.rh,
- ).show();
- if (result != null) {
- data.rh = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "文化程度",
- content: data.educationLevel.isNotNullOrEmpty
- ? PatientInfoRecord.educationLevelList
- .firstWhere((element) => element.key == data.educationLevel)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "文化程度",
- source: PatientInfoRecord.educationLevelList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.educationLevel,
- ).show();
- if (result != null) {
- data.educationLevel = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "职业",
- content: data.career.isNotNullOrEmpty
- ? PatientInfoRecord.careerList
- .firstWhere((element) => element.key == data.career)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "职业",
- source: PatientInfoRecord.careerList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.career,
- ).show();
- if (result != null) {
- data.career = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "婚姻状况",
- content: data.maritalStatus.isNotNullOrEmpty
- ? PatientInfoRecord.maritalStatusList
- .firstWhere((element) => element.key == data.maritalStatus)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "婚姻状况",
- source: PatientInfoRecord.maritalStatusList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.maritalStatus,
- ).show();
- if (result != null) {
- data.maritalStatus = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- VListFormCell(
- label: "医疗费用支付方式",
- content: data.providerPayments.isNotNullOrEmpty
- ? PatientInfoRecord.providerPaymentsList
- .firstWhere(
- (element) => element.key == data.providerPayments)
- .value
- : '',
- onTap: () async {
- final result =
- await VDialogSelect<MapEntry<String, String>, String>(
- title: "医疗费用支付方式",
- source: PatientInfoRecord.providerPaymentsList,
- valueGetter: (data) => data.key,
- labelGetter: (data) => data.value,
- initialValue: data.providerPayments,
- ).show();
- if (result != null) {
- data.providerPayments = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- if (data.providerPayments?.contains('8') ?? false)
- VListFormCell(
- label: "其他支付方式",
- content: data.providerPaymentsOther,
- onTap: () async {
- final result = await VDialogInput(
- title: "其他支付方式",
- initialValue: data.providerPaymentsOther,
- placeholder: '请输入',
- ).show();
- if (result != null) {
- data.providerPaymentsOther = result;
- state.refreshDetailInfo();
- }
- },
- endIcon: _buildEndIcon(),
- ),
- ],
- );
- });
- }
- Widget _buildEndIcon({bool isEdit = true}) {
- return Container(
- margin: EdgeInsets.only(left: isEdit ? 15 : 35),
- child: isEdit ? Icon(Icons.edit_outlined) : SizedBox(),
- );
- }
- }
|