diff --git a/lib/pages/manager_func.dart b/lib/pages/manager_func.dart index 004708b9..40e5f3b0 100644 --- a/lib/pages/manager_func.dart +++ b/lib/pages/manager_func.dart @@ -32,7 +32,7 @@ class ManagerFunc { BaseModel baseModel = await NetUtil().post( API.manager.reportRepairInsert, params: { - 'buildingUnitEstateld': id, + 'buildingUnitEstateId': id, 'type': type, 'reportDetail': reportDetail, 'fileUrls': fileUrls, diff --git a/lib/pages/things_page/widget/add_fixed_submit_page.dart b/lib/pages/things_page/widget/add_fixed_submit_page.dart index 22740739..3947d1e4 100644 --- a/lib/pages/things_page/widget/add_fixed_submit_page.dart +++ b/lib/pages/things_page/widget/add_fixed_submit_page.dart @@ -161,7 +161,9 @@ class _AddFixedSubmitPageState extends State { width: 686.w, child: TextField( controller: _textEditingController, - onEditingComplete: () {}, + onChanged: (value) { + setState(() {}); + }, maxLines: 10, minLines: 5, decoration: InputDecoration( @@ -204,6 +206,15 @@ class _AddFixedSubmitPageState extends State { } } + int _getBuildUnitEstateNameId(String estateName) { + int a = int.parse(estateName.split('|')[0]); + return a; + } + + String _getEstateName(String estateNmae) { + return estateNmae.split('|')[1]; + } + @override Widget build(BuildContext context) { UserProvider userProvider = Provider.of(context); @@ -217,37 +228,13 @@ class _AddFixedSubmitPageState extends State { kEstateName, userProvider.userDetailModel.estateNames.isEmpty ? '' - : userProvider.userDetailModel.estateNames[0]), + : _getEstateName( + userProvider.userDetailModel.estateNames[0])), _getType(), _buildReportCard(), _addImages(), ], ).expand(), - MaterialButton( - minWidth: double.infinity, - height: 98.w, - onPressed: _canSubmit(_selectType, _textEditingController.text) - ? () async { - List urls = await NetUtil() - .uploadFiles(_files, API.upload.uploadRepair); - BaseModel baseModel = await ManagerFunc.reportRepairInsert(userProvider.userDetailModel.id, - _selectType + 1, _textEditingController.text, urls); - if (baseModel.status) { - FinishFixedSubmitPage().to(); - } else - BotToast.showText(text: baseModel.message); - } - : () { - BotToast.showText(text: '请填写完整报修信息!'); - }, - child: '确认提交'.text.black.bold.size(32.sp).make(), - color: kPrimaryColor, - elevation: 0, - ) - .box - .padding(EdgeInsets.only( - bottom: MediaQuery.of(context).padding.bottom)) - .make() ], ), bottomNavi: BottomButton( @@ -256,7 +243,11 @@ class _AddFixedSubmitPageState extends State { List urls = await NetUtil() .uploadFiles(_files, API.upload.uploadRepair); BaseModel baseModel = await ManagerFunc.reportRepairInsert( - _selectType + 1, _textEditingController.text, urls); + _getBuildUnitEstateNameId( + userProvider.userDetailModel.estateNames[0]), + _selectType + 1, + _textEditingController.text, + urls); if (baseModel.status) { FinishFixedSubmitPage().to(); } else