优化工单管理

pull/1/head
张萌 3 years ago
parent 1455940627
commit 04b99bfebc

@ -153,6 +153,7 @@ class SignFunc {
return true;
}
///
static Future<List<MyHouseModel>> getMyHouseInfo() async {
BaseModel baseModel = await NetUtil().get(
SAASAPI.profile.house.userHouse,

@ -30,6 +30,7 @@ class UserProvider extends ChangeNotifier {
await updateUserInfo();
WebSocketUtil().setUser(userInfoModel!.id.toString());
WebSocketUtil().startWebSocket();
await updateMyHouseInfo();
///
_userConfig = await HiveStore.userBox!.get('${_userInfoModel!.id}') ??
@ -77,6 +78,7 @@ class UserProvider extends ChangeNotifier {
notifyListeners();
}
///
Future updateMyHouseInfo() async {
_myHouses = await SignFunc.getMyHouseInfo();
if (_myHouses.isEmpty) {
@ -99,6 +101,7 @@ class UserProvider extends ChangeNotifier {
UserInfoModel? get userInfoModel => _userInfoModel;
///
List<MyHouseModel> _myHouses = [];
List<MyHouseModel> get myHouses => _myHouses;

@ -80,51 +80,20 @@ class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
),
),
80.hb,
Row(
children: [
MaterialButton(
onPressed: () {},
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
side: BorderSide(color: Colors.black.withOpacity(0.25)),
),
child: Text(
'暂不评价',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: () async {
BottomPluralButtonWidget(
leftTitle: '暂不评价',
onLeftTap: () {},
rightTitle: '确认提交',
onRightTap: () async {
if (_currentIndex == null) {
BotToast.showText(text: '请选择评价满意度');
return;
}
var re =
await widget.evaluate(_currentIndex!, _controller.text);
var re = await widget.evaluate(_currentIndex!, _controller.text);
if (re) {
Get.back();
}
},
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
),
child: Text(
'确认提交',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.85)),
),
)
],
)
],
),
@ -159,3 +128,69 @@ class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
);
}
}
class BottomPluralButtonWidget extends StatelessWidget {
const BottomPluralButtonWidget({
Key? key,
required this.onLeftTap,
required this.onRightTap,
required this.leftTitle,
required this.rightTitle,
this.padding = false,
}) : super(key: key);
final VoidCallback onLeftTap;
final VoidCallback onRightTap;
final String leftTitle;
final String rightTitle;
final bool padding;
@override
Widget build(BuildContext context) {
return Container(
padding: padding
? EdgeInsets.only(
left: 32.w,
top: 32.w,
bottom: 32.w + MediaQuery.of(context).padding.bottom,
right: 32.w)
: EdgeInsets.zero,
color: padding ? Colors.white : Colors.transparent,
child: Row(
children: [
MaterialButton(
onPressed: onLeftTap,
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
side: BorderSide(color: Colors.black.withOpacity(0.25)),
),
child: Text(
leftTitle,
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: onRightTap,
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
),
child: Text(
rightTitle,
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.85)),
),
)
],
),
);
}
}

@ -5,6 +5,7 @@ import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/src/extensions/string_ext.dart';
class WorkOrderBillDialog extends StatelessWidget {
@ -76,7 +77,11 @@ class WorkOrderBillDialog extends StatelessWidget {
],
),
80.hb,
BeeLongButton(onPressed: () {}, text: '确认支付'),
BeeLongButton(
onPressed: () {
Get.back();
},
text: '确认支付'),
],
),
);

@ -2,12 +2,10 @@ import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_detail_model.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_progress_model.dart';
import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_evaluation_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/urge_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_finish_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_progress_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/history_report_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/team_list_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_func.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart';
@ -78,21 +76,8 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
children: [
GestureDetector(
onTap: () async {
var base = await NetUtil().get(
SAASAPI.workOrder.findScheduleById,
params: {'workOrderId': widget.id});
if (base.success) {
var models = (base.data as List)
.map((e) =>
WorkOrderProgressModel.fromJson(
e))
.toList();
await Get.bottomSheet(
WorkOrderProgressDialog(
models: models));
} else {
BotToast.showText(text: base.msg);
}
await WorkOrderFuc.getProgress(
workOrderId: widget.id);
},
child: Material(
color: Colors.transparent,
@ -147,6 +132,14 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
padding:
EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w),
children: [
Offstage(
offstage: _model!.status < 5,
child: Column(
children: [
_historyReport(),
24.hb,
],
)),
Offstage(
offstage: _model!.servicePersonnelImgList == null ||
_model!.servicePersonnelImgList!.isEmpty,
@ -242,8 +235,8 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
case 6:
return BeeLongButton(
onPressed: () async {
var bills = await WorkOrderFuc.getBill(workOrderId: widget.id);
await Get.bottomSheet(WorkOrderBillDialog(models: bills));
await WorkOrderFuc.getBill(workOrderId: widget.id);
_refreshController.callRefresh();
},
text: '确认支付');
case 7:
@ -268,7 +261,9 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
Widget _historyReport() {
return GestureDetector(
onTap: () {},
onTap: () {
Get.to(HistoryReportPage(id: widget.id));
},
child: Material(
color: Colors.transparent,
child: Container(

@ -1,7 +1,14 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_bill_model.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_progress_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/src/extension_navigation.dart';
import 'dialogs/work_order_bill_dialog.dart';
import 'dialogs/work_order_progress_dialog.dart';
class WorkOrderFuc {
///
@ -48,20 +55,36 @@ class WorkOrderFuc {
return base.success;
}
///
static Future<List<WorkOrderBillModel>> getBill({
///
static Future getProgress({
required int workOrderId,
}) async {
var models = <WorkOrderBillModel>[];
var base = await NetUtil().get(SAASAPI.workOrder.cancel, params: {
'workOrderId': workOrderId,
});
var base = await NetUtil().get(SAASAPI.workOrder.findScheduleById,
params: {'workOrderId': workOrderId});
if (base.success) {
var models = (base.data as List)
.map((e) => WorkOrderProgressModel.fromJson(e))
.toList();
await Get.bottomSheet(WorkOrderProgressDialog(models: models));
} else {
BotToast.showText(text: base.msg);
}
}
///
static Future getBill({
required int workOrderId,
}) async {
var base = await NetUtil().get(SAASAPI.workOrder.workOrderBill,
params: {'workOrderId': workOrderId});
if (base.success) {
models = (base.data as List)
var models = (base.data as List)
.map((e) => WorkOrderBillModel.fromJson(e))
.toList();
await Get.bottomSheet(WorkOrderBillDialog(models: models));
} else {
BotToast.showText(text: base.msg);
}
return models;
}
///

@ -76,7 +76,7 @@ class _OrderCardState extends State<OrderCard> {
"payType": 1, //
"payPrice": widget.model.payPrice,
"residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name,
"payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel,
});
if (baseModel.success) {

@ -197,7 +197,7 @@ class _SubmitOrderNormalPageState extends State<SubmitOrderNormalPage> {
"payPrice": totalPrice,
// 'points': widget.integral,
"residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name,
"payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel,
},
showMessage: true);

@ -11,6 +11,7 @@ import 'package:aku_new_community/widget/dialog/certification_dialog.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/tag/bee_tag.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
@ -23,15 +24,19 @@ class MyHousePage extends StatefulWidget {
}
class _MyHousePageState extends State<MyHousePage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
Future.delayed(Duration(milliseconds: 0), () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
});
super.initState();
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
@ -46,7 +51,15 @@ class _MyHousePageState extends State<MyHousePage> {
body: SafeArea(
child: UserTool.userProvider.myHouses.isEmpty
? HouseEmptyWidget()
: ListView(
: EasyRefresh(
controller: _refreshController,
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
},
child: ListView(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: <Widget>[
@ -54,6 +67,7 @@ class _MyHousePageState extends State<MyHousePage> {
.map((e) => _houseCard(e))
.toList()
].sepWidget(separate: 24.w.heightBox),
),
)),
bottomNavi: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
@ -74,11 +88,15 @@ class _MyHousePageState extends State<MyHousePage> {
Widget _houseCard(MyHouseModel model) {
return Stack(
children: [
Container(
GestureDetector(
onTap: () {},
child: Material(
child: Container(
width: 686.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
color: Colors.white,
borderRadius: BorderRadius.circular(8.w)),
child: Column(
children: [
Row(
@ -127,6 +145,8 @@ class _MyHousePageState extends State<MyHousePage> {
],
),
),
),
),
if (model.isDefault == 1)
Positioned(
top: 0,

Loading…
Cancel
Save