巡检接口更改

修复巡检模式显示不正确的问题
hmxc
张萌 3 years ago
parent 649aec297e
commit 4386da807b

@ -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';

@ -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;
}
}

@ -32,6 +32,15 @@ class InspectionQRCodeModel {
}
return data;
}
String get inspectionPattern {
switch (this.type) {
case 1:
return '巡检模式1';
break;
default:
return '未知';
}
}
}
class CheckVoList {

@ -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) {

@ -46,15 +46,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
_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<InspectionPointDetailPage> {
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<InspectionPointDetailPage> {
);
}
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<InspectionPointDetailPage> {
),
Spacer(),
Text(
'${inspectionPattern(model.type)}',
'${model.inspectionPattern}',
style: AppStyle().primaryStyle,
),
],

@ -101,7 +101,6 @@ class _InspectionPointInputPageState extends State<InspectionPointInputPage> {
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<InspectionPointInputPage> {
),
Spacer(),
Text(
'${widget.qrModel.type}',
'${widget.qrModel.inspectionPattern}',
style: AppStyle().primaryStyle,
),
],

@ -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;
}
}

@ -82,6 +82,7 @@ dev_dependencies:
#json序列化
json_serializable: ^4.1.1
build_runner: ^2.0.3
json_model:
flutter:
uses-material-design: true

Loading…
Cancel
Save