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

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

@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/utils/extension/aku_date.dart';
class InspectionManageCard extends StatefulWidget {
final InspectionListModel cardModel;
@ -150,7 +151,7 @@ class _InspectionManageCardState extends State<InspectionManageCard> {
Text('规定巡检时间', style: _textstyle),
Spacer(),
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,
),
],

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

@ -1,17 +1,10 @@
// 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/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/widgets/common/bee_list_view.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
// 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/widgets/common/aku_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -12,10 +13,12 @@ import 'package:velocity_x/velocity_x.dart';
class InspectionPointDetailPage extends StatefulWidget {
final int executePointId;
final String executeName;
final hasScan;
InspectionPointDetailPage({
Key key,
this.executePointId,
this.executeName,
@required this.hasScan,
}) : super(key: key);
@override
@ -65,7 +68,7 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
.map((e) => _bodyCard(e))
.toList(),
_selfPhotoCard(),
_selfPhotoCard(),
_scenePhotoCard(),
],
),
),
@ -82,11 +85,34 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
],
),
32.w.heightBox,
Container(
width: 320.w,
height: 320.w,
child: Placeholder(),
)
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
@ -95,46 +121,147 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
.make();
}
Widget _bodyCard(CheckFBIVoList model) {
Widget _scenePhotoCard() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
'2.${model.name}'.text.color(kTextPrimaryColor).size(32.sp).make()
'3.巡更人员拍摄现场'.text.color(kTextPrimaryColor).size(32.sp).bold.make()
],
),
32.w.heightBox,
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 _bodyCard(CheckFBIVoList model) {
return Column(
children: [
Row(
children: [
Container(
width: 180.w,
height: 72.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xFFFFF8E0),
border: Border.all(color: Color(0xFFFFC40C), width: 3.w),
),
child: model.status == 1
? '正常'.text.color(kTextPrimaryColor).size(32.sp).bold.make()
: '异常'.text.color(kTextPrimaryColor).size(32.sp).bold.make(),
),
'2.${model.name}'.text.color(kTextPrimaryColor).size(32.sp).make()
],
),
36.w.heightBox,
Container(
width: 686.w,
height: 120.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 2.w,
color: Color(0xFFE8E8E8),
32.w.heightBox,
widget.hasScan
? Row(
children: [
Container(
width: 180.w,
height: 72.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.w),
color: Color(0xFFFFF8E0),
border: Border.all(color: Color(0xFFFFC40C), width: 3.w),
),
child: model.status == 1
? '正常'
.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()),
],
),
),
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w),
child:
model.remakes.text.color(kTextPrimaryColor).size(28.sp).make()),
...!widget.hasScan
? []
: [
36.w.heightBox,
Container(
width: 686.w,
height: 120.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
padding:
EdgeInsets.symmetric(vertical: 16.w, horizontal: 24.w),
child: model.remakes.text
.color(kTextPrimaryColor)
.size(28.sp)
.make(),
),
],
],
)
.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