detail_infos.dart 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/src/widgets/framework.dart';
  3. import 'package:get/get.dart';
  4. import 'package:vitalapp/components/cell.dart';
  5. import 'package:vitalapp/components/dialog_input.dart';
  6. import 'package:vitalapp/components/dialog_select.dart';
  7. import 'package:vitalapp/pages/patient/info/controller.dart';
  8. import 'package:fis_common/index.dart';
  9. import 'package:vitalapp/pages/patient_info/controller.dart';
  10. import '../entitys/patientInfo_record.dart';
  11. class DetailInfomations extends GetView<PatientInfomationController> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return Obx(() {
  15. final data = controller.state.detailInfo;
  16. final state = controller.state;
  17. return VListFormCellGroup(
  18. formTitle: "详细信息",
  19. children: [
  20. VListFormCell(
  21. label: "工作单位",
  22. content: data.workUnit ?? '',
  23. onTap: () async {
  24. final result = await VDialogInput(
  25. title: "工作单位",
  26. initialValue: data.workUnit,
  27. placeholder: '请输入')
  28. .show();
  29. if (result != null) {
  30. data.workUnit = result;
  31. state.refreshDetailInfo();
  32. }
  33. },
  34. endIcon: _buildEndIcon(),
  35. ),
  36. // VListFormCell(
  37. // label: "联系人姓名",
  38. // content: data.contactName,
  39. // onTap: () async {
  40. // final result = await VDialogInput(
  41. // title: "联系人姓名",
  42. // initialValue: data.contactName,
  43. // placeholder: '请输入')
  44. // .show();
  45. // if (result != null) {
  46. // data.contactName = result;
  47. // state.refreshDetailInfo();
  48. // }
  49. // },
  50. // endIcon: _buildEndIcon(),
  51. // ),
  52. // VListFormCell(
  53. // label: "联系人电话",
  54. // content: data.contactPhone,
  55. // onTap: () async {
  56. // final result = await VDialogInput(
  57. // title: "联系人电话",
  58. // initialValue: data.contactPhone,
  59. // placeholder: '请输入')
  60. // .show();
  61. // if (result != null) {
  62. // data.contactPhone = result;
  63. // state.refreshDetailInfo();
  64. // }
  65. // },
  66. // endIcon: _buildEndIcon(),
  67. // ),
  68. VListFormCell(
  69. label: "常住类型",
  70. content: data.permanentlyResideType.isNotNullOrEmpty
  71. ? PatientInfoRecord.permanentlyResideTypeList
  72. .firstWhere(
  73. (element) => element.key == data.permanentlyResideType)
  74. .value
  75. : '',
  76. onTap: () async {
  77. final result =
  78. await VDialogSelect<MapEntry<String, String>, String>(
  79. title: "常住类型",
  80. source: PatientInfoRecord.permanentlyResideTypeList.toList(),
  81. valueGetter: (data) => data.key,
  82. labelGetter: (data) => data.value,
  83. initialValue: data.permanentlyResideType,
  84. ).show();
  85. if (result != null) {
  86. data.permanentlyResideType = result;
  87. state.refreshDetailInfo();
  88. }
  89. },
  90. endIcon: _buildEndIcon(),
  91. ),
  92. VListFormCell(
  93. label: "血型",
  94. content: data.bloodType.isNotNullOrEmpty
  95. ? PatientInfoRecord.bloodTypeList
  96. .firstWhere((element) => element.key == data.bloodType)
  97. .value
  98. : '',
  99. onTap: () async {
  100. final result =
  101. await VDialogSelect<MapEntry<String, String>, String>(
  102. title: "血型",
  103. source: PatientInfoRecord.bloodTypeList,
  104. valueGetter: (data) => data.key,
  105. labelGetter: (data) => data.value,
  106. initialValue: data.bloodType,
  107. ).show();
  108. if (result != null) {
  109. data.bloodType = result;
  110. state.refreshDetailInfo();
  111. }
  112. },
  113. endIcon: _buildEndIcon(),
  114. ),
  115. VListFormCell(
  116. label: "RH",
  117. content: data.rh.isNotNullOrEmpty
  118. ? PatientInfoRecord.rhList
  119. .firstWhere((element) => element.key == data.rh)
  120. .value
  121. : '',
  122. onTap: () async {
  123. final result =
  124. await VDialogSelect<MapEntry<String, String>, String>(
  125. title: "RH",
  126. source: PatientInfoRecord.rhList,
  127. valueGetter: (data) => data.key,
  128. labelGetter: (data) => data.value,
  129. initialValue: data.rh,
  130. ).show();
  131. if (result != null) {
  132. data.rh = result;
  133. state.refreshDetailInfo();
  134. }
  135. },
  136. endIcon: _buildEndIcon(),
  137. ),
  138. VListFormCell(
  139. label: "文化程度",
  140. content: data.educationLevel.isNotNullOrEmpty
  141. ? PatientInfoRecord.educationLevelList
  142. .firstWhere((element) => element.key == data.educationLevel)
  143. .value
  144. : '',
  145. onTap: () async {
  146. final result =
  147. await VDialogSelect<MapEntry<String, String>, String>(
  148. title: "文化程度",
  149. source: PatientInfoRecord.educationLevelList,
  150. valueGetter: (data) => data.key,
  151. labelGetter: (data) => data.value,
  152. initialValue: data.educationLevel,
  153. ).show();
  154. if (result != null) {
  155. data.educationLevel = result;
  156. state.refreshDetailInfo();
  157. }
  158. },
  159. endIcon: _buildEndIcon(),
  160. ),
  161. VListFormCell(
  162. label: "职业",
  163. content: data.career.isNotNullOrEmpty
  164. ? PatientInfoRecord.careerList
  165. .firstWhere((element) => element.key == data.career)
  166. .value
  167. : '',
  168. onTap: () async {
  169. final result =
  170. await VDialogSelect<MapEntry<String, String>, String>(
  171. title: "职业",
  172. source: PatientInfoRecord.careerList,
  173. valueGetter: (data) => data.key,
  174. labelGetter: (data) => data.value,
  175. initialValue: data.career,
  176. ).show();
  177. if (result != null) {
  178. data.career = result;
  179. state.refreshDetailInfo();
  180. }
  181. },
  182. endIcon: _buildEndIcon(),
  183. ),
  184. VListFormCell(
  185. label: "婚姻状况",
  186. content: data.maritalStatus.isNotNullOrEmpty
  187. ? PatientInfoRecord.maritalStatusList
  188. .firstWhere((element) => element.key == data.maritalStatus)
  189. .value
  190. : '',
  191. onTap: () async {
  192. final result =
  193. await VDialogSelect<MapEntry<String, String>, String>(
  194. title: "婚姻状况",
  195. source: PatientInfoRecord.maritalStatusList,
  196. valueGetter: (data) => data.key,
  197. labelGetter: (data) => data.value,
  198. initialValue: data.maritalStatus,
  199. ).show();
  200. if (result != null) {
  201. data.maritalStatus = result;
  202. state.refreshDetailInfo();
  203. }
  204. },
  205. endIcon: _buildEndIcon(),
  206. ),
  207. VListFormCell(
  208. label: "医疗费用支付方式",
  209. content: data.providerPayments.isNotNullOrEmpty
  210. ? PatientInfoRecord.providerPaymentsList
  211. .firstWhere(
  212. (element) => element.key == data.providerPayments)
  213. .value
  214. : '',
  215. onTap: () async {
  216. final result =
  217. await VDialogSelect<MapEntry<String, String>, String>(
  218. title: "医疗费用支付方式",
  219. source: PatientInfoRecord.providerPaymentsList,
  220. valueGetter: (data) => data.key,
  221. labelGetter: (data) => data.value,
  222. initialValue: data.providerPayments,
  223. ).show();
  224. if (result != null) {
  225. data.providerPayments = result;
  226. state.refreshDetailInfo();
  227. }
  228. },
  229. endIcon: _buildEndIcon(),
  230. ),
  231. if (data.providerPayments?.contains('8') ?? false)
  232. VListFormCell(
  233. label: "其他支付方式",
  234. content: data.providerPaymentsOther,
  235. onTap: () async {
  236. final result = await VDialogInput(
  237. title: "其他支付方式",
  238. initialValue: data.providerPaymentsOther,
  239. placeholder: '请输入',
  240. ).show();
  241. if (result != null) {
  242. data.providerPaymentsOther = result;
  243. state.refreshDetailInfo();
  244. }
  245. },
  246. endIcon: _buildEndIcon(),
  247. ),
  248. ],
  249. );
  250. });
  251. }
  252. Widget _buildEndIcon({bool isEdit = true}) {
  253. return Container(
  254. margin: EdgeInsets.only(left: isEdit ? 15 : 35),
  255. child: isEdit ? Icon(Icons.edit_outlined) : SizedBox(),
  256. );
  257. }
  258. }