Merge remote-tracking branch 'origin/master'

master
hs 2026-06-16 18:00:13 +08:00
commit fe973c0cfd
9 changed files with 1340 additions and 11 deletions

View File

@ -510,7 +510,10 @@ enum UploadFileType {
/// - : '609', : 'enclosed_area_personnel_applicant_signature'
enclosedAreaPersonnelApplicantSignature('609', 'enclosed_area_personnel_applicant_signature'),
/// - : '610', : 'enclosed_area_vehicle_applicant_signature'
enclosedAreaVehicleApplicantSignature('610', 'enclosed_area_vehicle_applicant_signature');
enclosedAreaVehicleApplicantSignature('610', 'enclosed_area_vehicle_applicant_signature'),
/// - : '701', : 'feedback_image_key_homework_punishment'
feedbackImageKeyHomeworkPunishment('701', 'feedback_image_key_homework_punishment');

View File

@ -47,6 +47,18 @@ class KeyTasksApi {
);
}
///
static Future<Map<String, dynamic>> deleteTasksData(String id) {
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/keyProject/$id',
method: Method.post,
data: {
// ...data
},
);
}
/// -
static Future<Map<String, dynamic>> getKeyTasksListCameraAll(String type) {
return HttpManager().request(
@ -153,4 +165,31 @@ class KeyTasksApi {
}
///
static Future<Map<String, dynamic>> getHiddenDangerPenalty(Map data) {
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/hidden/penalty/feedback/list',
method: Method.post,
data: {
...data
},
);
}
///
static Future<Map<String, dynamic>> setPenaltyFeedback(Map data) {
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/hidden/penalty/feedback/save',
method: Method.post,
data: {
...data
},
);
}
}

View File

@ -1002,7 +1002,7 @@ class HomePageState extends RouteAwareState<HomePage>
case "隐患治理":
case "隐患管理":
case "风险管控应用":
// await pushPage(ApplicationPageTwo(), context);
await pushPage(HiddenDangerTabPage(), context);
break;
case "消防检查":
// await pushPage(FireManagementTabPage(), context);

View File

