对接设施设备管理接口

hmxc
张萌 4 years ago
parent cd29224814
commit 179ff34094

@ -224,6 +224,12 @@ class _Manage {
///app
String get hygienceComplete => '/user/hygiene/complete';
///app
String get facilitiesCheckList => '/user/facilitiesCheck/list';
///app
String get submitFacilitiesCheckInfo => '/user/facilitiesCheck/submitCheck';
}
class _Upload {
@ -260,6 +266,10 @@ class _Upload {
///
String get uploadAdvices => '/user/upload/uploadAdvice';
///
String get uploadFacilitiCheckPhoto =>
'/user/upload/uploadFacilitiesCheckPhoto';
}
class _Message {

@ -0,0 +1,75 @@
import 'package:aku_community_manager/models/common/img_model.dart';
class FacilitiesCheckListModel {
int id;
String code;
String facilitiesName;
String facilitiesAddress;
int status;
String beginDate;
String endDate;
int situation;
String detail;
String checkDate;
List<ImgModel> imgList;
FacilitiesCheckListModel(
{this.id,
this.code,
this.facilitiesName,
this.facilitiesAddress,
this.status,
this.beginDate,
this.endDate,
this.situation,
this.detail,
this.checkDate,
this.imgList});
String get situationString {
switch (this.situation) {
case 1:
return '正常';
case 2:
return '异常';
default:
return '未知';
}
}
FacilitiesCheckListModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
code = json['code'];
facilitiesName = json['facilitiesName'];
facilitiesAddress = json['facilitiesAddress'];
status = json['status'];
beginDate = json['beginDate'];
endDate = json['endDate'];
situation = json['situation'];
detail = json['detail'];
checkDate = json['checkDate'];
if (json['imgList'] != null) {
imgList = new List<ImgModel>();
json['imgList'].forEach((v) {
imgList.add(new ImgModel.fromJson(v));
});
} else
imgList = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['code'] = this.code;
data['facilitiesName'] = this.facilitiesName;
data['facilitiesAddress'] = this.facilitiesAddress;
data['status'] = this.status;
data['beginDate'] = this.beginDate;
data['endDate'] = this.endDate;
data['situation'] = this.situation;
data['detail'] = this.detail;
data['checkDate'] = this.checkDate;
data['imgList'] = this.imgList;
return data;
}
}

@ -1,30 +0,0 @@
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_card.dart';
class FacilitiesView extends StatefulWidget {
final int index;
FacilitiesView({Key key, this.index}) : super(key: key);
@override
_FacilitiesViewState createState() => _FacilitiesViewState();
}
class _FacilitiesViewState extends State<FacilitiesView> {
@override
Widget build(BuildContext context) {
return ListView(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
children: [
FacilitiesCard(
index: widget.index,
),
],
);
}
}

@ -48,7 +48,7 @@ class AnouncementDetails extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('深圳永成物业有限公司', style: AppStyle().primaryStyle),
Text('南宁人才公寓物业管理处', style: AppStyle().primaryStyle),
SizedBox(
height: 4.w,
),

@ -1,5 +1,6 @@
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -9,7 +10,6 @@ import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/models/manager/facilities/facilities_page.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
@ -82,7 +82,7 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication(
'绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, () => GreenManagePage()),
AppApplication(
'设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesPage()),
'设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesSelectPage()),
AppApplication(
'包裹管理', R.ASSETS_HOME_PACKAGE_PNG, () => PackagesManagePage()),
AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, () => KeyManagePage()),

@ -1,4 +1,6 @@
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -9,7 +11,6 @@ import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/models/manager/facilities/facilities_page.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
@ -52,13 +53,14 @@ class _SearchWorkOrderpageState extends State<SearchWorkOrderPage> {
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()),
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()),
AppApplication(
'设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesPage()),
'设施检查', R.ASSETS_HOME_IC_FACILITIES_PNG, () => FacilitiesSelectPage()),
AppApplication(
'包裹管理', R.ASSETS_HOME_PACKAGE_PNG, () => PackagesManagePage()),
AppApplication('钥匙管理', R.ASSETS_HOME_KEY_PNG, () => KeyManagePage()),
AppApplication('规程管理', R.ASSETS_HOME_RULES_PNG, () => RulesManagePage()),
AppApplication(
'卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage())
'卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()),
AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage())
];
List<AppApplication> _displayApps = [];

