|
|
@ -1,8 +1,10 @@
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/dispatch_detail_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/dispatch_detail_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/dispatch_report_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/fixed_detail_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/fixed_detail_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/work_order_type_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/work_time_limit_model.dart';
|
|
|
|
import 'package:aku_community_manager/tools/aku_map.dart';
|
|
|
|
import 'package:aku_community_manager/tools/aku_map.dart';
|
|
|
|
import 'package:aku_community_manager/utils/network/manage_func.dart';
|
|
|
|
import 'package:aku_community_manager/utils/network/manage_func.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -11,7 +13,6 @@ 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:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
@ -21,7 +22,6 @@ import 'package:aku_community_manager/provider/user_provider.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/widget_tool.dart';
|
|
|
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fixer_department_page.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
|
|
|
|
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';
|
|
|
@ -47,6 +47,9 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
EasyRefreshController _easyRefreshController;
|
|
|
|
EasyRefreshController _easyRefreshController;
|
|
|
|
|
|
|
|
|
|
|
|
List<DispatchDetialModel> _dispatchModels;
|
|
|
|
List<DispatchDetialModel> _dispatchModels;
|
|
|
|
|
|
|
|
List<WorkTimeLimitModel> _timeLimitModels;
|
|
|
|
|
|
|
|
List<WorkOrderTypeModel> _workTypeModels;
|
|
|
|
|
|
|
|
DispatchReportModel _reportModel = DispatchReportModel.zero();
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
@ -134,6 +137,9 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
onRefresh: () async {
|
|
|
|
onRefresh: () async {
|
|
|
|
_detailModel = await ManageFunc.repairDetail(widget.model.id);
|
|
|
|
_detailModel = await ManageFunc.repairDetail(widget.model.id);
|
|
|
|
_onload = false;
|
|
|
|
_onload = false;
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: _onload
|
|
|
|
child: _onload
|
|
|
|
? _empty()
|
|
|
|
? _empty()
|
|
|
@ -141,7 +147,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_buildInfo(),
|
|
|
|
_buildInfo(),
|
|
|
|
_buildType(widget.model.type == FIX_ENUM.HAND_OUT),
|
|
|
|
_buildType(widget.model.status == 1),
|
|
|
|
_buildProcess(),
|
|
|
|
_buildProcess(),
|
|
|
|
_detailModel.handlingSituation == null
|
|
|
|
_detailModel.handlingSituation == null
|
|
|
|
? SizedBox()
|
|
|
|
? SizedBox()
|
|
|
@ -156,15 +162,15 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
final userProvider =
|
|
|
|
final userProvider =
|
|
|
|
Provider.of<UserProvider>(context, listen: false);
|
|
|
|
Provider.of<UserProvider>(context, listen: false);
|
|
|
|
if (widget.model.type == FIX_ENUM.HAND_OUT) {
|
|
|
|
if (userProvider.infoModel.canOperation) {
|
|
|
|
return AkuMaterialButton(
|
|
|
|
return AkuMaterialButton(
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
|
onPressed: detailModel.type != null &&
|
|
|
|
onPressed: _reportModel.type != null &&
|
|
|
|
detailModel.subType != null &&
|
|
|
|
_reportModel.workOrderTyoe != null &&
|
|
|
|
detailModel.limit != null
|
|
|
|
_reportModel.workOrderTimeLimit != null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Get.to(FixerDepartmentPage(model: widget.model));
|
|
|
|
// Get.to(FixerDepartmentPage(model: widget.model));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
@ -174,8 +180,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else if (widget.model.type == FIX_ENUM.WAIT_PICKUP) {
|
|
|
|
} else if (widget.model.status == 3) {
|
|
|
|
if (userProvider.userInfoModel.role == USER_ROLE.MANAGER) {
|
|
|
|
if (userProvider.infoModel.canOperation) {
|
|
|
|
return AkuMaterialButton(
|
|
|
|
return AkuMaterialButton(
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
@ -214,8 +220,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (widget.model.type == FIX_ENUM.PROCESSING &&
|
|
|
|
} else if ((widget.model.status >= 4 && widget.model.status <= 4) &&
|
|
|
|
userProvider.userInfoModel.role == USER_ROLE.FIXER)
|
|
|
|
userProvider.infoModel.canPickUpTicket)
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: 96.w,
|
|
|
|
height: 96.w,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
@ -336,7 +342,9 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'派单类型',
|
|
|
|
'派单类型',
|
|
|
|
fixType,
|
|
|
|
_dispatchModels==null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _dispatchModels[_reportModel.type]?.showName,
|
|
|
|
canTap,
|
|
|
|
canTap,
|
|
|
|
helpContent: '请选择服务类型',
|
|
|
|
helpContent: '请选择服务类型',
|
|
|
|
onTap: () async {
|
|
|
|
onTap: () async {
|
|
|
@ -346,9 +354,9 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
showItemSheet(
|
|
|
|
showItemSheet(
|
|
|
|
title: '派单类型',
|
|
|
|
title: '派单类型',
|
|
|
|
items: _dispatchModels.map((e) => e.showName).toList(),
|
|
|
|
items: _dispatchModels.map((e) => e.showName).toList(),
|
|
|
|
selectItem: fixPaymentMap[detailModel.type],
|
|
|
|
selectItem: _reportModel.type,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.type = fixPaymentStringMap[result];
|
|
|
|
_reportModel.type = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
@ -357,16 +365,21 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'工单时限',
|
|
|
|
'工单时限',
|
|
|
|
dateLimit,
|
|
|
|
_timeLimitModels==null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _timeLimitModels[_reportModel.workOrderTimeLimit]?.name,
|
|
|
|
canTap,
|
|
|
|
canTap,
|
|
|
|
helpContent: '请选择工单时限',
|
|
|
|
helpContent: '请选择工单时限',
|
|
|
|
onTap: () {
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
List models = await ManageFunc.workOrderTimeType();
|
|
|
|
|
|
|
|
_timeLimitModels =
|
|
|
|
|
|
|
|
models.map((e) => WorkTimeLimitModel.fromJson(e)).toList();
|
|
|
|
showItemSheet(
|
|
|
|
showItemSheet(
|
|
|
|
title: '工单时限',
|
|
|
|
title: '工单时限',
|
|
|
|
items: ['24小时内处理', '12小时内处理', '8小时内处理'],
|
|
|
|
items: _timeLimitModels.map((e) => e.name).toList(),
|
|
|
|
selectItem: fixDateLimitMap[detailModel.limit],
|
|
|
|
selectItem: _reportModel.workOrderTimeLimit,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.limit = fixDateLimitStringMap[result];
|
|
|
|
_reportModel.workOrderTimeLimit = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
@ -375,16 +388,21 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'工单子类',
|
|
|
|
'工单子类',
|
|
|
|
subType,
|
|
|
|
_workTypeModels==null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _workTypeModels[_reportModel.workOrderTyoe].name,
|
|
|
|
canTap,
|
|
|
|
canTap,
|
|
|
|
helpContent: '请选择工单子类',
|
|
|
|
helpContent: '请选择工单子类',
|
|
|
|
onTap: () {
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
List models = await ManageFunc.workOrderTypeDetail(widget.model.id);
|
|
|
|
|
|
|
|
_workTypeModels =
|
|
|
|
|
|
|
|
models.map((e) => WorkOrderTypeModel.fromJson(e)).toList();
|
|
|
|
showItemSheet(
|
|
|
|
showItemSheet(
|
|
|
|
title: '工单子类',
|
|
|
|
title: '工单子类',
|
|
|
|
items: ['一般单', '加急单'],
|
|
|
|
items: _workTypeModels.map((e) => e.name).toList(),
|
|
|
|
selectItem: fixSubTypeMap[detailModel.subType],
|
|
|
|
selectItem: _reportModel.workOrderTyoe,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.subType = fixSubTypeStringMap[result];
|
|
|
|
_reportModel.workOrderTyoe = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|