diff --git a/lib/const/api.dart b/lib/const/api.dart index 58ec3cb..522ff41 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -169,6 +169,10 @@ class _Manage { String get inspectionPointCheckDetail => '/user/inspection/findCheckDetailById'; + ///巡检管理:查询计划巡检点信息(当前巡检执行计划状态为1.待巡检,4.未巡检) + String get inspectionPointCheckDetailUnbegin => + '/user/inspection/findCheckDetailById2'; + ///待办事项:查询处理事项的数量 String get findItemNum => '/user/backlog/findItemNum'; diff --git a/lib/models/manager/inspection/inspection_check_detail_model.dart b/lib/models/manager/inspection/inspection_check_detail_model.dart index 4af5097..8f9ed31 100644 --- a/lib/models/manager/inspection/inspection_check_detail_model.dart +++ b/lib/models/manager/inspection/inspection_check_detail_model.dart @@ -70,6 +70,16 @@ class InspectionCheckDetialModel { } return data; } + + String get inspectionPattern { + switch (this.type) { + case 1: + return '巡检模式1'; + break; + default: + return '未知'; + } + } } class CheckFBIVoList { @@ -123,4 +133,6 @@ class FaceImg { data['sort'] = this.sort; return data; } + + } diff --git a/lib/models/manager/inspection/inspection_qrcode_model.dart b/lib/models/manager/inspection/inspection_qrcode_model.dart index 9675e15..be707ea 100644 --- a/lib/models/manager/inspection/inspection_qrcode_model.dart +++ b/lib/models/manager/inspection/inspection_qrcode_model.dart @@ -32,6 +32,15 @@ class InspectionQRCodeModel { } return data; } + String get inspectionPattern { + switch (this.type) { + case 1: + return '巡检模式1'; + break; + default: + return '未知'; + } + } } class CheckVoList { diff --git a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart index 0d48a1f..8e87ac6 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart @@ -527,7 +527,7 @@ class _InspectionManageDetailsPageState BotToast.showText(text: baseModel.message); } else { _canUploadLocation = false; - //TODO:绘制折线 + //绘制折线 _points.add(argument.latLng); if (_points.length % 5 == 0) { if (_polylines.isEmpty) { diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart index a49cf1c..6ee3bb5 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_detail_page.dart @@ -46,15 +46,7 @@ class _InspectionPointDetailPageState extends State { _easyRefreshController = EasyRefreshController(); } - String inspectionPattern(int type) { - switch (type) { - case 1: - return '巡检模式1'; - break; - default: - return ''; - } - } + @override void dispose() { @@ -72,8 +64,7 @@ class _InspectionPointDetailPageState extends State { MaterialHeader(valueColor: AlwaysStoppedAnimation(kPrimaryColor)), firstRefresh: true, onRefresh: () async { - BaseModel baseModel = await ManageFunc.getInspectionPointCheckDetail( - widget.executePointId); + BaseModel baseModel = await _getModels; if (baseModel.data != null) { _detialModel = InspectionCheckDetialModel.fromJson(baseModel.data); _onload = false; @@ -100,6 +91,22 @@ class _InspectionPointDetailPageState extends State { ); } + Future get _getModels async { + switch (widget.status) { + case 1: + return ManageFunc.getInspectionPointCheckDetailUnbegin( + widget.executePointId); + case 2: + case 3: + return ManageFunc.getInspectionPointCheckDetail(widget.executePointId); + case 4: + return ManageFunc.getInspectionPointCheckDetailUnbegin( + widget.executePointId); + default: + return ManageFunc.getInspectionPointCheckDetail(widget.executePointId); + } + } + Widget _selfPhotoCard() { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -430,7 +437,7 @@ class _InspectionPointDetailPageState extends State { ), Spacer(), Text( - '${inspectionPattern(model.type)}', + '${model.inspectionPattern}', style: AppStyle().primaryStyle, ), ], diff --git a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart index cefef21..c4934b3 100644 --- a/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart +++ b/lib/ui/manage_pages/inspection_manage/inspection_point_input_page.dart @@ -101,7 +101,6 @@ class _InspectionPointInputPageState extends State { if (baseModel.status) { BotToast.showText(text: baseModel.message); Get.to(() => InspectionPointSubmitPage()); - } else { BotToast.showText(text: baseModel.message); } @@ -385,7 +384,7 @@ class _InspectionPointInputPageState extends State { ), Spacer(), Text( - '${widget.qrModel.type}', + '${widget.qrModel.inspectionPattern}', style: AppStyle().primaryStyle, ), ], diff --git a/lib/ui/sub_pages/manage_func.dart b/lib/ui/sub_pages/manage_func.dart index 31c1161..17a10dd 100644 --- a/lib/ui/sub_pages/manage_func.dart +++ b/lib/ui/sub_pages/manage_func.dart @@ -95,4 +95,12 @@ class ManageFunc { }); return baseModel; } + + static Future getInspectionPointCheckDetailUnbegin(int planPointId) async{ + BaseModel baseModel = + await NetUtil().get(API.manage.inspectionPointCheckDetailUnbegin, params: { + "planPointId": planPointId, + }); + return baseModel; + } } diff --git a/pubspec.yaml b/pubspec.yaml index e6487f9..dda885a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -82,6 +82,7 @@ dev_dependencies: #json序列化 json_serializable: ^4.1.1 build_runner: ^2.0.3 + json_model: flutter: uses-material-design: true