2026.3.26 口门门禁
parent
d363c40408
commit
4f263b5ce0
|
|
@ -2,6 +2,7 @@ import 'dart:convert';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/http/modules/doorAndCar_api.dart';
|
||||
import 'package:qhd_prevention/services/SessionService.dart';
|
||||
import '../tools/tools.dart'; // 包含 SessionService
|
||||
|
||||
|
|
@ -21,8 +22,8 @@ class CategoryEnterpriseType {
|
|||
|
||||
factory CategoryEnterpriseType.fromJson(Map<String, dynamic> json) {
|
||||
return CategoryEnterpriseType(
|
||||
id: json['id'] != null ? json['id'].toString() : "",
|
||||
name: json['corpName'] != null ? json['corpName'].toString() : "",
|
||||
id: json['jurisdictionalCorpId'] != null ? json['jurisdictionalCorpId'].toString() : "",
|
||||
name: json['jurisdictionalCorpName'] != null ? json['jurisdictionalCorpName'].toString() : "",
|
||||
pdId: json['parentId'] != null ? json['parentId'].toString() : "",
|
||||
children: _safeParseChildren(json['childrenList']),
|
||||
);
|
||||
|
|
@ -106,7 +107,7 @@ class _DepartmentPickerEnterpriseState extends State<DepartmentPickerEnterprise>
|
|||
// raw = result['data'];
|
||||
// }
|
||||
|
||||
final result = await HiddenDangerApi.getCorpInfoListTree();
|
||||
final result = await DoorAndCarApi.getJurisdictionalAuthorityListTree(widget.jurisdictionalAuthorityId);
|
||||
raw = result['data'];
|
||||
|
||||
setState(() {
|
||||
|
|
|
|||
|
|
@ -224,7 +224,17 @@ class DoorAndCarApi {
|
|||
}
|
||||
|
||||
|
||||
/// 跟据港区查询管辖单位
|
||||
static Future<Map<String, dynamic>> getJurisdictionalAuthorityListTree(String id) {
|
||||
return HttpManager().request(
|
||||
'${ApiService.basePath}/primeport',
|
||||
'/closedArea/listAllByhgAuthArea?hgAuthArea=$id',
|
||||
method: Method.get,
|
||||
data: {
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,17 +40,17 @@ class HiddenDangerApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// 获取企业
|
||||
static Future<Map<String, dynamic>> getCorpInfoListTree() {
|
||||
return HttpManager().request(
|
||||
ApiService.basePath,
|
||||
'/basicInfo/corpInfo/listAll',
|
||||
method: Method.get,
|
||||
data: {
|
||||
"inType": '0,1',
|
||||
},
|
||||
);
|
||||
}
|
||||
// /// 获取企业
|
||||
// static Future<Map<String, dynamic>> getCorpInfoListTree() {
|
||||
// return HttpManager().request(
|
||||
// ApiService.basePath,
|
||||
// '/basicInfo/corpInfo/listAll',
|
||||
// method: Method.get,
|
||||
// data: {
|
||||
// "inType": '0,1',
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
/// 获取部门
|
||||
static Future<Map<String, dynamic>> getHiddenTreatmentListTree(String id) {
|
||||
|
|
|
|||
|
|
@ -829,7 +829,7 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
if(addData['vehicleBelongType'].isEmpty){
|
||||
if(addData['vehicleTypeName'].isEmpty){
|
||||
ToastUtil.showNormal(context, '请选择车辆类型');
|
||||
return;
|
||||
}
|
||||
|
|
@ -887,7 +887,7 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
|
|||
LoadingDialogHelper.show();
|
||||
final result = await DoorAndCarApi.enclosedAreaCarSave(addData);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success'] == true) {
|
||||
if (result['success'] ) {
|
||||
ToastUtil.showNormal(context, '提交成功');
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
|
|
@ -938,7 +938,7 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
|
|||
"projectId": "", //项目id
|
||||
"projectName": "", //项目名称
|
||||
"applyReason": "", //申请理由
|
||||
"entourage": "", //随行人员
|
||||
// "entourage": null, //随行人员
|
||||
"informSignId": "", //告知签字
|
||||
"drivingLicenseId": "", //行驶证照片
|
||||
"attachmentId": "", //车辆照片
|
||||
|
|
|
|||
|
|
@ -767,7 +767,7 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
if(addData['vehicleBelongType'].isEmpty){
|
||||
if(addData['vehicleTypeName'].isEmpty){
|
||||
ToastUtil.showNormal(context, '请选择车辆类型');
|
||||
return;
|
||||
}
|
||||
|
|
@ -859,7 +859,7 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
|
|||
"licenceNo": "", //车牌号
|
||||
"vehicleType": "", //车辆类型
|
||||
"vehicleTypeName": "", //车辆类型-名字
|
||||
"vehicleBelongType": "", //车辆所属类型 1-股份员工车辆,2-股份单位车辆,3-分公司员工车辆,4-分公司单位车辆 ,5-相关方车辆, 6:临时车辆,7检查部门车辆
|
||||
"vehicleBelongType": "5", //车辆所属类型 1-股份员工车辆,2-股份单位车辆,3-分公司员工车辆,4-分公司单位车辆 ,5-相关方车辆, 6:临时车辆,7检查部门车辆
|
||||
"gateLevelAuthArea": "", //授权范围港区与区域
|
||||
"visitStartTime": "", //访问起始时间
|
||||
"visitEndTime": "", //访问结束时间
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class _OnlylookCarApplicationState extends State<OnlylookCarApplication> {
|
|||
label: '审核人员:',
|
||||
isEditable: false,
|
||||
horizontalnum: 0,
|
||||
text: personnelList[0]['auditUserName'] ?? '',
|
||||
text: personnelList.isNotEmpty? personnelList[0]['auditUserName'] ?? '':'',
|
||||
onTap: () {},
|
||||
),
|
||||
const Divider(),
|
||||
|
|
@ -234,6 +234,8 @@ class _OnlylookCarApplicationState extends State<OnlylookCarApplication> {
|
|||
_buildPhotoItem(2,attachmentList),
|
||||
const Divider(),
|
||||
// _buildPhotoItem(3),
|
||||
|
||||
if(signList.isNotEmpty)
|
||||
Container(
|
||||
height: 150,
|
||||
padding: EdgeInsets.all(8),
|
||||
|
|
@ -351,8 +353,9 @@ class _OnlylookCarApplicationState extends State<OnlylookCarApplication> {
|
|||
|
||||
Future<void> _getXgfApplyInfoById() async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show();
|
||||
final Map<String, dynamic> result= await DoorAndCarApi.getLevelCarInfoById(widget.id);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success'] ) {
|
||||
|
||||
// final dynamic newList = result['data'] ;
|
||||
|
|
@ -387,6 +390,7 @@ class _OnlylookCarApplicationState extends State<OnlylookCarApplication> {
|
|||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,6 +354,7 @@ class _OnlylookDoorareaCarState extends State<OnlylookDoorareaCar> {
|
|||
// ),
|
||||
const Divider(),
|
||||
|
||||
if(signList.isNotEmpty)
|
||||
Container(
|
||||
height: 150,
|
||||
padding: EdgeInsets.all(8),
|
||||
|
|
@ -402,8 +403,9 @@ class _OnlylookDoorareaCarState extends State<OnlylookDoorareaCar> {
|
|||
|
||||
Future<void> _getXgfApplyInfoById() async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show();
|
||||
final Map<String, dynamic> result= await DoorAndCarApi.getEnclosedCarById(widget.id);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success'] ) {
|
||||
|
||||
// final dynamic newList = result['data'] ;
|
||||
|
|
@ -438,6 +440,7 @@ class _OnlylookDoorareaCarState extends State<OnlylookDoorareaCar> {
|
|||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class _DoorareaTypePageState extends State<DoorareaTypePage> {
|
|||
}
|
||||
|
||||
},
|
||||
text: '',
|
||||
text: ' ',
|
||||
|
||||
),
|
||||
const Divider(),
|
||||
|
|
@ -90,7 +90,7 @@ class _DoorareaTypePageState extends State<DoorareaTypePage> {
|
|||
}
|
||||
|
||||
},
|
||||
text: '',
|
||||
text: ' ',
|
||||
|
||||
),
|
||||
const Divider(),
|
||||
|
|
|
|||
|
|
@ -767,7 +767,9 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
|
|||
}
|
||||
|
||||
// 将 List<Person> 转换为 List<Map<String, dynamic>>
|
||||
addData['entourage'] = _personList.map((person) => person.toJson()).toList();
|
||||
List<Map<String, dynamic>> jsonList = _personList.map((person) => person.toJson()).toList();
|
||||
// 再转换为 JSON 字符串
|
||||
addData['entourage'] = jsonEncode(jsonList);
|
||||
|
||||
if(signImages.isEmpty){
|
||||
ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字');
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
await pushPage(OnlylookCarApplication(4,item['id']), context);
|
||||
await pushPage(OnlylookCarApplication(4,item['vehicleApplyId']), context);
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
|
|
@ -251,7 +251,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item['projectName'],
|
||||
item['projectName']??'',
|
||||
// '${item['name']??''}',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
|
|
@ -261,7 +261,10 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
|
||||
|
||||
const SizedBox(height: 8),
|
||||
Text('申请人:${item['applyUserName']??""}',),
|
||||
if(widget.type==1||widget.type==2||widget.type==5||widget.type==6)
|
||||
Text('审核人:${item['auditUserName']??""}',),
|
||||
if(widget.type==3||widget.type==4||widget.type==7||widget.type==8)
|
||||
Text('审核人:${item['auditPersonUserName']??""}',),
|
||||
if(widget.type==5||widget.type==6||widget.type==7||widget.type==8)...[
|
||||
const SizedBox(height: 8),
|
||||
Text('车牌号:${item['licenceNo']??""}',),
|
||||
|
|
@ -272,7 +275,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
Text('时间范围:自${item['visitStartTime']??""}至${item['visitEndTime']??""}止'),
|
||||
const SizedBox(height: 8),
|
||||
Text('审核状态:${_getReviewStatus(item)}',),
|
||||
if(widget.type==2||widget.type==4||widget.type==6||widget.type==8&&(item['reasonsRefusal']??"").isNotEmpty)...[
|
||||
if((widget.type==2||widget.type==4||widget.type==6||widget.type==8)&&(item['reasonsRefusal']??"").isNotEmpty)...[
|
||||
const SizedBox(height: 8),
|
||||
Text('驳回原因:${item['reasonsRefusal']??""}',),
|
||||
],
|
||||
|
|
@ -366,33 +369,33 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
child: Row(
|
||||
children: [
|
||||
// 可点击的筛选图标
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// 筛选逻辑
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'筛选',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Icon(
|
||||
Icons.expand_more,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
// GestureDetector(
|
||||
// onTap: () {
|
||||
// // 筛选逻辑
|
||||
// },
|
||||
// child: Container(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Text(
|
||||
// '筛选',
|
||||
// style: TextStyle(
|
||||
// fontSize: 14,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(width: 2),
|
||||
// Icon(
|
||||
// Icons.expand_more,
|
||||
// size: 20,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(width: 8),
|
||||
// 搜索框
|
||||
Expanded(
|
||||
child: SearchBarWidget(
|
||||
|
|
@ -426,7 +429,9 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
|
||||
String _getAccessArea(final item) {
|
||||
//审核状态(1:审核中;2审核通过; 3:审核驳回,4无需审批(检查部门车辆))
|
||||
String type = item["gateLevelAuthArea"]??'';
|
||||
String type ='';
|
||||
if(widget.type==1||widget.type==2||widget.type==5||widget.type==6){
|
||||
type = item["gateLevelAuthArea"]??'';
|
||||
if(type.isNotEmpty){
|
||||
// 解析 JSON
|
||||
Map<String, dynamic> jsonData = json.decode(type);
|
||||
|
|
@ -437,11 +442,22 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
|
|||
}else{
|
||||
return '';
|
||||
}
|
||||
}else{
|
||||
return item["closedAreaName"]??'';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String _getReviewStatus(final item) {
|
||||
//审核状态(1:审核中;2审核通过; 3:审核驳回,4无需审批(长期人员))
|
||||
int type = item['auditFlag']??"";
|
||||
// int type = item['auditFlag']??"";
|
||||
|
||||
int type =0;
|
||||
if(widget.type==1||widget.type==2||widget.type==3||widget.type==4){
|
||||
type = int.tryParse(item['auditFlag']?.toString() ?? '') ?? 0;
|
||||
}else{
|
||||
type = int.tryParse(item['auditStatus']?.toString() ?? '') ?? 0;
|
||||
}
|
||||
if (1 == type) {
|
||||
return "待审核";
|
||||
} else if (2 == type) {
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ class _OnlylookDoorareaPersonState extends State<OnlylookDoorareaPerson> {
|
|||
// 人员列表
|
||||
...personnelList.map((person) => _buildPersonCard(person)),
|
||||
|
||||
if(signList.isNotEmpty)
|
||||
Container(
|
||||
height: 150,
|
||||
padding: EdgeInsets.all(8),
|
||||
|
|
@ -352,8 +353,9 @@ class _OnlylookDoorareaPersonState extends State<OnlylookDoorareaPerson> {
|
|||
|
||||
Future<void> _getXgfApplyInfoById() async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show();
|
||||
final Map<String, dynamic> result= await DoorAndCarApi.getEnclosedPersonById(widget.id);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success'] ) {
|
||||
|
||||
// final dynamic newList = result['data'] ;
|
||||
|
|
@ -380,6 +382,7 @@ class _OnlylookDoorareaPersonState extends State<OnlylookDoorareaPerson> {
|
|||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import 'package:qhd_prevention/http/ApiService.dart';
|
|||
import 'package:qhd_prevention/http/modules/doorAndCar_api.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
import 'package:qhd_prevention/tools/h_colors.dart';
|
||||
import 'package:qhd_prevention/tools/tools.dart';
|
||||
|
||||
|
||||
class OnlylookPersonApplication extends StatefulWidget {
|
||||
|
|
@ -31,7 +32,7 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
List<dynamic> personnelList = [];
|
||||
|
||||
//签字图片
|
||||
List<String> signList = [];
|
||||
late List<String> signList = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -62,6 +63,7 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
// 人员列表
|
||||
...personnelList.map((person) => _buildPersonCard(person)),
|
||||
|
||||
if (signList.isNotEmpty)
|
||||
Container(
|
||||
height: 150,
|
||||
padding: EdgeInsets.all(8),
|
||||
|
|
@ -215,7 +217,7 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _buildPersonCard(Map<String, String> person) {
|
||||
Widget _buildPersonCard(Map<String, dynamic> person) {
|
||||
return Card(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
color: Colors.white,
|
||||
|
|
@ -255,8 +257,9 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
// _buildInfoItem('部门:', person['部门'] ?? ''),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
|
||||
|
||||
SizedBox(height: 12),
|
||||
// 第二行:是否培训和权限范围
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
@ -272,6 +275,7 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
),
|
||||
],
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -344,8 +348,9 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
|
||||
Future<void> _getXgfApplyInfoById() async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show();
|
||||
final Map<String, dynamic> result= await DoorAndCarApi.getXgfAuditInfoById(widget.id);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success'] ) {
|
||||
|
||||
// final dynamic newList = result['data'] ;
|
||||
|
|
@ -372,6 +377,7 @@ class _OnlylookPersonApplicationState extends State<OnlylookPersonApplication> {
|
|||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class _PersonSelectionPageState extends State<PersonSelectionPage> {
|
|||
groupedPersons = {};
|
||||
|
||||
for (var item in list) {
|
||||
String id = item['id']??'';
|
||||
String id = item['userId']??'';
|
||||
String name = item['userName']??'';
|
||||
|
||||
// 使用lpinyin获取姓名首字母
|
||||
|
|
@ -506,6 +506,7 @@ class _PersonSelectionPageState extends State<PersonSelectionPage> {
|
|||
|
||||
if(widget.isMoreSelect){
|
||||
selectedStates[person.employeePersonUserId] = value ?? false;
|
||||
_updateGroupSelection(person.group);
|
||||
}else{
|
||||
// 清空所有选中状态
|
||||
for (var group in groupedPersons.keys) {
|
||||
|
|
@ -517,7 +518,7 @@ class _PersonSelectionPageState extends State<PersonSelectionPage> {
|
|||
selectedStates[person.employeePersonUserId] = true;
|
||||
}
|
||||
|
||||
_updateGroupSelection(person.group);
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue