添加未巡检时巡检点状态和巡检详情页

hmxc
张萌 4 years ago
parent 278a712ec6
commit 09dbf76ab2

@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/utils/extension/aku_date.dart';
class InspectionManageCard extends StatefulWidget { class InspectionManageCard extends StatefulWidget {
final InspectionListModel cardModel; final InspectionListModel cardModel;
@ -150,7 +151,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
Text('规定巡检时间', style: _textstyle), Text('规定巡检时间', style: _textstyle),
Spacer(), Spacer(),
Text( Text(
'${DateUtil.formatDateStr(widget.cardModel.beginDate, format: "yyyy-MM-dd HH:mm")}${widget.cardModel?.endDate == null ? '' : DateUtil.formatDateStr(widget.cardModel.endDate, format: "HH:mm")}', '${widget.cardModel.beginDate.akuDate()}${widget.cardModel?.endDate == null ? '' : ''}${widget.cardModel?.endDate == null ? '' : widget.cardModel.endDate.akuDate()}',
style: AppStyle().primaryStyle, style: AppStyle().primaryStyle,
), ),
], ],

@ -119,10 +119,9 @@ class _InspectionManageDetailsPageState
children: <Widget>[ children: <Widget>[
'巡检站点'.text.black.size(32.sp).bold.make(), '巡检站点'.text.black.size(32.sp).bold.make(),
..._pointModels ..._pointModels
?.map((e) => _buildInspectionTile( .map((e) => _buildInspectionTile(
e.name, e.checkNum, e.id)) e, _pointModels.indexOf(e)))
?.toList() ?? .toList()
[]
].sepWidget(separate: 16.w.heightBox), ].sepWidget(separate: 16.w.heightBox),
), ),
) )
@ -356,32 +355,42 @@ class _InspectionManageDetailsPageState
); );
} }
Widget _buildInspectionTile( Widget _buildInspectionTile(InspectionPointModel model, int index) {
String inspectionStation,
int inspectionCount,
int index,
) {
return Row( return Row(
children: [ children: [
CircleAvatar( CircleAvatar(
child: child: '$index'
'$index'.text.color(Color(0xFF3F8FFE)).size(28.sp).bold.make(), .text
.color(model.completeDate == null
? Color(0xFFA6CBFF)
: Color(0xFF3F8FFE))
.size(28.sp)
.bold
.make(),
radius: 48.w, radius: 48.w,
backgroundColor: Color(0xFFE9F2FF), backgroundColor: Color(0xFFE9F2FF),
), ),
24.w.widthBox, 24.w.widthBox,
Column( Column(
children: [ children: [
inspectionStation.text.black.size(28.sp).bold.make(), model.name.text
'$inspectionCount项检查'.text.color(kTextSubColor).size(24.sp).make() .color(model.completeDate == null
? kTextPrimaryColor
: kTextSubColor)
.size(28.sp)
.bold
.make(),
'${model.checkNum}项检查'.text.color(kTextSubColor).size(24.sp).make()
], ],
), ),
Spacer(), Spacer(),
_inspectionStatus[_detailModel.status] (model.completeDate == null ? '待巡检' : '已巡检')
.text .text
.size(24.sp) .size(24.sp)
.bold .bold
.color(_inspectionColor(_detailModel.status)) .color(model.completeDate == null
? Color(0xFFFF4501)
: Color(0xFF52C41A))
.make(), .make(),
14.w.widthBox, 14.w.widthBox,
Icon( Icon(
@ -398,7 +407,8 @@ class _InspectionManageDetailsPageState
.make() .make()
.onInkTap(() { .onInkTap(() {
Get.to(() => InspectionPointDetailPage( Get.to(() => InspectionPointDetailPage(
executePointId: index, hasScan: model.completeDate == null ? false : true,
executePointId: model.id,
executeName: _detailModel.name, executeName: _detailModel.name,
)); ));
}); });

@ -1,17 +1,10 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/inspection/inspection_list_model.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_view.dart'; import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_view.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
// Package imports: // Package imports:

@ -4,6 +4,7 @@ import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspecti
import 'package:aku_community_manager/ui/sub_pages/manage_func.dart'; import 'package:aku_community_manager/ui/sub_pages/manage_func.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -12,10 +13,12 @@ import 'package:velocity_x/velocity_x.dart';
class InspectionPointDetailPage extends StatefulWidget { class InspectionPointDetailPage extends StatefulWidget {
final int executePointId; final int executePointId;
final String executeName; final String executeName;
final hasScan;
InspectionPointDetailPage({ InspectionPointDetailPage({
Key key, Key key,
this.executePointId, this.executePointId,
this.executeName, this.executeName,
@required this.hasScan,
}) : super(key: key); }) : super(key: key);
@override @override
@ -65,7 +68,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
.map((e) => _bodyCard(e)) .map((e) => _bodyCard(e))
.toList(), .toList(),
_selfPhotoCard(), _selfPhotoCard(),
_selfPhotoCard(), _scenePhotoCard(),
], ],
), ),
), ),
@ -82,11 +85,80 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
], ],
), ),
32.w.heightBox, 32.w.heightBox,
Container( widget.hasScan
? Container(
width: 320.w,
height: 320.w,
child: Placeholder(),
)
: DottedBorder(
color: Color(0xFF999999),
strokeWidth: 2.w,
radius: Radius.circular(8.w),
child: Container(
width: 160.w,
height: 160.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
R.ASSETS_MANAGE_IC_IMAGE_PNG,
width: 60.w,
height: 60.w,
),
4.w.heightBox,
'上传图片'.text.color(kTextSubColor).size(22.sp).bold.make(),
],
),
),
)
],
)
.box
.color(Colors.white)
.padding(EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w))
.make();
}
Widget _scenePhotoCard() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'3.巡更人员拍摄现场'.text.color(kTextPrimaryColor).size(32.sp).bold.make()
],
),
32.w.heightBox,
widget.hasScan
? Container(
width: 320.w, width: 320.w,
height: 320.w, height: 320.w,
child: Placeholder(), child: Placeholder(),
) )
: DottedBorder(
color: Color(0xFF999999),
strokeWidth: 2.w,
radius: Radius.circular(8.w),
child: Container(
width: 160.w,
height: 160.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
R.ASSETS_MANAGE_IC_IMAGE_PNG,
width: 60.w,
height: 60.w,
),
4.w.heightBox,
'上传图片'.text.color(kTextSubColor).size(22.sp).bold.make(),
],
),
),
)
], ],
) )
.box .box
@ -104,7 +176,8 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
], ],
), ),
32.w.heightBox, 32.w.heightBox,
Row( widget.hasScan
? Row(
children: [ children: [
Container( Container(
width: 180.w, width: 180.w,
@ -116,11 +189,60 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
border: Border.all(color: Color(0xFFFFC40C), width: 3.w), border: Border.all(color: Color(0xFFFFC40C), width: 3.w),
), ),
child: model.status == 1 child: model.status == 1
? '正常'.text.color(kTextPrimaryColor).size(32.sp).bold.make() ? '正常'
: '异常'.text.color(kTextPrimaryColor).size(32.sp).bold.make(), .text
.color(kTextPrimaryColor)
.size(32.sp)
.bold
.make()
: '异常'
.text
.color(kTextPrimaryColor)
.size(32.sp)
.bold
.make(),
),
],
)
: Row(
children: [
Container(
width: 180.w,
height: 72.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xFFF9F9F9),
border:
Border.all(color: Color(0xFF999999), width: 3.w),
),
child: '正常'
.text
.color(kTextSubColor)
.size(32.sp)
.bold
.make()),
Container(
width: 180.w,
height: 72.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xFFF9F9F9),
border:
Border.all(color: Color(0xFF999999), width: 3.w),
), ),
child: '异常'
.text
.color(kTextSubColor)
.size(32.sp)
.bold
.make()),
], ],
), ),
...!widget.hasScan
? []
: [
36.w.heightBox, 36.w.heightBox,
Container( Container(
width: 686.w, width: 686.w,
@ -132,9 +254,14 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
color: Color(0xFFE8E8E8), color: Color(0xFFE8E8E8),
), ),
), ),
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w), padding:
child: EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w),
model.remakes.text.color(kTextPrimaryColor).size(28.sp).make()), child: model.remakes.text
.color(kTextPrimaryColor)
.size(28.sp)
.make(),
),
],
], ],
) )
.box .box

@ -0,0 +1,7 @@
import 'package:common_utils/common_utils.dart';
extension DateExt on String {
String akuDate({String format}) {
return DateUtil.formatDateStr(this, format: format ?? "yyyy-MM-dd HH:mm");
}
}
Loading…
Cancel
Save