@ -183,7 +183,7 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage> {
children: time == null
? [
Center(
child: '未打卡'
child: (type == 0 ? '上班未打卡' : '下班未打卡')
.text
.size(32.sp)
.bold
@ -212,12 +212,19 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage> {
);
}
String get getWorkHours {
int _time = UserTool.appProvider.clockInTime
.difference(UserTool.appProvider.clockOutTime)
.inMinutes;
int _hour = _time ~/ 60;
int _min = _time % 60;
String get getWorkHours {
int _hour = 0;
int _min = 0;
if (UserTool.appProvider.clockInTime != null) {
int _time = (UserTool.appProvider.clockOutTime == null
? DateTime.now()
: UserTool.appProvider.clockOutTime)
.difference(UserTool.appProvider.clockInTime)
.inMinutes;
print(_time);
_hour = _time ~/ 60;
_min = _time % 60;
}
return '$_hour小时$_min分钟';
}
}

@ -1,4 +1,8 @@
// Flutter imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_check_list_model.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_inspect_report_page.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -8,14 +12,13 @@ import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_inspect_report_page.dart';
import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart';
class FacilitiesCard extends StatefulWidget {
final int index;
FacilitiesCard({Key key, this.index}) : super(key: key);
final FacilitiesCheckListModel model;
FacilitiesCard({Key key, this.index, this.model}) : super(key: key);
@override
_FacilitiesCardState createState() => _FacilitiesCardState();
@ -29,10 +32,14 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
children: [
Row(
children: [
'户外2号篮球场'.text.color(kTextPrimaryColor).size(32.sp).bold.make(),
widget.model.facilitiesName.text
.color(kTextPrimaryColor)
.size(32.sp)
.bold
.make(),
Spacer(),
FacilitiesMap.inspectStatus[widget.index + 1].text
.color(FacilitiesMap.insepectColor[widget.index + 1])
FacilitiesMap.inspectStatus[widget.model.status].text
.color(FacilitiesMap.insepectColor[widget.model.status])
.size(28.sp)
.bold
.make(),
@ -41,7 +48,8 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
16.w.heightBox,
AkuDivider.horizontal(),
24.w.heightBox,
_buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址', '1号楼4单元门口'),
_buildTile(R.ASSETS_MANAGE_ADDRESS_PNG, '场地地址',
widget.model.facilitiesAddress),
..._midTile(),
...widget.index != 0
? []
@ -59,7 +67,7 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
onPressed: () {
Get.to(() => FacilitiesInspectReportPage());
},
child: '扫码报告'
child: '填写报告'
.text
.size(26.sp)
.color(kTextPrimaryColor)
@ -86,28 +94,33 @@ class _FacilitiesCardState extends State<FacilitiesCard> {
case 0:
return [
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '任务时间', '2020-10-1 19:00-20:300'),
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '任务时间',
'${DateUtil.formatDateStr(widget.model.beginDate, format: 'yyyy-MM-dd HH:mm')}-${DateUtil.formatDateStr(widget.model.endDate, format: 'HH;mm')}'),
];
case 1:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', '超时',
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '未完成原因', widget.model.detail,
color: Colors.red),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间',
'${DateUtil.formatDateStr(widget.model.beginDate, format: 'yyyy-MM-dd HH:mm')}-${DateUtil.formatDateStr(widget.model.endDate, format: 'HH;mm')}'),
];
case 2:
return [
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '场地情况', '正常',
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '场地情况', widget.model.situationString,
color: Color(0xFF3F8FFE)),
15.w.heightBox,
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间', '2020-10-1 19:00-20:300'),
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '规定任务时间',
'${DateUtil.formatDateStr(widget.model.beginDate, format: 'yyyy-MM-dd HH:mm')}-${DateUtil.formatDateStr(widget.model.endDate, format: 'HH;mm')}'),
15.w.heightBox,
_buildTile(R.ASSETS_MANAGE_CLOCK_PNG, '检查提交时间', '2020-10-1 19:00'),
_buildTile(
R.ASSETS_MANAGE_CLOCK_PNG,
'检查提交时间',
DateUtil.formatDateStr(widget.model.checkDate,
format: 'yyyy-MM-dd HH:mm')),
];
default:
return [];

