|
|
@ -1,29 +1,39 @@
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
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_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/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/ui/sub_pages/business_and_fix/fix_more_time_page.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fix_work_finish_page.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fixer_department_page.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/utils/network/base_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/utils/network/manage_func.dart';
|
|
|
|
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
// Package imports:
|
|
|
|
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:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.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/fix/fix_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
|
|
|
import 'package:aku_community_manager/mock_models/users/user_info_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/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/fix_more_time_page.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fix_work_finish_page.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';
|
|
|
|
|
|
|
|
|
|
|
|
class BusinessAndFixDetailPage extends StatefulWidget {
|
|
|
|
class BusinessAndFixDetailPage extends StatefulWidget {
|
|
|
|
final FixModel model;
|
|
|
|
final BussinessAndFixModel model;
|
|
|
|
BusinessAndFixDetailPage({Key key, this.model}) : super(key: key);
|
|
|
|
BusinessAndFixDetailPage({Key key, this.model}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -37,103 +47,91 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
return userProvider.userInfoModel.role;
|
|
|
|
return userProvider.userInfoModel.role;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool get isHandOut => widget.model.type == FIX_ENUM.HAND_OUT;
|
|
|
|
bool get isHandOut => widget.model.status == 1;
|
|
|
|
FixDetailModel get detailModel => widget.model.detail;
|
|
|
|
FixedDetailModel _detailModel;
|
|
|
|
|
|
|
|
bool _onload = true;
|
|
|
|
|
|
|
|
EasyRefreshController _easyRefreshController;
|
|
|
|
|
|
|
|
|
|
|
|
String get fixType {
|
|
|
|
List<DispatchDetialModel> _dispatchModels;
|
|
|
|
switch (detailModel.type) {
|
|
|
|
List<WorkTimeLimitModel> _timeLimitModels;
|
|
|
|
case FIX_PAYMENT_TYPE.FREE:
|
|
|
|
List<WorkOrderTypeModel> _workTypeModels;
|
|
|
|
return '无偿服务';
|
|
|
|
DispatchReportModel _reportModel = DispatchReportModel.zero();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FIX_PAYMENT_TYPE.PAY:
|
|
|
|
@override
|
|
|
|
return '有偿服务';
|
|
|
|
void initState() {
|
|
|
|
break;
|
|
|
|
super.initState();
|
|
|
|
default:
|
|
|
|
_easyRefreshController = EasyRefreshController();
|
|
|
|
return '';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String get dateLimit {
|
|
|
|
@override
|
|
|
|
switch (detailModel.limit) {
|
|
|
|
void dispose() {
|
|
|
|
case FIX_DATE_LIMIT.HOUR_24:
|
|
|
|
_easyRefreshController?.dispose();
|
|
|
|
return '24小时内处理';
|
|
|
|
super.dispose();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FIX_DATE_LIMIT.HOUR_12:
|
|
|
|
|
|
|
|
return '12小时内处理';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FIX_DATE_LIMIT.HOUR_8:
|
|
|
|
|
|
|
|
return '8小时内处理';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String get subType {
|
|
|
|
Widget fixTypeWidget() {
|
|
|
|
switch (detailModel.subType) {
|
|
|
|
UserProvider userProvider =
|
|
|
|
case FIX_SUB_TYPE.NORMAL:
|
|
|
|
Provider.of<UserProvider>(context, listen: false);
|
|
|
|
return '一般单';
|
|
|
|
return Text(
|
|
|
|
break;
|
|
|
|
AkuMap.fixStatus(userProvider.infoModel.canOperation,
|
|
|
|
case FIX_SUB_TYPE.HURRY:
|
|
|
|
userProvider.infoModel.canPickUpTicket, widget.model.status),
|
|
|
|
return '加急单';
|
|
|
|
style: TextStyle(
|
|
|
|
break;
|
|
|
|
color: widget.model.status < 4
|
|
|
|
default:
|
|
|
|
? Color(0XFFFF4501)
|
|
|
|
return '';
|
|
|
|
: AppStyle.minorTextColor,
|
|
|
|
break;
|
|
|
|
),
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget get fixTypeWidget {
|
|
|
|
Widget _empty() {
|
|
|
|
if (userRole == USER_ROLE.MANAGER) {
|
|
|
|
return Container();
|
|
|
|
return Text(
|
|
|
|
|
|
|
|
FixModel.managerRoleMap[widget.model.type],
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: widget.model.type != FIX_ENUM.DONE
|
|
|
|
|
|
|
|
? Color(0XFFFF4501)
|
|
|
|
|
|
|
|
: AppStyle.minorTextColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return Text(
|
|
|
|
|
|
|
|
FixModel.otherRoleMap[widget.model.type],
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: widget.model.type != FIX_ENUM.DONE
|
|
|
|
|
|
|
|
? Color(0XFFFF4501)
|
|
|
|
|
|
|
|
: AppStyle.minorTextColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AkuScaffold(
|
|
|
|
return AkuScaffold(
|
|
|
|
title: '报修详情',
|
|
|
|
title: '报修详情',
|
|
|
|
body: ListView(
|
|
|
|
body: EasyRefresh(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
firstRefresh: true,
|
|
|
|
children: [
|
|
|
|
controller: _easyRefreshController,
|
|
|
|
_buildInfo(),
|
|
|
|
header: MaterialHeader(),
|
|
|
|
_buildType(widget.model.type == FIX_ENUM.HAND_OUT),
|
|
|
|
onRefresh: () async {
|
|
|
|
_buildProcess(),
|
|
|
|
_detailModel = await ManageFunc.repairDetail(widget.model.id);
|
|
|
|
detailModel.result == null ? SizedBox() : _buildResult(),
|
|
|
|
_reportModel.dispatchListId = widget.model.id;
|
|
|
|
detailModel.review == null ? SizedBox() : _buildRating(),
|
|
|
|
_reportModel.workOrderTyoe = 1;
|
|
|
|
],
|
|
|
|
_onload = false;
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: _onload
|
|
|
|
|
|
|
|
? _empty()
|
|
|
|
|
|
|
|
: ListView(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_buildInfo(),
|
|
|
|
|
|
|
|
_buildType(widget.model.status == 1),
|
|
|
|
|
|
|
|
_buildProcess(),
|
|
|
|
|
|
|
|
_detailModel.handlingSituation == null
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: _buildResult(),
|
|
|
|
|
|
|
|
_detailModel.evaluateInfo == null
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: _buildRating(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottom: Builder(
|
|
|
|
bottom: Builder(
|
|
|
|
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&&widget.model.status<2) {
|
|
|
|
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: _reportModel));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
@ -143,14 +141,14 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else if (widget.model.type == FIX_ENUM.WAIT_PICKUP) {
|
|
|
|
} else if (widget.model.status == 2) {
|
|
|
|
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,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Get.to(FixerDepartmentPage(
|
|
|
|
Get.to(FixerDepartmentPage(
|
|
|
|
model: widget.model,
|
|
|
|
model: _reportModel,
|
|
|
|
changeType: true,
|
|
|
|
changeType: true,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -165,15 +163,14 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
return AkuMaterialButton(
|
|
|
|
return AkuMaterialButton(
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
|
nullColor: AppStyle.minorColor,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async {
|
|
|
|
final userProvider =
|
|
|
|
BaseModel baseModel =
|
|
|
|
Provider.of<UserProvider>(context, listen: false);
|
|
|
|
await ManageFunc.recevingOrders(widget.model.dispatchId);
|
|
|
|
detailModel.fixStatuses.add(FixStatus(
|
|
|
|
if (baseModel.status) {
|
|
|
|
title: '${userProvider.userInfoModel.nickName}已接单',
|
|
|
|
Get.back();
|
|
|
|
date: DateTime.now(),
|
|
|
|
} else {
|
|
|
|
));
|
|
|
|
BotToast.showText(text: baseModel.message);
|
|
|
|
widget.model.type = FIX_ENUM.PROCESSING;
|
|
|
|
}
|
|
|
|
Get.back();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'立即接单',
|
|
|
|
'立即接单',
|
|
|
@ -183,8 +180,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (widget.model.type == FIX_ENUM.PROCESSING &&
|
|
|
|
} else if ((widget.model.status==3) &&
|
|
|
|
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,
|
|
|
@ -212,7 +209,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Get.to(FixMoreTimePage(model: widget.model));
|
|
|
|
Get.to(
|
|
|
|
|
|
|
|
FixMoreTimePage(dispatchId: widget.model.dispatchId));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'申请延时',
|
|
|
|
'申请延时',
|
|
|
@ -228,7 +226,11 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
radius: 4.w,
|
|
|
|
radius: 4.w,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Get.to(FixWorkFinishPage(model: widget.model));
|
|
|
|
Get.to(FixWorkFinishPage(
|
|
|
|
|
|
|
|
fixModel: widget.model,
|
|
|
|
|
|
|
|
model: _detailModel,
|
|
|
|
|
|
|
|
dispatchType:
|
|
|
|
|
|
|
|
_detailModel.dispatchType.dispatchType == 1));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'处理完成',
|
|
|
|
'处理完成',
|
|
|
@ -251,27 +253,27 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
_buildInfo() {
|
|
|
|
_buildInfo() {
|
|
|
|
return AkuTitleBox(
|
|
|
|
return AkuTitleBox(
|
|
|
|
title: '报修信息',
|
|
|
|
title: '报修信息',
|
|
|
|
suffix: fixTypeWidget,
|
|
|
|
suffix: fixTypeWidget(),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AkuBox.h(16),
|
|
|
|
AkuBox.h(16),
|
|
|
|
_buildTile(
|
|
|
|
_buildTile(
|
|
|
|
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
|
|
|
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
|
|
|
'报修人',
|
|
|
|
'报修人',
|
|
|
|
widget.model.detail.userName,
|
|
|
|
_detailModel.repairDetail.name,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTile(
|
|
|
|
_buildTile(
|
|
|
|
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
|
|
|
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
|
|
|
'联系电话',
|
|
|
|
'联系电话',
|
|
|
|
widget.model.detail.userPhoneNumber,
|
|
|
|
_detailModel.repairDetail.tel,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTile(
|
|
|
|
_buildTile(
|
|
|
|
R.ASSETS_MESSAGE_IC_AREA_PNG,
|
|
|
|
R.ASSETS_MESSAGE_IC_AREA_PNG,
|
|
|
|
'报修区域',
|
|
|
|
'报修区域',
|
|
|
|
widget.model.detail.fixArea,
|
|
|
|
AkuMap.fixAreaType[_detailModel.repairDetail.type],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.h(8),
|
|
|
|
AkuBox.h(8),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
widget.model.title,
|
|
|
|
widget.model.reportDetail,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
@ -285,10 +287,11 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
crossAxisSpacing: 16.w,
|
|
|
|
crossAxisSpacing: 16.w,
|
|
|
|
mainAxisSpacing: 16.w,
|
|
|
|
mainAxisSpacing: 16.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
children: widget.model.imgs.map((e) {
|
|
|
|
children: _detailModel.repairDetail.imgUrls.map((e) {
|
|
|
|
return ClipRRect(
|
|
|
|
return ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
child: (e is String) ? Image.asset(e) : Image.file(e),
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: e.url),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
@ -304,54 +307,93 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'派单类型',
|
|
|
|
'派单类型',
|
|
|
|
fixType,
|
|
|
|
canTap
|
|
|
|
|
|
|
|
? _dispatchModels == null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _dispatchModels[_dispatchModels.indexWhere(
|
|
|
|
|
|
|
|
(element) => element.showValue == _reportModel.type)]
|
|
|
|
|
|
|
|
.showName
|
|
|
|
|
|
|
|
: AkuMap.dispatchType[_detailModel.dispatchType.dispatchType],
|
|
|
|
canTap,
|
|
|
|
canTap,
|
|
|
|
helpContent: '请选择服务类型',
|
|
|
|
helpContent: '请选择服务类型',
|
|
|
|
onTap: () {
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
List models = await ManageFunc.dispatchListDetailType();
|
|
|
|
|
|
|
|
_dispatchModels =
|
|
|
|
|
|
|
|
models.map((e) => DispatchDetialModel.fromJson(e)).toList();
|
|
|
|
showItemSheet(
|
|
|
|
showItemSheet(
|
|
|
|
title: '派单类型',
|
|
|
|
title: '派单类型',
|
|
|
|
items: ['无偿服务', '有偿服务'],
|
|
|
|
items: _dispatchModels.map((e) => e.showName).toList(),
|
|
|
|
selectItem: fixPaymentMap[detailModel.type],
|
|
|
|
ids: _dispatchModels.map((e) => e.showValue).toList(),
|
|
|
|
|
|
|
|
selectItem: _reportModel.type,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.type = fixPaymentStringMap[result];
|
|
|
|
_reportModel.type = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
|
|
|
|
if (_reportModel.type == -1) {
|
|
|
|
|
|
|
|
_dispatchModels = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'工单时限',
|
|
|
|
'工单时限',
|
|
|
|
dateLimit,
|
|
|
|
canTap
|
|
|
|
|
|
|
|
? _timeLimitModels == null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _timeLimitModels[_timeLimitModels.indexWhere((element) =>
|
|
|
|
|
|
|
|
element.id == _reportModel.workOrderTimeLimit)]
|
|
|
|
|
|
|
|
?.name
|
|
|
|
|
|
|
|
: _detailModel.dispatchType.workOrderLimitName,
|
|
|
|
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],
|
|
|
|
ids: _timeLimitModels.map((e) => e.id).toList(),
|
|
|
|
|
|
|
|
selectItem: _reportModel.workOrderTimeLimit,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.limit = fixDateLimitStringMap[result];
|
|
|
|
_reportModel.workOrderTimeLimit = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
|
|
|
|
if (_reportModel.workOrderTimeLimit == -1) {
|
|
|
|
|
|
|
|
_timeLimitModels = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_buildTypeTile(
|
|
|
|
_buildTypeTile(
|
|
|
|
'工单子类',
|
|
|
|
'工单子类',
|
|
|
|
subType,
|
|
|
|
canTap
|
|
|
|
|
|
|
|
? _workTypeModels == null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: _workTypeModels[_workTypeModels.indexWhere((element) =>
|
|
|
|
|
|
|
|
element.id == _reportModel.workOrderTypeDetail)]
|
|
|
|
|
|
|
|
.name
|
|
|
|
|
|
|
|
: _detailModel.dispatchType.workOrderSubclassName,
|
|
|
|
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],
|
|
|
|
ids: _workTypeModels.map((e) => e.id).toList(),
|
|
|
|
|
|
|
|
selectItem: _reportModel.workOrderTypeDetail,
|
|
|
|
onTap: (result) {
|
|
|
|
onTap: (result) {
|
|
|
|
detailModel.subType = fixSubTypeStringMap[result];
|
|
|
|
_reportModel.workOrderTypeDetail = result;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).then((_) {
|
|
|
|
).then((_) {
|
|
|
|
|
|
|
|
if (_reportModel.workOrderTypeDetail == -1) {
|
|
|
|
|
|
|
|
_workTypeModels = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -363,10 +405,11 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
_buildProcess() {
|
|
|
|
_buildProcess() {
|
|
|
|
return AkuTitleBox(
|
|
|
|
return AkuTitleBox(
|
|
|
|
title: '报修进程',
|
|
|
|
title: '报修进程',
|
|
|
|
children: detailModel.fixStatuses.map((e) {
|
|
|
|
children: _detailModel.processRecord.map((e) {
|
|
|
|
return _buildProcessTile(
|
|
|
|
return _buildProcessTile(
|
|
|
|
e.title,
|
|
|
|
AkuMap.operationType[e.operationType],
|
|
|
|
DateUtil.formatDate(e.date, format: 'yyyy-MM-dd HH:mm:ss'),
|
|
|
|
DateUtil.formatDateStr(e.operationDate,
|
|
|
|
|
|
|
|
format: 'yyyy-MM-dd HH:mm:ss'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -386,7 +429,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.h(8),
|
|
|
|
AkuBox.h(8),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
detailModel.result.detail,
|
|
|
|
_detailModel.handlingSituation.detail,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontSize: 28.w,
|
|
|
|
fontSize: 28.w,
|
|
|
@ -403,7 +446,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.h(8),
|
|
|
|
AkuBox.h(8),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
detailModel.result.material,
|
|
|
|
_detailModel.handlingSituation.materialList,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontSize: 28.w,
|
|
|
|
fontSize: 28.w,
|
|
|
@ -425,19 +468,11 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 4,
|
|
|
|
crossAxisCount: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
children: detailModel.result.imgs.map((e) {
|
|
|
|
children: _detailModel.handlingSituation.imgUrls.map((e) {
|
|
|
|
return ClipRRect(
|
|
|
|
return ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
child: (e is String)
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
? Image.asset(
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: e.url));
|
|
|
|
e,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Image.file(
|
|
|
|
|
|
|
|
e,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -459,7 +494,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
_buildStar(detailModel.review.rate),
|
|
|
|
_buildStar(5),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.h(24),
|
|
|
|
AkuBox.h(24),
|
|
|
@ -472,7 +507,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
AkuBox.h(8),
|
|
|
|
AkuBox.h(8),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
detailModel.review.content,
|
|
|
|
_detailModel.evaluateInfo,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
color: AppStyle.primaryTextColor,
|
|
|
|
fontSize: 28.w,
|
|
|
|
fontSize: 28.w,
|
|
|
|