对接:报事报修:查询所有的工单时限信息(id and name)

对接:报事报修:查询所有的工单类型明细信息(工单子类信息)
hmxc
张萌 4 years ago
parent d0a5f150a5
commit bec70947a3

@ -65,5 +65,12 @@ class _Manage {
String get repairDetail => '/user/repair/findById';
///-
String get dispatchListDetailType => 'system/dataDictionary/findSysDispatchListDetailType';
String get dispatchListDetailType => '/manage/dataDictionary/findSysDispatchListDetailType';
///(id and name)
String get workOrderTimeLimit => '/user/repair/findWorkOrderTimeLimit';
///
String get workOrderTypeDetail => '/user/repair/findWorkOrderTypeDetail';
}

@ -0,0 +1,27 @@
class DispatchReportModel {
int dispatchListId;
int workOrderTyoe;
int workOrderTypeDetail;
int workOrderTimeLimit;
int type;
int operato;
String remark;
DispatchReportModel.zero() {
dispatchListId = 0;
workOrderTyoe = 0;
workOrderTyoe = 0;
workOrderTimeLimit = 0;
type = 0;
operato = 0;
remark = '';
}
DispatchReportModel(
{this.dispatchListId,
this.operato,
this.remark,
this.type,
this.workOrderTimeLimit,
this.workOrderTyoe,
this.workOrderTypeDetail});
}

@ -0,0 +1,18 @@
class WorkOrderTypeModel {
int id;
String name;
WorkOrderTypeModel({this.id, this.name});
WorkOrderTypeModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}

@ -0,0 +1,18 @@
class WorkTimeLimitModel {
int id;
String name;
WorkTimeLimitModel({this.id, this.name});
WorkTimeLimitModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}

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

@ -1,11 +1,13 @@
// Flutter imports:
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_community_manager/tools/aku_map.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart';
import 'package:flutter/material.dart';
// Package imports:
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports:
@ -62,7 +64,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return GestureDetector(
onTap: () {
// Get.to(BusinessAndFixDetailPage(model: widget.model));
Get.to(BusinessAndFixDetailPage(model: widget.model));
},
child: Container(
padding: EdgeInsets.all(24.w),

@ -58,8 +58,8 @@ Future showNormalSheet(String title, List<Widget> children) async {
Future showItemSheet({
String title,
List<String> items,
String selectItem,
Function(String result) onTap,
int selectItem,
Function(int result) onTap,
}) async {
await showNormalSheet(
title,
@ -69,14 +69,14 @@ Future showItemSheet({
minWidth: double.infinity,
onPressed: () {
Get.back();
onTap(e);
onTap(items.indexOf(e));
},
child: Text(
e,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 32.sp,
color: e == selectItem
color: e == items[selectItem]
? AppStyle.secondaryColor
: AppStyle.primaryTextColor,
),

@ -1,4 +1,6 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/bussiness_and_fix/fixed_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:dio/dio.dart';
@ -8,12 +10,26 @@ class ManageFunc {
await NetUtil().dio.get(API.manage.repairDetail, queryParameters: {
'repairId': id,
});
return response.data;
return FixedDetailModel.fromJson(response.data);
}
static Future dispatchListDetailType() async {
Response response =
await NetUtil().dio.get(API.manage.dispatchListDetailType);
Response response = await NetUtil().dio.get(
'http://test.akuhotel.com:8804/IntelligentCommunity' +
API.manage.dispatchListDetailType);
return response.data as List;
}
static Future workOrderTimeType() async {
BaseModel baseModel = await NetUtil().get(API.manage.workOrderTimeLimit);
return baseModel.data as List;
}
static Future workOrderTypeDetail(int id) async {
BaseModel baseModel =
await NetUtil().get(API.manage.workOrderTypeDetail, params: {
'workOrderTypeId': id,
});
return baseModel.data as List;
}
}

@ -104,8 +104,15 @@ class NetUtil {
}) async {
try {
Response res = await _dio.get(path, queryParameters: params);
BaseListModel baseListModel = BaseListModel.fromJson(res.data);
return baseListModel;
if ((res.data as Map<String, dynamic>).containsKey('status') &&
(res.data as Map<String, dynamic>).containsKey('data') &&
(res.data as Map<String, dynamic>).containsKey('message')) {
BaseModel baseModel = BaseModel.fromJson(res.data);
_parseRequestError(baseModel);
} else {
BaseListModel baseListModel = BaseListModel.fromJson(res.data);
return baseListModel;
}
} on DioError catch (e) {
_parseErr(e);
}

Loading…
Cancel
Save