update models/repair some issues

hmxc
张萌 3 years ago
parent 57db1151a0
commit 4f4b3b145d

@ -7,17 +7,17 @@ part 'engineer_repair_new_acceptance_record_model.g.dart';
class EngineerRepairNewAcceptanceRecordModel {
final int id;
final int repairEngineeringId;
final String content;
final String billMaterials;
final List<ImgModel> maintenanceImgLists;
final String? content;
final String? billMaterials;
final List<ImgModel>? maintenanceImgLists;
final String createName;
final String createDate;
final int results;
final String advice;
final String acceptancePeople;
final int acceptancePeople;
final String acceptancePeopleName;
final String acceptanceDate;
final List<ImgModel> acceptanceImgLists;
final List<ImgModel>? acceptanceImgLists;
factory EngineerRepairNewAcceptanceRecordModel.fromJson(
Map<String, dynamic> json) =>
_$EngineerRepairNewAcceptanceRecordModelFromJson(json);

@ -12,20 +12,20 @@ EngineerRepairNewAcceptanceRecordModel
return EngineerRepairNewAcceptanceRecordModel(
json['id'] as int,
json['repairEngineeringId'] as int,
json['content'] as String,
json['billMaterials'] as String,
(json['maintenanceImgLists'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
json['content'] as String?,
json['billMaterials'] as String?,
(json['maintenanceImgLists'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
json['createName'] as String,
json['createDate'] as String,
json['results'] as int,
json['advice'] as String,
json['acceptancePeople'] as String,
json['acceptancePeople'] as int,
json['acceptancePeopleName'] as String,
json['acceptanceDate'] as String,
(json['acceptanceImgLists'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
(json['acceptanceImgLists'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

@ -5,33 +5,33 @@ part 'engineer_repair_person_model.g.dart';
@JsonSerializable()
class EngineerRepairPersonModel {
final int id;
final String userName;
final String pwd;
final String? userName;
final String? pwd;
final String actualName;
final String tel;
final int sex;
final String userCode;
final String birthday;
final String email;
final String idCard;
final int organizationId;
final String organizationPath;
final int positionId;
final int roleId;
final int status;
final int isDelete;
final int createId;
final String createDate;
final int modifyId;
final String modifyDate;
final int lastLoginIp;
final String lastLoginDate;
final String nickName;
final String code;
final String codeSendDate;
final String remake;
final int reportTo;
final String entryDate;
final int? sex;
final String? userCode;
final String? birthday;
final String? email;
final String? idCard;
final int? organizationId;
final String? organizationPath;
final int? positionId;
final int? roleId;
final int? status;
final int? isDelete;
final int? createId;
final String? createDate;
final int? modifyId;
final String? modifyDate;
final int? lastLoginIp;
final String? lastLoginDate;
final String? nickName;
final String? code;
final String? codeSendDate;
final String? remake;
final int? reportTo;
final String? entryDate;
factory EngineerRepairPersonModel.fromJson(Map<String, dynamic> json) =>
_$EngineerRepairPersonModelFromJson(json);
EngineerRepairPersonModel(

@ -10,32 +10,32 @@ EngineerRepairPersonModel _$EngineerRepairPersonModelFromJson(
Map<String, dynamic> json) {
return EngineerRepairPersonModel(
json['id'] as int,
json['userName'] as String,
json['pwd'] as String,
json['userName'] as String?,
json['pwd'] as String?,
json['actualName'] as String,
json['tel'] as String,
json['sex'] as int,
json['userCode'] as String,
json['birthday'] as String,
json['email'] as String,
json['idCard'] as String,
json['organizationId'] as int,
json['organizationPath'] as String,
json['positionId'] as int,
json['roleId'] as int,
json['status'] as int,
json['isDelete'] as int,
json['createId'] as int,
json['createDate'] as String,
json['modifyId'] as int,
json['modifyDate'] as String,
json['lastLoginIp'] as int,
json['lastLoginDate'] as String,
json['nickName'] as String,
json['code'] as String,
json['codeSendDate'] as String,
json['remake'] as String,
json['reportTo'] as int,
json['entryDate'] as String,
json['sex'] as int?,
json['userCode'] as String?,
json['birthday'] as String?,
json['email'] as String?,
json['idCard'] as String?,
json['organizationId'] as int?,
json['organizationPath'] as String?,
json['positionId'] as int?,
json['roleId'] as int?,
json['status'] as int?,
json['isDelete'] as int?,
json['createId'] as int?,
json['createDate'] as String?,
json['modifyId'] as int?,
json['modifyDate'] as String?,
json['lastLoginIp'] as int?,
json['lastLoginDate'] as String?,
json['nickName'] as String?,
json['code'] as String?,
json['codeSendDate'] as String?,
json['remake'] as String?,
json['reportTo'] as int?,
json['entryDate'] as String?,
);
}

@ -7,8 +7,8 @@ part 'engineer_repair_result_model.g.dart';
class EngineerRepairResultModel {
final int id;
final int repairEngineeringId;
final String content;
final String billMaterials;
final String? content;
final String? billMaterials;
final List<ImgModel> maintenanceImgLists;
final String createName;
final String createDate;

@ -11,8 +11,8 @@ EngineerRepairResultModel _$EngineerRepairResultModelFromJson(
return EngineerRepairResultModel(
json['id'] as int,
json['repairEngineeringId'] as int,
json['content'] as String,
json['billMaterials'] as String,
json['content'] as String?,
json['billMaterials'] as String?,
(json['maintenanceImgLists'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),

@ -11,7 +11,7 @@ class EngineerRepairWorkReportModel {
final int createId;
final String createName;
final String createDate;
final List<ImgModel> workReportImgLists;
final List<ImgModel>? workReportImgLists;
factory EngineerRepairWorkReportModel.fromJson(Map<String, dynamic> json) =>
_$EngineerRepairWorkReportModelFromJson(json);

@ -15,8 +15,8 @@ EngineerRepairWorkReportModel _$EngineerRepairWorkReportModelFromJson(
json['createId'] as int,
json['createName'] as String,
json['createDate'] as String,
(json['workReportImgLists'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
(json['workReportImgLists'] as List<dynamic>?)
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

@ -2,7 +2,6 @@ import 'dart:io';
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_detail_model.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_new_acceptance_record_model.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
@ -24,11 +23,15 @@ import 'package:velocity_x/velocity_x.dart';
import 'engineer_repair_map.dart';
class EngineerRepairAcceptancePage extends StatefulWidget {
final EngineerRepairDetailModel detailModel;
final int repairId;
final int status;
final EngineerRepairResultModel resultModel;
const EngineerRepairAcceptancePage(
{Key? key, required this.detailModel, required this.resultModel})
{Key? key,
required this.repairId,
required this.resultModel,
required this.status})
: super(key: key);
@override
@ -50,6 +53,29 @@ class _EngineerRepairAcceptancePageState
children: [
_buildInfo(),
_buildCheckBox(),
GestureDetector(
onTap: () async {
List<EngineerRepairNewAcceptanceRecordModel> models = [];
models.addAll(await EngineerRepairFunc.getAcceptanceRecordList(
widget.repairId));
await Get.to(
() => EngineerRepairAcceptanceRecordListPage(models: models));
},
child: Container(
color: Colors.white,
padding: EdgeInsets.all(32.w),
child: Row(
children: [
'查看验收记录'.text.size(28.sp).color(kTextPrimaryColor).make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
)
],
),
),
)
],
),
bottom: AkuBottomButton(
@ -60,14 +86,13 @@ class _EngineerRepairAcceptancePageState
urls = await EngineerRepairFunc.uploadAcceptanceImages(_files);
var result = await EngineerRepairFunc.submitAcceptance(
widget.resultModel.id,
widget.detailModel.id,
widget.repairId,
_selectResult,
_reportDetail,
urls);
cancel();
if (result) {
Get.back();
Get.back();
}
},
),
@ -84,7 +109,7 @@ class _EngineerRepairAcceptancePageState
Row(
children: [
AkuSingleCheckButton(
text: '工程维修',
text: '通过',
value: 1,
gropValue: _selectResult,
onPressed: () {
@ -94,7 +119,7 @@ class _EngineerRepairAcceptancePageState
),
80.w.widthBox,
AkuSingleCheckButton(
text: '异常',
text: '驳回',
value: 2,
gropValue: _selectResult,
onPressed: () {
@ -139,6 +164,7 @@ class _EngineerRepairAcceptancePageState
),
),
),
16.w.heightBox,
'上传到场验收照片'.text.size(28.sp).color(kTextPrimaryColor).make(),
16.w.heightBox,
AkuPickImageWidget(onChanged: (value) {
@ -147,29 +173,6 @@ class _EngineerRepairAcceptancePageState
setState(() {});
}),
16.w.heightBox,
GestureDetector(
onTap: () async {
List<EngineerRepairNewAcceptanceRecordModel> models = [];
models.addAll(await EngineerRepairFunc.getAcceptanceRecordList(
widget.detailModel.id));
await Get.to(
() => EngineerRepairAcceptanceRecordListPage(models: models));
},
child: Container(
color: Colors.white,
padding: EdgeInsets.all(32.w),
child: Row(
children: [
'查看验收记录'.text.size(28.sp).color(kTextPrimaryColor).make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 40.w,
)
],
),
),
)
],
);
}
@ -178,7 +181,7 @@ class _EngineerRepairAcceptancePageState
return AkuTitleBox(
title: '维修结果',
suffix: Text(
ERMap.statusString(widget.detailModel.status),
ERMap.statusString(widget.status),
style: TextStyle(color: Color(0xFFFF4501)),
),
children: [
@ -186,12 +189,12 @@ class _EngineerRepairAcceptancePageState
_buildTile(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
'处理描述',
widget.resultModel.content,
widget.resultModel.content ?? '',
),
_buildTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
'材料清单',
widget.resultModel.billMaterials,
widget.resultModel.billMaterials ?? '',
),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '完成时间',
widget.resultModel.createDate),

@ -40,6 +40,7 @@ class _EngineerRepairAcceptanceRecordListPageState
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
@ -69,29 +70,30 @@ class _EngineerRepairAcceptanceRecordListPageState
),
40.w.heightBox,
'现场情况'.text.size(28.sp).color(kTextSubColor).make(),
40.w.heightBox,
24.w.heightBox,
model.advice.text.size(28.sp).color(kTextPrimaryColor).make(),
40.w.heightBox,
'现场照片'.text.size(28.sp).color(kTextSubColor).make(),
24.w.heightBox,
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
if (model.acceptanceImgLists != null)
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
children: model.acceptanceImgLists!.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
children: model.acceptanceImgLists.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
40.w.heightBox,
Row(
children: [

@ -114,24 +114,25 @@ class _EngineerRepairAcceptanceResultPageState
40.w.heightBox,
'到现场验收照片'.text.size(28.sp).color(kTextSubColor).make(),
24.w.heightBox,
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
if (widget.recordModel.acceptanceImgLists != null)
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
children: widget.recordModel.acceptanceImgLists!.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
children: widget.recordModel.acceptanceImgLists.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
40.w.heightBox,
'反馈时间'.text.size(28.sp).color(kTextSubColor).make(),
24.w.heightBox,
@ -152,12 +153,12 @@ class _EngineerRepairAcceptanceResultPageState
_buildTile(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
'处理描述',
widget.recordModel.content,
widget.recordModel.content ?? '',
),
_buildTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
'材料清单',
widget.recordModel.billMaterials,
widget.recordModel.billMaterials ?? '',
),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '完成时间',
widget.recordModel.createDate),
@ -170,24 +171,25 @@ class _EngineerRepairAcceptanceResultPageState
fontSize: 28.w,
),
),
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
if (widget.recordModel.maintenanceImgLists != null)
GridView(
padding: EdgeInsets.only(top: 16.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
children: widget.recordModel.maintenanceImgLists!.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
children: widget.recordModel.maintenanceImgLists.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url!)),
);
}).toList(),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
],
);
}

@ -1,11 +1,17 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_list_model.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_new_acceptance_record_model.dart';
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_result_model.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_acceptance_page.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_acceptance_record_list_page.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_depart_company_page.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_detail_page.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_func.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_map.dart';
import 'package:aku_community_manager/ui/manage_pages/engineer_repair/engineer_repair_report_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:flutter/material.dart';
@ -186,6 +192,7 @@ class EngineerRepairCard extends StatelessWidget {
? AkuMaterialButton(
height: 64.w,
onPressed: () async {
await EngineerRepairFunc.personPick(model.id);
callRefresh();
},
radius: 4,
@ -227,6 +234,7 @@ class EngineerRepairCard extends StatelessWidget {
AkuMaterialButton(
height: 64.w,
onPressed: () async {
await Get.to(() => EngineerRepairReportPage(repairId: model.id));
callRefresh();
},
radius: 4,
@ -248,14 +256,37 @@ class EngineerRepairCard extends StatelessWidget {
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {
callRefresh();
},
onPressed: UserTool
.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
? () async {
EngineerRepairResultModel? resultModel =
await EngineerRepairFunc.getRepairResult(model.id);
if (resultModel != null) {
await Get.to(() => EngineerRepairAcceptancePage(
resultModel: resultModel,
repairId: model.id,
status: model.status,
));
}
}
: () async {
List<EngineerRepairNewAcceptanceRecordModel> models = [];
models.addAll(
await EngineerRepairFunc.getAcceptanceRecordList(
model.id));
await Get.to(() =>
EngineerRepairAcceptanceRecordListPage(models: models));
callRefresh();
},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('验收记录'),
UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
ERAUTH.SENDTOCOMPANY
? '验收审核'
: '验收记录',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,

@ -54,17 +54,19 @@ class _EngineerRepairCompletePageState
Container(
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'维修结果'.text.size(36.sp).color(kTextPrimaryColor).make(),
40.w.heightBox,
'处理描述'.text.size(28.sp).color(kTextPrimaryColor).make(),
24.w.heightBox,
_buildTextField(_reportDetailController),
_buildTextField(_reportDetailController, '请描述维修结果'),
24.w.heightBox,
'材料清单'.text.size(28.sp).color(kTextPrimaryColor).make(),
24.w.heightBox,
_buildTextField(_materialController),
_buildTextField(_materialController, '请填写材料清单'),
40.w.heightBox,
'上传维修完成照片'.text.size(28.sp).color(kTextPrimaryColor).make(),
24.w.heightBox,
@ -96,7 +98,7 @@ class _EngineerRepairCompletePageState
);
}
Widget _buildTextField(TextEditingController controller) {
Widget _buildTextField(TextEditingController controller, String hintText) {
return Container(
width: 686.w,
height: 300.w,
@ -110,12 +112,13 @@ class _EngineerRepairCompletePageState
child: TextField(
minLines: 5,
maxLines: 10,
controller: controller,
autofocus: false,
onChanged: (value) {
setState(() {});
},
decoration: InputDecoration(
hintText: '请简要描述一下维修结果',
hintText: hintText,
hintStyle: TextStyle(
fontSize: 28.sp,
color: kTextSubColor,

@ -58,6 +58,7 @@ class _EngineerRepairDepartCompanyState
widget.repairId, _selectId);
if (result) {
Get.back();
Get.back();
}
},
),
@ -65,23 +66,33 @@ class _EngineerRepairDepartCompanyState
}
Widget _buildTile(EngineerRepairOrganizationModel model) {
return Row(
children: [
Checkbox(
value: _selectId == model.id,
onChanged: (value) {
if (value ?? false) {
_selectId = model.id;
} else {
_selectId = 0;
}
setState(() {});
},
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
).box.width(28.w).height(28.sp).make(),
8.w.widthBox,
model.name.text.size(32.sp).color(kTextPrimaryColor).make(),
],
).box.color(Colors.white).padding(EdgeInsets.all(32.w)).make();
return GestureDetector(
onTap: () {
if (_selectId == model.id) {
_selectId = 0;
} else {
_selectId = model.id;
}
setState(() {});
},
child: Row(
children: [
Checkbox(
value: _selectId == model.id,
onChanged: (value) {
if (value ?? false) {
_selectId = model.id;
} else {
_selectId = 0;
}
setState(() {});
},
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
).box.width(28.w).height(28.sp).make(),
8.w.widthBox,
model.name.text.size(32.sp).color(kTextPrimaryColor).make(),
],
).box.color(Colors.white).padding(EdgeInsets.all(32.w)).make(),
);
}
}

@ -42,6 +42,7 @@ class _EngineerRepairDepartPersonPageState
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
_models.clear();
_models.addAll(
await EngineerRepairFunc.getPersons(widget.organizationId));
if (_models.isNotEmpty) {
@ -65,6 +66,7 @@ class _EngineerRepairDepartPersonPageState
widget.repairId, _selectId);
if (result) {
Get.back();
Get.back();
}
},
),
@ -105,7 +107,11 @@ class _EngineerRepairDepartPersonPageState
AkuMaterialButton(
height: 96.w,
onPressed: () {
_selectId = e.id;
if (_selectId == e.id) {
_selectId = 0;
} else {
_selectId = e.id;
}
setState(() {});
},
child: Row(
@ -132,7 +138,7 @@ class _EngineerRepairDepartPersonPageState
width: 40.w,
),
Text(
e.userName,
e.actualName,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,

@ -84,7 +84,6 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
_buildInfo(),
16.w.heightBox,
if (_model?.maintenanceStaff != null) _buildOperator(),
if (_model?.organizationId != null) _buildOrganization(),
if (_processModels.isNotEmpty) _buildProcess(),
@ -133,7 +132,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
? AkuBottomButton(
title: '立即派单',
onTap: () async {
await Get.off(EngineerRepairDepartCompany(
await Get.to(EngineerRepairDepartCompany(
repairId: widget.repairEngineerId));
},
)
@ -146,7 +145,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
? AkuBottomButton(
title: '立即派单',
onTap: () async {
await Get.off(EngineerRepairDepartPersonPage(
await Get.to(EngineerRepairDepartPersonPage(
organizationId: _model!.organizationId!,
organizationName: _model!.organizationName!,
repairId: _model!.id));
@ -183,6 +182,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
'维修完成'.text.size(32.sp).color(Colors.white).make()),
AkuMaterialButton(
color: kPrimaryColor,
minWidth: 463.w,
onPressed: () async {
await Get.to(() =>
EngineerRepairReportPage(repairId: _model!.id));
@ -204,11 +204,13 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
if (resultModel != null) {
await Get.to(() => EngineerRepairAcceptancePage(
resultModel: resultModel,
detailModel: _model!,
repairId: _model!.id,
status: _model!.status,
));
}
},
child: '验收审核'.text.size(32.sp).color(Colors.black).make())
child:
'验收审核'.text.size(32.sp).bold.color(Colors.black).make())
: SizedBox();
case 6:
return UserTool.userProvider.infoModel!.engineeringRepairAuthority ==
@ -226,7 +228,8 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
));
}
},
child: '验收结果'.text.size(32.sp).color(Colors.black).make())
child:
'验收结果'.text.size(32.sp).bold.color(Colors.black).make())
: SizedBox();
default:
return SizedBox();
@ -239,15 +242,19 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
Widget _buildReport() {
return AkuTitleBox(
title: '工作日志',
children: _reportModels
.mapIndexed(
(currentValue, index) => _buildReportTile(currentValue, index))
.toList(),
children: [
40.w.heightBox,
..._reportModels
.mapIndexed(
(currentValue, index) => _buildReportTile(currentValue, index))
.toList()
],
).pOnly(bottom: 16.w);
}
Widget _buildReportTile(EngineerRepairWorkReportModel model, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
@ -271,8 +278,9 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
.make()
.pOnly(left: 58.w),
18.w.heightBox,
BeeGridImageView(
urls: model.workReportImgLists.map((e) => e.url ?? '').toList())
if (model.workReportImgLists != null)
BeeGridImageView(
urls: model.workReportImgLists!.map((e) => e.url ?? '').toList())
],
);
}
@ -286,7 +294,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
e.operationDate,
);
}).toList(),
).pOnly(bottom: 16.w);
);
}
Widget _buildProcessTile(String title, String date) {
@ -326,7 +334,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
_buildTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', _model!.maintenanceStaffTel!)
],
).pOnly(bottom: 16.w);
);
}
_buildOrganization() {
@ -343,7 +351,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
_buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话',
_model!.organizationLeadingTel ?? '')
],
).pOnly(bottom: 16.w);
);
}
_buildInfo() {
@ -363,7 +371,7 @@ class _EngineerRepairDetailPageState extends State<EngineerRepairDetailPage> {
_model!.createTel,
),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '报修区域',
'${S.of(context)!.tempPlotName}'),
'${S.of(context)!.tempPlotName} ${_model!.repairArea}'),
AkuBox.h(8),
Text(
_model!.reportDetail,

@ -34,6 +34,7 @@ class _EngineerRepairReportPageState extends State<EngineerRepairReportPage> {
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
width: double.infinity,
color: Colors.white,
child: Column(
@ -45,7 +46,6 @@ class _EngineerRepairReportPageState extends State<EngineerRepairReportPage> {
24.w.heightBox,
Container(
width: 686.w,
height: 87.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
@ -61,6 +61,7 @@ class _EngineerRepairReportPageState extends State<EngineerRepairReportPage> {
});
},
minLines: 5,
maxLines: 10,
decoration: InputDecoration(
hintText: '请输入具体描述',
hintStyle: TextStyle(
@ -73,18 +74,18 @@ class _EngineerRepairReportPageState extends State<EngineerRepairReportPage> {
isDense: true,
),
),
)
),
40.w.heightBox,
'上传照片'.text.size(28.sp).color(kTextPrimaryColor).make(),
24.w.heightBox,
AkuPickImageWidget(onChanged: (files) {
_files.clear();
_files.addAll(files);
setState(() {});
}),
],
),
),
40.w.heightBox,
'上传照片'.text.size(28.sp).color(kTextPrimaryColor).make(),
24.w.heightBox,
AkuPickImageWidget(onChanged: (files) {
_files.clear();
_files.addAll(files);
setState(() {});
}),
],
),
bottom: AkuBottomButton(
@ -97,7 +98,6 @@ class _EngineerRepairReportPageState extends State<EngineerRepairReportPage> {
widget.repairId, _reportDetail, urls);
if (result) {
Get.back();
Get.back();
}
cancel();
},

Loading…
Cancel
Save