领取工单~提交报告

master
戴余标 2 years ago
parent 4511f94d23
commit c572d7045e

@ -56,6 +56,7 @@ class _NewHomePageState extends State<NewHomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print(UserTool.userProvider.userInfoModel!.workOrderJurisdiction);
return Scaffold( return Scaffold(
extendBody: true, extendBody: true,
drawer: PersonalDraw(), drawer: PersonalDraw(),

@ -221,7 +221,6 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
} }
}, },
text: '移至待分配'); text: '移至待分配');
case 3: case 3:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
@ -231,7 +230,6 @@ class _DistributorDetailPageState extends State<DistributorDetailPage> {
} }
}, },
text: '提醒处理'); text: '提醒处理');
case 4: case 4:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {

@ -1,6 +1,7 @@
import 'package:aku_new_community_manager/gen/assets.gen.dart'; import 'package:aku_new_community_manager/gen/assets.gen.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart'; import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_detail_page.dart'; import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_detail_page.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/receiver_detail_page.dart';
import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart'; import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart';
import 'package:aku_new_community_manager/style/app_style.dart'; import 'package:aku_new_community_manager/style/app_style.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_hor_image_view.dart'; import 'package:aku_new_community_manager/ui/widgets/common/bee_hor_image_view.dart';
@ -54,7 +55,7 @@ class ReceiverCard extends StatelessWidget {
)), )),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Get.to(() => DistributorDetailPage( Get.to(() => ReceiverDetailPage(
id: model.id, id: model.id,
)); ));
}, },

@ -204,7 +204,7 @@ class _ReceiverDetailPageState extends State<ReceiverDetailPage> {
Widget _getBottomButton() { Widget _getBottomButton() {
switch (_model?.status) { switch (_model?.status) {
case 1: case 2:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
var re = await WorkOrderFuc.receiveTask(widget.id); var re = await WorkOrderFuc.receiveTask(widget.id);
@ -213,7 +213,7 @@ class _ReceiverDetailPageState extends State<ReceiverDetailPage> {
} }
}, },
text: '领取任务'); text: '领取任务');
case 2: case 3:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
Get.bottomSheet(UrgeDialog( Get.bottomSheet(UrgeDialog(
@ -228,14 +228,14 @@ class _ReceiverDetailPageState extends State<ReceiverDetailPage> {
}, },
text: '开始服务'); text: '开始服务');
case 3: case 4:
return BottomPluralButtonWidget( return BottomPluralButtonWidget(
onLeftTap: () {}, onLeftTap: () {},
onRightTap: () {}, onRightTap: () {},
leftTitle: '提交报告', leftTitle: '提交报告',
rightTitle: '完成工单'); rightTitle: '完成工单');
case 4: case 5:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
var re = await WorkOrderFuc.reminderConfirm(widget.id); var re = await WorkOrderFuc.reminderConfirm(widget.id);
@ -244,7 +244,7 @@ class _ReceiverDetailPageState extends State<ReceiverDetailPage> {
} }
}, },
text: '提醒用户确认'); text: '提醒用户确认');
case 5: case 6:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
WorkOrderFuc.getBill( WorkOrderFuc.getBill(
@ -259,14 +259,14 @@ class _ReceiverDetailPageState extends State<ReceiverDetailPage> {
); );
}, },
text: '提醒用户支付'); text: '提醒用户支付');
case 6:
case 7: case 7:
case 8: case 8:
return SizedBox.shrink();
case 9: case 9:
return SizedBox.shrink(); return SizedBox.shrink();
case 10:
return SizedBox.shrink();
default: default:
return SizedBox.shrink(); return SizedBox.shrink();
} }

