2025.9.8 修改bug

main
xufei 2025-09-08 17:53:44 +08:00
parent 41c514cdc4
commit e727730f0c
11 changed files with 93 additions and 26 deletions

View File

@ -343,6 +343,7 @@ class _SafeDrawerPageState extends State<SafeDrawerPage> {
// ),
// ),
// ),
const SizedBox(height: 10),
ItemListWidget.itemContainer(horizontal: 15,ListItemFactory.createRowSpaceBetweenItem(
leftText: '整改部门',
rightText:hiddenForm['RECTIFICATIONDEPT_NAME'] ?? '',

View File

@ -61,12 +61,15 @@ class _SafecheckDetailState extends State<SafecheckDetail> {
{'name': 'UNITS_ID', 'message': '请选择被检查单位'},
{'name': 'PERSONNELMANAGEMENT_ID', 'message': '请选择被检查单位现场负责人'},
{'name': 'INSPECTION_PLACE', 'message': '请输入检查场所'},
{'name': 'INSPECTION_TYPE', 'message': '请选择检查类型不能为空'},
{'name': 'INSPECTION_TYPE', 'message': '请选择检查类型'},
{'name': 'INSPECTION_TIME_START', 'message': '请选择检查开始时间'},
{'name': 'INSPECTION_TIME_END', 'message': '请选择作业结束时间'},
{'name': 'INSPECTION_USERS', 'message': '请输入检查人员'},
];
Map<String, dynamic> form = {
'INSPECTION_USERS': '',
'KEYPROJECTCHECK_ID': '', // ID
@ -448,6 +451,18 @@ class _SafecheckDetailState extends State<SafecheckDetail> {
}
}
// {'name': 'INSPECTION_USERS', 'message': '请输入检查人员'},
final name2 = 'INSPECTION_USERS';
final message2 ='请输入检查人员';
final v = form[name2];
if (v == null || v.toString().isEmpty || v.toString() == '请选择') {
LoadingDialogHelper.hide();
ToastUtil.showNormal(context, message2);
return;
}
// inspectorList INSPECTION_USER_ID
final List<Map<String, String>> inspectors = form['inspectorList'] ?? [];
final seenIds = <String>{};

View File

@ -112,7 +112,17 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
files5 = data['pImgs'] ?? [];
files6 = data['yImgs'] ?? [];
checkList = data['checkList'] ?? [];
});
//
final result = await ApiService.getListTreePersonList(buMenId);
setState(() {
_personCache=List<Map<String, dynamic>>.from(
result['userList'] as List,
);
});
}
} catch (e) {
@ -155,6 +165,15 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
files6 = data['yImgs'] ?? [];
checkList = data['checkList'] ?? [];
});
//
final result = await ApiService.getListTreePersonList(buMenId);
setState(() {
_personCache=List<Map<String, dynamic>>.from(
result['userList'] as List,
);
});
}
} catch (e) {
@ -402,9 +421,12 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
});
//
final result = await ApiService.getListTreePersonList(id);
_personCache=List<Map<String, dynamic>>.from(
result['userList'] as List,
);
setState(() {
_personCache=List<Map<String, dynamic>>.from(
result['userList'] as List,
);
});
}),
@ -429,7 +451,7 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
),
GestureDetector(
onTap: () {
if ( renYuanId.isEmpty) {
if ( buMenId.isEmpty) {
ToastUtil.showNormal(context, '请先选择部门');
return;
}

View File

@ -112,9 +112,12 @@ class _SafecheckStartListPageState extends State<SafecheckStartListPage> {
}
///
void _handleApply() {
Future<void> _handleApply() async {
//
pushPage(SafecheckStartDetail(INSPECTION_ID: '', type: 'add',), context);
await pushPage(SafecheckStartDetail(INSPECTION_ID: '', type: 'add',), context);
_search();
}
///

View File

@ -264,10 +264,10 @@ class _RiskControlPageState extends State<RiskControlPage> {
if (_isLoading) return;
_isLoading = true;
LoadingDialogHelper.show();
final result = await ApiService.getRiskRecordList( currentPage,
riskId, dept, level, keyWord);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
_totalPage =result["page"]['totalPage'] ?? 1;
@ -291,6 +291,7 @@ class _RiskControlPageState extends State<RiskControlPage> {
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
} finally {

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/tools.dart';
import '../../http/ApiService.dart';
@ -24,8 +25,9 @@ class _UserinfoPageState extends State<UserinfoPage> {
Future<void> _getUserInfo() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getUserInfo();
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
setState(() {
user= result['pd'];
@ -35,6 +37,7 @@ class _UserinfoPageState extends State<UserinfoPage> {
_showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}

View File

@ -348,7 +348,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
Future<void> _getAlreadyUpImages(Map item) async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getAlreadyUpImages(item["RECORDITEM_ID"]);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['imgs'] ?? [];
List<PhotoItem> imgList = [];
@ -369,6 +371,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
ToastUtil.showNormal(context, "加载数据失败");
}
} catch (e) {
LoadingDialogHelper.hide();
print('加载数据失败:$e');
}
}

View File

@ -45,7 +45,9 @@ class _LawsRegulationsPage extends State<LawsRegulationsPage> {
try {
_accordionList.clear();
_fileList.clear();
LoadingDialogHelper.show();
final result = await ApiService.getLowList(keyWord);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -60,6 +62,7 @@ class _LawsRegulationsPage extends State<LawsRegulationsPage> {
_showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}

View File

@ -59,7 +59,7 @@ class _MineSetPageState extends State<MineSetPage> {
GestureDetector(
child: _setItemWidget("修改密码"),
onTap: () {
pushPage(const MineSetPwdPage(), context);
pushPage(const MineSetPwdPage("0"), context);
},
),
const Divider(height: 1, color: Colors.black12),

View File

@ -13,8 +13,9 @@ import '../../http/ApiService.dart';
import '../login_page.dart';
class MineSetPwdPage extends StatefulWidget {
const MineSetPwdPage({super.key});
const MineSetPwdPage(this.type, {super.key});
final String type;
@override
State<MineSetPwdPage> createState() => _MineSetPwdPageState();
}
@ -38,19 +39,19 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
final confirmPwd = _confirmPwdController.text.trim();
if (oldPwd.isEmpty) {
ToastUtil.showNormal(context, '填写旧密码');
// _showMessage('请填写密码');
ToastUtil.showNormal(context, '输入当前密码');
// _showMessage('请填写当前密码');
return;
}
if (newPwd.isEmpty) {
ToastUtil.showNormal(context, '填写新密码');
ToastUtil.showNormal(context, '输入新密码');
// _showMessage('请填写新密码');
return;
}
if (confirmPwd.isEmpty) {
ToastUtil.showNormal(context, '填写确认新密码');
ToastUtil.showNormal(context, '输入确认密码');
// _showMessage('请填写确认新密码');
return;
}
@ -62,14 +63,20 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
// }
if (newPwd != confirmPwd) {
ToastUtil.showNormal(context, '新密码与确认密码不一致');
ToastUtil.showNormal(context, '两次输入的密码不一致');
// _showMessage('新密码与确认密码不一致');
return;
}
//
if (newPwd.length < 8 || newPwd.length > 18) {
ToastUtil.showNormal(context, '新密码长度需在8-18位之间');
if (newPwd.length < 8 ) {
ToastUtil.showNormal(context, '密码需要大于8位');
// _showMessage('密码长度需在8-18位之间');
return;
}
if ( newPwd.length > 18) {
ToastUtil.showNormal(context, '密码需要小于18位');
// _showMessage('密码长度需在8-18位之间');
return;
}
@ -137,14 +144,14 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
const SizedBox(height: 30),
_buildPwdField('密码', _oldPwdController),
_buildPwdField('当前密码', _oldPwdController),
const SizedBox(height: 20),
_buildPwdField('新密码', _newPwdController),
const SizedBox(height: 20),
_buildPwdField('确认新密码', _confirmPwdController),
const SizedBox(height: 15),
const Text(
'需8-18位字母大小写、数字、字符混合',
'为了您的账户安全,请确保密码长度为 8-18 位,必须包含大小写字母+数字+特殊字符,例如:Aa@123456',
style: TextStyle(color: Colors.grey, fontSize: 13),
),
const SizedBox(height: 30,),
@ -173,7 +180,7 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
// final hidCount = raw['hidCount'] as Map<String, dynamic>;
// print(hidCount);
if (raw['result'] == 'success') {
ToastUtil.showNormal(context, '密码修改成功');
ToastUtil.showNormal(context, '密码修改成功!');
// _showMessage('密码修改成功'); //
Navigator.pop(context,true);
@ -187,17 +194,17 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
);
}else if (raw['result'] == 'usererror'){
ToastUtil.showNormal(context, '旧密码输入错');
ToastUtil.showNormal(context, '当前密码密码有');
// _showMessage('密码修改失败');
}else{
ToastUtil.showNormal(context, '密码修改失败');
ToastUtil.showNormal(context, '登录错误!请联系管理员');
// _showMessage('密码修改失败');
}
} catch (e) {
// Toast
print('加载首页数据失败:$e');
ToastUtil.showNormal(context, '密码修改失败');
ToastUtil.showNormal(context, '登录错误!请联系管理员');
// _showMessage('密码修改失败');
}
}

View File

@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:pointycastle/asymmetric/api.dart' show RSAPublicKey;
import 'package:qhd_prevention/pages/mine/mine_set_pwd_page.dart';
import 'package:qhd_prevention/tools/tools.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:fluttertoast/fluttertoast.dart';
@ -36,6 +37,14 @@ class AuthService {
return false;
}
// if(data['result']['WEAK_PASSWORD']=='1'){
// pushPage(const MineSetPwdPage("1"), context);
// return false;
// }else if(data['result']['LONG_TERM_PASSWORD_NOT_CHANGED']=='1'){
// pushPage(const MineSetPwdPage("2"), context);
// return false;
// }
final prefs = await SharedPreferences.getInstance();
await prefs.setString(_keyUser, json.encode(data));
await prefs.setStringList(_keyRemember, [username, password]);