From a44cedeb31ed74e8cb578add4fb9adf801f4e23b Mon Sep 17 00:00:00 2001 From: datang Date: Thu, 9 Jun 2022 18:23:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 2 +- lib/new_ui/work_order/finish_report_page.dart | 43 +++++++++++++++---- .../receiver/receiver_detail_page.dart | 10 ++++- lib/new_ui/work_order/work_order_func.dart | 2 +- 4 files changed, 45 insertions(+), 12 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 453ed67..73d2110 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,6 +106,6 @@ dependencies { // implementation platform('com.google.firebase:firebase-bom:27.0.0') //implementation 'com.google.firebase:firebase-analytics' implementation 'com.amap.api:3dmap:latest.integration' - implementation 'com.amap.api:location:5.2.0' +// implementation 'com.amap.api:location:5.2.0' implementation 'com.android.support:multidex:2.0.1' } diff --git a/lib/new_ui/work_order/finish_report_page.dart b/lib/new_ui/work_order/finish_report_page.dart index fc17254..db5fa06 100644 --- a/lib/new_ui/work_order/finish_report_page.dart +++ b/lib/new_ui/work_order/finish_report_page.dart @@ -23,7 +23,8 @@ import 'package:velocity_x/src/extensions/num_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart'; class FinishReportPage extends StatefulWidget { - const FinishReportPage({Key? key}) : super(key: key); + final int id; + const FinishReportPage({Key? key, required this.id}) : super(key: key); @override _FinishReportPageState createState() => _FinishReportPageState(); @@ -45,6 +46,13 @@ class _FinishReportPageState extends State { return sum; } + @override + void initState() { + super.initState(); + _submitModel.workOrderId=widget.id; + } + + @override Widget build(BuildContext context) { return AkuScaffold( @@ -98,11 +106,11 @@ class _FinishReportPageState extends State { width: double.infinity, padding: EdgeInsets.symmetric(horizontal: 24.w), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.06), - borderRadius: BorderRadius.circular(16.w)), + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), child: Column( mainAxisSize: MainAxisSize.min, children: [ + 10.heightBox, Row( children: [ '上传图片' @@ -225,6 +233,7 @@ class _FinishReportPageState extends State { } Widget _costTile(WorkOrderFinishCostDTOList model, int index) { + int _type = 1; return Column( children: [ 32.w.heightBox, @@ -250,14 +259,20 @@ class _FinishReportPageState extends State { return BeePickerBox( onPressed: () { Get.back(); + model.costType = _type; setState(() {}); }, child: CupertinoPicker.builder( itemExtent: 60.w, childCount: WorkOrderMap.costType.keys.length, onSelectedItemChanged: (index) { - model.costType = - WorkOrderMap.costType.keys.toList()[index]; + var typeStr = + WorkOrderMap.costType.values.toList()[index]; + WorkOrderMap.costType.forEach((key, value) { + if (value == typeStr) { + _type = key; + } + }); }, itemBuilder: (context, index) { var str = @@ -330,7 +345,11 @@ class _FinishReportPageState extends State { FilteringTextInputFormatter.allow(RegExp(r'[0-9.]')), ], onChanged: (text) { - model.price = double.parse(text); + if (text.isNotEmpty) + model.price = double.parse(text); + else + model.price = 0; + setState(() {}); }, autofocus: false, decoration: InputDecoration( @@ -377,7 +396,11 @@ class _FinishReportPageState extends State { FilteringTextInputFormatter.digitsOnly, ], onChanged: (text) { - model.num = int.parse(text); + if (text.isNotEmpty) + model.num = int.parse(text); + else + model.num = 0; + setState(() {}); }, autofocus: false, decoration: InputDecoration( @@ -416,7 +439,11 @@ class _FinishReportPageState extends State { FilteringTextInputFormatter.allow(RegExp(r'[0-9.]')), ], onChanged: (text) { - model.price = double.parse(text); + if (text.isNotEmpty) + model.price = double.parse(text); + else + model.price = 0; + setState(() {}); }, autofocus: false, decoration: InputDecoration( diff --git a/lib/new_ui/work_order/receiver/receiver_detail_page.dart b/lib/new_ui/work_order/receiver/receiver_detail_page.dart index 92d2386..7517f88 100644 --- a/lib/new_ui/work_order/receiver/receiver_detail_page.dart +++ b/lib/new_ui/work_order/receiver/receiver_detail_page.dart @@ -22,7 +22,9 @@ import 'package:url_launcher/url_launcher.dart'; import 'package:velocity_x/src/extensions/num_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart'; +import '../finish_report_page.dart'; import '../history_report_page.dart'; +import '../report_progress.dart'; import '../team_list_page.dart'; import '../work_order_func.dart'; import '../work_order_map.dart'; @@ -230,8 +232,12 @@ class _ReceiverDetailPageState extends State { case 4: return BottomPluralButtonWidget( - onLeftTap: () {}, - onRightTap: () {}, + onLeftTap: () { + Get.to(() => ReportProgress(id: widget.id,)); + }, + onRightTap: () { + Get.to(() => FinishReportPage(id:widget.id)); + }, leftTitle: '提交报告', rightTitle: '完成工单'); diff --git a/lib/new_ui/work_order/work_order_func.dart b/lib/new_ui/work_order/work_order_func.dart index d949eb9..fd2d14c 100644 --- a/lib/new_ui/work_order/work_order_func.dart +++ b/lib/new_ui/work_order/work_order_func.dart @@ -122,7 +122,7 @@ class WorkOrderFuc { required String content, required List imgUrls, }) async { - var base = await NetUtil().post(SAASAPI.workOrder.insert, + var base = await NetUtil().post(SAASAPI.workOrder.report, params: { 'workOrderId': workOrderId, 'content': content,