修复报事保修相关问题

hmxc
张萌 4 years ago
parent 07be710c86
commit 314faba546

@ -1,6 +1,6 @@
// Dart imports:
import 'dart:io';
@Deprecated('use canOpertion/canSendTicket/canPickUpTicke/canPass instead')
enum USER_ROLE {
///
MANAGER,
@ -17,7 +17,7 @@ enum USER_ROLE {
///
EMPTY,
}
@Deprecated('use infoModel instead')
class UserInfoModel {
String nickName;
File avatar;

@ -1,7 +1,7 @@
class AkuMap {
///
static String fixStatus(bool canOpention, bool canPickup, int status) {
if (canOpention) {
static String fixStatus(bool canSendTicket, bool canPickup, int status) {
if (canSendTicket) {
switch (status) {
case 1:
return '待派单';

@ -24,7 +24,6 @@ import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
@ -43,10 +42,6 @@ class BusinessAndFixDetailPage extends StatefulWidget {
}
class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
USER_ROLE get userRole {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return userProvider.userInfoModel.role;
}
bool get isHandOut => widget.model.status == 1;
FixedDetailModel _detailModel;
@ -98,7 +93,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
header: MaterialHeader(),
onRefresh: () async {
_detailModel = await ManageFunc.repairDetail(widget.model.id);
_reportModel.dispatchListId = widget.model.id;
_reportModel.dispatchListId = widget.model.dispatchId;
_reportModel.workOrderTyoe = 1;
_onload = false;
setState(() {});
@ -132,7 +127,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
_reportModel.workOrderTyoe != null &&
_reportModel.workOrderTimeLimit != null
? () {
Get.to(FixerDepartmentPage(model: _reportModel,dispatchId: _detailModel.repairDetail.dispatchId,));
Get.to(FixerDepartmentPage(model: _reportModel));
}
: null,
child: Text(

@ -212,7 +212,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
)
: SizedBox(),
(widget.model.status == 2) && (!userInfoModel.canSendTicket)
(widget.model.status == 2) && (userInfoModel.canPickUpTicket)
? AkuMaterialButton(
onPressed: () {
// final userProvider =
@ -223,6 +223,9 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
// ));
// widget.model.type = FIX_ENUM.PROCESSING;
// Get.back();
Get.to(() => BusinessAndFixDetailPage(
model: widget.model,
));
},
radius: 4.w,
color: AppStyle.primaryColor,

@ -348,12 +348,12 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
TextUtil.isEmpty(
_materialPriceController.text)) {
return Text('人工费或材料费不能为空');
}
else
} else {
humanPrice =
double.tryParse(_humanController.text);
materialPrice =
double.tryParse(_materialPriceController.text);
materialPrice = double.tryParse(
_materialPriceController.text);
}
return Text(
'¥${(humanPrice + materialPrice).toStringAsFixed(2)}');
},
@ -388,6 +388,13 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
// materialPrice: double.parse(_materialController.text),
// );
// Get.back();
if (!widget.dispatchType) {
if (TextUtil.isEmpty(_humanController.text) ||
TextUtil.isEmpty(_materialPriceController.text)) {
BotToast.showText(text: '人工费或材料费不能为空');
return;
}
}
List<String> urls =
await NetUtil().uploadFiles(_imgs, API.upload.uploadArtical);
BaseModel baseModel = await ManageFunc.handleResult(

@ -24,9 +24,8 @@ import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class FixerDepartmentPage extends StatefulWidget {
final DispatchReportModel model;
final bool changeType;
final int dispatchId;
FixerDepartmentPage(
{Key key, @required this.model, this.changeType = false, this.dispatchId})
{Key key, @required this.model, this.changeType = false,})
: super(key: key);
@override
@ -93,8 +92,8 @@ class _FixerDepartmentPageState extends State<FixerDepartmentPage> {
}
} else {
BaseModel baseModel = await ManageFunc.repairDispatch(
_reportModel,
dispatchId: widget.dispatchId);
_reportModel
);
if (baseModel.status) {
Get.back();
Get.back();

@ -40,12 +40,12 @@ class ManageFunc {
}
///
static Future repairDispatch(DispatchReportModel model,
{@required int dispatchId}) async {
print(dispatchId);
static Future repairDispatch(
DispatchReportModel model,
) async {
BaseModel baseModel =
await NetUtil().post(API.manage.repairDispatch, params: {
'dispatchListId': dispatchId,
'dispatchListId': model.dispatchListId,
'workOrderType': model.workOrderTyoe,
'workOrderTypeDetail': model.workOrderTypeDetail,
'workOrderTimeLimit': model.workOrderTimeLimit,

Loading…
Cancel
Save