2026.3.25 列表权限

master
xufei 2026-03-25 16:09:17 +08:00
parent c30ace06df
commit d363c40408
9 changed files with 497 additions and 362 deletions

View File

@ -21,7 +21,7 @@ class CategoryEnterpriseType {
factory CategoryEnterpriseType.fromJson(Map<String, dynamic> json) { factory CategoryEnterpriseType.fromJson(Map<String, dynamic> json) {
return CategoryEnterpriseType( return CategoryEnterpriseType(
id: json['corpinfoId'] != null ? json['corpinfoId'].toString() : "", id: json['id'] != null ? json['id'].toString() : "",
name: json['corpName'] != null ? json['corpName'].toString() : "", name: json['corpName'] != null ? json['corpName'].toString() : "",
pdId: json['parentId'] != null ? json['parentId'].toString() : "", pdId: json['parentId'] != null ? json['parentId'].toString() : "",
children: _safeParseChildren(json['childrenList']), children: _safeParseChildren(json['childrenList']),
@ -54,8 +54,10 @@ typedef DeptSelectCallback = void Function(String id, String name,String pdId);
class DepartmentPickerEnterprise extends StatefulWidget { class DepartmentPickerEnterprise extends StatefulWidget {
/// id name /// id name
final DeptSelectCallback onSelected; final DeptSelectCallback onSelected;
///id
final String jurisdictionalAuthorityId;
const DepartmentPickerEnterprise({Key? key, required this.onSelected}) : super(key: key); const DepartmentPickerEnterprise(this.jurisdictionalAuthorityId,{Key? key, required this.onSelected}) : super(key: key);
@override @override
_DepartmentPickerEnterpriseState createState() => _DepartmentPickerEnterpriseState(); _DepartmentPickerEnterpriseState createState() => _DepartmentPickerEnterpriseState();

View File

@ -221,3 +221,17 @@ class CertificateApi {
} }
} }
//
class TodoApi {
static Future<Map<String, dynamic>> getTodoList(Map data) {
return HttpManager().request(
ApiService.basePath + '/appmenu',
'/todoList/list',
method: Method.post,
data: {
...data
},
);
}
}

View File

@ -60,10 +60,17 @@ class DoorAndCarApi {
/// ///
static Future<Map<String, dynamic>> getApproverList(String corpId,String deptId) { static Future<Map<String, dynamic>> getApproverList(String corpId,String deptId,
String personnelPermissionFlag, //(1-,2-)
String vehiclePermissionFlag,//(1-,2-)
String temporaryPermissionFlag,//(1-,2-)
) {
return HttpManager().request( return HttpManager().request(
'${ApiService.basePath}/primeport', '${ApiService.basePath}/primeport',
'/mkmjApprovalUser/listAll?corpId=$corpId', '/mkmjApprovalUser/listAll?corpId=$corpId'
'&personnelPermissionFlag=$personnelPermissionFlag'
'&vehiclePermissionFlag=$vehiclePermissionFlag'
'&temporaryPermissionFlag=$temporaryPermissionFlag',
method: Method.get, method: Method.get,
data: { data: {
// ...data // ...data

View File

@ -82,15 +82,27 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
ListItemFactory.createBuildSimpleSection('申请信息'), ListItemFactory.createBuildSimpleSection('申请信息'),
const Divider(), const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择港区:',
isEditable: true,
text: addData['portAreaName'] ?? '请选择',
isRequired: true,
onTap: () async {
_getPortAreaType();
},
),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton( ItemListWidget.selectableLineTitleTextRightButton(
label: '选择管辖单位:', label: '选择管辖单位:',
isEditable: true, isEditable: true,
text: addData['jurisdictionalCorpName'] ?? '请选择', text: addData['jurisdictionalCorpName'] ?? '请选择',
isRequired: true, isRequired: true,
onTap: () { onTap: () {
if( addData['portAreaId'].isEmpty){
ToastUtil.showNormal(context, '请先选择港区');
return;
}
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@ -98,6 +110,7 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: builder:
(ctx) => DepartmentPickerEnterprise( (ctx) => DepartmentPickerEnterprise(
addData['portAreaId'],
onSelected: (id, name,pdId) async { onSelected: (id, name,pdId) async {
setState(() { setState(() {
addData['jurisdictionalCorpId']= id; addData['jurisdictionalCorpId']= id;
@ -495,94 +508,54 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
Future<void> _getVisitPortArea() async { Future<void> _getVisitPortArea() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpId']);
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
List<String> result = []; for(int i=0;i<newList.length;i++){
// newList[i]["dataId"] = newList[i]["id"];
final List<int> initialIndices = []; newList[i]["dataName"] = newList[i]["closedAreaName"];
final resultList = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpName']);
List<dynamic> raw = resultList["data"] as List<dynamic>;
result = raw.map((item) => item['closedAreaName'].toString()).toList();
if(addData['gateLevelAuthArea'].isNotEmpty){
// JSON
Map<String, dynamic> jsonData = json.decode(addData['gateLevelAuthArea']);
List<dynamic> areaList = jsonData['area'];
// value
List<String> targetValues = areaList.map((item) => item['value'].toString()).toList();
// raw
for (String targetValue in targetValues) {
for (int i = 0; i < raw.length; i++) {
var item = raw[i];
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == targetValue) {
initialIndices.add(i);// 0
break;
}
}
} }
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerThree(
listdata: newList,
onSelected: (id, name,pdId) async {
setState(() {
addData['closedAreaId']=id;//id
addData['closedAreaName']=name;//
});
},
),
);
}else{
ToastUtil.showNormal(context, "获取列表失败");
LoadingDialogHelper.hide();
// _showMessage('反馈提交失败');
// return "";
} }
} catch (e) {
// Toast
print('加载首页数据失败:$e');
// return "";
LoadingDialogHelper.hide();
} }
//
final selectedItems = await CenterMultiPicker.show<String>(
context,
items: result,
itemBuilder: (item) => Text(
item,
style: const TextStyle(fontSize: 16),
),
initialSelectedIndices: initialIndices, //
maxSelection: null, //
allowEmpty: true,
title: '管辖区域',
);
//
if (selectedItems != null) {
setState(() {
addData['gateLevelAuthAreaName'] = selectedItems.join(',');
// JSON
List<Map<String, dynamic>> areaList = [];
// raw
for (String selectedItem in selectedItems) {
for (var item in raw) {
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == selectedItem) {
// value(dictLabel) bianma(dictValue)
areaList.add({
'value': item['dictLabel'].toString(),
'bianma': item['dictValue'].toString(), // 使 toString()
});
break;
}
}
}
}
// JSON
Map<String, dynamic> jsonData = {
'area': areaList
};
// Map JSON
addData['gateLevelAuthArea'] = json.encode(jsonData);
});
}
} }
Future<void> _getApproverList() async { Future<void> _getApproverList() async {
try { try {
LoadingDialogHelper.show(); LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'');//addData['auditDeptId'] final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'','','1','');//addData['auditDeptId']
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
if (raw['success'] ) { if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? []; List<dynamic> newList = raw['data'] ?? [];
@ -703,6 +676,31 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
}); });
} }
Future<void> _getPortAreaType() async {
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(_) => MultiDictValuesPicker(
title: '港区',
dictType: 'HG_AUTH_AREA',
allowSelectParent: false,
onSelected: (id, name, extraData) {
setState(() {
addData['portAreaId'] = extraData?['dictValue'];//id
addData['portAreaName'] = name;//
});
},
),
).then((_) {
// FocusHelper.clearFocus(context);
});
}
Future<void> _getLicensePlateType() async { Future<void> _getLicensePlateType() async {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
@ -789,19 +787,24 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
Future<void> _saveSuccess() async { Future<void> _saveSuccess() async {
try { try {
if(addData['projectName'].isEmpty){ if(addData['jurisdictionalCorpId'].isEmpty){
ToastUtil.showNormal(context, '请选择选择项目名称'); ToastUtil.showNormal(context, '请选择选择管辖单位');
return; return;
} }
if(addData['auditUserName'].isEmpty){ if(addData['auditPersonUserName'].isEmpty){
ToastUtil.showNormal(context, '请选择审核人员'); ToastUtil.showNormal(context, '请选择审核人员');
return; return;
} }
if(addData['gateLevelAuthAreaName'].isEmpty){ if(addData['projectName'].isEmpty){
ToastUtil.showNormal(context, '请选择访问港区'); ToastUtil.showNormal(context, '请选择项目');
return;
}
if(addData['applyReason'].isEmpty){
ToastUtil.showNormal(context, '请填写申请原因');
return; return;
} }
@ -836,20 +839,6 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return; return;
} }
if(addData['licenceTypeName'].isEmpty){
ToastUtil.showNormal(context, '请选择车牌类型');
return;
}
if(addData['vehicleBelongType'].isEmpty){
ToastUtil.showNormal(context, '请选择车辆类型');
return;
}
if(addData['licenceNo'].isEmpty){
ToastUtil.showNormal(context, '请输入车牌号');
return;
}
bool isLicenseTrue = isValidChineseLicensePlate(addData['licenceNo']); bool isLicenseTrue = isValidChineseLicensePlate(addData['licenceNo']);
if(!isLicenseTrue){ if(!isLicenseTrue){
@ -857,6 +846,11 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return; return;
} }
if(_vehicleImages.isEmpty){
ToastUtil.showNormal(context, '请上传车辆照片');
return;
}
if(_vehicleLicenseImages.isEmpty){ if(_vehicleLicenseImages.isEmpty){
ToastUtil.showNormal(context, '请上传行驶证照片'); ToastUtil.showNormal(context, '请上传行驶证照片');
return; return;
@ -865,10 +859,6 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return; return;
} }
if(_vehicleImages.isEmpty){
ToastUtil.showNormal(context, '请上传车辆照片');
return;
}
if(signImages.isEmpty){ if(signImages.isEmpty){
ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字'); ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字');
@ -968,6 +958,8 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
"userPhone": "", // "userPhone": "", //
"userCard": "", // "userCard": "", //
"portAreaId": '', //id
"portAreaName": '', //
"auditAllTime": '', // "auditAllTime": '', //
}; };

View File

@ -537,7 +537,7 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
Future<void> _getApproverList() async { Future<void> _getApproverList() async {
try { try {
LoadingDialogHelper.show(); LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( corpinfoId,''); final raw = await DoorAndCarApi.getApproverList( corpinfoId,'','','1','');
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
if (raw['success'] ) { if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? []; List<dynamic> newList = raw['data'] ?? [];
@ -757,6 +757,8 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
return; return;
} }
addData['drivingUserId']=_personList[0].userPhone;
addData['drivingUserName']=_personList[0].userCard;
addData['lsUserPhone']=_personList[0].userPhone; addData['lsUserPhone']=_personList[0].userPhone;
addData['lsUserIdcard']=_personList[0].userCard; addData['lsUserIdcard']=_personList[0].userCard;

View File

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:qhd_prevention/constants/app_enums.dart'; import 'package:qhd_prevention/constants/app_enums.dart';
import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart';
import 'package:qhd_prevention/customWidget/MultiDictValuesPicker.dart';
import 'package:qhd_prevention/customWidget/bottom_picker.dart'; import 'package:qhd_prevention/customWidget/bottom_picker.dart';
import 'package:qhd_prevention/customWidget/center_multi_picker.dart'; import 'package:qhd_prevention/customWidget/center_multi_picker.dart';
import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart'; import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
@ -80,12 +81,26 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
children: [ children: [
ListItemFactory.createBuildSimpleSection('申请信息'), ListItemFactory.createBuildSimpleSection('申请信息'),
const Divider(), const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择港区:',
isEditable: true,
text: addData['portAreaName'] ?? '请选择',
isRequired: true,
onTap: () async {
_getPortAreaType();
},
),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton( ItemListWidget.selectableLineTitleTextRightButton(
label: '选择管辖单位:', label: '选择管辖单位:',
isEditable: true, isEditable: true,
text: addData['jurisdictionalCorpName'] ?? '请选择', text: addData['jurisdictionalCorpName'] ?? '请选择',
isRequired: true, isRequired: true,
onTap: () { onTap: () {
if( addData['portAreaId'].isEmpty){
ToastUtil.showNormal(context, '请先选择港区');
return;
}
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@ -93,6 +108,7 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: builder:
(ctx) => DepartmentPickerEnterprise( (ctx) => DepartmentPickerEnterprise(
addData['portAreaId'],
onSelected: (id, name,pdId) async { onSelected: (id, name,pdId) async {
setState(() { setState(() {
addData['jurisdictionalCorpId']= id; addData['jurisdictionalCorpId']= id;
@ -526,95 +542,81 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
}); });
} }
Future<void> _getVisitPortArea() async {
List<String> result = []; Future<void> _getPortAreaType() async {
// showModalBottomSheet(
final List<int> initialIndices = []; context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(_) => MultiDictValuesPicker(
title: '港区',
dictType: 'HG_AUTH_AREA',
allowSelectParent: false,
onSelected: (id, name, extraData) {
setState(() {
addData['portAreaId'] = extraData?['dictValue'];//id
addData['portAreaName'] = name;//
final resultList = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpName']); });
List<dynamic> raw = resultList["data"] as List<dynamic>; },
result = raw.map((item) => item['closedAreaName'].toString()).toList();
if(addData['gateLevelAuthArea'].isNotEmpty){
// JSON
Map<String, dynamic> jsonData = json.decode(addData['gateLevelAuthArea']);
List<dynamic> areaList = jsonData['area'];
// value
List<String> targetValues = areaList.map((item) => item['value'].toString()).toList();
// raw
for (String targetValue in targetValues) {
for (int i = 0; i < raw.length; i++) {
var item = raw[i];
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == targetValue) {
initialIndices.add(i);// 0
break;
}
}
}
}
}
//
final selectedItems = await CenterMultiPicker.show<String>(
context,
items: result,
itemBuilder: (item) => Text(
item,
style: const TextStyle(fontSize: 16),
), ),
initialSelectedIndices: initialIndices, // ).then((_) {
maxSelection: null, // // FocusHelper.clearFocus(context);
allowEmpty: true, });
title: '管辖区域', }
);
//
if (selectedItems != null) {
setState(() {
addData['gateLevelAuthAreaName'] = selectedItems.join(',');
// JSON Future<void> _getVisitPortArea() async {
List<Map<String, dynamic>> areaList = []; try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpId']);
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
// raw for(int i=0;i<newList.length;i++){
for (String selectedItem in selectedItems) { newList[i]["dataId"] = newList[i]["id"];
for (var item in raw) { newList[i]["dataName"] = newList[i]["closedAreaName"];
if (item != null && item is Map && item.containsKey('dictLabel')) { }
if (item['dictLabel'].toString() == selectedItem) {
// value(dictLabel) bianma(dictValue)
areaList.add({
'value': item['dictLabel'].toString(),
'bianma': item['dictValue'].toString(), // 使 toString()
});
break;
}
}
}
}
// JSON showModalBottomSheet(
Map<String, dynamic> jsonData = { context: context,
'area': areaList isScrollControlled: true,
}; barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerThree(
listdata: newList,
onSelected: (id, name,pdId) async {
setState(() {
addData['closedAreaId']=id;//id
addData['closedAreaName']=name;//
// Map JSON });
addData['gateLevelAuthArea'] = json.encode(jsonData); },
),
}); );
}else{
ToastUtil.showNormal(context, "获取列表失败");
LoadingDialogHelper.hide();
// _showMessage('反馈提交失败');
// return "";
}
} catch (e) {
// Toast
print('加载首页数据失败:$e');
// return "";
LoadingDialogHelper.hide();
} }
} }
Future<void> _getApproverList() async { Future<void> _getApproverList() async {
try { try {
LoadingDialogHelper.show(); LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'');//addData['auditDeptId'] final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'','1','','');//addData['auditDeptId']
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
if (raw['success'] ) { if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? []; List<dynamic> newList = raw['data'] ?? [];
@ -765,7 +767,7 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
} }
// List<Person> List<Map<String, dynamic>> // List<Person> List<Map<String, dynamic>>
addData['personApplyList'] = _personList.map((person) => person.toJson()).toList(); addData['entourage'] = _personList.map((person) => person.toJson()).toList();
if(signImages.isEmpty){ if(signImages.isEmpty){
ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字'); ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字');
@ -839,21 +841,23 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
"userPhone": "", // "userPhone": "", //
"userCard": "", // "userCard": "", //
"portAreaId": '', //id
"portAreaName": '', //
"auditAllTime": '', // "auditAllTime": '', //
"personApplyList": [], "personApplyList": [],
}; };
Map<String, dynamic> addPersonData= { // Map<String, dynamic> addPersonData= {
"personCorpId": '', //ID // "personCorpId": '', //ID
"personCorpName": '', // // "personCorpName": '', //
"personDepartmentId": '', //id // "personDepartmentId": '', //id
"personDepartmentName": '', // // "personDepartmentName": '', //
"employeePersonUserId": '', //id // "employeePersonUserId": '', //id
"employeePersonUserName": '', // // "employeePersonUserName": '', //
"userFaceUrl": '', // // "userFaceUrl": '', //
"userPhone": '', // // "userPhone": '', //
"userCard": '', // // "userCard": '', //
}; // };

View File

@ -66,24 +66,34 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
buttonName='查看'; buttonName='查看';
isAdd=true; isAdd=true;
xgfDataApplyListData['processOrRecord']=1; xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['xgf-stk-personnel-application'] = '/primeport/container/stakeholder/firstLevelDoor/personnelApplication/list';
break; break;
case 2:// 2 () case 2:// 2 ()
titleName='人员审核记录'; titleName='人员审核记录';
buttonName='查看'; buttonName='查看';
isAdd=false; isAdd=false;
xgfDataApplyListData['processOrRecord']=2; xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['xgf-stk-personnel-app-records'] = '/primeport/container/stakeholder/firstLevelDoor/personnelApplicationRecords/list';
break; break;
case 3://3 () case 3://3 ()
titleName='人员审核'; titleName='人员审核';
buttonName='查看'; buttonName='查看';
isAdd=true; isAdd=true;
xgfDataApplyListData['processOrRecord']=1; xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-ren-yuan-feng-bi-qu-yu-shen-qing'] = '/primeport/container/stakeholder/enclosedArea/apply/personnel/list';
break; break;
case 4://4 () case 4://4 ()
titleName='人员审核记录'; titleName='人员审核记录';
buttonName='查看'; buttonName='查看';
isAdd=false; isAdd=false;
xgfDataApplyListData['processOrRecord']=2; xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-ren-yuan-feng-bi-qu-yu-shen-qing-ji-lu'] = '/primeport/container/stakeholder/enclosedArea/apply/personnelRecords/list';
break; break;
case 5: //5 () case 5: //5 ()
titleName='车辆审核'; titleName='车辆审核';
@ -91,6 +101,8 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
isAdd=true; isAdd=true;
xgfDataApplyListData['processOrRecord']=1; xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['vehicleBelongType']='5'; xgfDataApplyListData['vehicleBelongType']='5';
xgfDataApplyListData['xgf-stk-vehicle-application'] = '/primeport/container/stakeholder/firstLevelDoor/vehicleApplication/list';
break; break;
case 6: // 6 () case 6: // 6 ()
titleName='车辆审核记录'; titleName='车辆审核记录';
@ -98,18 +110,26 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
isAdd=false; isAdd=false;
xgfDataApplyListData['processOrRecord']=2; xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['vehicleBelongType']='5'; xgfDataApplyListData['vehicleBelongType']='5';
xgfDataApplyListData['xgf-stk-vehicle-app-records'] = '/primeport/container/stakeholder/firstLevelDoor/vehicleApplicationRecords/list';
break; break;
case 7: // 7 () case 7: // 7 ()
titleName='车辆审核'; titleName='车辆审核';
buttonName='查看'; buttonName='查看';
isAdd=true; isAdd=true;
xgfDataApplyListData['processOrRecord']=1; xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-che-liang-feng-bi-qu-yu-shen-qing'] = '/primeport/container/stakeholder/enclosedArea/apply/vehicle/list';
break; break;
case 8: // 8 () case 8: // 8 ()
titleName='车辆审核记录'; titleName='车辆审核记录';
buttonName='查看'; buttonName='查看';
isAdd=false; isAdd=false;
xgfDataApplyListData['processOrRecord']=2; xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-che-liang-feng-bi-qu-yu-shen-qing-ji-lu'] = '/primeport/container/stakeholder/enclosedArea/apply/vehicleRecords/list';
break; break;
} }
@ -190,7 +210,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
switch(widget.type){ switch(widget.type){
case 1: case 1:
case 2: case 2:
await pushPage(OnlylookPersonApplication(3,item['id']), context);// await pushPage(OnlylookPersonApplication(3,item['id']), context);
break; break;
case 3: case 3:
case 4: case 4:
@ -446,6 +466,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
"licenceNo": "", // "licenceNo": "", //
"vehicleBelongTypeArr": "", // 1-2-3-4- 5- 6:7 "vehicleBelongTypeArr": "", // 1-2-3-4- 5- 6:7
"vehicleBelongType": "", // 1-2-3-4- 5- 6:7 "vehicleBelongType": "", // 1-2-3-4- 5- 6:7
"personBelongType": '', //1234
}; };

View File

@ -544,7 +544,7 @@ class _FirstlevelPersonAddPageState extends State<FirstlevelPersonAddPage> {
Future<void> _getApproverList() async { Future<void> _getApproverList() async {
try { try {
LoadingDialogHelper.show(); LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( corpinfoId,''); final raw = await DoorAndCarApi.getApproverList( corpinfoId,'','1','','');
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
if (raw['success'] ) { if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? []; List<dynamic> newList = raw['data'] ?? [];

View File

@ -10,6 +10,7 @@ import 'package:qhd_prevention/customWidget/custom_button.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/http/ApiService.dart'; import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/pages/home/Study/study_tab_list_page.dart'; import 'package:qhd_prevention/pages/home/Study/study_tab_list_page.dart';
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
import 'package:qhd_prevention/pages/home/scan_page.dart'; import 'package:qhd_prevention/pages/home/scan_page.dart';
import 'package:qhd_prevention/pages/home/unit/unit_tab_page.dart'; import 'package:qhd_prevention/pages/home/unit/unit_tab_page.dart';
import 'package:qhd_prevention/pages/main_tab.dart'; import 'package:qhd_prevention/pages/main_tab.dart';
@ -60,28 +61,31 @@ class HomePageState extends RouteAwareState<HomePage>
List totalList = []; List totalList = [];
Map<String, int> workStats = {'total': 36, 'processed': 30, 'pending': 6}; //
Map<String, int> workStats = {'total': 0, 'processed': 0, 'pending': 0};
List<Map<String, dynamic>> checkLists = [ //
{ List<dynamic> checkLists = [];
"title": "电工班车间清单", // List<Map<String, dynamic>> checkLists = [
"type": "隐患排查", // {
"time": "2025-11-17", // "title": "电工班车间清单",
"color": Color(0xFF4CAF50), // "type": "隐患排查",
}, // "time": "2025-11-17",
{ // "color": Color(0xFF4CAF50),
"title": "工地区消防点检清单", // },
"type": "消防点检", // {
"time": "2025-11-17", // "title": "工地区消防点检清单",
"color": Color(0xFF2196F3), // "type": "消防点检",
}, // "time": "2025-11-17",
{ // "color": Color(0xFF2196F3),
"title": "消防专项检查清单", // },
"type": "重点作业", // {
"time": "2025-11-17", // "title": "消防专项检查清单",
"color": Color(0xFFFF9800), // "type": "安环检查",
}, // "time": "2025-11-17",
]; // "color": Color(0xFFFF9800),
// },
// ];
final List<String> _notifications = [ final List<String> _notifications = [
"系统通知今晚20:00 将进行系统维护,请提前保存数据。", "系统通知今晚20:00 将进行系统维护,请提前保存数据。",
@ -128,6 +132,8 @@ class HomePageState extends RouteAwareState<HomePage>
"scan": "dashboard-scan", "scan": "dashboard-scan",
}; };
int pcType=1;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -158,6 +164,10 @@ class HomePageState extends RouteAwareState<HomePage>
Future.microtask(() { Future.microtask(() {
_updateModuleAndButtonVisibility(); _updateModuleAndButtonVisibility();
}); });
if(_isShowCheckLogin){
_getToDoWorkList(pcType);
}
} }
@override @override
@ -622,6 +632,9 @@ class HomePageState extends RouteAwareState<HomePage>
case "入港培训": case "入港培训":
pushPage(StudyTabListPage(), context); pushPage(StudyTabListPage(), context);
break; break;
case "口门门禁":
pushPage(DoorcarTabPage(), context);
break;
default: default:
ToastUtil.showNormal(context, '功能开发中...'); ToastUtil.showNormal(context, '功能开发中...');
break; break;
@ -629,37 +642,79 @@ class HomePageState extends RouteAwareState<HomePage>
} }
Widget _buildWorkStatsSection() { Widget _buildWorkStatsSection() {
double buttonHeight = 45.0;
return Container( return Container(
padding: const EdgeInsets.all(1), padding: const EdgeInsets.all(15),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))], boxShadow: const [
BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2)),
],
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 0),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: "今日有工作项",
style: TextStyle(fontSize: 16, color: Colors.black87),
),
TextSpan(
text: " ${workStats['total']}",
style: const TextStyle(
fontSize: 16,
color: Color(0xFF2A75F8),
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: "",
style: TextStyle(fontSize: 16, color: Colors.black87),
),
],
),
),
),
const SizedBox(height: 15),
Container( Container(
width: screenWidth(context), width: screenWidth(context),
height: buttonHeight, height: 36,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Colors.grey[300]!, width: 1),
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () => setState(() => _isMobileSelected = true), onTap: () {
setState(() {
_isMobileSelected = true;
});
pcType=1;
_getToDoWorkList(pcType);
},
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: _isMobileSelected ? const Color(0xFFE9F4FE) : Colors.white, color:
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12)), _isMobileSelected ? const Color(0xFF2A75F8) : Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
), ),
child: Center( child: Center(
child: Text( child: Text(
"手机端", "手机端",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: _isMobileSelected ? Colors.black : Colors.blue, color: _isMobileSelected ? Colors.white : Colors.black87,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
@ -667,26 +722,29 @@ class HomePageState extends RouteAwareState<HomePage>
), ),
), ),
), ),
Image.asset(
'assets/images/${_isMobileSelected ? 'img2.png' : 'img1.png'}',
fit: BoxFit.cover,
height: buttonHeight,
width: 30,
),
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () => setState(() => _isMobileSelected = false), onTap: () {
setState(() {
_isMobileSelected = false;
});
pcType=2;
_getToDoWorkList(pcType);
},
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: !_isMobileSelected ? const Color(0xFFE9F4FE) : Colors.white, color: !_isMobileSelected ? const Color(0xFF2A75F8) : Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(12)), borderRadius: const BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
), ),
child: Center( child: Center(
child: Text( child: Text(
"电脑端", "电脑端",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 14,
color: !_isMobileSelected ? Colors.black : Colors.blue, color: !_isMobileSelected ? Colors.white : Colors.black87,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
@ -697,147 +755,182 @@ class HomePageState extends RouteAwareState<HomePage>
], ],
), ),
), ),
Padding( // const SizedBox(height: 15),
padding: const EdgeInsets.all(15), // Row(
child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
Container( // RichText(
width: double.infinity, // text: TextSpan(
padding: const EdgeInsets.symmetric(vertical: 0), // children: [
child: RichText( // TextSpan(
text: TextSpan( // text: "已处理工作项:",
children: [ // style: TextStyle(fontSize: 14, color: Colors.black87),
const TextSpan(text: "今日有工作项", style: TextStyle(fontSize: 16, color: Colors.black87)), // ),
TextSpan( // TextSpan(
text: " ${workStats['total']}", // text: " ${workStats['processed']}",
style: const TextStyle(fontSize: 16, color: Color(0xFF2A75F8), fontWeight: FontWeight.bold), // style: const TextStyle(
), // fontSize: 14,
const TextSpan(text: "", style: TextStyle(fontSize: 16, color: Colors.black87)), // color: Colors.greenAccent,
], // fontWeight: FontWeight.bold,
), // ),
), // ),
), // TextSpan(
const SizedBox(height: 15), // text: "",
Row( // style: TextStyle(fontSize: 14, color: Colors.black87),
mainAxisAlignment: MainAxisAlignment.spaceBetween, // ),
children: [ // ],
RichText( // ),
text: TextSpan( // ),
children: [ // RichText(
const TextSpan(text: "已处理工作项:", style: TextStyle(fontSize: 14, color: Colors.black87)), // text: TextSpan(
TextSpan( // children: [
text: " ${workStats['processed']}", // TextSpan(
style: const TextStyle(fontSize: 14, color: Colors.greenAccent, fontWeight: FontWeight.bold), // text: "待处理工作项:",
), // style: TextStyle(fontSize: 14, color: Colors.black87),
const TextSpan(text: "", style: TextStyle(fontSize: 14, color: Colors.black87)), // ),
], // TextSpan(
), // text: " ${workStats['processed']}",
), // style: const TextStyle(
RichText( // fontSize: 14,
text: TextSpan( // color: Colors.orange,
children: [ // fontWeight: FontWeight.bold,
const TextSpan(text: "待处理工作项:", style: TextStyle(fontSize: 14, color: Colors.black87)), // ),
TextSpan( // ),
text: " ${workStats['pending']}", // TextSpan(
style: const TextStyle(fontSize: 14, color: Colors.orange, fontWeight: FontWeight.bold), // text: "",
), // style: TextStyle(fontSize: 14, color: Colors.black87),
const TextSpan(text: "", style: TextStyle(fontSize: 14, color: Colors.black87)), // ),
], // ],
), // ),
), // ),
], // ],
), // ),
],
),
),
], ],
), ),
); );
} }
// Widget _buildCheckListSection() {
// return Column(
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: const [
// Text(' 待办清单', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
// SizedBox(),
// ],
// ),
// const SizedBox(height: 8),
// Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(12),
// boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))],
// ),
// child: Column(children: [...checkLists.map((item) => _buildCheckListItem(item))]),
// ),
// ],
// );
// }
Widget _buildCheckListSection() { Widget _buildCheckListSection() {
return Column( return Container(
children: [ decoration: BoxDecoration(
Row( color: Colors.white,
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(12),
children: const [ boxShadow: const [
Text(' 待办清单', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2)),
SizedBox(), ],
], ),
), child: Column(
const SizedBox(height: 8), children: checkLists.map((item) => _buildCheckListItem(item)).toList(),
Container( ),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))],
),
child: Column(children: [...checkLists.map((item) => _buildCheckListItem(item))]),
),
],
); );
} }
Widget _buildCheckListItem(Map<String, dynamic> item) { Widget _buildCheckListItem(Map<String, dynamic> item) {
return Container( return GestureDetector(
padding: const EdgeInsets.all(15), onTap: () async {
decoration: BoxDecoration( if(pcType==2){
border: Border(bottom: BorderSide(color: Colors.grey[200]!, width: 1)), return;
), }
child: Row( // if(item['appName']=="隐患治理"||item['appName']=="隐患管理"||item['appName']=="风险管控应用"){
children: [ // await pushPage(ApplicationPageTwo(), context);
Expanded( // }else if(item['appName']=="消防检查"){
child: Column( // await pushPage(FireManagementTabPage(), context);
crossAxisAlignment: CrossAxisAlignment.start, // }else{
children: [ // await pushPage(SafecheckTabList(), context);
Row( // }
mainAxisAlignment: MainAxisAlignment.spaceBetween, _getToDoWorkList(pcType);
children: [ // _getHiddenIssuesNum();
Flexible(
child: Text( },
child: Container(
padding: const EdgeInsets.all(15),
decoration:
BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey[200]!, width: 1))),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
item['title'], item['title'],
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold, color: Colors.black87), style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold, color: Colors.black87),
overflow: TextOverflow.ellipsis,
maxLines: 1,
), ),
), Text(item['content'], style: TextStyle(fontSize: 12, color: Colors.grey[500])),
const SizedBox(width: 8), ],
Text(item['type'], style: TextStyle(fontSize: 12, color: Colors.grey[500])), ),
], const Divider(),
), Row(
const SizedBox(height: 8), mainAxisAlignment: MainAxisAlignment.spaceBetween,
Row( children: [
mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
children: [ children: [
Flexible( Image.asset('assets/images/mine1.png', width: 15, height: 15),
child: Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration( decoration: BoxDecoration(color: Colors.grey[100], borderRadius: BorderRadius.circular(4)),
color: Colors.grey[100], child: Text("类型:${item['appName']}", style: const TextStyle(fontSize: 12, color: Colors.blue)),
borderRadius: BorderRadius.circular(4), ),
), ],
child: Text(
"类型:${item['type']}",
style: const TextStyle(fontSize: 12, color: Colors.blue),
overflow: TextOverflow.ellipsis,
),
), ),
), Text("时间:${item['createTime']}", style: const TextStyle(fontSize: 12, color: Colors.grey)),
const SizedBox(width: 8), ],
Flexible( ),
child: Text( ],
"时间:${item['time']}", ),
style: const TextStyle(fontSize: 12, color: Colors.grey),
overflow: TextOverflow.ellipsis,
),
),
],
),
],
), ),
), ],
], ),
), ),
); );
} }
//
void _getToDoWorkList(int type) async {
Map data = {
"eqAppFlag": type==1?"1":"",
"eqPcFlag": type==1?"":"1",
"eqStatus": "1",
"pageIndex": '1',
"pageSize": '999',
};
final result = await TodoApi.getTodoList(data);
if (result['success']) {
setState(() {
workStats['total'] =result['totalCount'] ;
checkLists=result['data'];
// checkLists = result['data'];
int m= checkLists.length;
});
}
}
} }