update 报事报修接口

hmxc
张萌 4 years ago
parent 0897efe0ef
commit 505e61e10d

@ -32,7 +32,7 @@ class ManagerFunc {
BaseModel baseModel = await NetUtil().post( BaseModel baseModel = await NetUtil().post(
API.manager.reportRepairInsert, API.manager.reportRepairInsert,
params: { params: {
'buildingUnitEstateld': id, 'buildingUnitEstateId': id,
'type': type, 'type': type,
'reportDetail': reportDetail, 'reportDetail': reportDetail,
'fileUrls': fileUrls, 'fileUrls': fileUrls,

@ -161,7 +161,9 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
width: 686.w, width: 686.w,
child: TextField( child: TextField(
controller: _textEditingController, controller: _textEditingController,
onEditingComplete: () {}, onChanged: (value) {
setState(() {});
},
maxLines: 10, maxLines: 10,
minLines: 5, minLines: 5,
decoration: InputDecoration( decoration: InputDecoration(
@ -204,6 +206,15 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
} }
} }
int _getBuildUnitEstateNameId(String estateName) {
int a = int.parse(estateName.split('|')[0]);
return a;
}
String _getEstateName(String estateNmae) {
return estateNmae.split('|')[1];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
UserProvider userProvider = Provider.of<UserProvider>(context); UserProvider userProvider = Provider.of<UserProvider>(context);
@ -217,37 +228,13 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
kEstateName, kEstateName,
userProvider.userDetailModel.estateNames.isEmpty userProvider.userDetailModel.estateNames.isEmpty
? '' ? ''
: userProvider.userDetailModel.estateNames[0]), : _getEstateName(
userProvider.userDetailModel.estateNames[0])),
_getType(), _getType(),
_buildReportCard(), _buildReportCard(),
_addImages(), _addImages(),
], ],
).expand(), ).expand(),
MaterialButton(
minWidth: double.infinity,
height: 98.w,
onPressed: _canSubmit(_selectType, _textEditingController.text)
? () async {
List<String> 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( bottomNavi: BottomButton(
@ -256,7 +243,11 @@ class _AddFixedSubmitPageState extends State<AddFixedSubmitPage> {
List<String> urls = await NetUtil() List<String> urls = await NetUtil()
.uploadFiles(_files, API.upload.uploadRepair); .uploadFiles(_files, API.upload.uploadRepair);
BaseModel baseModel = await ManagerFunc.reportRepairInsert( BaseModel baseModel = await ManagerFunc.reportRepairInsert(
_selectType + 1, _textEditingController.text, urls); _getBuildUnitEstateNameId(
userProvider.userDetailModel.estateNames[0]),
_selectType + 1,
_textEditingController.text,
urls);
if (baseModel.status) { if (baseModel.status) {
FinishFixedSubmitPage().to(); FinishFixedSubmitPage().to();
} else } else

Loading…
Cancel
Save