|
|
|
@ -1,9 +1,16 @@
|
|
|
|
|
// Flutter imports:
|
|
|
|
|
import 'package:aku_community_manager/const/api.dart';
|
|
|
|
|
import 'package:aku_community_manager/models/manager/goods_out/goods_out_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:common_utils/common_utils.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
|
import 'package:aku_ui/common_widgets/aku_material_button.dart';
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
@ -21,9 +28,8 @@ import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_pa
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
|
|
|
|
|
class ItemsOutdoorDetailsPage extends StatefulWidget {
|
|
|
|
|
final ItemsOutdoorModel cardMedel;
|
|
|
|
|
ItemsOutdoorDetailsPage({Key key, @required this.cardMedel})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
final int id;
|
|
|
|
|
ItemsOutdoorDetailsPage({Key key, @required this.id}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_ItemsOutdoorDetailsPageState createState() =>
|
|
|
|
@ -31,137 +37,246 @@ class ItemsOutdoorDetailsPage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
GoodsOutDetailModel _model;
|
|
|
|
|
|
|
|
|
|
_buildTile(String path, String title, String subTitle) {
|
|
|
|
|
return Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
path,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
title ?? '',
|
|
|
|
|
style: TextStyle(color: AppStyle.minorTextColor, fontSize: 28.sp),
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
subTitle ?? '',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
UserProvider _userprovider =
|
|
|
|
|
Provider.of<UserProvider>(context, listen: false);
|
|
|
|
|
USER_ROLE userRole = _userprovider.userInfoModel.role;
|
|
|
|
|
return AkuScaffold(
|
|
|
|
|
title: '出户详情',
|
|
|
|
|
body: ListView(
|
|
|
|
|
children: [
|
|
|
|
|
ItemsOutdoorCard(
|
|
|
|
|
cardModel: widget.cardMedel,
|
|
|
|
|
isdetail: true,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
|
margin: EdgeInsets.only(top: 16.w),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: 24.w, left: 32.w, right: 32.w, bottom: 40.w),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'物品信息',
|
|
|
|
|
style: AppStyle().barTitleStyle,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'出户物品',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.itemname,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_WEIGHT_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'物品重量',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.weight < 50.0
|
|
|
|
|
? '<50kg'
|
|
|
|
|
: '${widget.cardMedel.items.weight}kg',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_TRANSPORT_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'搬运方式',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
body: EasyRefresh(
|
|
|
|
|
firstRefresh: true,
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
BaseModel model = await NetUtil().get(
|
|
|
|
|
API.manage.goodsOutDetail,
|
|
|
|
|
params: {'articleOutId': widget.id},
|
|
|
|
|
);
|
|
|
|
|
_model = GoodsOutDetailModel.fromJson(model.data);
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
header: MaterialHeader(),
|
|
|
|
|
child: _model == null
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: ListView(
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'出户信息',
|
|
|
|
|
style: AppStyle().barTitleStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_model.statusValue,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: _model.statusColor,
|
|
|
|
|
fontSize: 24.sp,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
...<Widget>[
|
|
|
|
|
_buildTile(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_HOME_PNG, '小区名称', 'XXXX'),
|
|
|
|
|
_buildTile(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_ADDRESS_PNG,
|
|
|
|
|
'详细地址',
|
|
|
|
|
_model.roomName,
|
|
|
|
|
),
|
|
|
|
|
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '出户人',
|
|
|
|
|
_model.applicantName),
|
|
|
|
|
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '身份',
|
|
|
|
|
_model.identityValue),
|
|
|
|
|
_buildTile(R.ASSETS_OUTDOOR_IC_HOME_PNG, '联系方式',
|
|
|
|
|
_model.applicantTel),
|
|
|
|
|
_buildTile(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_HOME_PNG,
|
|
|
|
|
'出户时间',
|
|
|
|
|
DateUtil.formatDate(
|
|
|
|
|
_model.expected,
|
|
|
|
|
format: 'yyyy-MM-dd HH:mm',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
].sepWidget(separate: AkuBox.h(12)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.items.way,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_IMAGE_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
Divider(height: 1.w),
|
|
|
|
|
MaterialButton(
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
elevation: 0,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_PHONEBLUE_PNG,
|
|
|
|
|
width: 30.w,
|
|
|
|
|
height: 30.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(16),
|
|
|
|
|
Text(
|
|
|
|
|
'联系业主',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFF3F8FFE),
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'图片信息',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: 96.w,
|
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
|
margin: EdgeInsets.only(top: 16.w),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: 24.w, left: 32.w, right: 32.w, bottom: 40.w),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'物品信息',
|
|
|
|
|
style: AppStyle().barTitleStyle,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_CHUHU_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'出户物品',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_model.articleOutName ?? '',
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_WEIGHT_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'物品重量',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_model.weightValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_TRANSPORT_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'搬运方式',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
_model.approachValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_OUTDOOR_IC_IMAGE_PNG,
|
|
|
|
|
width: 40.w,
|
|
|
|
|
height: 40.w,
|
|
|
|
|
),
|
|
|
|
|
AkuBox.w(4),
|
|
|
|
|
Text(
|
|
|
|
|
'图片信息',
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 16.w,
|
|
|
|
|
children: _model.imgUrls
|
|
|
|
|
.map(
|
|
|
|
|
(e) => ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
|
|
|
|
|
image: API.image(e?.url ?? ''),
|
|
|
|
|
width: 218.w,
|
|
|
|
|
height: 218.w,
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
.toList(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AkuBox.h(16),
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 16.w,
|
|
|
|
|
children: widget.cardMedel.items.imagepath
|
|
|
|
|
.map(
|
|
|
|
|
(e) => ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
e,
|
|
|
|
|
width: 218.w,
|
|
|
|
|
height: 218.w,
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
.toList(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottom: _bottomCard(userRole),
|
|
|
|
|
bottom: _model == null ? SizedBox() : _bottomCard(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _bottomCard(USER_ROLE userRole) {
|
|
|
|
|
switch (widget.cardMedel.status) {
|
|
|
|
|
case OUTDOORSTATUS.NOT_OUT:
|
|
|
|
|
return userRole == USER_ROLE.SECURITY
|
|
|
|
|
Widget _bottomCard() {
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
switch (_model.status) {
|
|
|
|
|
case 1:
|
|
|
|
|
return userProvider.infoModel.canPass
|
|
|
|
|
? Container(
|
|
|
|
|
height: 98.w,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
@ -181,9 +296,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
children: [
|
|
|
|
|
AkuButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(OutdoorNotpassPage(
|
|
|
|
|
model: widget.cardMedel,
|
|
|
|
|
));
|
|
|
|
|
//TODO not pass
|
|
|
|
|
// Get.to(OutdoorNotpassPage(
|
|
|
|
|
// model: widget.cardMedel,
|
|
|
|
|
// ));
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 304.w,
|
|
|
|
@ -203,9 +319,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
Spacer(),
|
|
|
|
|
AkuMaterialButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Get.to(OutdoorPassPage(
|
|
|
|
|
model: widget.cardMedel,
|
|
|
|
|
));
|
|
|
|
|
//TODO pass
|
|
|
|
|
// Get.to(OutdoorPassPage(
|
|
|
|
|
// model: widget.cardMedel,
|
|
|
|
|
// ));
|
|
|
|
|
},
|
|
|
|
|
radius: 4.w,
|
|
|
|
|
color: Color(0xFFFFC40C),
|
|
|
|
@ -221,7 +338,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
)
|
|
|
|
|
: SizedBox();
|
|
|
|
|
break;
|
|
|
|
|
case OUTDOORSTATUS.OUT_DONE:
|
|
|
|
|
case 2:
|
|
|
|
|
return Container(
|
|
|
|
|
height: 226.w,
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
@ -247,7 +364,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.finalOutTime,
|
|
|
|
|
DateUtil.formatDate(
|
|
|
|
|
_model.expected,
|
|
|
|
|
format: 'yyyy-MM-dd HH:mm',
|
|
|
|
|
),
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -267,7 +387,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.outPlace,
|
|
|
|
|
_model.exportValue,
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -276,7 +396,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
case OUTDOORSTATUS.REJECTED:
|
|
|
|
|
case 3:
|
|
|
|
|
return Container(
|
|
|
|
|
height: 226.w,
|
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
@ -302,7 +422,10 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(
|
|
|
|
|
widget.cardMedel.finalOutTime,
|
|
|
|
|
DateUtil.formatDate(
|
|
|
|
|
_model.expected,
|
|
|
|
|
format: 'yyyy-MM-dd HH:mm',
|
|
|
|
|
),
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -321,11 +444,13 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
|
|
|
|
|
style: AppStyle().secondaryTextStyle,
|
|
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
Text(widget.cardMedel.rejectReason,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFFFF4501),
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
fontWeight: FontWeight.bold)),
|
|
|
|
|
Text(
|
|
|
|
|
_model.remarks,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Color(0xFFFF4501),
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|