@ -48,7 +48,7 @@ class KeyTasksHiddenDangerDetail extends StatefulWidget {
this.inspectCodeId,
}) : super(key: key);
final item; // 1 2
final item; // 1 2 3
final String itemId;
final String hiddenId;
final String foreignKey;
@ -129,6 +129,9 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
case 2: //
title='隐患记录';
break;
case 3: //
title='处罚反馈';
break;
}
@ -765,6 +768,93 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
),
],
//
if (widget.item==3)...[
SizedBox(height: 10),
Card(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: 10,
left: 10,
right: 10,
),
child: Row(
children: [
Container(
width: 3,
height: 15,
color: Colors.blue,
),
const SizedBox(width: 8),
Text(
"处罚反馈",
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
),
ItemListWidget.itemContainer(
RepairedPhotoSection(
isRequired:true,
title: "罚款缴纳单",
maxCount: 4,
mediaType: MediaType.image,
onChanged: (files) {
// files
gaiHouImages.clear();
for(int i=0;i<files.length;i++){
gaiHouImages.add(files[i].path);
}
},
onAiIdentify: () {
},
),
),
Divider(height: 1),
_buildInfoItem('处罚反馈人', widget.foreignKey ,),
const Divider(height: 1),
GestureDetector(
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.dateTimeWithSeconds,
context,
allowPast:false,
);
if (picked != null) {
setState(() {
penaltyFeedbackData['feedbackTime']= DateFormat('yyyy-MM-dd HH:mm:ss').format(picked);
});
}
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 15),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "处罚反馈时间",
rightText: penaltyFeedbackData['feedbackTime'].isNotEmpty?hiddenDangerRectification['feedbackTime']:"请选择",
isRight: true,
),
),
),
],
),
),
],
// //
// if (widget.canChange && widget.item == 6) ...[
// SizedBox(height: 10),
@ -899,7 +989,7 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
//
if (widget.item==1)...[
if (widget.item==1||widget.item==3)...[
SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -910,8 +1000,11 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
child: CustomButton(
height: 35,
onPressed: () {
if(widget.item==3){
_setPenaltyFeedback();
}else{
_setHiddenDangerRectification();
}
// _setHiddenDangerAcceptance();
},
textStyle: const TextStyle(color: Colors.white),
@ -1018,6 +1111,46 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
}
}
//
Future<void> _setPenaltyFeedback() async {
try {
if (gaiHouImages.isEmpty) {
ToastUtil.showNormal(context, "请上传罚款缴纳单图片");
return;
}
penaltyFeedbackData['hiddenPenaltyId']=widget.itemId;
penaltyFeedbackData['feedbackUserId']=widget.hiddenId;
LoadingDialogHelper.show();
if (gaiHouImages.isNotEmpty) {
String url= await _addImgFilesZhengGaiID(
gaiHouImages,
UploadFileType.feedbackImageKeyHomeworkPunishment,
);
penaltyFeedbackData['finePaymentReceipt']=url;
}
LoadingDialogHelper.show();
final Map<String, dynamic> raw = await KeyTasksApi.setPenaltyFeedback(penaltyFeedbackData,);
LoadingDialogHelper.hide();
if (raw['success']) {
setState(() {
ToastUtil.showNormal(context, "提交成功");
Navigator.of(context).pop('1');
});
} else {
ToastUtil.showNormal(context, "提交失败");
}
} catch (e) {
// Toast
print('加载首页数据失败:$e');
LoadingDialogHelper.hide();
}
}
//
Future<void> _setHiddenDangerAcceptance() async {
try {
@ -1271,7 +1404,7 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
final raw = await FileApi.uploadFiles(imagePaths, type, widget.hiddenId);
if (raw['success']) {
// raw['data']['foreignKey'];
return raw['data'];
return raw['data']['foreignKey'];
} else {
// _showMessage('反馈提交失败');
return "";
@ -1618,4 +1751,15 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
"repulseCause": "",
"checkUserId": "",
};
//
Map<String, dynamic> penaltyFeedbackData = {
"feedbackTime": "",
"hiddenPenaltyId": "",
"finePaymentReceipt": "",
"feedbackUserId": ''
};
}

View File

@ -132,7 +132,7 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
Divider(height: 1),
_buildInfoItem('重点作业名称', pd['projectName'] ?? ''),
Divider(height: 1),
_buildInfoItem('重点作业属性', pd['projectTypeName'] ?? ''),
_buildInfoItem('重点作业属性', pd['projectTypeName']!=null?pd['projectTypeName'].map((e) => e.toString()).join(","):''),
Divider(height: 1),
_buildInfoItem('计划工期开始', pd['planWorkStartDate'] ?? ''),
Divider(height: 1),
@ -636,6 +636,9 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
case 6:
typeText='已完工';
break;
case 7:
typeText='已驳回';
break;
}
return typeText;
}

View File

