2026.3.25 列表权限
parent
c30ace06df
commit
d363c40408
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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": '', //时间反显
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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": '', //身份证号码
|
||||||
};
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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": '', //1股份2分公司3相关方4临时人员
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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'] ?? [];
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue