|
@@ -34,8 +34,7 @@ class ReapSampleBasicDetailPage extends StatefulWidget {
|
34
|
34
|
State<ReapSampleBasicDetailPage> createState() => _ReapSampleBasicDetailPageState();
|
35
|
35
|
}
|
36
|
36
|
|
37
|
|
-class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasicDetailPage>
|
38
|
|
- with AutomaticKeepAliveClientMixin {
|
|
37
|
+class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasicDetailPage> with AutomaticKeepAliveClientMixin {
|
39
|
38
|
SampleTaskItem? data;
|
40
|
39
|
late bool isDetail;
|
41
|
40
|
|
|
@@ -46,8 +45,8 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
46
|
45
|
final sheng = null.notifier<CardMenuData?>();
|
47
|
46
|
final shi = null.notifier<CardMenuData?>();
|
48
|
47
|
final qu = null.notifier<CardMenuData?>();
|
49
|
|
- final xian = null.notifier<CardMenuData?>();
|
50
|
|
- final cun = null.notifier<CardMenuData?>();
|
|
48
|
+ final TextEditingController xian = TextEditingController();
|
|
49
|
+ final TextEditingController cun = TextEditingController();
|
51
|
50
|
|
52
|
51
|
final trxxList = <CardMenuData>[].notifier<List<CardMenuData>>();
|
53
|
52
|
final trxx = null.notifier<CardMenuData?>();
|
|
@@ -99,38 +98,38 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
99
|
98
|
MyNavigator.dismissLoading();
|
100
|
99
|
}
|
101
|
100
|
|
102
|
|
- /// 选中行政区划
|
103
|
|
- void onSelectXzqh(ValueNotifier<CardMenuData?> selNotifier, CardMenuData selData) {
|
104
|
|
- num level = 100;
|
105
|
|
- if (selNotifier == xian) {
|
106
|
|
- level = 4;
|
107
|
|
- data?.xiangXzqh = selData.value;
|
108
|
|
- data?.cunXzqh = null;
|
109
|
|
- cun.value = null;
|
110
|
|
- cunList.value = [];
|
111
|
|
- } else if (selNotifier == cun) {
|
112
|
|
- level = 5;
|
113
|
|
- data?.cunXzqh = selData.value;
|
114
|
|
- }
|
115
|
|
- if (level < 5) {
|
116
|
|
- // 获取下一个等级的菜单数据
|
117
|
|
- getDistrictList(level + 1, id: selData.value ?? 0);
|
118
|
|
- }
|
119
|
|
- }
|
120
|
|
-
|
121
|
|
- /// 获取编辑数据
|
122
|
|
- void getEditData() async {
|
123
|
|
- MyNavigator.showLoading();
|
124
|
|
- // 县
|
125
|
|
- if (data?.quXzqh != null) {
|
126
|
|
- await getDistrictList(4, id: data?.quXzqh, showLoading: false);
|
127
|
|
- }
|
128
|
|
- // 村
|
129
|
|
- if (data?.xiangXzqh != null) {
|
130
|
|
- await getDistrictList(5, id: data?.xiangXzqh, showLoading: false);
|
131
|
|
- }
|
132
|
|
- MyNavigator.dismissLoading();
|
133
|
|
- }
|
|
101
|
+ // /// 选中行政区划
|
|
102
|
+ // void onSelectXzqh(ValueNotifier<CardMenuData?> selNotifier, CardMenuData selData) {
|
|
103
|
+ // num level = 100;
|
|
104
|
+ // if (selNotifier == xian) {
|
|
105
|
+ // level = 4;
|
|
106
|
+ // data?.xiangXzqh = selData.value;
|
|
107
|
+ // data?.cunXzqh = null;
|
|
108
|
+ // cun.value = null;
|
|
109
|
+ // cunList.value = [];
|
|
110
|
+ // } else if (selNotifier == cun) {
|
|
111
|
+ // level = 5;
|
|
112
|
+ // data?.cunXzqh = selData.value;
|
|
113
|
+ // }
|
|
114
|
+ // if (level < 5) {
|
|
115
|
+ // // 获取下一个等级的菜单数据
|
|
116
|
+ // getDistrictList(level + 1, id: selData.value ?? 0);
|
|
117
|
+ // }
|
|
118
|
+ // }
|
|
119
|
+
|
|
120
|
+ // /// 获取编辑数据
|
|
121
|
+ // void getEditData() async {
|
|
122
|
+ // MyNavigator.showLoading();
|
|
123
|
+ // // 县
|
|
124
|
+ // if (data?.quXzqh != null) {
|
|
125
|
+ // await getDistrictList(4, id: data?.quXzqh, showLoading: false);
|
|
126
|
+ // }
|
|
127
|
+ // // 村
|
|
128
|
+ // if (data?.xiangXzqh != null) {
|
|
129
|
+ // await getDistrictList(5, id: data?.xiangXzqh, showLoading: false);
|
|
130
|
+ // }
|
|
131
|
+ // MyNavigator.dismissLoading();
|
|
132
|
+ // }
|
134
|
133
|
|
135
|
134
|
void getPersonData() async {
|
136
|
135
|
try {
|
|
@@ -191,9 +190,9 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
191
|
190
|
shi.value = null;
|
192
|
191
|
qu.value = null;
|
193
|
192
|
data?.xiangXzqhName = null;
|
194
|
|
- xian.value = null;
|
|
193
|
+ xian.text = '';
|
195
|
194
|
data?.cunXzqhName = null;
|
196
|
|
- cun.value = null;
|
|
195
|
+ cun.text = '';
|
197
|
196
|
|
198
|
197
|
MyNavigator.showLoading();
|
199
|
198
|
bool stepSuccess = false;
|
|
@@ -242,8 +241,8 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
242
|
241
|
// 乡、村
|
243
|
242
|
data?.xiangXzqhName = street;
|
244
|
243
|
data?.cunXzqhName = streetNumber;
|
245
|
|
- xian.value = CardMenuData(street, null);
|
246
|
|
- cun.value = CardMenuData(streetNumber, null);
|
|
244
|
+ xian.text = street;
|
|
245
|
+ cun.text = streetNumber;
|
247
|
246
|
}
|
248
|
247
|
}
|
249
|
248
|
}
|
|
@@ -402,8 +401,8 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
402
|
401
|
if (data?.sheng != null) sheng.value = CardMenuData(data?.sheng, data?.shengXzqh);
|
403
|
402
|
if (data?.shi != null) shi.value = CardMenuData(data?.shi, data?.shiXzqh);
|
404
|
403
|
if (data?.qu != null) qu.value = CardMenuData(data?.qu, data?.quXzqh);
|
405
|
|
- if (data?.xian != null) xian.value = CardMenuData(data?.xian, data?.xiangXzqh);
|
406
|
|
- if (data?.cun != null) cun.value = CardMenuData(data?.cun, data?.cunXzqh);
|
|
404
|
+ if (data?.xiangXzqhName != null) xian.text = data!.xiangXzqhName!;
|
|
405
|
+ if (data?.cunXzqhName != null) cun.text = data!.cunXzqhName!;
|
407
|
406
|
qyddjwd.value = data?.qyddjwd;
|
408
|
407
|
if ((data?.dgryName ?? '0') == '0') {
|
409
|
408
|
data?.dgryName = UserService.get().getUser()?.nickname;
|
|
@@ -447,8 +446,22 @@ class _ReapSampleBasicDetailPageState extends BaseLifecycleState<ReapSampleBasic
|
447
|
446
|
sheng.builder((v) => CardItemWidget('省份', rightText: v?.name, bottomLine: true)),
|
448
|
447
|
shi.builder((v) => CardItemWidget('市/州', rightText: v?.name, bottomLine: true)),
|
449
|
448
|
qu.builder((v) => CardItemWidget('区县', rightText: v?.name, bottomLine: true)),
|
450
|
|
- xian.builder((v) => CardItemWidget('乡镇', rightText: v?.name, bottomLine: true)),
|
451
|
|
- cun.builder((v) => CardItemWidget('村', rightText: v?.name, bottomLine: true)),
|
|
449
|
+ // xian.builder((v) => CardItemWidget('乡镇', rightText: v?.name, bottomLine: true)),
|
|
450
|
+ // cun.builder((v) => CardItemWidget('村', rightText: v?.name, bottomLine: true)),
|
|
451
|
+ CardWidgets.buildEdit(
|
|
452
|
+ isDetail,
|
|
453
|
+ ctrl: xian,
|
|
454
|
+ '乡镇',
|
|
455
|
+ data?.xiangXzqhName?.toString(),
|
|
456
|
+ onChanged: (value) => data?.xiangXzqhName = value.isEmpty ? null : value,
|
|
457
|
+ ),
|
|
458
|
+ CardWidgets.buildEdit(
|
|
459
|
+ isDetail,
|
|
460
|
+ ctrl: cun,
|
|
461
|
+ '村',
|
|
462
|
+ data?.cunXzqhName?.toString(),
|
|
463
|
+ onChanged: (value) => data?.cunXzqhName = value.isEmpty ? null : value,
|
|
464
|
+ ),
|
452
|
465
|
qyddjwd.builder(
|
453
|
466
|
(v) => CardItemWidget(
|
454
|
467
|
'扦样地点经纬度',
|