|
|
@ -1,8 +1,10 @@
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_detail_model.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.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/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:aku_community_manager/utils/extension/list_extension.dart';
|
|
|
|
import 'package:aku_community_manager/utils/extension/list_extension.dart';
|
|
|
|
import 'package:aku_community_manager/style/app_style.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';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class InspectionManageDetailsPage extends StatefulWidget {
|
|
|
|
class InspectionManageDetailsPage extends StatefulWidget {
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
final int executeId;
|
|
|
|
InspectionManageDetailsPage({Key key, this.cardModel}) : super(key: key);
|
|
|
|
final int inspectionStatus;
|
|
|
|
|
|
|
|
InspectionManageDetailsPage({
|
|
|
|
|
|
|
|
Key key,
|
|
|
|
|
|
|
|
@required this.executeId,
|
|
|
|
|
|
|
|
@required this.inspectionStatus,
|
|
|
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_InspectionManageDetailsPageState createState() =>
|
|
|
|
_InspectionManageDetailsPageState createState() =>
|
|
|
@ -23,7 +30,8 @@ class InspectionManageDetailsPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _InspectionManageDetailsPageState
|
|
|
|
class _InspectionManageDetailsPageState
|
|
|
|
extends State<InspectionManageDetailsPage> {
|
|
|
|
extends State<InspectionManageDetailsPage> {
|
|
|
|
bool get _isFinishInspection => widget.cardModel.status == 2;
|
|
|
|
TextStyle _textstyle =
|
|
|
|
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
Map<int, String> _inspectionStatus = {
|
|
|
|
Map<int, String> _inspectionStatus = {
|
|
|
|
1: '待巡检',
|
|
|
|
1: '待巡检',
|
|
|
|
2: '已巡检',
|
|
|
|
2: '已巡检',
|
|
|
@ -40,16 +48,46 @@ 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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AkuScaffold(
|
|
|
|
return AkuScaffold(
|
|
|
|
title: '巡检详情',
|
|
|
|
title: '巡检详情',
|
|
|
|
body: Column(
|
|
|
|
body: EasyRefresh(
|
|
|
|
|
|
|
|
controller: _refreshController,
|
|
|
|
|
|
|
|
firstRefresh: true,
|
|
|
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
|
|
|
_detailModel = await ManageFunc.getInspectionDetail(widget.executeId);
|
|
|
|
|
|
|
|
_onload = false;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: _onload
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
InspectionManageCard(cardModel: widget.cardModel, extra: false),
|
|
|
|
_inspectionHeadCard(),
|
|
|
|
16.w.heightBox,
|
|
|
|
16.w.heightBox,
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFFF)),
|
|
|
|
decoration: BoxDecoration(color: Color(0xFFFFFF)),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
@ -64,6 +102,151 @@ class _InspectionManageDetailsPageState
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
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(),
|
|
|
|
Spacer(),
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
_inspectionStatus[widget.inspectionStatus]
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.size(24.sp)
|
|
|
|
.size(24.sp)
|
|
|
|
.bold
|
|
|
|
.bold
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
|
.color(_inspectionColor(widget.inspectionStatus))
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
14.w.widthBox,
|
|
|
|
14.w.widthBox,
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|