|
@@ -859,6 +859,12 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
if (currentSelectedCheckBox.contains(disabledValue)) {
|
|
|
// PromptBox.toast('选项冲突');
|
|
|
} else {
|
|
|
+ // 最大可选处理
|
|
|
+ if (currentFormObject.maxItems != null &&
|
|
|
+ currentSelectedCheckBox.length >= currentFormObject.maxItems!) {
|
|
|
+ PromptBox.toast('最多选择${currentFormObject.maxItems}项');
|
|
|
+ return;
|
|
|
+ }
|
|
|
currentSelectedCheckBox.add(e.value ?? '');
|
|
|
}
|
|
|
}
|
|
@@ -1172,11 +1178,28 @@ class _ConfigurableFormState extends State<ConfigurableCard> {
|
|
|
setState(() {});
|
|
|
}
|
|
|
|
|
|
+ Future<void> editVeterinaryDrug(int index) async {
|
|
|
+ MedicationModel medicationModel =
|
|
|
+ MedicationModel.fromJson(currentValue[index]);
|
|
|
+
|
|
|
+ MedicationModel? result = await VDialogMedication(
|
|
|
+ title: currentFormObject.label,
|
|
|
+ medicationModel: medicationModel,
|
|
|
+ ).show();
|
|
|
+ if (result != null) {
|
|
|
+ currentValue[index] = result.toJson();
|
|
|
+ formValue[currentFormObject.key!] = null;
|
|
|
+ formValue[currentFormObject.key!] = currentValue;
|
|
|
+ setState(() {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return ExamMedication(
|
|
|
currentFormObject: currentFormObject,
|
|
|
currentValues: currentValue,
|
|
|
addVeterinaryDrug: addVeterinaryDrug,
|
|
|
deleteVeterinaryDrug: deleteVeterinaryDrug,
|
|
|
+ editVeterinaryDrug: editVeterinaryDrug,
|
|
|
);
|
|
|
}
|
|
|
|