@ -0,0 +1,475 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/customWidget/MultiDictValuesPicker.dart';
import 'package:qhd_prevention/customWidget/bottom_picker.dart';
import 'package:qhd_prevention/customWidget/custom_button.dart';
import 'package:qhd_prevention/customWidget/date_picker_dialog.dart';
import 'package:qhd_prevention/customWidget/department_person_picker.dart';
import 'package:qhd_prevention/customWidget/department_picker.dart';
import 'package:qhd_prevention/customWidget/department_picker_three.dart';
import 'package:qhd_prevention/customWidget/item_list_widget.dart';
import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/http/modules/basic_info_api.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/tools.dart';
class KeyTasksPunishmentFilterPage extends StatefulWidget {
const KeyTasksPunishmentFilterPage({
super.key,
required this.searchData,
});
final Map searchData;
@override
State<KeyTasksPunishmentFilterPage> createState() => _KeyTasksPunishmentFilterPageState();
}
class _KeyTasksPunishmentFilterPageState extends State<KeyTasksPunishmentFilterPage> {
// controllers / state
///
TextEditingController _inspectionSiteController = TextEditingController();
///
TextEditingController _initiatorInspectionController = TextEditingController();
///
TextEditingController _inspectorController = TextEditingController();
///
TextEditingController _punishmentReasonController = TextEditingController();
//
final Map<String, List<Map<String, dynamic>>> _personCache = {};
DateTime? _startDate;
DateTime? _endDate;
Map searchData = {};
final DateFormat _dateFmt = DateFormat('yyyy-MM-dd');
@override
void initState() {
// TODO: implement initState
super.initState();
_fetchData();
}
Future<void> _fetchData() async {
setState(() {
searchData=widget.searchData;
_inspectionSiteController.text = searchData['hiddenDesc'];
_initiatorInspectionController.text = searchData['xgfCorpinfoName'];
_inspectorController.text = searchData['projectName'];
_punishmentReasonController.text = searchData['projectName'];
});
}
// ========== ==========
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppbar(title: '筛选'),
backgroundColor: Colors.white,
body: SafeArea(
child: Column(
children: [
Expanded(
child: ListView(
children: [
Container(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildTextFieldRow(
labelText: '隐患描述',
controller: _inspectionSiteController,
hintText: '请输入隐患描述',
onChanged: (value) {
searchData['hiddenDesc'] = value;
},
),
const SizedBox(height: 10),
buildTextFieldRow(
labelText: '被处罚单位',
controller: _initiatorInspectionController,
hintText: '请输入被处罚单位',
onChanged: (value) {
searchData['xgfCorpinfoName'] = value;
},
),
const SizedBox(height: 10),
buildTextFieldRow(
labelText: '处罚原因',
controller: _punishmentReasonController,
hintText: '请输入处罚原因',
onChanged: (value) {
searchData['projectName'] = value;
},
),
const SizedBox(height: 10),
buildTextFieldRow(
labelText: '重点作业名称',
controller: _inspectorController,
hintText: '请输入重点作业名称',
onChanged: (value) {
searchData['projectName'] = value;
},
),
],
),
),
],
),
),
ItemListWidget.itemContainer(
Row(
children: [
CustomButton(
text: '重置',
padding: const EdgeInsets.symmetric(
vertical: 8,
horizontal: 30,
),
buttonStyle: ButtonStyleType.secondary,
onPressed: _resetAll,
),
const SizedBox(width: 12),
Expanded(
child: CustomButton(text: '确定', onPressed: _confirm),
),
],
),
),
],
),
),
);
}
@override
void dispose() {
_inspectionSiteController.dispose();
_initiatorInspectionController.dispose();
_inspectorController.dispose();
_punishmentReasonController.dispose();
super.dispose();
}
Widget buildTextFieldRow({
required String labelText,
required TextEditingController controller,
required String hintText,
ValueChanged<String>? onChanged,
}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
labelText,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
const SizedBox(height: 8),
Container(
height: 45,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5),
),
padding: const EdgeInsets.symmetric(horizontal: 8),
alignment: Alignment.centerLeft,
child: TextFormField(
controller: controller,
decoration: InputDecoration(
hintText: hintText,
hintStyle: const TextStyle(color: Colors.grey),
border: InputBorder.none,
isDense: true,
),
maxLines: 1,
onChanged: onChanged,
),
),
],
);
}
Widget buildChooseRow({
required String labelText,
required String hintText,
required String valueText,
required VoidCallback onTap,
bool showArrow = true,
}) {
final bool hasValue = valueText.trim().isNotEmpty;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
labelText,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.black,
),
),
const SizedBox(height: 8),
Container(
height: 45,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(5),
),
child: InkWell(
onTap: onTap,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
Expanded(
child: Text(
hasValue ? valueText : hintText,
style: TextStyle(
color: hasValue ? Colors.black87 : Colors.black54,
fontSize: 15,
),
overflow: TextOverflow.ellipsis,
),
),
if (showArrow)
const Icon(Icons.arrow_drop_down, color: Colors.black54),
],
),
),
),
),
],
);
}
// Future<void> _chooseDepartment({required String typeStr}) async {
// showModalBottomSheet(
// context: context,
// isScrollControlled: true,
// barrierColor: Colors.black54,
// backgroundColor: Colors.transparent,
// builder:
// (_) => DepartmentPicker(
// onSelected: (id, name) async {
// setState(() {
// searchData['inspectionDepartmentId']=id;
// searchData['inspectionDepartmentName']=name;
// // personUnderInspection['departmentId'] = id;
// // personUnderInspection['userName'] = name;
// // if (typeStr == '检查部门') {
// // _inspectionDeptName = name;
// // } else if (typeStr == '被检查单位') {
// // _inspectedDepartmentName = name;
// // }
// });
// //
// await _getPersonListForUnitId(typeStr);
// },
// ),
// ).then((_) {
// // FocusHelper.clearFocus(context);
// });
// }
Future<void> _getPersonListForUnitId(String typeStr) async {
String unitId = searchData['inspectionDepartmentId'] ?? '';
//
final result = await BasicInfoApi.getDeptUsers(unitId);
dynamic raw = result['data'];
List<Map<String, dynamic>> list = [];
if (raw is List) {
list =
raw.map<Map<String, dynamic>>((e) {
if (e is Map<String, dynamic>) return e;
if (e is Map) return Map<String, dynamic>.from(e);
return <String, dynamic>{};
}).toList();
} else {
list = [];
}
setState(() {
_personCache[typeStr] = list;
});
//FocusHelper.clearFocus(context);
}
Future<void> _getApproverList() async {
try {
List<dynamic> newList = [
{'dataId':'1','dataName':'视频识别报警',},
{'dataId':'2','dataName':'安全环保检查(监管端)',},
{'dataId':'3','dataName':'安全环保检查(企业端)',},
];
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerThree(
listdata: newList,
onSelected: (id, name,pdId) async {
setState(() {
searchData['source']=id;
searchData['sourceName']=name;
});
},
),
);
} catch (e) {
// Toast
print('加载首页数据失败:$e');
// return "";
LoadingDialogHelper.hide();
}
}
///
// void choosePersonHandle(String typeStr) async {
// final personList = _personCache[typeStr];
// if (!FormUtils.hasValue(_personCache, typeStr)) {
// ToastUtil.showNormal(context, '请先选择单位');
// return;
// }
//
// DepartmentPersonPicker.show(
// context,
// personsData: personList!,
// onSelectedWithIndex: (userId, name, index) {
// setState(() {
// if (typeStr == '检查人') {
// _inspectionUserName = name;
// } else {
// _inspectedUserName = name;
// }
// });
// //FocusHelper.clearFocus(context);
// },
// ).then((_) {});
// }
Future<void> _pickDate({required bool isStart}) async {
DateTime? picked = await BottomDateTimePicker.showDate(
context,
minTimeStr: !isStart ? searchData['startTime'] : null,
mode: BottomPickerMode.dateTime,
);
if (picked != null) {
setState(() {
final dateFormat = DateFormat('yyyy-MM-dd HH:mm');
if (isStart) {
_startDate = picked;
searchData['startTime'] = dateFormat.format(picked);
} else {
_endDate = picked;
searchData['endTime'] = dateFormat.format(picked);
}
// <=
if (_endDate != null && _endDate!.isBefore(picked)) {
_endDate = null;
}
});
}
}
// //
// Future<void> _pickCheckStatus() async {
// List<Map<String, dynamic>> items = SafeCheckListItem.getStepList();
// final choice = await BottomPicker.show<String>(
// context,
// items: items.map((item) => item['name'].toString()).toList(),
// itemBuilder: (item) => Text(item, textAlign: TextAlign.center),
// initialIndex: 0,
// );
// if (choice != null) {
// setState(() {
// Map item = items[items.indexWhere((item) => item['name'] == choice)];
// _checkStatus = item['id'];
// });
// }
// }
// Future<void> _pickYearDate() async {
// DateTime? picked = await BottomDateTimePicker.showDate(
// context,
// minTimeStr: null,
// mode: BottomPickerMode.year,
// );
// if (picked != null) {
// setState(() {
// final dateFormat = DateFormat('yyyy');
// searchData['year'] = dateFormat.format(picked);
// });
// }
// }
// ========== / ==========
void _resetAll() {
setState(() {
_inspectionSiteController.clear();
_initiatorInspectionController.clear();
_inspectorController.clear();
_punishmentReasonController.clear();
// searchData['hiddenDesc']='';
// searchData['source']='';
// searchData['sourceName']='';
// searchData['startTime']='';
// searchData['endTime']='';
// searchData['projectName']='';
// searchData['hiddenFindUserName']='';
// searchData['orderBy']='';
// searchData['orderDirection']='';
// searchData['groupBy']='';
});
final Map<String, dynamic> pd = {
...searchData,
};
Navigator.of(context).pop(pd);
}
void _confirm() {
final Map<String, dynamic> pd = {
...searchData,
};
// for (Map subject in subjectList) {
// if (subject['bianma'] == pd['inspectionSubject']) {
// pd['inspectionSubject'] = subject['name'];
// }
// }
Navigator.of(context).pop(pd);
}
}