@ -1,5 +1,6 @@
import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart'; import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/receiver_card.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/work_order_receiver_widget.dart'; import 'package:aku_new_community_manager/new_ui/work_order/receiver/work_order_receiver_widget.dart';
import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart'; import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -33,20 +34,20 @@ class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
'已取消' '已取消'
]; ];
late TabController _tabController; late TabController _tabController;
EasyRefreshController _refreshController = EasyRefreshController(); List<EasyRefreshController> _refreshControllers = [];
int _page = 1;
int _size = 10;
List<WorkOrderListModel> _models = [];
@override @override
void initState() { void initState() {
_refreshControllers = List.filled(_tabs.length, EasyRefreshController());
_tabController = TabController(length: _tabs.length, vsync: this); _tabController = TabController(length: _tabs.length, vsync: this);
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
_refreshController.dispose(); _refreshControllers.forEach((element) {
element.dispose();
});
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
} }
@ -75,56 +76,56 @@ class _WorkOrderReceiverPageState extends State<WorkOrderReceiverPage>
controller: _tabController, controller: _tabController,
children: _tabs children: _tabs
.mapIndexed((e, index) => WorkOrderReceiverWidget( .mapIndexed((e, index) => WorkOrderReceiverWidget(
index: index, refreshController: _refreshControllers[index],index: index,
)) ))
.toList()), .toList()),
); );
} }
Widget _getOrderView(int index) { // Widget _getOrderView(int index) {
return EasyRefresh( // return EasyRefresh(
firstRefresh: true, // firstRefresh: true,
header: MaterialHeader(), // header: MaterialHeader(),
onRefresh: () async { // onRefresh: () async {
_models = []; // _models = [];
_page = 1; // _page = 1;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: { // var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page, // 'pageNum': _page,
'size': _size, // 'size': _size,
'status': index == 0 ? null : index + 1, // 'status': index == 0 ? null : index + 1,
}); // });
_models = // _models =
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList(); // base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList();
setState(() {}); // setState(() {});
}, // },
onLoad: () async { // onLoad: () async {
_page++; // _page++;
var base = await NetUtil().getList(SAASAPI.workOrder.list, params: { // var base = await NetUtil().getList(SAASAPI.workOrder.list, params: {
'pageNum': _page, // 'pageNum': _page,
'size': _size, // 'size': _size,
'status': index == 0 ? null : index + 1, // 'status': index == 0 ? null : index + 1,
}); // });
if (_models.length < base.total) { // if (_models.length < base.total) {
_models.addAll( // _models.addAll(
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList()); // base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {}); // setState(() {});
} else { // } else {
_refreshController.finishLoad(); // _refreshController.finishLoad();
} // }
}, // },
child: _models == [] // child: _models == []
? SizedBox() // ? SizedBox()
: ListView.separated( // : ListView.separated(
padding: EdgeInsets.all(24.w), // padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) { // itemBuilder: (context, index) {
return DistributorCard( // return ReceiverCard(
model: _models[index], // model: _models[index],
refresh: _refreshController.callRefresh, // refresh: _refreshController.callRefresh,
); // );
}, // },
separatorBuilder: (context, index) { // separatorBuilder: (context, index) {
return 24.w.heightBox; // return 24.w.heightBox;
}, // },
itemCount: _models.length)); // itemCount: _models.length));
} // }
} }

@ -1,5 +1,6 @@
import 'package:aku_new_community_manager/const/saas_api.dart'; import 'package:aku_new_community_manager/const/saas_api.dart';
import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart'; import 'package:aku_new_community_manager/new_ui/work_order/distributor/distributor_card.dart';
import 'package:aku_new_community_manager/new_ui/work_order/receiver/receiver_card.dart';
import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart'; import 'package:aku_new_community_manager/saas_models/work_order/work_order_list_model.dart';
import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_new_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart'; import 'package:aku_new_community_manager/ui/widgets/inner/aku_tab_bar.dart';
@ -12,9 +13,9 @@ import 'package:velocity_x/velocity_x.dart';
class WorkOrderReceiverWidget extends StatefulWidget { class WorkOrderReceiverWidget extends StatefulWidget {
final int index; final int index;
final EasyRefreshController refreshController;
const WorkOrderReceiverWidget({Key? key, required this.index, required this.refreshController}) : super(key: key);
const WorkOrderReceiverWidget({Key? key, required this.index}) : super(key: key);
@override @override
_WorkOrderReceiverWidgetState createState() => _WorkOrderReceiverWidgetState(); _WorkOrderReceiverWidgetState createState() => _WorkOrderReceiverWidgetState();
@ -23,24 +24,10 @@ class WorkOrderReceiverWidget extends StatefulWidget {
class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget> class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
EasyRefreshController _refreshController = EasyRefreshController();
int _page = 1; int _page = 1;
int _size = 10; int _size = 10;
List<WorkOrderListModel> _models = []; List<WorkOrderListModel> _models = [];
@override
void initState() {
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return EasyRefresh( return EasyRefresh(
@ -70,15 +57,15 @@ class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget>
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList()); base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {}); setState(() {});
} else { } else {
_refreshController.finishLoad(); widget.refreshController.finishLoad();
} }
}, },
child:_models==[]?SizedBox(): ListView.separated( child:_models==[]?SizedBox(): ListView.separated(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DistributorCard( return ReceiverCard(
model: _models[index], model: _models[index],
refresh: _refreshController.callRefresh, refresh: widget.refreshController.callRefresh,
); );
}, },
separatorBuilder: (context, index) { separatorBuilder: (context, index) {

Loading…
Cancel
Save