diff --git a/lib/mock_models/users/user_info_model.dart b/lib/mock_models/users/user_info_model.dart index adfa397..944acb0 100644 --- a/lib/mock_models/users/user_info_model.dart +++ b/lib/mock_models/users/user_info_model.dart @@ -1,6 +1,6 @@ // Dart imports: import 'dart:io'; - +@Deprecated('use ‘canOpertion/canSendTicket/canPickUpTicke/canPass’ instead') enum USER_ROLE { ///管家角色 MANAGER, @@ -17,7 +17,7 @@ enum USER_ROLE { ///无角色 EMPTY, } - +@Deprecated('use infoModel instead') class UserInfoModel { String nickName; File avatar; diff --git a/lib/tools/aku_map.dart b/lib/tools/aku_map.dart index ecabf6f..9f685cd 100644 --- a/lib/tools/aku_map.dart +++ b/lib/tools/aku_map.dart @@ -1,7 +1,7 @@ class AkuMap { ///根据权限返回不同的派单状态 - static String fixStatus(bool canOpention, bool canPickup, int status) { - if (canOpention) { + static String fixStatus(bool canSendTicket, bool canPickup, int status) { + if (canSendTicket) { switch (status) { case 1: return '待派单'; 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 509cb0c..fb70c57 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 @@ -24,7 +24,6 @@ import 'package:provider/provider.dart'; // Project imports: import 'package:aku_community_manager/const/resource.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/style/app_style.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; @@ -43,10 +42,6 @@ class BusinessAndFixDetailPage extends StatefulWidget { } class _BusinessAndFixDetailPageState extends State { - USER_ROLE get userRole { - final userProvider = Provider.of(context, listen: false); - return userProvider.userInfoModel.role; - } bool get isHandOut => widget.model.status == 1; FixedDetailModel _detailModel; @@ -98,7 +93,7 @@ class _BusinessAndFixDetailPageState extends State { header: MaterialHeader(), onRefresh: () async { _detailModel = await ManageFunc.repairDetail(widget.model.id); - _reportModel.dispatchListId = widget.model.id; + _reportModel.dispatchListId = widget.model.dispatchId; _reportModel.workOrderTyoe = 1; _onload = false; setState(() {}); @@ -132,7 +127,7 @@ class _BusinessAndFixDetailPageState extends State { _reportModel.workOrderTyoe != null && _reportModel.workOrderTimeLimit != null ? () { - Get.to(FixerDepartmentPage(model: _reportModel,dispatchId: _detailModel.repairDetail.dispatchId,)); + Get.to(FixerDepartmentPage(model: _reportModel)); } : null, child: Text( diff --git a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart index 4370c8d..ff0853c 100644 --- a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart +++ b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart @@ -212,7 +212,7 @@ class _BusinessFixCardState extends State { ), ) : SizedBox(), - (widget.model.status == 2) && (!userInfoModel.canSendTicket) + (widget.model.status == 2) && (userInfoModel.canPickUpTicket) ? AkuMaterialButton( onPressed: () { // final userProvider = @@ -223,6 +223,9 @@ class _BusinessFixCardState extends State { // )); // widget.model.type = FIX_ENUM.PROCESSING; // Get.back(); + Get.to(() => BusinessAndFixDetailPage( + model: widget.model, + )); }, radius: 4.w, color: AppStyle.primaryColor, diff --git a/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart b/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart index 4c707f3..3b9972a 100644 --- a/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart +++ b/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart @@ -348,12 +348,12 @@ class _FixWorkFinishPageState extends State { TextUtil.isEmpty( _materialPriceController.text)) { return Text('人工费或材料费不能为空'); - } - else + } else { humanPrice = double.tryParse(_humanController.text); - materialPrice = - double.tryParse(_materialPriceController.text); + materialPrice = double.tryParse( + _materialPriceController.text); + } return Text( '¥${(humanPrice + materialPrice).toStringAsFixed(2)}'); }, @@ -388,6 +388,13 @@ class _FixWorkFinishPageState extends State { // materialPrice: double.parse(_materialController.text), // ); // Get.back(); + if (!widget.dispatchType) { + if (TextUtil.isEmpty(_humanController.text) || + TextUtil.isEmpty(_materialPriceController.text)) { + BotToast.showText(text: '人工费或材料费不能为空'); + return; + } + } List urls = await NetUtil().uploadFiles(_imgs, API.upload.uploadArtical); BaseModel baseModel = await ManageFunc.handleResult( 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 6d313d1..e7cb0fe 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 @@ -24,9 +24,8 @@ import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; class FixerDepartmentPage extends StatefulWidget { final DispatchReportModel model; final bool changeType; - final int dispatchId; FixerDepartmentPage( - {Key key, @required this.model, this.changeType = false, this.dispatchId}) + {Key key, @required this.model, this.changeType = false,}) : super(key: key); @override @@ -93,8 +92,8 @@ class _FixerDepartmentPageState extends State { } } else { BaseModel baseModel = await ManageFunc.repairDispatch( - _reportModel, - dispatchId: widget.dispatchId); + _reportModel + ); if (baseModel.status) { Get.back(); Get.back(); diff --git a/lib/utils/network/manage_func.dart b/lib/utils/network/manage_func.dart index 58a87c5..967f596 100644 --- a/lib/utils/network/manage_func.dart +++ b/lib/utils/network/manage_func.dart @@ -40,12 +40,12 @@ class ManageFunc { } ///派单 - static Future repairDispatch(DispatchReportModel model, - {@required int dispatchId}) async { - print(dispatchId); + static Future repairDispatch( + DispatchReportModel model, + ) async { BaseModel baseModel = await NetUtil().post(API.manage.repairDispatch, params: { - 'dispatchListId': dispatchId, + 'dispatchListId': model.dispatchListId, 'workOrderType': model.workOrderTyoe, 'workOrderTypeDetail': model.workOrderTypeDetail, 'workOrderTimeLimit': model.workOrderTimeLimit,