优化工单管理

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

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

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

@ -80,51 +80,20 @@ class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
), ),
), ),
80.hb, 80.hb,
Row( BottomPluralButtonWidget(
children: [ leftTitle: '暂不评价',
MaterialButton( onLeftTap: () {},
onPressed: () {}, rightTitle: '确认提交',
minWidth: 330.w, onRightTap: () async {
height: 80.w, if (_currentIndex == null) {
elevation: 0, BotToast.showText(text: '请选择评价满意度');
color: Colors.white, return;
shape: RoundedRectangleBorder( }
borderRadius: BorderRadius.circular(40.w), var re = await widget.evaluate(_currentIndex!, _controller.text);
side: BorderSide(color: Colors.black.withOpacity(0.25)), if (re) {
), Get.back();
child: Text( }
'暂不评价', },
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: () async {
if (_currentIndex == null) {
BotToast.showText(text: '请选择评价满意度');
return;
}
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:aku_new_community/widget/buttons/bee_long_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/src/extensions/string_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart';
class WorkOrderBillDialog extends StatelessWidget { class WorkOrderBillDialog extends StatelessWidget {
@ -76,7 +77,11 @@ class WorkOrderBillDialog extends StatelessWidget {
], ],
), ),
80.hb, 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/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.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_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/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/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_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/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_func.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.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: [ children: [
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
var base = await NetUtil().get( await WorkOrderFuc.getProgress(
SAASAPI.workOrder.findScheduleById, workOrderId: widget.id);
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);
}
}, },
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
@ -147,6 +132,14 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
padding: padding:
EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w), EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w),
children: [ children: [
Offstage(
offstage: _model!.status < 5,
child: Column(
children: [
_historyReport(),
24.hb,
],
)),
Offstage( Offstage(
offstage: _model!.servicePersonnelImgList == null || offstage: _model!.servicePersonnelImgList == null ||
_model!.servicePersonnelImgList!.isEmpty, _model!.servicePersonnelImgList!.isEmpty,
@ -242,8 +235,8 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
case 6: case 6:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
var bills = await WorkOrderFuc.getBill(workOrderId: widget.id); await WorkOrderFuc.getBill(workOrderId: widget.id);
await Get.bottomSheet(WorkOrderBillDialog(models: bills)); _refreshController.callRefresh();
}, },
text: '确认支付'); text: '确认支付');
case 7: case 7:
@ -268,7 +261,9 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
Widget _historyReport() { Widget _historyReport() {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {
Get.to(HistoryReportPage(id: widget.id));
},
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(

@ -1,7 +1,14 @@
import 'package:aku_new_community/constants/saas_api.dart'; 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_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/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.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 { class WorkOrderFuc {
/// ///
@ -48,20 +55,36 @@ class WorkOrderFuc {
return base.success; return base.success;
} }
/// ///
static Future<List<WorkOrderBillModel>> getBill({ static Future getProgress({
required int workOrderId,
}) async {
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, required int workOrderId,
}) async { }) async {
var models = <WorkOrderBillModel>[]; var base = await NetUtil().get(SAASAPI.workOrder.workOrderBill,
var base = await NetUtil().get(SAASAPI.workOrder.cancel, params: { params: {'workOrderId': workOrderId});
'workOrderId': workOrderId,
});
if (base.success) { if (base.success) {
models = (base.data as List) var models = (base.data as List)
.map((e) => WorkOrderBillModel.fromJson(e)) .map((e) => WorkOrderBillModel.fromJson(e))
.toList(); .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, // "payType": 1, //
"payPrice": widget.model.payPrice, "payPrice": widget.model.payPrice,
"residentId": UserTool.userProvider.userInfoModel!.id, "residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name, "payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel, "payTel": UserTool.userProvider.userInfoModel!.tel,
}); });
if (baseModel.success) { if (baseModel.success) {

@ -197,7 +197,7 @@ class _SubmitOrderNormalPageState extends State<SubmitOrderNormalPage> {
"payPrice": totalPrice, "payPrice": totalPrice,
// 'points': widget.integral, // 'points': widget.integral,
"residentId": UserTool.userProvider.userInfoModel!.id, "residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name, "payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel, "payTel": UserTool.userProvider.userInfoModel!.tel,
}, },
showMessage: true); 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/others/user_tool.dart';
import 'package:aku_new_community/widget/tag/bee_tag.dart'; import 'package:aku_new_community/widget/tag/bee_tag.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.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:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
@ -23,15 +24,19 @@ class MyHousePage extends StatefulWidget {
} }
class _MyHousePageState extends State<MyHousePage> { class _MyHousePageState extends State<MyHousePage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override @override
void initState() { void initState() {
Future.delayed(Duration(milliseconds: 0), () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
});
super.initState(); super.initState();
} }
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
@ -46,14 +51,23 @@ class _MyHousePageState extends State<MyHousePage> {
body: SafeArea( body: SafeArea(
child: UserTool.userProvider.myHouses.isEmpty child: UserTool.userProvider.myHouses.isEmpty
? HouseEmptyWidget() ? HouseEmptyWidget()
: ListView( : EasyRefresh(
padding: controller: _refreshController,
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), firstRefresh: true,
children: <Widget>[ header: MaterialHeader(),
...UserTool.userProvider.myHouses onRefresh: () async {
.map((e) => _houseCard(e)) await UserTool.userProvider.updateMyHouseInfo();
.toList() setState(() {});
].sepWidget(separate: 24.w.heightBox), },
child: ListView(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: <Widget>[
...UserTool.userProvider.myHouses
.map((e) => _houseCard(e))
.toList()
].sepWidget(separate: 24.w.heightBox),
),
)), )),
bottomNavi: Padding( bottomNavi: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
@ -74,57 +88,63 @@ class _MyHousePageState extends State<MyHousePage> {
Widget _houseCard(MyHouseModel model) { Widget _houseCard(MyHouseModel model) {
return Stack( return Stack(
children: [ children: [
Container( GestureDetector(
width: 686.w, onTap: () {},
padding: EdgeInsets.all(24.w), child: Material(
decoration: BoxDecoration( child: Container(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)), width: 686.w,
child: Column( padding: EdgeInsets.all(24.w),
children: [ decoration: BoxDecoration(
Row( color: Colors.white,
children: [ borderRadius: BorderRadius.circular(8.w)),
'${model.addressName} ${model.communityName}' child: Column(
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
8.w.heightBox,
Row(
children: [ children: [
'${model.buildingName}${model.unitName}${model.estateName}' Row(
.text children: [
.size(36.sp) '${model.addressName} ${model.communityName}'
.color(Colors.black.withOpacity(0.85)) .text
.make(), .size(24.sp)
24.w.widthBox, .color(Colors.black.withOpacity(0.65))
model.isDefault == 1 .make(),
? BeeTag.yellowSolid( ],
text: '${model.manageEstateTypeName}') ),
: BeeTag.blackSolid( 8.w.heightBox,
text: '${model.manageEstateTypeName}'), Row(
children: [
'${model.buildingName}${model.unitName}${model.estateName}'
.text
.size(36.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
24.w.widthBox,
model.isDefault == 1
? BeeTag.yellowSolid(
text: '${model.manageEstateTypeName}')
: BeeTag.blackSolid(
text: '${model.manageEstateTypeName}'),
],
),
24.w.heightBox,
BeeDivider.horizontal(),
24.w.heightBox,
Row(
children: [
model.isDefault == 1
? BeeTag.yellowHollow(
text: '${model.manageEstateTypeName}')
: BeeTag.blackHollow(
text: '${model.manageEstateTypeName}'),
10.w.widthBox,
'${model.name} ${model.tel}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
)
], ],
), ),
24.w.heightBox, ),
BeeDivider.horizontal(),
24.w.heightBox,
Row(
children: [
model.isDefault == 1
? BeeTag.yellowHollow(
text: '${model.manageEstateTypeName}')
: BeeTag.blackHollow(
text: '${model.manageEstateTypeName}'),
10.w.widthBox,
'${model.name} ${model.tel}'
.text
.size(24.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
)
],
), ),
), ),
if (model.isDefault == 1) if (model.isDefault == 1)

Loading…
Cancel
Save