|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
// Flutter imports:
|
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart';
|
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_detail_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/manage_func.dart';
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
import 'package:aku_community_manager/utils/extension/list_extension.dart';
|
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
@ -13,8 +15,13 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
|
|
|
|
|
class InspectionManageDetailsPage extends StatefulWidget {
|
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
|
InspectionManageDetailsPage({Key key, this.cardModel}) : super(key: key);
|
|
|
|
|
final int executeId;
|
|
|
|
|
final int inspectionStatus;
|
|
|
|
|
InspectionManageDetailsPage({
|
|
|
|
|
Key key,
|
|
|
|
|
@required this.executeId,
|
|
|
|
|
@required this.inspectionStatus,
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_InspectionManageDetailsPageState createState() =>
|
|
|
|
@ -23,7 +30,8 @@ class InspectionManageDetailsPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _InspectionManageDetailsPageState
|
|
|
|
|
extends State<InspectionManageDetailsPage> {
|
|
|
|
|
bool get _isFinishInspection => widget.cardModel.status == 2;
|
|
|
|
|
TextStyle _textstyle =
|
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
|
Map<int, String> _inspectionStatus = {
|
|
|
|
|
1: '待巡检',
|
|
|
|
|
2: '已巡检',
|
|
|
|
@ -40,30 +48,205 @@ class _InspectionManageDetailsPageState
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InspectionDetailModel _detailModel;
|
|
|
|
|
bool _onload = true;
|
|
|
|
|
EasyRefreshController _refreshController;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
_refreshController = EasyRefreshController();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_refreshController?.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _emptyWidget() {
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AkuScaffold(
|
|
|
|
|
title: '巡检详情',
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
InspectionManageCard(cardModel: widget.cardModel, extra: false),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFFF)),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
'巡检站点'.text.black.size(32.sp).bold.make(),
|
|
|
|
|
_buildInspectionTile(
|
|
|
|
|
'',
|
|
|
|
|
1,
|
|
|
|
|
1,
|
|
|
|
|
body: EasyRefresh(
|
|
|
|
|
controller: _refreshController,
|
|
|
|
|
firstRefresh: true,
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
_detailModel = await ManageFunc.getInspectionDetail(widget.executeId);
|
|
|
|
|
_onload = false;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
child: _onload
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
_inspectionHeadCard(),
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFFF)),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
'巡检站点'.text.black.size(32.sp).bold.make(),
|
|
|
|
|
_buildInspectionTile(
|
|
|
|
|
'',
|
|
|
|
|
1,
|
|
|
|
|
1,
|
|
|
|
|
),
|
|
|
|
|
].sepWidget(separate: 16.w.heightBox),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _inspectionHeadCard() {
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
16.w.heightBox,
|
|
|
|
|
Container(
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 40.w),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(8.w),
|
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 86.w,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'${_detailModel.name}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
|
fontSize: 36.sp,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
_inspectionStatus[widget.inspectionStatus]
|
|
|
|
|
.text
|
|
|
|
|
.color(_inspectionColor(widget.inspectionStatus))
|
|
|
|
|
.bold
|
|
|
|
|
.size(28.sp)
|
|
|
|
|
.make()
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'巡检名称',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
].sepWidget(separate: 16.w.heightBox),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_detailModel.name,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'巡检编号',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_detailModel.code,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.w.heightBox,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_INSPECTION_IC_XUNJIAN_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text('规定巡检时间', style: _textstyle),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
'${DateUtil.formatDateStr(_detailModel.beginDate, format: "yyyy-MM-dd HH:mm")}~${_detailModel?.endDate == null ? '' : DateUtil.formatDateStr(_detailModel.endDate, format: "HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.w.heightBox,
|
|
|
|
|
..._detailModel?.actualBeginDate == null
|
|
|
|
|
? [SizedBox()]
|
|
|
|
|
: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_MANAGE_IC_TIME_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'开始巡检时间',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
'${DateUtil.formatDateStr(_detailModel.actualBeginDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
12.w.heightBox,
|
|
|
|
|
],
|
|
|
|
|
_detailModel?.actualEndDate == null
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
4.w.widthBox,
|
|
|
|
|
Text(
|
|
|
|
|
'结束巡检时间',
|
|
|
|
|
style: _textstyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
'${DateUtil.formatDateStr(_detailModel.actualEndDate, format: "yyyy-MM-dd HH:mm")}',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -87,11 +270,11 @@ class _InspectionManageDetailsPageState
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
|
_inspectionStatus[widget.inspectionStatus]
|
|
|
|
|
.text
|
|
|
|
|
.size(24.sp)
|
|
|
|
|
.bold
|
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
|
|
.color(_inspectionColor(widget.inspectionStatus))
|
|
|
|
|
.make(),
|
|
|
|
|
14.w.widthBox,
|
|
|
|
|
Icon(
|
|
|
|
|