修改装修管理详情

hmxc
张萌 4 years ago
parent f3b56566c9
commit 45baef9cb5

@ -9,7 +9,7 @@ import 'package:aku_community_manager/mock_models/decoration/decoration_data.dar
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/mock_models/fix/fix_model.dart'; import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart'; import 'package:aku_community_manager/provider/fix_provider.dart';
@Deprecated('this mock model should be removed')
class AllModel { class AllModel {
BuildContext context; BuildContext context;
AllModel(this.context); AllModel(this.context);

@ -1,7 +1,7 @@
// Project imports: // Project imports:
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/mock_models/fix/fixer_model.dart'; import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
@Deprecated('this should be removed')
class DecorationData { class DecorationData {
static List<DecorationModel> allModels = [ static List<DecorationModel> allModels = [
DecorationModel( DecorationModel(

@ -52,7 +52,7 @@ Map<CHECK_TYPE, String> checkAssetMap = {
CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG, CHECK_TYPE.DOOR_AND_WINDOWS: R.ASSETS_MANAGE_WINDOW_PNG,
CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG, CHECK_TYPE.SECURITY: R.ASSETS_MANAGE_SECURITY_PNG,
}; };
@Deprecated('under should be removed')
class DecorationModel { class DecorationModel {
DecorationType type; DecorationType type;
DecorationStatusType statusType; DecorationStatusType statusType;
@ -81,7 +81,7 @@ class DecorationModel {
this.checkInfomations, this.checkInfomations,
}); });
} }
@Deprecated('under should be removed')
/// ///
class UserHomeModel { class UserHomeModel {
String plot; String plot;
@ -95,7 +95,7 @@ class UserHomeModel {
this.phone, this.phone,
}); });
} }
@Deprecated('under should be removed')
/// ///
class DecorationTeamModel { class DecorationTeamModel {
String name; String name;
@ -107,7 +107,7 @@ class DecorationTeamModel {
this.phone, this.phone,
}); });
} }
@Deprecated('under should be removed')
/// ///
class CycleCheck { class CycleCheck {
FixerModel authPerson; FixerModel authPerson;
@ -129,7 +129,7 @@ class CycleCheck {
this.checkDetails, this.checkDetails,
}); });
} }
@Deprecated('under should be removed')
class WorkFinishCheck { class WorkFinishCheck {
FixerModel authPerson; FixerModel authPerson;
DateTime startDate; DateTime startDate;
@ -140,7 +140,7 @@ class WorkFinishCheck {
this.checkDetails, this.checkDetails,
}); });
} }
@Deprecated('under should be removed')
/// ///
class CheckInfomation { class CheckInfomation {
DateTime checkDate; DateTime checkDate;
@ -162,7 +162,7 @@ class CheckInfomation {
return true; return true;
} }
} }
@Deprecated('under should be removed')
class CheckDetail { class CheckDetail {
CHECK_TYPE type; CHECK_TYPE type;
bool status; bool status;

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_detail_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
@ -13,6 +14,7 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:get/get.dart';
class DecorationManagerCard extends StatefulWidget { class DecorationManagerCard extends StatefulWidget {
final DecorationListModel model; final DecorationListModel model;
@ -82,7 +84,7 @@ class _DecorationManagerCardState extends State<DecorationManagerCard> {
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AkuMaterialButton( child: AkuMaterialButton(
onPressed: () { onPressed: () {
// Get.to(DecorationManagerDetailPage(model: widget.model)); Get.to(DecorationManagerDetailPage(decorationModel: widget.model));
}, },
height: 64.w, height: 64.w,
minWidth: 160.w, minWidth: 160.w,

@ -2,6 +2,7 @@
import 'dart:math'; import 'dart:math';
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -20,8 +21,6 @@ import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_department_page.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_follow_check.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -30,8 +29,8 @@ 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 DecorationModel model; final DecorationListModel decorationModel;
DecorationManagerDetailPage({Key key, @required this.model}) DecorationManagerDetailPage({Key key, this.decorationModel})
: super(key: key); : super(key: key);
@override @override
@ -49,45 +48,36 @@ class _DecorationManagerDetailStatePage
padding: EdgeInsets.symmetric(vertical: 16.w), padding: EdgeInsets.symmetric(vertical: 16.w),
children: [ children: [
_buildInfo(), _buildInfo(),
widget.model.workFinishCheck == null widget.decorationModel.status>3
? SizedBox() ? SizedBox()
: _buildFinishWorkCheck(), : _buildFinishWorkCheck(),
_buildCycleCheck(), _buildCycleCheck(),
widget.model.checkInfomations == null UserTool.userProvider.infoModel.manager
? SizedBox() ? SizedBox()
: _buildCheckDetail(), : _buildCheckDetail(),
], ],
), ),
bottom: Builder(builder: (context) { bottom: Builder(builder: (context) {
final CycleCheck cycleCheck = widget.model.cycleCheck;
if (UserTool.userProvider.infoModel.canOperation) { if (UserTool.userProvider.infoModel.canOperation) {
switch (widget.model.type) { switch (widget.decorationModel.operationStatus) {
case DecorationType.WAIT_HAND_OUT: case 1:
return AkuBottomButton( return AkuBottomButton(
title: '立即安排', title: '立即安排',
onTap: cycleCheck.authPerson != null && onTap:() {
cycleCheck.checkCycle != null &&
cycleCheck.startDate != null
? () {
widget.model.type = DecorationType.HAND_OUT;
setState(() {});
} }
: null,
); );
break; break;
default: default:
return SizedBox(); return SizedBox();
break; break;
} }
// else if(widget.model.type)
} else if (UserTool.userProvider.infoModel.canOperation) { } else if (UserTool.userProvider.infoModel.canOperation) {
switch (widget.model.type) { switch (widget.decorationModel.operationStatus) {
case DecorationType.HAND_OUT: case 2:
return AkuBottomButton( return AkuBottomButton(
title: '立即执行', title: '立即执行',
onTap: () { onTap: () {
Get.to(DecorationFollowCheck(model: widget.model)); // Get.to(DecorationFollowCheck(model: widget.model));
}, },
); );
break; break;
@ -115,13 +105,13 @@ class _DecorationManagerDetailStatePage
children: [ children: [
_buildInfoCard( _buildInfoCard(
tag: '', tag: '',
midTop: widget.model.userHomeModel.plot, midTop: '人才公寓',
midBottom: widget.model.userHomeModel.detailAddr, midBottom: widget.decorationModel.roomName,
name: '业主:' + widget.model.userHomeModel.userName, name: '业主:' + UserTool.userProvider.infoModel.nickName,
phone: widget.model.userHomeModel.phone, phone: UserTool.userProvider.profileModel.tel,
rightTopWidget: Transform.rotate( rightTopWidget: Transform.rotate(
angle: pi / 4, angle: pi / 4,
child: widget.model.statusType == DecorationStatusType.DONE child: widget.decorationModel.operationStatus==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),
), ),
@ -129,9 +119,9 @@ class _DecorationManagerDetailStatePage
AkuBox.h(16), AkuBox.h(16),
_buildInfoCard( _buildInfoCard(
tag: '', tag: '',
midTop: widget.model.decorationTeamModel.name, midTop: widget.decorationModel.constructionUnit,
name: '负责人:' + widget.model.decorationTeamModel.userName, name: '负责人:' + '马泽鹏',
phone: widget.model.decorationTeamModel.phone, phone: '13831971345',
), ),
], ],
); );
@ -254,7 +244,7 @@ class _DecorationManagerDetailStatePage
], ],
); );
} }
///
_buildFinishWorkCheck() { _buildFinishWorkCheck() {
return AkuTitleBox( return AkuTitleBox(
title: '完工检查', title: '完工检查',
@ -262,20 +252,20 @@ class _DecorationManagerDetailStatePage
children: [ children: [
_buildRow( _buildRow(
title: '开始装修时间', title: '开始装修时间',
subTitle: DateUtil.formatDate( subTitle: DateUtil.formatDateStr(
widget.model.decorationDate, '2021-5-20 13:14',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
_buildRow( _buildRow(
title: '接受人', title: '接受人',
subTitle: widget.model.workFinishCheck?.authPerson?.name, subTitle: '金礼伟',
), ),
_buildRow(title: '所属项目', subTitle: '装修管理'), _buildRow(title: '所属项目', subTitle: '装修管理'),
_buildRow( _buildRow(
title: '开始日期', title: '开始日期',
subTitle: DateUtil.formatDate( subTitle: DateUtil.formatDateStr(
widget.model.workFinishCheck?.startDate, '2021-5-20 13:14',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
@ -292,13 +282,18 @@ class _DecorationManagerDetailStatePage
), ),
), ),
DecorationCheckRow( DecorationCheckRow(
details: widget.model.workFinishCheck?.checkDetails, details: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
onChange: (details) {}, onChange: (details) {},
), ),
], ],
); );
} }
///
_buildCycleCheck() { _buildCycleCheck() {
return AkuTitleBox( return AkuTitleBox(
title: '周期检查', title: '周期检查',
@ -306,27 +301,27 @@ class _DecorationManagerDetailStatePage
children: [ children: [
_buildRow( _buildRow(
title: '开始装修时间', title: '开始装修时间',
subTitle: DateUtil.formatDate( subTitle: DateUtil.formatDateStr(
widget.model.decorationDate, '2021-05-20 13:14:00',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
), ),
_buildRow( _buildRow(
title: '接受人', title: '接受人',
subTitle: widget.model.cycleCheck?.authPerson?.name, subTitle: '黄鑫',
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canOperation
? () { ? () {
Get.to(DecorationDepartmentPage( // Get.to(DecorationDepartmentPage(
model: widget.model, // model: widget.model,
)).then((value) => setState(() {})); // )).then((value) => setState(() {}));
} }
: null, : null,
), ),
_buildRow(title: '所属项目', subTitle: '装修管理'), _buildRow(title: '所属项目', subTitle: '装修管理'),
_buildRow( _buildRow(
title: '开始日期', title: '开始日期',
subTitle: DateUtil.formatDate( subTitle: DateUtil.formatDateStr(
widget.model.cycleCheck?.startDate, '2021-05-20 13:14:00',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
), ),
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canOperation
@ -368,7 +363,7 @@ class _DecorationManagerDetailStatePage
height: 500.w, height: 500.w,
child: CupertinoDatePicker( child: CupertinoDatePicker(
onDateTimeChanged: (dateTime) { onDateTimeChanged: (dateTime) {
widget.model.cycleCheck.startDate = dateTime;
}, },
), ),
), ),
@ -382,9 +377,7 @@ class _DecorationManagerDetailStatePage
), ),
_buildRow( _buildRow(
title: '检查周期', title: '检查周期',
subTitle: widget.model.cycleCheck.checkCycle == null subTitle: '${15}',
? null
: '${widget.model.cycleCheck.checkCycle}',
onTap: UserTool.userProvider.infoModel.canOperation onTap: UserTool.userProvider.infoModel.canOperation
? () { ? () {
showAkuSheet( showAkuSheet(
@ -460,7 +453,7 @@ class _DecorationManagerDetailStatePage
realValue = 30; realValue = 30;
break; break;
} }
widget.model.cycleCheck.checkCycle = realValue;
}, },
), ),
), ),
@ -493,19 +486,19 @@ class _DecorationManagerDetailStatePage
CHECK_TYPE.SECURITY, CHECK_TYPE.SECURITY,
], ],
onChange: (details) { onChange: (details) {
widget.model.cycleCheck.checkDetails = details;
}, },
canTap: UserTool.userProvider.infoModel.canOperation, canTap: UserTool.userProvider.infoModel.canOperation,
) )
], ],
); );
} }
///
_buildCheckDetail() { _buildCheckDetail() {
return AkuTitleBox( return AkuTitleBox(
title: '执行信息', title: '执行信息',
spacing: 24, spacing: 24,
children: widget.model.checkInfomations.map((e) { children: [].map((e) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
@ -527,7 +520,7 @@ class _DecorationManagerDetailStatePage
children: [ children: [
AkuBox.h(96), AkuBox.h(96),
Text( Text(
'${DateUtil.formatDate(e.checkDate, format: 'yyyy-MM-dd')} ' + '${DateUtil.formatDateStr('2021-5-20 13:14', format: 'yyyy-MM-dd')} ' +
e.checkType, e.checkType,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
@ -537,7 +530,7 @@ class _DecorationManagerDetailStatePage
), ),
Spacer(), Spacer(),
Text( Text(
e.checkAllResult ? '正常' : '异常', 3>2? '正常' : '异常',
style: TextStyle( style: TextStyle(
color: e.checkAllResult color: e.checkAllResult
? Color(0xFF32B814) ? Color(0xFF32B814)
@ -550,7 +543,7 @@ class _DecorationManagerDetailStatePage
expanded: Column( expanded: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
...e.details.map((e) { ...[].map((e) {
return Container( return Container(
height: 96.w, height: 96.w,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -565,11 +558,11 @@ class _DecorationManagerDetailStatePage
children: [ children: [
AkuBox.w(48), AkuBox.w(48),
Image.asset( Image.asset(
e.assetpath, R.ASSETS_PLACEHOLDER_WEBP,
height: 40.w, height: 40.w,
), ),
Text( Text(
e.typeValue, '233',
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
@ -578,7 +571,7 @@ class _DecorationManagerDetailStatePage
), ),
Spacer(), Spacer(),
DecorationCheckBox( DecorationCheckBox(
initValue: e.status, initValue: true,
), ),
Spacer(), Spacer(),
], ],
@ -607,7 +600,7 @@ class _DecorationManagerDetailStatePage
), ),
), ),
TextSpan( TextSpan(
text: e.info, text: 'e.info',
), ),
], ],
style: TextStyle( style: TextStyle(

@ -7,7 +7,6 @@ import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart'; import 'package:aku_community_manager/models/manager/decoration/decoration_list_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
@ -27,8 +26,6 @@ class _DecorationManagerPageState extends State<DecorationManagerPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
TabController _tabController; TabController _tabController;
EasyRefreshController _refreshController; EasyRefreshController _refreshController;
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
List<String> get tabs { List<String> get tabs {
final userProvider = Provider.of<UserProvider>(context, listen: false); final userProvider = Provider.of<UserProvider>(context, listen: false);

Loading…
Cancel
Save