|
@@ -1137,8 +1137,21 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
String currentInputValue = formValue[currentFormObject.key!] ?? '';
|
|
|
DateTime currentDateValue = DateTime.now();
|
|
|
if (currentInputValue.isNotNullOrEmpty) {
|
|
|
- DateFormat format = DateFormat('yyyy-MM-dd');
|
|
|
- currentDateValue = format.parse(currentInputValue);
|
|
|
+ bool parseResult = false;
|
|
|
+ try {
|
|
|
+ DateFormat format = DateFormat('yyyy-MM-dd');
|
|
|
+ currentDateValue = format.parse(currentInputValue);
|
|
|
+ parseResult = true;
|
|
|
+ } catch (e) {
|
|
|
+ logger.e("_buildDate yyyy-MM-dd error:", e);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ DateFormat format = DateFormat('yyyyMMdd');
|
|
|
+ currentDateValue = format.parse(currentInputValue);
|
|
|
+ parseResult = true;
|
|
|
+ } catch (e) {
|
|
|
+ logger.e("_buildDate yyyyMMdd error:", e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Future<void> commonInput() async {
|
|
@@ -1255,10 +1268,15 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
Widget _buildGxyAndTnbMedication(FormObject currentFormObject) {
|
|
|
List<dynamic> currentValue = [];
|
|
|
var value = formValue[currentFormObject.key!];
|
|
|
- if (value is String) {
|
|
|
+ if (value is String && currentFormObject.key != "Appraisal") {
|
|
|
return Container();
|
|
|
- } else {
|
|
|
- if (value != null) currentValue = value;
|
|
|
+ } else if (value != null && value is List) {
|
|
|
+ currentValue = value;
|
|
|
+ } else if (currentFormObject.key == "Appraisal" && value is String) {
|
|
|
+ ///老版本的用药情况就是字符串
|
|
|
+ currentValue = [
|
|
|
+ {"name": value}
|
|
|
+ ];
|
|
|
}
|
|
|
|
|
|
Future<void> addVeterinaryDrug() async {
|