修复派单问题

hmxc
张萌 4 years ago
parent a7bb48424a
commit 07be710c86

@ -124,7 +124,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
builder: (context) { builder: (context) {
final userProvider = final userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
if (userProvider.infoModel.canOperation && widget.model.status < 2) { if (userProvider.infoModel.canSendTicket && widget.model.status < 2) {
return AkuMaterialButton( return AkuMaterialButton(
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor, nullColor: AppStyle.minorColor,
@ -143,7 +143,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
), ),
); );
} else if (widget.model.status == 2) { } else if (widget.model.status == 2) {
if (userProvider.infoModel.canOperation) { if (userProvider.infoModel.canSendTicket){
return AkuMaterialButton( return AkuMaterialButton(
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor, nullColor: AppStyle.minorColor,

@ -24,7 +24,12 @@ import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
class BusinessFixCard extends StatefulWidget { class BusinessFixCard extends StatefulWidget {
final BussinessAndFixModel model; final BussinessAndFixModel model;
final bool homeDisplay; final bool homeDisplay;
BusinessFixCard({Key key, @required this.model, this.homeDisplay = false}) final bool canSeeBottomButton;
BusinessFixCard(
{Key key,
@required this.model,
this.homeDisplay = false,
this.canSeeBottomButton = true})
: super(key: key); : super(key: key);
@override @override
@ -88,7 +93,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
), ),
Text( Text(
AkuMap.fixStatus(userInfoModel.canOperation, AkuMap.fixStatus(userInfoModel.canSendTicket,
userInfoModel.canPickUpTicket, widget.model.status), userInfoModel.canPickUpTicket, widget.model.status),
style: TextStyle( style: TextStyle(
color: widget.model.status < 4 color: widget.model.status < 4
@ -113,7 +118,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
), ),
AkuBox.h(16), AkuBox.h(16),
_buildImgs(), _buildImgs(),
_buildBottomCard(), !widget.canSeeBottomButton ? SizedBox() : _buildBottomCard(),
], ],
), ),
margin: EdgeInsets.only(top: 16.w), margin: EdgeInsets.only(top: 16.w),

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class FixSubmitFinishPage extends StatelessWidget { class FixSubmitFinishPage extends StatelessWidget {
final BussinessAndFixModel model; final BussinessAndFixModel model;
const FixSubmitFinishPage({Key key, this.model}) : super(key: key); const FixSubmitFinishPage({Key key, this.model}) : super(key: key);
@ -17,10 +18,14 @@ class FixSubmitFinishPage extends StatelessWidget {
width: double.infinity, width: double.infinity,
child: Column( child: Column(
children: [ children: [
Image.asset(R.ASSETS_MANAGE_SUBMIT_SUCCESS_PNG,width:587.w,height:350.w), Image.asset(R.ASSETS_MANAGE_SUBMIT_SUCCESS_PNG,
width: 587.w, height: 350.w),
'您已处理完成该报修'.text.black.size(40.sp).bold.make(), '您已处理完成该报修'.text.black.size(40.sp).bold.make(),
120.w.heightBox, 120.w.heightBox,
BusinessFixCard(model: this.model), BusinessFixCard(
model: this.model,
canSeeBottomButton: false,
),
], ],
), ),
), ),

@ -348,15 +348,12 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
TextUtil.isEmpty( TextUtil.isEmpty(
_materialPriceController.text)) { _materialPriceController.text)) {
return Text('人工费或材料费不能为空'); return Text('人工费或材料费不能为空');
} else if (humanPrice == null || }
materialPrice == null)
return Text('输入有误');
else else
humanPrice = humanPrice =
double.tryParse(_humanController.text); double.tryParse(_humanController.text);
materialPrice = materialPrice =
double.tryParse(_materialPriceController.text); double.tryParse(_materialPriceController.text);
return Text( return Text(
'¥${(humanPrice + materialPrice).toStringAsFixed(2)}'); '¥${(humanPrice + materialPrice).toStringAsFixed(2)}');
}, },

@ -25,7 +25,8 @@ class FixerDepartmentPage extends StatefulWidget {
final DispatchReportModel model; final DispatchReportModel model;
final bool changeType; final bool changeType;
final int dispatchId; final int dispatchId;
FixerDepartmentPage({Key key, @required this.model, this.changeType = false, this.dispatchId}) FixerDepartmentPage(
{Key key, @required this.model, this.changeType = false, this.dispatchId})
: super(key: key); : super(key: key);
@override @override
@ -91,8 +92,9 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
BotToast.showText(text: baseModel.message); BotToast.showText(text: baseModel.message);
} }
} else { } else {
BaseModel baseModel = BaseModel baseModel = await ManageFunc.repairDispatch(
await ManageFunc.repairDispatch(_reportModel,widget.dispatchId); _reportModel,
dispatchId: widget.dispatchId);
if (baseModel.status) { if (baseModel.status) {
Get.back(); Get.back();
Get.back(); Get.back();

@ -4,6 +4,7 @@ import 'package:aku_community_manager/models/manager/bussiness_and_fix/fixed_det
import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
class ManageFunc { class ManageFunc {
/// ///
@ -39,7 +40,9 @@ class ManageFunc {
} }
/// ///
static Future repairDispatch(DispatchReportModel model,int dispatchId) async { static Future repairDispatch(DispatchReportModel model,
{@required int dispatchId}) async {
print(dispatchId);
BaseModel baseModel = BaseModel baseModel =
await NetUtil().post(API.manage.repairDispatch, params: { await NetUtil().post(API.manage.repairDispatch, params: {
'dispatchListId': dispatchId, 'dispatchListId': dispatchId,

Loading…
Cancel
Save