|
|
@ -32,6 +32,13 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
PickedHouseModel? _otherPickHouse;
|
|
|
|
PickedHouseModel? _otherPickHouse;
|
|
|
|
TextEditingController _nameController = TextEditingController();
|
|
|
|
TextEditingController _nameController = TextEditingController();
|
|
|
|
TextEditingController _telController = TextEditingController();
|
|
|
|
TextEditingController _telController = TextEditingController();
|
|
|
|
|
|
|
|
List<int> get manageEstateIds {
|
|
|
|
|
|
|
|
if (_identify == Identify.OWNER) {
|
|
|
|
|
|
|
|
return _pickedHouses.map((e) => e.house!.id).toList();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return [_otherPickHouse!.house!.id];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
@ -213,9 +220,7 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
var base = await NetUtil().post(SARSAPI.profile.house.addHouse,
|
|
|
|
var base = await NetUtil().post(SARSAPI.profile.house.addHouse,
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
'identity': _identify.index + 1,
|
|
|
|
'identity': _identify.index + 1,
|
|
|
|
'manageEstateIds': _identify.index == 0
|
|
|
|
'manageEstateIds': manageEstateIds,
|
|
|
|
? _pickedHouses
|
|
|
|
|
|
|
|
: [_otherPickHouse],
|
|
|
|
|
|
|
|
'ownerName': _nameController.text,
|
|
|
|
'ownerName': _nameController.text,
|
|
|
|
'ownerTel': _telController.text,
|
|
|
|
'ownerTel': _telController.text,
|
|
|
|
'tenantName': _nameController.text,
|
|
|
|
'tenantName': _nameController.text,
|
|
|
@ -297,14 +302,21 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
var house = GestureDetector(
|
|
|
|
var house = GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
var cancel = BotToast.showLoading();
|
|
|
|
var cancel = BotToast.showLoading();
|
|
|
|
var base = await NetUtil().get(SARSAPI.house.allHouses);
|
|
|
|
var base = await NetUtil().get(SARSAPI.house.allHouses, params: {
|
|
|
|
|
|
|
|
'communityId': UserTool.userProvider.userInfoModel!.communityId
|
|
|
|
|
|
|
|
});
|
|
|
|
cancel();
|
|
|
|
cancel();
|
|
|
|
if (base.success) {
|
|
|
|
if (base.success) {
|
|
|
|
|
|
|
|
if ((base.data as List).isNotEmpty) {
|
|
|
|
var _buildings = (base.data as List)
|
|
|
|
var _buildings = (base.data as List)
|
|
|
|
.map((e) => EstateCascadeModel.fromJson(e))
|
|
|
|
.map((e) => EstateCascadeModel.fromJson(e))
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
_otherPickHouse =
|
|
|
|
_otherPickHouse =
|
|
|
|
await BeeHouseCascadePicker.pick(context, _buildings);
|
|
|
|
await BeeHouseCascadePicker.pick(context, _buildings);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BotToast.showText(text: '房屋列表为空');
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -323,12 +335,15 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
56.w.widthBox,
|
|
|
|
56.w.widthBox,
|
|
|
|
'${_otherPickHouse == null ? '请选择楼层房号' : '${_otherPickHouse!.building!.name}-${_otherPickHouse!.unit!.name}-${_otherPickHouse!.floor!.name}层-${_otherPickHouse!.house!.name}'}'
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
'${_otherPickHouse == null ? '请选择楼层房号' : '${_otherPickHouse!.building!.name}-${_otherPickHouse!.unit!.name}-${_otherPickHouse!.floor!.name}-${_otherPickHouse!.house!.name}'}'
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.size(28.sp)
|
|
|
|
.size(28.sp)
|
|
|
|
.color(Colors.black.withOpacity(0.25))
|
|
|
|
.color(Colors.black.withOpacity(0.25))
|
|
|
|
|
|
|
|
.maxLines(2)
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
Spacer(),
|
|
|
|
),
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
CupertinoIcons.chevron_right,
|
|
|
|
CupertinoIcons.chevron_right,
|
|
|
|
size: 25.w,
|
|
|
|
size: 25.w,
|
|
|
@ -454,7 +469,9 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
|
var cancel = BotToast.showLoading();
|
|
|
|
var cancel = BotToast.showLoading();
|
|
|
|
var base = await NetUtil().get(SARSAPI.house.allHouses);
|
|
|
|
var base = await NetUtil().get(SARSAPI.house.allHouses, params: {
|
|
|
|
|
|
|
|
'communityId': UserTool.userProvider.userInfoModel!.communityId
|
|
|
|
|
|
|
|
});
|
|
|
|
cancel();
|
|
|
|
cancel();
|
|
|
|
if (base.success) {
|
|
|
|
if (base.success) {
|
|
|
|
var _buildings = (base.data as List)
|
|
|
|
var _buildings = (base.data as List)
|
|
|
@ -462,6 +479,7 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
_pickedHouses[index] =
|
|
|
|
_pickedHouses[index] =
|
|
|
|
await BeeHouseCascadePicker.pick(context, _buildings);
|
|
|
|
await BeeHouseCascadePicker.pick(context, _buildings);
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -480,12 +498,14 @@ class _AddHousePageState extends State<AddHousePage> {
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
.color(Colors.black.withOpacity(0.65))
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
56.w.widthBox,
|
|
|
|
56.w.widthBox,
|
|
|
|
'${model.house == null ? '请选择楼层房号' : '${model.building!.name}-${model.unit!.name}-${model.floor!.name}层-${model.house!.name}'}'
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
'${model.house == null ? '请选择楼层房号' : '${model.building!.name}-${model.unit!.name}-${model.floor!.name}-${model.house!.name}'}'
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.size(28.sp)
|
|
|
|
.size(28.sp)
|
|
|
|
.color(Colors.black.withOpacity(0.25))
|
|
|
|
.color(Colors.black.withOpacity(0.25))
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
Spacer(),
|
|
|
|
),
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
CupertinoIcons.chevron_right,
|
|
|
|
CupertinoIcons.chevron_right,
|
|
|
|
size: 25.w,
|
|
|
|
size: 25.w,
|
|
|
|