View File

@ -0,0 +1,581 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/CustomWidget/range_filter_bar.dart';
import 'package:qhd_prevention/common/route_service.dart';
import 'package:qhd_prevention/customWidget/custom_button.dart';
import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/keyTasksHiddenDanger/key_tasks_hidden_danger_detail.dart';
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/keyTasksHiddenDanger/key_tasks_hidden_filter_page.dart';
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/punishmentKeyTasks/key_tasks_punishment_filter_page.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/services/SessionService.dart';
import 'package:qhd_prevention/tools/h_colors.dart';
import 'package:qhd_prevention/tools/tools.dart';
import 'dart:async';
class KeyTasksPunishmentList extends StatefulWidget {
const KeyTasksPunishmentList( {super.key});
@override
State<KeyTasksPunishmentList> createState() => _KeyTasksPunishmentListState();
}
class _KeyTasksPunishmentListState extends State<KeyTasksPunishmentList> {
int _page = 1;
// String searchKey = "";
int _totalPage = 1;
bool _isLoading = false;
bool _hasMore = true;
Timer? _debounceTimer;
String buttonTextOne = '查看';
String buttonTextTwo = '确认';
String title = "";
final TextEditingController _searchController = TextEditingController();
bool isJGD = false;
late List<dynamic> _list = [];
@override
void initState() {
super.initState();
//
_searchController.addListener(_onSearchChanged);
_distinguishData();
}
Future<void> _distinguishData() async {
buttonTextTwo = '反馈';
title = "处罚反馈";
final parentPerm = 'dashboard:Key-assignment:Hidden-hazard-record';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
keyTasksPunishmentData['menuPath']=menuPath;
_getListData(false);
}
@override
void dispose() {
_debounceTimer?.cancel();
_searchController.removeListener(_onSearchChanged);
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
//
final double screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
appBar: MyAppbar(title:title),
body: SafeArea(
child: NotificationListener<ScrollNotification>(
onNotification: _onScroll,
child: _vcDetailWidget(),
),
),
backgroundColor: Colors.white,
);
}
Widget _vcDetailWidget() {
return Column(
children: [
RangeFilterBar(
initial: RangeOption.none,
mode: RangeFilterBarMode.dayWeekMonth,
onRangeChanged: (range) {
switch (range) {
case RangeOption.oneDay:
keyTasksPunishmentData['hiddenCreateTimeStart'] = DateFormat('yyyy-MM-dd HH:mm:ss')
.format(DateTime.now().subtract(const Duration(days: 1)));
break;
case RangeOption.oneWeek:
keyTasksPunishmentData['hiddenCreateTimeStart'] = DateFormat('yyyy-MM-dd HH:mm:ss')
.format(DateTime.now().subtract(const Duration(days: 7)));
break;
case RangeOption.oneMonth:
keyTasksPunishmentData['hiddenCreateTimeStart'] = DateFormat('yyyy-MM-dd HH:mm:ss')
.format(DateTime.now().subtract(const Duration(days: 30)));
break;
case RangeOption.threeMonths:
break;
case RangeOption.none:
break;
}
_performSearch();
},
onFilterPressed: () async {
//
// String searchData='';
final searchData= await pushPage(
KeyTasksPunishmentFilterPage(
searchData: keyTasksPunishmentData,
),
context,
);
if(searchData!=null){
keyTasksPunishmentData=searchData;
_performSearch();
}
},
),
Container(height: 5, color: h_backGroundColor()),
Expanded(
child:
_list.isEmpty
? NoDataWidget.show()
: ListView.builder(
itemCount: _list.length,
itemBuilder: (context, index) {
final item = _list[index];
return _fxitemCell(item);
},
),
),
],
);
}
Widget _fxitemCell(pageData) {
// 使GestureDetector
return GestureDetector(
onTap: () {},
child: Container(
margin: EdgeInsets.all(6),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, //
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(left: 10, top: 15, right: 8),
child: Text(
'隐患描述: ${pageData['hiddenDesc'] ?? ''}',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black87,
),
maxLines: 1, //
overflow: TextOverflow.ellipsis, //
),
),
),
//
// Container(
// padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
// decoration: BoxDecoration(
// color: _getLevelColor(pageData),
// borderRadius: BorderRadius.only(
// bottomLeft: Radius.circular(12),
// topRight: Radius.circular(12), //
// ),
// ),
// child: Text(
// pageData['hiddenLevelName'] ?? '',
// style: TextStyle(
// color: Colors.white,
// fontSize: 12,
// fontWeight: FontWeight.bold,
// ),
// ),
// ),
],
),
SizedBox(height: 16),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//
Expanded(
child: Text(
'被处罚单位: ${pageData['']??''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
),
),
],
),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// - 使 Expanded
Expanded(
child: Text(
'被处罚人:${pageData['findUserName'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
// Expanded(
// child: Text(
// '发现时间:${_changeTime(pageData['createTime'] ?? '')}',
//
// style: TextStyle(fontSize: 14, color: Colors.black87),
// // maxLines: 1,
// // overflow: TextOverflow.ellipsis,
// ),
// ),
],
),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Expanded(
child:
Text('处罚原因: ${pageData['projectName'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
),
),
],
),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Expanded(
child:
Text('下发人: ${pageData['projectName'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
),
),
],
),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Expanded(
child:
Text('处罚反馈状态: ${pageData['projectName'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
),
),
],
),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Expanded(
child:
Text(
'重点作业名称: ${pageData['projectName'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.black87),
),
),
// Expanded(
// child:
// Text(
// '',
// style: TextStyle(
// fontSize: 14,
// color: Colors.black87,
// ),
// ),
// ),
],
),
),
SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Expanded(
child: CustomButton(
height: 35,
onPressed: () async {
// print('查看: ${pageData['title']}');
await pushPage(
KeyTasksHiddenDangerDetail(
2,
pageData['id'],
pageData['hiddenId'],
pageData['foreignKey'],
false,
),
context,
);
_page = 1;
_getListData(false);
},
backgroundColor: h_backGroundColor(),
textStyle: const TextStyle(color: Colors.black),
buttonStyle: ButtonStyleType.secondary,
text: buttonTextOne,
),
),
SizedBox(width: 10), // 使widthheight
Expanded(
child: CustomButton(
height: 35,
onPressed: () async {
await pushPage(
KeyTasksHiddenDangerDetail(
3,
pageData['hiddenPenaltyId']??'',
pageData['feedbackUserId']??'',
pageData['feedbackUserName']??'',
false,
),
context,
);
_page = 1;
_getListData(false);
},
backgroundColor: h_AppBarColor(),
textStyle: const TextStyle(color: Colors.white),
buttonStyle: ButtonStyleType.primary,
text: buttonTextTwo,
),
),
],
),
SizedBox(height: 10),
],
),
),
);
}
void _performSearch() {
//
// if (keyword.isNotEmpty) {
// print('执行搜索: $keyword');
// API
//
_page = 1;
// searchKey = keyword;
_getListData(false);
// }
}
bool _onScroll(ScrollNotification n) {
if (n.metrics.pixels > n.metrics.maxScrollExtent - 100 &&
_hasMore &&
!_isLoading) {
_page++;
_getListData(true);
}
return false;
}
void _onSearchChanged() {
final query = _searchController.text.toLowerCase().trim();
setState(() {
print("=====>" + query);
// filtered = query.isEmpty ? original : _filterCategories(original, query);
});
}
Future<void> _getListData(bool loadMore) async {
try {
if (_isLoading) return;
_isLoading = true;
keyTasksPunishmentData['pageIndex']=_page;
// keyTasksPunishmentData['hiddenDesc']=searchKey;
LoadingDialogHelper.show();
final Map<String, dynamic> result = await KeyTasksApi.getHiddenDangerPenalty(keyTasksPunishmentData);
LoadingDialogHelper.hide();
if (result['success']) {
_totalPage = result['pageSize'] ?? 1;
final List<dynamic> newList = result['data'] ?? [];
// setState(() {
// _list.addAll(newList);
// });
setState(() {
if (loadMore) {
_list.addAll(newList);
} else {
_list = newList;
}
_hasMore = _page < _totalPage;
// if (_hasMore) _page++;
});
} else {
ToastUtil.showNormal(context, "加载数据失败");
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
} finally {
// if (!loadMore) LoadingDialogHelper.hide();
_isLoading = false;
}
}
String _getSourceDangers(final item) {
//,1-,2-() 3-()
int type = item["source"] ?? 0;
if (1 == type) {
return "隐患来源:视频识别报警";
} else if (2 == type) {
return "隐患来源:安全环保检查(监管端)";
} else if (3 == type) {
return "隐患来源:安全环保检查(企业端)";
} else {
return "隐患来源:";
}
}
//
Color _getLevelColor(final item) {
String type = item["hiddenLevelName"] ?? '';
if ("重大隐患" == type) {
return Colors.red;
} else if ("较大隐患" == type) {
return Color(0xFFFF6A4D);
} else if ("一般隐患" == type) {
return Colors.orange;
} else if ("轻微隐患" == type) {
return h_AppBarColor();
} else {
return Colors.green;
}
}
String _getState(final item) {
//1,,2:,3:,4:
int type = item["state"];
if(1==type){
return "未整改";
}else if(2==type){
return "已整改";
}else if(3==type){
return "已验收";
}else if(4==type){
return "验收打回";
}else{
return "";
}
}
String _changeTime(String time) {
try {
// ISO 8601
DateTime dateTime = DateTime.parse(time);
//
return DateFormat('yyyy-MM-dd').format(dateTime);
} catch (e) {
//
return ' ';
}
}
String truncateString(String input) {
if (input.length > 10) {
return '${input.substring(0, 10)}...';
}
return input;
}
Map<String, dynamic> keyTasksPunishmentData={
"needTotalCount": true,
"pageSize": 20,
"orderBy": "",
"hiddenCreateTimeStart": "",
"groupBy": "",
"fineFlag": 1,
"hiddenDesc": "",
"xgfCorpinfoName": "",
"pageIndex": '',
"hiddenSource": '',
"orderDirection": "",
"findUserName": "",
"projectName": "",
"hiddenCreateTimeEnd": ""
};
}

