对接装修管理详情

hmxc
张萌 4 years ago
parent 4cb2a1598a
commit bc387b5352

@ -172,6 +172,29 @@ class TrackRecordVos {
this.result, this.result,
this.recordDetailVoList}); this.recordDetailVoList});
String get typeString {
switch (this.type) {
case 1:
return '周期检查';
case 2:
return '完工检查';
default:
return '未知';
}
}
String get resultString {
switch (this.result) {
case 1:
return '合格';
case 2:
return '不合格';
default:
return '未知';
}
}
TrackRecordVos.fromJson(Map<String, dynamic> json) { TrackRecordVos.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
trackDate = json['trackDate']; trackDate = json['trackDate'];
@ -221,4 +244,16 @@ class RecordDetailVoList {
data['isQualified'] = this.isQualified; data['isQualified'] = this.isQualified;
return data; return data;
} }
String get qualifiedString {
switch (this.isQualified) {
case 1:
return '正常';
case 2:
return '异常';
default:
return '未知';
}
}
} }

@ -16,6 +16,12 @@ class UserInfoModel {
/// ///
bool get canOperation => jurisdiction.contains(57); bool get canOperation => jurisdiction.contains(57);
///
bool get canDecorationDispatch => jurisdiction.contains(59);
///
bool get canDecorationTrack => jurisdiction.contains(60);
/// ///
bool get manager => canSendTicket && canPickUpTicket; bool get manager => canSendTicket && canPickUpTicket;

@ -85,7 +85,7 @@ class _DecorationManagerCardState extends State<DecorationManagerCard> {
child: AkuMaterialButton( child: AkuMaterialButton(
onPressed: () { onPressed: () {
Get.to( Get.to(
DecorationManagerDetailPage(decorationModel: widget.model)); DecorationManagerDetailPage(id: widget.model.id,status: widget.model.status,operationStatus: widget.model.operationStatus,));
}, },
height: 64.w, height: 64.w,
minWidth: 160.w, minWidth: 160.w,

@ -2,6 +2,11 @@
import 'dart:math'; import 'dart:math';
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_detail_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -9,12 +14,12 @@ import 'package:flutter/material.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:expandable/expandable.dart'; import 'package:expandable/expandable.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/user_tool.dart'; import 'package:aku_community_manager/tools/user_tool.dart';
@ -29,9 +34,14 @@ import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart'; import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart';
class DecorationManagerDetailPage extends StatefulWidget { class DecorationManagerDetailPage extends StatefulWidget {
final DecorationListModel decorationModel; final int id;
DecorationManagerDetailPage({Key key, this.decorationModel}) final int status;
: super(key: key); final int operationStatus;
DecorationManagerDetailPage({
Key key,
this.id,
this.status, this.operationStatus,
}) : super(key: key);
@override @override
_DecorationManagerDetailStatePage createState() => _DecorationManagerDetailStatePage createState() =>
@ -40,26 +50,57 @@ class DecorationManagerDetailPage extends StatefulWidget {
class _DecorationManagerDetailStatePage class _DecorationManagerDetailStatePage
extends State<DecorationManagerDetailPage> { extends State<DecorationManagerDetailPage> {
EasyRefreshController _refreshController;
DecorationDetailModel _model;
bool _onload = true;
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
title: '装修详情', title: '装修详情',
body: ListView( body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
BaseModel baseModel =
await NetUtil().get(API.manage.decorationFindByld, params: {
"decorationId ": widget.id,
});
if (baseModel.status) {
_model = DecorationDetailModel.fromJson(baseModel.data);
_onload = false;
} else {
BotToast.showText(text: baseModel.message);
}
},
child: _onload
? Container()
: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w), padding: EdgeInsets.symmetric(vertical: 16.w),
children: [ children: [
_buildInfo(), _buildInfo(),
widget.decorationModel.status > 3 widget.status > 3 ? SizedBox() : _buildFinishWorkCheck(),
? SizedBox()
: _buildFinishWorkCheck(),
_buildCycleCheck(), _buildCycleCheck(),
UserTool.userProvider.infoModel.manager UserTool.userProvider.infoModel.canDecorationTrack
? SizedBox() ? SizedBox()
: _buildCheckDetail(), : _buildCheckDetail(),
], ],
), ),
),
bottom: Builder(builder: (context) { bottom: Builder(builder: (context) {
if (UserTool.userProvider.infoModel.canOperation) { if (UserTool.userProvider.infoModel.canDecorationDispatch) {
switch (widget.decorationModel.operationStatus) { switch (widget.status) {
case 1: case 1:
return AkuBottomButton(title: '立即安排', onTap: () {}); return AkuBottomButton(title: '立即安排', onTap: () {});
break; break;
@ -67,8 +108,8 @@ class _DecorationManagerDetailStatePage
return SizedBox(); return SizedBox();
break; break;
} }
} else if (UserTool.userProvider.infoModel.canOperation) { } else if (UserTool.userProvider.infoModel.canDecorationTrack) {
switch (widget.decorationModel.operationStatus) { switch (widget.status) {
case 2: case 2:
return AkuBottomButton( return AkuBottomButton(
title: '立即执行', title: '立即执行',
@ -102,12 +143,12 @@ class _DecorationManagerDetailStatePage
_buildInfoCard( _buildInfoCard(
tag: '', tag: '',
midTop: '人才公寓', midTop: '人才公寓',
midBottom: widget.decorationModel.roomName, midBottom: _model.decorationFBIVo.roomName,
name: '业主:' + UserTool.userProvider.infoModel.nickName, name: '业主:' + UserTool.userProvider.infoModel.nickName,
phone: UserTool.userProvider.profileModel.tel, phone: UserTool.userProvider.profileModel.tel,
rightTopWidget: Transform.rotate( rightTopWidget: Transform.rotate(
angle: pi / 4, angle: pi / 4,
child: widget.decorationModel.operationStatus == 3 child: widget.status == 3
? Image.asset(R.ASSETS_MANAGE_IC_WANCHENG_PNG) ? Image.asset(R.ASSETS_MANAGE_IC_WANCHENG_PNG)
: Image.asset(R.ASSETS_MANAGE_IC_ZHUANGXIU_PNG), : Image.asset(R.ASSETS_MANAGE_IC_ZHUANGXIU_PNG),
), ),
@ -115,9 +156,9 @@ class _DecorationManagerDetailStatePage
AkuBox.h(16), AkuBox.h(16),
_buildInfoCard( _buildInfoCard(
tag: '', tag: '',
midTop: widget.decorationModel.constructionUnit, midTop: _model.decorationFBIVo.constructionUnit,
name: '负责人:' + '马泽鹏', name: '负责人:${_model.decorationFBIVo.director}',
phone: '13831971345', phone: '${_model.decorationFBIVo.directorTel}',
), ),
], ],
); );
@ -250,19 +291,19 @@ class _DecorationManagerDetailStatePage
_buildRow( _buildRow(
title: '开始装修时间', title: '开始装修时间',
subTitle: DateUtil.formatDateStr( subTitle: DateUtil.formatDateStr(
'2021-5-20 13:14', _model.decorationFBIVo.actualBegin,
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
_buildRow( _buildRow(
title: '接受人', title: '接受人',
subTitle: '金礼伟', subTitle: _model.decorationFBIVo.director,
), ),
_buildRow(title: '所属项目', subTitle: '装修管理'), _buildRow(title: '所属项目', subTitle: '装修管理'),
_buildRow( _buildRow(
title: '开始日期', title: '开始日期',
subTitle: DateUtil.formatDateStr( subTitle: DateUtil.formatDateStr(
'2021-5-20 13:14', _model.trackInspectionFBIVo.startDate,
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
@ -284,6 +325,7 @@ class _DecorationManagerDetailStatePage
CHECK_TYPE.WATER, CHECK_TYPE.WATER,
CHECK_TYPE.WALL, CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS, CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
], ],
onChange: (details) {}, onChange: (details) {},
), ),
@ -300,14 +342,14 @@ class _DecorationManagerDetailStatePage
_buildRow( _buildRow(
title: '开始装修时间', title: '开始装修时间',
subTitle: DateUtil.formatDateStr( subTitle: DateUtil.formatDateStr(
'2021-05-20 13:14:00', _model.decorationFBIVo.actualBegin,
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
_buildRow( _buildRow(
title: '接受人', title: '接受人',
subTitle: '黄鑫', subTitle: '黄鑫',
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canDecorationTrack
? () { ? () {
// Get.to(DecorationDepartmentPage( // Get.to(DecorationDepartmentPage(
// model: widget.model, // model: widget.model,
@ -322,7 +364,7 @@ class _DecorationManagerDetailStatePage
'2021-05-20 13:14:00', '2021-05-20 13:14:00',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canDecorationTrack
? () { ? () {
showAkuSheet( showAkuSheet(
child: Column( child: Column(
@ -373,8 +415,8 @@ class _DecorationManagerDetailStatePage
), ),
_buildRow( _buildRow(
title: '检查周期', title: '检查周期',
subTitle: '${15}', subTitle: '${_model.trackInspectionFBIVo.inspectionCycle}',
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canDecorationTrack
? () { ? () {
showAkuSheet( showAkuSheet(
child: Column( child: Column(
@ -481,7 +523,7 @@ class _DecorationManagerDetailStatePage
CHECK_TYPE.SECURITY, CHECK_TYPE.SECURITY,
], ],
onChange: (details) {}, onChange: (details) {},
canTap: UserTool.userProvider.infoModel.canOperation, canTap: UserTool.userProvider.infoModel.canDecorationTrack,
) )
], ],
); );
@ -492,7 +534,7 @@ class _DecorationManagerDetailStatePage
return AkuTitleBox( return AkuTitleBox(
title: '执行信息', title: '执行信息',
spacing: 24, spacing: 24,
children: [].map((e) { children: _model.trackRecordVos.map((e) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
@ -515,7 +557,7 @@ class _DecorationManagerDetailStatePage
AkuBox.h(96), AkuBox.h(96),
Text( Text(
'${DateUtil.formatDateStr('2021-5-20 13:14', format: 'yyyy-MM-dd')} ' + '${DateUtil.formatDateStr('2021-5-20 13:14', format: 'yyyy-MM-dd')} ' +
e.checkType, e.typeString,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -526,7 +568,7 @@ class _DecorationManagerDetailStatePage
Text( Text(
3 > 2 ? '正常' : '异常', 3 > 2 ? '正常' : '异常',
style: TextStyle( style: TextStyle(
color: e.checkAllResult color: e.result==1
? Color(0xFF32B814) ? Color(0xFF32B814)
: Color(0xFFFF4501), : Color(0xFFFF4501),
fontSize: 28.sp, fontSize: 28.sp,
@ -537,7 +579,7 @@ class _DecorationManagerDetailStatePage
expanded: Column( expanded: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
...[].map((e) { ...e.recordDetailVoList.map((e) {
return Container( return Container(
height: 96.w, height: 96.w,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -556,7 +598,7 @@ class _DecorationManagerDetailStatePage
height: 40.w, height: 40.w,
), ),
Text( Text(
'233', e.qualifiedString,
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
@ -594,7 +636,7 @@ class _DecorationManagerDetailStatePage
), ),
), ),
TextSpan( TextSpan(
text: 'e.info', text: e.description,
), ),
], ],
style: TextStyle( style: TextStyle(

Loading…
Cancel
Save