add engineer repair page

hmxc
张萌 3 years ago
parent bfb113ba3c
commit 7441b73fb3

@ -9,6 +9,21 @@ enum HKAUTH {
HIDE
}
///
enum ERAUTH {
///
SENDTOCOMPANY,
///
SENDTOPERSON,
///
PICK,
///
HIDE
}
class UserInfoModel {
int? id;
String? roleId;
@ -50,6 +65,18 @@ class UserInfoModel {
}
}
ERAUTH get engineeringRepairAuthority {
if (jurisdiction!.contains(69)) {
return ERAUTH.SENDTOCOMPANY;
} else if (jurisdiction!.contains(70)) {
return ERAUTH.SENDTOPERSON;
} else if (jurisdiction!.contains(71)) {
return ERAUTH.PICK;
} else {
return ERAUTH.HIDE;
}
}
UserInfoModel(
{required this.id, this.roleId, this.nickName, this.jurisdiction});

@ -0,0 +1,53 @@
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_view.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class EngineerRepairPage extends StatefulWidget {
EngineerRepairPage({Key? key}) : super(key: key);
@override
_EngineerRepairPageState createState() => _EngineerRepairPageState();
}
class _EngineerRepairPageState extends State<EngineerRepairPage>
with TickerProviderStateMixin {
List<String> get _tabs {
switch (UserTool.userProvider.infoModel!.engineeringRepairAuthority) {
case ERAUTH.SENDTOCOMPANY:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.SENDTOPERSON:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
case ERAUTH.PICK:
return ['全部', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
default:
return ['全部', '待派单', '已派单', '处理中', '待验收', '验收驳回', '已完成'];
}
}
late TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(length: _tabs.length, vsync: this);
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '工程维修',
appBarBottom: PreferredSize(
preferredSize: Size.fromHeight(88.w),
child: AkuTabBar(controller: _tabController, tabs: _tabs),
),
body: TabBarView(
controller: _tabController,
children: _tabs.mapIndexed((currentValue, index) => EngineerRepairView()).toList()),
);
}
}

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class EngineerRepairView extends StatefulWidget {
EngineerRepairView({Key? key}) : super(key: key);
@override
_EngineerRepairViewState createState() => _EngineerRepairViewState();
}
class _EngineerRepairViewState extends State<EngineerRepairView> {
@override
Widget build(BuildContext context) {
return ListView();
}
}

@ -20,6 +20,7 @@ import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/fix_more_time_page.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:velocity_x/velocity_x.dart';
class BusinessFixCard extends StatefulWidget {
final BussinessAndFixModel model;
@ -243,8 +244,8 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
? AkuMaterialButton(
height: 64.w,
onPressed: () async {
Get.to(() => Get.to(
()=> FixMoreTimePage(dispatchId: widget.model.dispatchId!)));
Get.to(() => Get.to(() =>
FixMoreTimePage(dispatchId: widget.model.dispatchId!)));
if (widget.callRefresh != null) {
widget.callRefresh!();
}
@ -263,6 +264,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
)
: SizedBox(),
12.w.widthBox,
AkuMaterialButton(
height: 64.w,
onPressed: () async {
@ -315,5 +317,4 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
return [];
}
}
}

Loading…
Cancel
Save