|
|
@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:power_logger/power_logger.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class WorkOrderPage extends StatefulWidget {
|
|
|
|
class WorkOrderPage extends StatefulWidget {
|
|
|
@ -47,8 +48,9 @@ class _WorkOrderPageState extends State<WorkOrderPage>
|
|
|
|
title: '报事报修',
|
|
|
|
title: '报事报修',
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () async {
|
|
|
|
Get.to(() => PublishWorkOrderPage());
|
|
|
|
await Get.to(() => PublishWorkOrderPage());
|
|
|
|
|
|
|
|
_refreshController.callRefresh();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
icon: Icon(
|
|
|
|
icon: Icon(
|
|
|
|
CupertinoIcons.plus_circle,
|
|
|
|
CupertinoIcons.plus_circle,
|
|
|
@ -69,16 +71,23 @@ class _WorkOrderPageState extends State<WorkOrderPage>
|
|
|
|
Widget _getOrderView(int index) {
|
|
|
|
Widget _getOrderView(int index) {
|
|
|
|
return EasyRefresh(
|
|
|
|
return EasyRefresh(
|
|
|
|
firstRefresh: true,
|
|
|
|
firstRefresh: true,
|
|
|
|
|
|
|
|
controller: _refreshController,
|
|
|
|
header: MaterialHeader(),
|
|
|
|
header: MaterialHeader(),
|
|
|
|
|
|
|
|
footer: MaterialFooter(),
|
|
|
|
onRefresh: () async {
|
|
|
|
onRefresh: () async {
|
|
|
|
_page = 1;
|
|
|
|
_page = 1;
|
|
|
|
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
|
|
|
|
_models.clear();
|
|
|
|
'pageNum': _page,
|
|
|
|
try {
|
|
|
|
'size': _size,
|
|
|
|
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
|
|
|
|
'status': index == 0 ? null : index,
|
|
|
|
'pageNum': _page,
|
|
|
|
});
|
|
|
|
'size': _size,
|
|
|
|
_models =
|
|
|
|
'status': index == 0 ? null : index,
|
|
|
|
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
|
|
|
|
});
|
|
|
|
|
|
|
|
_models =
|
|
|
|
|
|
|
|
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
LoggerData.addData(e.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad: () async {
|
|
|
|
onLoad: () async {
|
|
|
@ -93,7 +102,7 @@ class _WorkOrderPageState extends State<WorkOrderPage>
|
|
|
|
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
|
|
|
|
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_refreshController.finishLoad();
|
|
|
|
_refreshController.finishLoad(noMore: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: ListView.separated(
|
|
|
|
child: ListView.separated(
|
|
|
|