对接接口:完成报修

hmxc
张萌 4 years ago
parent 094c6cf1e2
commit df7bf47956

@ -81,4 +81,15 @@ class ManagerFunc {
); );
return baseModel; return baseModel;
} }
static Future<BaseModel> reportRepairComplete(int id) async {
BaseModel baseModel = await NetUtil().get(
API.manager.reportRepairComplete,
params: {
'repairId': id,
},
showMessage: true,
);
return baseModel;
}
} }

@ -1,5 +1,6 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.dart'; import 'package:akuCommunity/pages/things_page/widget/fixed_evaluate_page.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -44,6 +45,23 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
FixedDetailModel _model = FixedDetailModel(); FixedDetailModel _model = FixedDetailModel();
bool get showRepairCard => _model?.appDispatchListVo != null; bool get showRepairCard => _model?.appDispatchListVo != null;
bool get showProcessCard => _model.appProcessRecordVo.isNotEmpty; bool get showProcessCard => _model.appProcessRecordVo.isNotEmpty;
bool _canComplete(int state) {
switch (state) {
case 1:
case 2:
case 3:
case 4:
return true;
case 5:
case 6:
case 7:
return false;
default:
return false;
}
}
Color _getColor(int state) { Color _getColor(int state) {
switch (state) { switch (state) {
case 1: case 1:
@ -453,9 +471,22 @@ class _FixedDetailPageState extends State<FixedDetailPage> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
MaterialButton( MaterialButton(
textColor: ktextPrimary,
disabledColor: kDarkSubColor,
disabledTextColor: ktextPrimary.withOpacity(0.8),
minWidth: 375.w, minWidth: 375.w,
onPressed: () {}, onPressed: _canComplete(_model.appReportRepairVo.status)
child: '完成维修'.text.black.size(32.sp).bold.make(), ? () async {
BaseModel baseModel =
await ManagerFunc.reportRepairComplete(
_model.appReportRepairVo.id);
if (baseModel.status) {
Get.back();
Get.back();
}
}
: null,
child: '完成维修'.text.size(32.sp).bold.make(),
padding: EdgeInsets.symmetric(vertical: 26.w), padding: EdgeInsets.symmetric(vertical: 26.w),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
elevation: 0, elevation: 0,

Loading…
Cancel
Save