2026.5.12 重大较大隐患,图标,重点作业

master
xufei 2026-05-12 10:21:08 +08:00
parent 5420cfe4aa
commit 171cb3acf6
13 changed files with 163 additions and 138 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,4 +1,5 @@
import 'package:dio/dio.dart';
import 'package:qhd_prevention/common/route_service.dart';
import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/HttpManager.dart';
import 'package:qhd_prevention/services/SessionService.dart';
@ -7,12 +8,16 @@ class KeyTasksApi {
/// --
static Future<Map<String, dynamic>> getKeyTasksConfirmList(Map data) {
static Future<Map<String, dynamic>> getKeyTasksConfirmList(Map data) async {
final parentPerm = 'dashboard:Key-assignment:Key-Task-Application';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/keyProject/pageConfirm',
method: Method.post,
data: {
"menuPath": menuPath,
...data
},
);
@ -57,12 +62,16 @@ class KeyTasksApi {
///
static Future<Map<String, dynamic>> getKeyTasksSafetyEnvironmentalInspectionList(Map data) {
static Future<Map<String, dynamic>> getKeyTasksSafetyEnvironmentalInspectionList(Map data) async {
final parentPerm = 'dashboard:Key-assignment:Confirmed-by-the-inspectee';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/safetyEnvironmentalInspection/list',
method: Method.post,
data: {
"menuPath": menuPath,
...data
},
);
@ -131,6 +140,17 @@ class KeyTasksApi {
);
}
///
static Future<Map<String, dynamic>> getKeyTasksToDoCount(String id) {
return HttpManager().request(
'${ApiService.basePath}/keyProject',
'/keyProject/count/$id',
method: Method.get,
data: {
// ...data
},
);
}
}

View File

@ -12,13 +12,15 @@ typedef ItemTapCallback = void Function();
class AppSectionItem {
final String title;
final String icon; // asset path
final int badge;
final String menuPerms; //
int badge;
final bool visible;
final ItemTapCallback? onTap;
AppSectionItem({
required this.title,
required this.icon,
required this.menuPerms,
this.badge = 0,
this.visible = true,
this.onTap,
@ -50,6 +52,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
AppSectionItem(
title: '进港口门申请',
icon: 'assets/images/door_ico9.png',
menuPerms:'',
badge: 0,
onTap: () async {
await pushPage(DoorareaTypePage(1), context);
@ -59,6 +62,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
AppSectionItem(
title: '进港口门申请记录',
icon: 'assets/images/door_ico10.png',
menuPerms:'',
badge: 0,
onTap: () async {
await pushPage(DoorareaTypePage(2), context);
@ -71,6 +75,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
AppSectionItem(
title: '封闭区域口门申请',
icon: 'assets/images/door_ico9.png',
menuPerms:'',
badge: 0,
onTap: () async {
await pushPage(DoorareaTypePage(3), context);
@ -80,6 +85,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
AppSectionItem(
title: '封闭区域口门申请记录',
icon: 'assets/images/door_ico10.png',
menuPerms:'',
badge: 0,
onTap: () async {
await pushPage(DoorareaTypePage(4), context);

View File

@ -9,6 +9,7 @@ import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
import 'package:qhd_prevention/customWidget/custom_button.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/Study/study_tab_list_page.dart';
import 'package:qhd_prevention/pages/home/Tap/work_tab_list_page.dart';
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
@ -19,6 +20,7 @@ import 'package:qhd_prevention/pages/main_tab.dart';
import 'package:qhd_prevention/pages/mine/onboarding_full_page.dart';
import 'package:qhd_prevention/pages/user/choose_userFirm_page.dart';
import 'package:qhd_prevention/pages/user/firm_list_page.dart';
import 'package:qhd_prevention/services/SessionService.dart';
import 'package:qhd_prevention/services/auth_service.dart';
import 'package:qhd_prevention/services/scan_service.dart';
import 'package:qhd_prevention/tools/h_colors.dart';
@ -120,7 +122,7 @@ class HomePageState extends RouteAwareState<HomePage>
"现场监管": "dashboard-Site-Supervision",
"危险作业": "dashboard-Hazardous-Work",
"隐患治理": "dashboard-Hazard-Management",
"重点作业": "dashboard-Hazard-Management", //
"重点作业": "dashboard:Key-assignment",
"口门门禁": "dashboard-Gate-Access-Control",
"入港培训": "dashboard-Study-Training",
};
@ -1103,7 +1105,9 @@ class HomePageState extends RouteAwareState<HomePage>
};
final result = await TodoApi.getTodoList(data);
final specialWork = await SpecialWorkApi.specialWorkTaskLogTotalCount();
final keyTasksWork = await KeyTasksApi.getKeyTasksToDoCount(SessionService.instance.accountId??'');
int specialWorkNum = 0;
int keyTasksNum = 0;
try {
if (specialWork['success']) {
List<dynamic> specialWorkList = specialWork['data'] ?? [];
@ -1114,11 +1118,21 @@ class HomePageState extends RouteAwareState<HomePage>
}
}
}
if (keyTasksWork['success']) {
int zdzysqCount = int.parse(keyTasksWork['data']['zdzysqCount']??0);
int bjcrqrCount = int.parse(keyTasksWork['data']['bjcrqrCount']??0);
int yhdzgCount = int.parse(keyTasksWork['data']['yhdzgCount']??0);
keyTasksNum = bjcrqrCount+yhdzgCount+zdzysqCount;
}
setState(() {
for (var section in buttonInfos) {
if (section['title'] == '危险作业') {
section['unreadCount'] = specialWorkNum;
}
if (section['title'] == '重点作业') {
section['unreadCount'] = keyTasksNum;
}
}
});
} catch (e) {}

View File

@ -481,12 +481,12 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
_buildInfoItem(
'整改部门',
pd["rectificationRecord"]['rectificationDepartmentIdName'] ?? '',
pd['rectificationDepartmentName'] ?? '',
),
Divider(height: 1),
_buildInfoItem(
'整改人',
pd["rectificationRecord"]['rectificationUserIdName'] ?? '',
pd['rectificationUserName'] ?? '',
),
Divider(height: 1),

View File

@ -1,6 +1,7 @@
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';
@ -48,19 +49,31 @@ class _KeyTasksHiddenDangerListState extends State<KeyTasksHiddenDangerList> {
_searchController.addListener(_onSearchChanged);
_distinguishData();
// _getListData(false);
}
Future<void> _distinguishData() async {
switch (widget.appItem) {
case 1:
buttonTextTwo = '整改';
title = "隐患整改";
keyTasksHiddenDangerListData['stateList']=[1];
keyTasksHiddenDangerListData['stateList']=[1,4];
final parentPerm = 'dashboard:Key-assignment:Hidden-danger-rectification';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
keyTasksHiddenDangerListData['menuPath']=menuPath;
break;
case 2:
buttonTextTwo = '查看';
title = "隐患记录";
keyTasksHiddenDangerListData['stateList']=[1,2,3,4];
final parentPerm = 'dashboard:Key-assignment:Hidden-Hazard-Record';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
keyTasksHiddenDangerListData['menuPath']=menuPath;
break;
}
_getListData(false);
}
@ -304,7 +317,7 @@ class _KeyTasksHiddenDangerListState extends State<KeyTasksHiddenDangerList> {
// - 使 Expanded
Expanded(
child: Text(
'发现人:${truncateString(pageData['createName'] ?? '')}',
'发现人:${truncateString(pageData['findUserName'] ?? '')}',
style: TextStyle(fontSize: 14, color: Colors.black87),
maxLines: 1,
overflow: TextOverflow.ellipsis,

View File

@ -20,6 +20,7 @@ import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/http/modules/auth_api.dart';
import 'package:qhd_prevention/http/modules/hidden_danger_api.dart';
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
import 'package:qhd_prevention/http/modules/safety_check_api.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/services/SessionService.dart';
@ -105,7 +106,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
"hiddenUserId": "", //idid
"hiddenPartName": "", //
'hiddenFindUserdList':[],//
'hiddenFindUserList':[],//
'hiddenFindUserdName':'',//
};
@ -185,16 +186,26 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
}
Future<void> _getHiddenDetail() async {
// LoadingDialogHelper.show();
// final result = await HiddenDangerApi.getDangerDetail(widget.initData['id']);
// LoadingDialogHelper.hide();
// if (result['success']) {
// final data = result['data'];
// setState(() {
// addData = data;
_getHiddenImages();
// });
// }
_getHiddenImages();
LoadingDialogHelper.show();
final result = await KeyTasksApi.getKeyTasksHiddenDangerDetail(widget.initData['id']);
LoadingDialogHelper.hide();
if (result['success']) {
final data = result['data'];
setState(() {
addData['rectificationDepartmentId'] = data['rectificationDepartmentId'];
addData['rectificationDepartmentName'] = data['rectificationDepartmentName'];
addData['rectificationUserId'] = data['rectificationUserId'];
addData['rectificationUserName'] = data['rectificationUserName'];
//
List<dynamic> result = addData['findUserList']??[];
addData['hiddenFindUserName'] = result.map((user) => user['findUserName']).join(',');
List<String> idList = result.map<String>((item) => item['findUserId'].toString()).toList();
addData['hiddenFindUserList'] = idList;
});
}
}
///
@ -610,7 +621,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
}
//
final dynamic currentSelected = addData['hiddenFindUserdList'] ?? [];
final dynamic currentSelected = addData['hiddenFindUserList'] ?? [];
List<String> selectedList = [];
if (currentSelected is List) {
@ -657,7 +668,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
String userName = person['userName']?.toString() ?? '';
return selectedItems.contains(userName);
}).toList();
addData['hiddenFindUserdList'] = result;
addData['hiddenFindUserList'] = result;
});
}

View File

@ -38,8 +38,8 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
final _standardController = TextEditingController();
double centerLat = 39.8883;
double centerLng = 119.519;
double centerLat = 0;
double centerLng = 0;
late Map<String, dynamic> pd = {};
@ -208,6 +208,7 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
},
),
if(centerLat!=0)
Container(
height: 200,
margin: EdgeInsetsGeometry.symmetric(horizontal: 15),
@ -357,7 +358,11 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
_buildTableHeaderCell("视频类型"),
]),
if (monitorList.isEmpty)
TableRow(children: [Padding(padding: EdgeInsets.all(12), child: Text("暂无数据")), SizedBox()])
TableRow(children: [
SizedBox(),
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
])
else
...monitorList.asMap().entries.map((entry) {
final index = entry.key + 1; // 1
@ -412,7 +417,12 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
_buildTableHeaderCell("操作"),
]),
if (monitorList.isEmpty)
TableRow(children: [Padding(padding: EdgeInsets.all(12), child: Text("暂无数据")), SizedBox()])
TableRow(children: [
SizedBox(),
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
SizedBox()
])
else
...monitorList.asMap().entries.map((entry) {
final index = entry.key + 1; // 1

View File

@ -2,11 +2,14 @@
import 'dart:ffi';
import 'package:flutter/material.dart';
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/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';
import 'package:qhd_prevention/services/SessionService.dart';
import 'package:qhd_prevention/tools/tools.dart';
@ -20,7 +23,7 @@ class KeyTasksTabPage extends StatefulWidget {
class _DoorcarTabPageState extends State<KeyTasksTabPage> {
final String bannerAsset = 'assets/images/door_banner.png';
final String bannerAsset = 'assets/images/key_tasks_banner.jpg';
late List<AppSection> defaultSections;
@ -40,7 +43,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
AppSection(title: '重点作业管理', items: [
AppSectionItem(
title: '重点作业申请',
icon: 'assets/images/door_ico9.png',
icon: 'assets/images/key_tasks_ico2.png',
menuPerms:'dashboard:Key-assignment:Key-Task-Application',
badge: 0,
onTap: () async {
await pushPage(KeyTasksConfirmListPage(), context);
@ -49,7 +53,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
),
AppSectionItem(
title: '被检查确认',
icon: 'assets/images/door_ico9.png',
icon: 'assets/images/key_tasks_ico3.png',
menuPerms:'dashboard:Key-assignment:Key-Task-Application',
badge: 0,
onTap: () async {
await pushPage(KeyTasksCheckListPage(), context);
@ -58,7 +63,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
),
AppSectionItem(
title: '隐患整改',
icon: 'assets/images/door_ico9.png',
icon: 'assets/images/key_tasks_ico6.png',
menuPerms:'dashboard:Key-assignment:Hidden-danger-rectification',
badge: 0,
onTap: () async {
await pushPage(KeyTasksHiddenDangerList(1), context);
@ -67,7 +73,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
),
AppSectionItem(
title: '隐患记录',
icon: 'assets/images/door_ico9.png',
icon: 'assets/images/key_tasks_ico7.png',
menuPerms:'dashboard:Key-assignment:Hidden-Hazard-Record',
badge: 0,
onTap: () async {
await pushPage(KeyTasksHiddenDangerList(2), context);
@ -81,106 +88,32 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
}
Future<void> _getDoorCarCount() async {
// try {
// final result = await DoorAndCarApi.getDoorCarCount();
// if (result['success'] ) {
// List< dynamic> data = result['data']??[] ;
//
// int stakeholderPersonCount =0;
// int stakeholderCarCount =0;
// int temporaryPersonCount =0;
// int temporaryCarCount =0;
// int companyCarCount =0;
// int closureLongPersonCount =0;
// int closureLongCarCount =0;
// int closureTemporaryPersonCount =0;
// int closureTemporaryCarCount =0;
// for(int i=0;i<data.length;i++){
// if(data[i]['type']=='one_level_person'){
// if(data[i]['belongType']=='3'){
// stakeholderPersonCount=data[i]['waitAuditCount']??0;
// }
// if(data[i]['belongType']=='4'){
// temporaryPersonCount=data[i]['waitAuditCount']??0;
// }
// }
//
// if(data[i]['type']=='one_level_car'){
// if(widget.isLoginJGD&&data[i]['belongType']=='2'){
// stakeholderCarCount=data[i]['waitAuditCount']??0;
// }
// if(!widget.isLoginJGD&&data[i]['belongType']=='4'){
// temporaryCarCount=data[i]['waitAuditCount']??0;
// }
// }
//
//
// if(data[i]['type']=='one_level_car'){//
// if(data[i]['belongType']=='2'){
// companyCarCount=data[i]['waitAuditCount']??0;
// }
// if(data[i]['belongType']=='4'){
// companyCarCount=data[i]['waitAuditCount']??0;
// }
// }
//
// if(data[i]['type']=='two_level_person'){
// if(data[i]['belongType']=='1'||data[i]['belongType']=='2'||data[i]['belongType']=='3'){
// closureLongPersonCount=closureLongPersonCount+((data[i]['waitAuditCount']??0)as int);
// }
// if(data[i]['belongType']=='4'){
// closureTemporaryPersonCount=data[i]['waitAuditCount']??0;
// }
// }
//
// if(data[i]['type']=='two_level_car'){
// if(data[i]['belongType']=='1'||data[i]['belongType']=='2'||data[i]['belongType']=='3'){
// closureLongCarCount=closureLongCarCount+((data[i]['waitAuditCount']??0)as int);
// }
// if(data[i]['belongType']=='4'){
// closureTemporaryCarCount=data[i]['waitAuditCount']??0;
// }
// }
//
// }
//
// setState(() {
// // badge
// final gateSection = defaultSections[0];
//
// //
// gateSection.items[0].badge = stakeholderPersonCount;
// //
// gateSection.items[1].badge = stakeholderCarCount;
// // 访
// gateSection.items[3].badge = temporaryPersonCount;
// //
// gateSection.items[4].badge = temporaryCarCount;
//
// //
// gateSection.items[7].badge = companyCarCount;
//
// // JGD
// if (!widget.isLoginJGD && defaultSections.length > 2) {
// final closureSection = defaultSections[2];
// //
// closureSection.items[0].badge = closureLongPersonCount;
// //
// closureSection.items[1].badge = closureLongCarCount;
// // 访
// closureSection.items[2].badge = closureTemporaryPersonCount;
// //
// closureSection.items[3].badge = closureTemporaryCarCount;
// }
// });
// }
// // else {
// // ToastUtil.showNormal(context, result['errMessage'] ?? "加载数据失败");
// // }
// } catch (e) {
// LoadingDialogHelper.hide();
// print('加载数据失败:$e');
// }
try {
String userId= SessionService.instance.accountId??'';
final result = await KeyTasksApi.getKeyTasksToDoCount(userId);
if (result['success'] ) {
dynamic data = result['data']?? {} ;
setState(() {
//
final gateSection = defaultSections[0];
// //
gateSection.items[0].badge = int.parse(data['zdzysqCount']??0);
//
gateSection.items[1].badge = int.parse(data['bjcrqrCount']??0);
//
gateSection.items[2].badge = int.parse(data['yhdzgCount']??0);
});
}
// else {
// ToastUtil.showNormal(context, result['errMessage'] ?? "加载数据失败");
// }
} catch (e) {
LoadingDialogHelper.hide();
print('加载数据失败:$e');
}
}
@override
@ -191,12 +124,28 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
const double iconOverlapBanner = 30.0;
// items
final visibleSections = defaultSections
.map((s) => AppSection(
title: s.title,
items: s.items.where((it) => it.visible).toList()))
.where((s) => s.items.isNotEmpty)
.toList();
// final visibleSections = defaultSections
// .map((s) => AppSection(
// title: s.title,
// items: s.items.where((it) => it.visible).toList()))
// .where((s) => s.items.isNotEmpty)
// .toList();
final routeService = RouteService();
return AnimatedBuilder(
animation: routeService,
builder: (context, _)
{
final rebuiltVisibleSections = defaultSections.map((section) {
final visibleItems = section.items.where((item) {
return item.visible && routeService.hasPerm(item.menuPerms);
}).toList();
return AppSection(
title: section.title,
items: visibleItems,
);
}).where((section) => section.items.isNotEmpty).toList();
return Scaffold(
extendBodyBehindAppBar: true,
@ -222,13 +171,15 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
right: 10,
top: bannerHeight - iconOverlapBanner,
height: iconSectionHeight,
child: _buildIconSection(context, visibleSections),
child: _buildIconSection(context, rebuiltVisibleSections),
),
],
),
),
],
),
);
},
);
}