View File

@ -163,7 +163,7 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
),
),
const SizedBox(height: 8),
_buildItemChild('重点作业属性:',item['projectTypeName']??""),
_buildItemChild('重点作业属性:',item['projectTypeName']!=null?item['projectTypeName'].map((e) => e.toString()).join(","):''),
const SizedBox(height: 8),
_buildItemChild('辖区单位:',item['jurisdictionCorpinfoName']??""),
const SizedBox(height: 8),
@ -193,7 +193,7 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
buttonStyle:ButtonStyleType.primary,
text: '查看'),),
if((item['uncheckHiddenCount']==0&&item['unFinishInspectionCount']==0)||item["applyStatus"]==1)...[
if(((item['uncheckHiddenCount']==0&&item['unFinishInspectionCount']==0)||item["applyStatus"]==1)&&item["applyStatus"]!=7)...[
const SizedBox(width: 8),
Expanded(child: CustomButton(
height: 35,
@ -218,6 +218,56 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
text: item["applyStatus"]==1?'开工申请':'完工申请'),),
],
if(item["applyStatus"]==1&&item["createSource"]==2)...[
const SizedBox(width: 8),
Expanded(child: CustomButton(
height: 35,
onPressed: () async {
final ok = await CustomAlertDialog.showConfirm(
context,
title: '删除',
content: '确定要删除吗?',
cancelText: '取消',
);
if (ok) {
_deleteTasksData(item);
}
},
backgroundColor: Colors.red,
textStyle: const TextStyle(color: Colors.red),
buttonStyle: ButtonStyleType.primary,
text: '删除'),),
],
if(item["applyStatus"]==7)...[
const SizedBox(width: 8),
Expanded(child: CustomButton(
height: 35,
onPressed: () {
_goToDetail(item,index,2);
},
backgroundColor: h_AppBarColor(),
textStyle: const TextStyle(color: Colors.red),
buttonStyle:ButtonStyleType.primary,
text: '重新提交'),),
const SizedBox(width: 8),
Expanded(child: CustomButton(
height: 35,
onPressed: () async {
final ok = await CustomAlertDialog.showConfirm(
context,
title: '驳回原因',
cancelText:'',
content: item["rejectReason"]??'',
);
},
backgroundColor: h_AppBarColor(),
textStyle: const TextStyle(color: Colors.red),
buttonStyle:ButtonStyleType.secondary,
text: '驳回原因'),),
]
],),
@ -309,6 +359,9 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
case 6:
typeText='已完工';
break;
case 7:
typeText='已驳回';
break;
}
return typeText;
}
@ -361,7 +414,7 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
Map<String, dynamic> keyTasksConfirmListData={
"projectName": "",
"applyStatusList": [1,4],//,0:1:,2:,3:,4:,5:,6:
"applyStatusList": [1,4,7],//,0:1:,2:,3:,4:,5:,6:
"pageSize": 20,
"pageIndex": 1,
"needTotalCount": true,
@ -386,6 +439,25 @@ class _KeyTasksConfirmListPageState extends State<KeyTasksConfirmListPage> {
}
}
Future<void> _deleteTasksData( item) async {
try {
final Map<String, dynamic> result;
result = await KeyTasksApi.deleteTasksData(item["id"]);
if (result['success'] ) {
ToastUtil.showNormal(context, '删除成功');
// _list.remove(item);
getListData(false);
}else{
ToastUtil.showNormal(context, '删除失败');
// _showMessage('加载数据失败');
}
} catch (e) {
// Toast
print('加载数据失败:$e');
}
}
Map<String, dynamic> upKeyTasksData={
"applyStatus": '5',

View File

@ -6,6 +6,7 @@ import 'package:qhd_prevention/common/route_service.dart';
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/keyTasksHiddenDanger/key_tasks_hidden_danger_list.dart';
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/punishmentKeyTasks/key_tasks_punishment_list.dart';
import 'package:qhd_prevention/pages/home/keyTasks/key_tasks_check_list_page.dart';
import 'package:qhd_prevention/pages/home/keyTasks/key_tasks_confirm_list_page.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
@ -82,6 +83,17 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
},
),
AppSectionItem(
title: '处罚反馈',
icon: 'assets/images/door_ico10.png',
menuPerms:'dashboard:Key-assignment:Hidden-Hazard-Record',
badge: 0,
onTap: () async {
await pushPage(KeyTasksPunishmentList(), context);
_getDoorCarCount();
},
),
]),
];