领取工单~提交报告

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

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

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

@ -1,6 +1,7 @@
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_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/style/app_style.dart';
import 'package:aku_new_community_manager/ui/widgets/common/bee_hor_image_view.dart';
@ -54,7 +55,7 @@ class ReceiverCard extends StatelessWidget {
)),
GestureDetector(
onTap: () {
Get.to(() => DistributorDetailPage(
Get.to(() => ReceiverDetailPage(
id: model.id,
));
},

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

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

@ -1,5 +1,6 @@
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/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/ui/widgets/common/aku_scaffold.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 {
final int index;
final EasyRefreshController refreshController;
const WorkOrderReceiverWidget({Key? key, required this.index}) : super(key: key);
const WorkOrderReceiverWidget({Key? key, required this.index, required this.refreshController}) : super(key: key);
@override
_WorkOrderReceiverWidgetState createState() => _WorkOrderReceiverWidgetState();
@ -23,24 +24,10 @@ class WorkOrderReceiverWidget extends StatefulWidget {
class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget>
with SingleTickerProviderStateMixin {
EasyRefreshController _refreshController = EasyRefreshController();
int _page = 1;
int _size = 10;
List<WorkOrderListModel> _models = [];
@override
void initState() {
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return EasyRefresh(
@ -70,15 +57,15 @@ class _WorkOrderReceiverWidgetState extends State<WorkOrderReceiverWidget>
base.rows.map((e) => WorkOrderListModel.fromJson(e)).toList());
setState(() {});
} else {
_refreshController.finishLoad();
widget.refreshController.finishLoad();
}
},
child:_models==[]?SizedBox(): ListView.separated(
padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) {
return DistributorCard(
return ReceiverCard(
model: _models[index],
refresh: _refreshController.callRefresh,
refresh: widget.refreshController.callRefresh,
);
},
separatorBuilder: (context, index) {

Loading…
Cancel
Save