修复报事保修相关问题

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

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

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

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

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

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

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

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

Loading…
Cancel
Save