2026.3.26 口门门禁

master
xufei 2026-03-26 15:23:39 +08:00
parent d363c40408
commit 4f263b5ce0
13 changed files with 119 additions and 73 deletions

View File

@ -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(() {

View File

@ -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: {
},
);
}

View File

@ -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) {

View File

@ -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": "", //

View File

@ -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": "", //访

View File

@ -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');
}

View File

@ -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');
}

View File

@ -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(),

View File

@ -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, '请阅读《安全进港须知》并签字');

View File

@ -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; 34)
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; 34)
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) {

View File

@ -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');
}

View File

@ -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');
}

View File

@ -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);
});
},