修改完成报告部分bug

master
戴余标 2 years ago
parent c572d7045e
commit a44cedeb31

@ -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'
}

@ -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<FinishReportPage> {
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<FinishReportPage> {
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<FinishReportPage> {
}
Widget _costTile(WorkOrderFinishCostDTOList model, int index) {
int _type = 1;
return Column(
children: [
32.w.heightBox,
@ -250,14 +259,20 @@ class _FinishReportPageState extends State<FinishReportPage> {
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<FinishReportPage> {
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<FinishReportPage> {
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<FinishReportPage> {
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(

@ -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<ReceiverDetailPage> {
case 4:
return BottomPluralButtonWidget(
onLeftTap: () {},
onRightTap: () {},
onLeftTap: () {
Get.to(() => ReportProgress(id: widget.id,));
},
onRightTap: () {
Get.to(() => FinishReportPage(id:widget.id));
},
leftTitle: '提交报告',
rightTitle: '完成工单');

@ -122,7 +122,7 @@ class WorkOrderFuc {
required String content,
required List<String> imgUrls,
}) async {
var base = await NetUtil().post(SAASAPI.workOrder.insert,
var base = await NetUtil().post(SAASAPI.workOrder.report,
params: {
'workOrderId': workOrderId,
'content': content,

Loading…
Cancel
Save