|
@@ -1,5 +1,6 @@
|
1
|
1
|
import 'package:flutter/material.dart';
|
2
|
2
|
import 'package:lszlgl/base/base_lifecycle_state.dart';
|
|
3
|
+import 'package:lszlgl/config/colors.dart';
|
3
|
4
|
import 'package:lszlgl/widget/card_item.dart';
|
4
|
5
|
|
5
|
6
|
import '../../../model/rsp/sample_task_rsp.dart';
|
|
@@ -78,7 +79,29 @@ class _ReapSampleMedicineDetailPageState extends BaseLifecycleState<ReapSampleMe
|
78
|
79
|
|
79
|
80
|
/// 校验数据
|
80
|
81
|
bool verifyData() {
|
81
|
|
- return true;
|
|
82
|
+ if (data?.codeUseMedicineList == null){
|
|
83
|
+ return true;
|
|
84
|
+ } else {
|
|
85
|
+ for(UseMedicineItem item in data?.codeUseMedicineList ?? <UseMedicineItem>[]){
|
|
86
|
+ if((item.synypz ?? '').isEmpty){
|
|
87
|
+ MyNavigator.showToast('农药品种不能为空');
|
|
88
|
+ return false;
|
|
89
|
+ }
|
|
90
|
+ if(item.synysl == null){
|
|
91
|
+ MyNavigator.showToast('农药数量不能为空');
|
|
92
|
+ return false;
|
|
93
|
+ }
|
|
94
|
+ if((item.sysj ?? '').isEmpty){
|
|
95
|
+ MyNavigator.showToast('施药时间不能为空');
|
|
96
|
+ return false;
|
|
97
|
+ }
|
|
98
|
+ if((item.syff ?? '').isEmpty){
|
|
99
|
+ MyNavigator.showToast('施药方法不能为空');
|
|
100
|
+ return false;
|
|
101
|
+ }
|
|
102
|
+ }
|
|
103
|
+ return true;
|
|
104
|
+ }
|
82
|
105
|
}
|
83
|
106
|
|
84
|
107
|
@override
|
|
@@ -104,7 +127,13 @@ class _ReapSampleMedicineDetailPageState extends BaseLifecycleState<ReapSampleMe
|
104
|
127
|
data?.codeUseMedicineList?.length ?? 0,
|
105
|
128
|
(index) => buildItem(index, data!.codeUseMedicineList![index]),
|
106
|
129
|
).toList(),
|
|
130
|
+ if((data?.codeUseMedicineList?.isNotEmpty ?? false) && !isDetail )
|
|
131
|
+ const Padding(
|
|
132
|
+ padding: EdgeInsets.only(top: 10),
|
|
133
|
+ child: Text('长按上方可删除',style: TextStyle(fontSize: 12,color: MyColor.c_666666)),
|
|
134
|
+ ),
|
107
|
135
|
buildAdd(),
|
|
136
|
+
|
108
|
137
|
],
|
109
|
138
|
);
|
110
|
139
|
}
|
|
@@ -146,7 +175,7 @@ class _ReapSampleMedicineDetailPageState extends BaseLifecycleState<ReapSampleMe
|
146
|
175
|
),
|
147
|
176
|
CardWidgets.buildEdit(
|
148
|
177
|
detail,
|
149
|
|
- '使用农药的数量(公斤或毫升/每亩地)',
|
|
178
|
+ '使用农药的数量(毫升/每亩地)',
|
150
|
179
|
item.synysl?.toString(),
|
151
|
180
|
backgroundColor: null,
|
152
|
181
|
inputType: const TextInputType.numberWithOptions(decimal: true),
|