@ -2,6 +2,7 @@
import 'dart:io';
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_map.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -10,7 +11,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_map.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_pick_image_widget.dart';
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.dart';

@ -1,17 +1,17 @@
// Flutter imports:
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_view.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports:
import 'package:aku_community_manager/models/manager/facilities/facilities_view.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
class FacilitiesPage extends StatefulWidget {
FacilitiesPage({Key key}) : super(key: key);
final int facilitiesType;
FacilitiesPage({Key key, this.facilitiesType}) : super(key: key);
@override
_FacilitiesPageState createState() => _FacilitiesPageState();
@ -20,9 +20,7 @@ class FacilitiesPage extends StatefulWidget {
class _FacilitiesPageState extends State<FacilitiesPage>
with TickerProviderStateMixin {
List<String> get _tabs {
return UserTool.userProvider.infoModel.canOperation
? ['待检查', '未完成', '已完成']
: ['待检查', '已完成'];
return ['待检查', '未完成', '已完成'];
}
TabController _tabController;
@ -52,6 +50,7 @@ class _FacilitiesPageState extends State<FacilitiesPage>
children: List.generate(
_tabs.length,
(index) => FacilitiesView(
facilitiesType: widget.facilitiesType,
index: index,
)),
),

@ -0,0 +1,65 @@
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart';
class FacilitiesSelectPage extends StatefulWidget {
FacilitiesSelectPage({Key key}) : super(key: key);
@override
_FacilitiesSelectPageState createState() => _FacilitiesSelectPageState();
}
class _FacilitiesSelectPageState extends State<FacilitiesSelectPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '借还管理',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 40.w, horizontal: 36.w),
children: [
_buidTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '设施检查', 1),
_buidTile(R.ASSETS_MANAGE_IC_RENWU_PNG, '设备检查', 2),
].sepWidget(separate: 20.w.heightBox),
),
);
}
Widget _buidTile(String iconPath, String text, int type) {
return Row(
children: [
SizedBox(
width: 32.w,
height: 32.w,
child: Image.asset(iconPath),
),
28.w.widthBox,
text.text.black.size(30.sp).make(),
Spacer(),
Icon(
CupertinoIcons.chevron_forward,
size: 32.w,
),
],
)
.box
.padding(EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w))
.make()
.onInkTap(() {
Get.to(
() => FacilitiesPage(
facilitiesType: type,
),
);
}).material(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
clipBehavior: Clip.antiAlias,
);
}
}

@ -0,0 +1,66 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/facilities/facilities_check_list_model.dart';
import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
// Project imports:
class FacilitiesView extends StatefulWidget {
final int index;
final int facilitiesType;
FacilitiesView({Key key, this.index, this.facilitiesType}) : super(key: key);
@override
_FacilitiesViewState createState() => _FacilitiesViewState();
}
class _FacilitiesViewState extends State<FacilitiesView> {
EasyRefreshController _refreshController;
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manage.facilitiesCheckList,
extraParams: {
"facilitiesType": widget.facilitiesType,
"executeStatus": widget.index + 1,
},
controller: _refreshController,
convert: (models) {
return models.tableList
.map((e) => FacilitiesCheckListModel.fromJson(e)).toList();
},
builder: (items) {
return ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
return FacilitiesCard(
index: widget.index,
model:items[index],
);
},
separatorBuilder: (_, __) {
return 24.w.heightBox;
},
itemCount: items.length);
});
}
}
Loading…
Cancel
Save