From c356c705762c43017a1d4410f92fa011d927530d Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Tue, 23 Feb 2021 18:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=EF=BC=9A=E6=94=B9=E6=B4=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/const/api.dart | 4 ++- .../business_and_fix_detail_page.dart | 8 +++--- .../fixer_department_page.dart | 7 ++++++ lib/utils/network/manage_func.dart | 25 ++++++++++++------- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/lib/const/api.dart b/lib/const/api.dart index f570120..11b7675 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -75,5 +75,7 @@ class _Manage { ///报事报修:报事报修:派单 String get repairDispatch => '/user/repair/dispatch'; - + + ///报事报修:改派 + String get repairReassignment => '/user/repair/reassignment'; } diff --git a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart index 39c5011..e1f8209 100644 --- a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart +++ b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart @@ -143,10 +143,10 @@ class _BusinessAndFixDetailPageState extends State { color: AppStyle.primaryColor, nullColor: AppStyle.minorColor, onPressed: () { - // Get.to(FixerDepartmentPage( - // model: widget.model, - // changeType: true, - // )); + Get.to(FixerDepartmentPage( + model:_reportModel , + changeType: true, + )); }, child: Text( '改派', diff --git a/lib/ui/sub_pages/business_and_fix/fixer_department_page.dart b/lib/ui/sub_pages/business_and_fix/fixer_department_page.dart index 0e74024..53c2000 100644 --- a/lib/ui/sub_pages/business_and_fix/fixer_department_page.dart +++ b/lib/ui/sub_pages/business_and_fix/fixer_department_page.dart @@ -63,6 +63,13 @@ class _FixerDepartmentPageState extends State { height: 96.w, onPressed: () async { if (widget.changeType) { + BaseModel baseModel = await ManageFunc.repairReassignment( + _reportModel.dispatchListId, _reportModel.operato); + if (baseModel.status) { + Get.back(); + } else { + BotToast.showText(text: baseModel.message); + } } else { BaseModel baseModel = await ManageFunc.repairDispatch(_reportModel); if (baseModel.status) { diff --git a/lib/utils/network/manage_func.dart b/lib/utils/network/manage_func.dart index e278c65..1a76975 100644 --- a/lib/utils/network/manage_func.dart +++ b/lib/utils/network/manage_func.dart @@ -35,15 +35,22 @@ class ManageFunc { } static Future repairDispatch(DispatchReportModel model) async { - BaseModel baseModel = await NetUtil().get(API.manage.repairDispatch, params:{ - 'dispatchListId':model.dispatchListId, - 'workOrderType':model.workOrderTyoe, - 'workOrderTypeDetail':model.workOrderTypeDetail, - 'workOrderTimeLimit':model.workOrderTimeLimit, - 'type':model.type, - 'operator':model.operato, - 'remake':model.remark, + BaseModel baseModel = + await NetUtil().get(API.manage.repairDispatch, params: { + 'dispatchListId': model.dispatchListId, + 'workOrderType': model.workOrderTyoe, + 'workOrderTypeDetail': model.workOrderTypeDetail, + 'workOrderTimeLimit': model.workOrderTimeLimit, + 'type': model.type, + 'operator': model.operato, + 'remake': model.remark, }); - return baseModel; + return baseModel; + } + + static Future repairReassignment(int id, int operato) async { + BaseModel baseModel = await NetUtil().get(API.manage.repairReassignment, + params: {'dispatchListId': id, 'operator': operato}); + return baseModel; } }