|
|
@ -1,58 +1,65 @@
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/provider/user_provider.dart';
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
|
|
|
|
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_details_page.dart';
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class InspectionManageCard extends StatefulWidget {
|
|
|
|
class InspectionManageCard extends StatefulWidget {
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
final InspectionListModel cardModel;
|
|
|
|
final bool extra;
|
|
|
|
InspectionManageCard({
|
|
|
|
InspectionManageCard({Key key, this.cardModel, this.extra = true})
|
|
|
|
Key key,
|
|
|
|
: super(key: key);
|
|
|
|
this.cardModel,
|
|
|
|
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_InspectionManageCardState createState() => _InspectionManageCardState();
|
|
|
|
_InspectionManageCardState createState() => _InspectionManageCardState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
TextStyle _textstyle =
|
|
|
|
TextStyle _textstyle =
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp);
|
|
|
|
Map<int, String> _inspectionStatus = {
|
|
|
|
Map<int, String> _inspectionStatus = {1: '待巡检', 2: '已巡检', 3: '巡检中', 4: '未巡检'};
|
|
|
|
1: '待巡检',
|
|
|
|
|
|
|
|
2: '已巡检',
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Color _inspectionColor(int status) {
|
|
|
|
Color _inspectionColor(int status) {
|
|
|
|
switch (status) {
|
|
|
|
switch (status) {
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
return Color(0xFF4501);
|
|
|
|
return Color(0xFFFF4501);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
return Color(0x999999);
|
|
|
|
return Color(0xFF999999);
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
return Color(0xFFFF4501);
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
|
|
return Color(0xFFFF4501);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return Colors.black;
|
|
|
|
return Colors.blue;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool get isManager {
|
|
|
|
|
|
|
|
UserProvider userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
|
|
|
return userProvider.infoModel.canOperation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
16.w.heightBox,
|
|
|
|
16.w.heightBox,
|
|
|
|
AkuButton(
|
|
|
|
AkuButton(
|
|
|
|
onPressed: widget.extra
|
|
|
|
onPressed: () {
|
|
|
|
? () {
|
|
|
|
|
|
|
|
Get.to(
|
|
|
|
Get.to(
|
|
|
|
InspectionManageDetailsPage(
|
|
|
|
InspectionManageDetailsPage(
|
|
|
|
inspectionStatus: widget.cardModel.status,
|
|
|
|
inspectionStatus: widget.cardModel.status,
|
|
|
|
executeId: widget.cardModel.id,
|
|
|
|
executeId: widget.cardModel.id,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
: () {},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 40.w),
|
|
|
|
padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 40.w),
|
|
|
@ -62,19 +69,19 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
color: Color(0xFFFFFFFF)),
|
|
|
|
child: Column(children: [
|
|
|
|
child: Column(children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: widget.extra ? 93.w : 86.w,
|
|
|
|
height: 93.w,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'${widget.cardModel.name}',
|
|
|
|
'${widget.cardModel.name}',
|
|
|
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontSize: widget.extra ? 32.sp : 36.sp,
|
|
|
|
fontSize: 32.sp,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
).expand(),
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
_inspectionStatus[widget.cardModel.status]
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
|
.color(_inspectionColor(widget.cardModel.status))
|
|
|
@ -84,10 +91,10 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
...widget.extra
|
|
|
|
Divider(height: 1.w),
|
|
|
|
? <Widget>[Divider(height: 1.w), 24.w.heightBox]
|
|
|
|
24.w.heightBox,
|
|
|
|
: [
|
|
|
|
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
|
|
|
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
|
|
@ -95,19 +102,27 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
height: 40.w,
|
|
|
|
height: 40.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
4.w.widthBox,
|
|
|
|
4.w.widthBox,
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'巡检名称',
|
|
|
|
'巡检编号',
|
|
|
|
style: _textstyle,
|
|
|
|
style: _textstyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
36.w.widthBox,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
widget.cardModel.name,
|
|
|
|
widget.cardModel.code,
|
|
|
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
)
|
|
|
|
).expand()
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.w.heightBox,
|
|
|
|
12.w.heightBox,
|
|
|
|
],
|
|
|
|
...isManager
|
|
|
|
|
|
|
|
? [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
@ -117,17 +132,19 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
4.w.widthBox,
|
|
|
|
4.w.widthBox,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'巡检编号',
|
|
|
|
'巡检人',
|
|
|
|
style: _textstyle,
|
|
|
|
style: _textstyle,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
widget.cardModel.code,
|
|
|
|
widget.cardModel.inspectorName,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.w.heightBox,
|
|
|
|
12.w.heightBox,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
: [SizedBox()],
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
@ -145,7 +162,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.w.heightBox,
|
|
|
|
12.w.heightBox,
|
|
|
|
...widget.cardModel?.actualBeginDate == null
|
|
|
|
...widget?.cardModel?.actualBeginDate == null
|
|
|
|
? [SizedBox()]
|
|
|
|
? [SizedBox()]
|
|
|
|
: [
|
|
|
|
: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
@ -169,7 +186,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
12.w.heightBox,
|
|
|
|
12.w.heightBox,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
widget.cardModel?.actualEndDate == null
|
|
|
|
widget?.cardModel?.actualEndDate == null
|
|
|
|
? SizedBox()
|
|
|
|
? SizedBox()
|
|
|
|
: Row(
|
|
|
|
: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|