parent
2b5a699029
commit
57db1151a0
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:aku_community_manager/models/common/img_model.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'engineer_repair_new_acceptance_record_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class EngineerRepairNewAcceptanceRecordModel {
|
||||||
|
final int id;
|
||||||
|
final int repairEngineeringId;
|
||||||
|
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 String acceptancePeopleName;
|
||||||
|
final String acceptanceDate;
|
||||||
|
final List<ImgModel> acceptanceImgLists;
|
||||||
|
factory EngineerRepairNewAcceptanceRecordModel.fromJson(
|
||||||
|
Map<String, dynamic> json) =>
|
||||||
|
_$EngineerRepairNewAcceptanceRecordModelFromJson(json);
|
||||||
|
EngineerRepairNewAcceptanceRecordModel(
|
||||||
|
this.id,
|
||||||
|
this.repairEngineeringId,
|
||||||
|
this.content,
|
||||||
|
this.billMaterials,
|
||||||
|
this.maintenanceImgLists,
|
||||||
|
this.createName,
|
||||||
|
this.createDate,
|
||||||
|
this.results,
|
||||||
|
this.advice,
|
||||||
|
this.acceptancePeople,
|
||||||
|
this.acceptancePeopleName,
|
||||||
|
this.acceptanceDate,
|
||||||
|
this.acceptanceImgLists);
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'engineer_repair_new_acceptance_record_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
EngineerRepairNewAcceptanceRecordModel
|
||||||
|
_$EngineerRepairNewAcceptanceRecordModelFromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
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>))
|
||||||
|
.toList(),
|
||||||
|
json['createName'] as String,
|
||||||
|
json['createDate'] as String,
|
||||||
|
json['results'] as int,
|
||||||
|
json['advice'] as String,
|
||||||
|
json['acceptancePeople'] as String,
|
||||||
|
json['acceptancePeopleName'] as String,
|
||||||
|
json['acceptanceDate'] as String,
|
||||||
|
(json['acceptanceImgLists'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
import 'package:aku_community_manager/models/common/img_model.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'engineer_repair_result_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class EngineerRepairResultModel {
|
||||||
|
final int id;
|
||||||
|
final int repairEngineeringId;
|
||||||
|
final String content;
|
||||||
|
final String billMaterials;
|
||||||
|
final List<ImgModel> maintenanceImgLists;
|
||||||
|
final String createName;
|
||||||
|
final String createDate;
|
||||||
|
|
||||||
|
factory EngineerRepairResultModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$EngineerRepairResultModelFromJson(json);
|
||||||
|
|
||||||
|
EngineerRepairResultModel(
|
||||||
|
this.id,
|
||||||
|
this.repairEngineeringId,
|
||||||
|
this.content,
|
||||||
|
this.billMaterials,
|
||||||
|
this.maintenanceImgLists,
|
||||||
|
this.createName,
|
||||||
|
this.createDate);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'engineer_repair_result_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
EngineerRepairResultModel _$EngineerRepairResultModelFromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
return EngineerRepairResultModel(
|
||||||
|
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>))
|
||||||
|
.toList(),
|
||||||
|
json['createName'] as String,
|
||||||
|
json['createDate'] as String,
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
import 'package:aku_community_manager/const/api.dart';
|
||||||
|
import 'package:aku_community_manager/json_models/manager/engineer_repair/engineer_repair_new_acceptance_record_model.dart';
|
||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class EngineerRepairAcceptanceRecordListPage extends StatefulWidget {
|
||||||
|
final List<EngineerRepairNewAcceptanceRecordModel> models;
|
||||||
|
|
||||||
|
const EngineerRepairAcceptanceRecordListPage({Key? key, required this.models})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_EngineerRepairAcceptanceRecordListPageState createState() =>
|
||||||
|
_EngineerRepairAcceptanceRecordListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EngineerRepairAcceptanceRecordListPageState
|
||||||
|
extends State<EngineerRepairAcceptanceRecordListPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '验收记录',
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||||
|
children: widget.models
|
||||||
|
.mapIndexed(
|
||||||
|
(currentValue, index) => _buildCard(currentValue, index))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildCard(EngineerRepairNewAcceptanceRecordModel model, index) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
'${S.of(context)!.tempPlotName}'
|
||||||
|
.text
|
||||||
|
.size(32.sp)
|
||||||
|
.color(kTextPrimaryColor)
|
||||||
|
.make(),
|
||||||
|
Spacer(),
|
||||||
|
'${model.results == 1 ? '通过' : '驳回'}'
|
||||||
|
.text
|
||||||
|
.size(32.sp)
|
||||||
|
.color(Colors.red)
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
40.w.heightBox,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
'验收人'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
Spacer(),
|
||||||
|
model.acceptancePeopleName.text
|
||||||
|
.size(28.sp)
|
||||||
|
.color(kTextPrimaryColor)
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
40.w.heightBox,
|
||||||
|
'现场情况'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
40.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,
|
||||||
|
),
|
||||||
|
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: [
|
||||||
|
'反馈时间'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
Spacer(),
|
||||||
|
model.acceptanceDate.text
|
||||||
|
.size(28.sp)
|
||||||
|
.color(kTextPrimaryColor)
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,223 @@
|
|||||||
|
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_new_acceptance_record_model.dart';
|
||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/tools/widget_tool.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_func.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class EngineerRepairAcceptanceResultPage extends StatefulWidget {
|
||||||
|
final EngineerRepairNewAcceptanceRecordModel recordModel;
|
||||||
|
|
||||||
|
const EngineerRepairAcceptanceResultPage(
|
||||||
|
{Key? key, required this.recordModel})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_EngineerRepairAcceptanceResultPageState createState() =>
|
||||||
|
_EngineerRepairAcceptanceResultPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EngineerRepairAcceptanceResultPageState
|
||||||
|
extends State<EngineerRepairAcceptanceResultPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '验收结果',
|
||||||
|
body: ListView(
|
||||||
|
children: [
|
||||||
|
_buildAcceptanceResult(),
|
||||||
|
16.w.heightBox,
|
||||||
|
_buildRepairResult(),
|
||||||
|
16.w.heightBox,
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () async {
|
||||||
|
List<EngineerRepairNewAcceptanceRecordModel> models = [];
|
||||||
|
models.addAll(await EngineerRepairFunc.getAcceptanceRecordList(
|
||||||
|
widget.recordModel.repairEngineeringId));
|
||||||
|
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: widget.recordModel.results == 1
|
||||||
|
? SizedBox()
|
||||||
|
: AkuBottomButton(
|
||||||
|
title: '开始整改',
|
||||||
|
onTap: () async {
|
||||||
|
var result = await EngineerRepairFunc.startRectification(
|
||||||
|
widget.recordModel.repairEngineeringId);
|
||||||
|
if (result) {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildAcceptanceResult() {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
'验收单位'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
'${widget.recordModel.acceptancePeopleName}'
|
||||||
|
.text
|
||||||
|
.size(32.sp)
|
||||||
|
.color(kTextPrimaryColor)
|
||||||
|
.bold
|
||||||
|
.make(),
|
||||||
|
40.w.heightBox,
|
||||||
|
'验收结果'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
'${widget.recordModel.results == 1 ? '通过' : '驳回'}'
|
||||||
|
.text
|
||||||
|
.size(32.sp)
|
||||||
|
.color(Colors.red)
|
||||||
|
.bold
|
||||||
|
.make(),
|
||||||
|
40.w.heightBox,
|
||||||
|
'反馈意见'.text.size(28.sp).color(kTextSubColor).make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
widget.recordModel.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,
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
widget.recordModel.acceptanceDate.text
|
||||||
|
.size(28.sp)
|
||||||
|
.color(kTextPrimaryColor)
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildRepairResult() {
|
||||||
|
return AkuTitleBox(
|
||||||
|
title: '维修结果',
|
||||||
|
children: [
|
||||||
|
AkuBox.h(16),
|
||||||
|
_buildTile(
|
||||||
|
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
||||||
|
'处理描述',
|
||||||
|
widget.recordModel.content,
|
||||||
|
),
|
||||||
|
_buildTile(
|
||||||
|
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
||||||
|
'材料清单',
|
||||||
|
widget.recordModel.billMaterials,
|
||||||
|
),
|
||||||
|
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '完成时间',
|
||||||
|
widget.recordModel.createDate),
|
||||||
|
AkuBox.h(8),
|
||||||
|
Text(
|
||||||
|
'现场照片',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 28.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildTile(String asset, String title, String subTitle) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
AkuBox.h(56),
|
||||||
|
Image.asset(
|
||||||
|
asset,
|
||||||
|
height: 40.w,
|
||||||
|
width: 40.w,
|
||||||
|
),
|
||||||
|
AkuBox.w(4),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28.sp,
|
||||||
|
color: AppStyle.minorTextColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
subTitle,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28.sp,
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue