危险作业bug修改5
parent
b1b00ec469
commit
a1fdfef4b6
|
|
@ -296,7 +296,7 @@ class _MeasureslistsureState extends State<Measureslistsure> {
|
|||
vertical: 12,
|
||||
horizontal: 5,
|
||||
),
|
||||
child: Text(widget.item['content'] ?? ''),
|
||||
child: Text('${widget.item['content']}'.replaceAll('&&', '__')),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ class _SpecialWorkGasListState extends State<SpecialWorkGasList> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
_getListData();
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class DlApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.cutRoadWork;
|
||||
|
|
@ -74,20 +74,20 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复图片选择状态
|
||||
if (widget.isReEdit && FormUtils.hasValue(pd, 'workScopeAndMethodImage')) {
|
||||
|
|
@ -311,7 +311,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -332,7 +332,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class DtApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.breakgroundWork;
|
||||
|
|
@ -73,20 +73,20 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复图片选择状态
|
||||
if (widget.isReEdit && FormUtils.hasValue(pd, 'workScopeAndMethodImage')) {
|
||||
|
|
@ -297,7 +297,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -318,7 +318,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class DzApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.hoistingWork;
|
||||
|
|
@ -73,20 +73,20 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -308,7 +308,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -329,7 +329,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class GcApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.highWork;
|
||||
|
|
@ -70,20 +70,20 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -283,7 +283,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -302,7 +302,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class LsydApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
// 临时用电特有:台账列表(原代码中有但实际未使用,保留以备扩展)
|
||||
List<dynamic> limitedSpaceList = [];
|
||||
|
|
@ -79,20 +79,20 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -335,7 +335,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -354,7 +354,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class _LsydGasAddPageState extends State<LsydGasAddPage> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class MbcdApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
||||
// 安全措施确认人来源
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
// 盲板抽堵参数动态列表
|
||||
late List<dynamic> boardList = [
|
||||
|
|
@ -89,20 +89,20 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许人员列表
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复盲板参数和图片状态
|
||||
if (widget.isReEdit) {
|
||||
|
|
@ -352,7 +352,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -371,7 +371,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
List<dynamic> limitedSpaceList = [];
|
||||
|
||||
/// 气体分析人和安全措施确认人在作业监护人和作业负责人之中选择
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.confinedspaceWork;
|
||||
|
|
@ -94,38 +94,38 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 如果是重新编辑,从详情中恢复负责人/监护人选择
|
||||
if (widget.isReEdit) {
|
||||
setState(() {
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1': {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2': {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
// 安全防护措施模块(基类 controller 已初始化)
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -385,7 +385,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
@ -486,21 +486,15 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
pd['workChargeUserName'] = name;
|
||||
pd['workChargeUserDepartment'] = data['departmentId'];
|
||||
pd['workChargeUserDepartmentName'] = data['departmentName'];
|
||||
if (allowChoosePersonList.length > 1) {
|
||||
allowChoosePersonList[1] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
}
|
||||
allowChoosePerson['1'] = data;
|
||||
|
||||
} else {
|
||||
pd['workGuardianUserId'] = userId;
|
||||
pd['workGuardianUserName'] = name;
|
||||
pd['workGuardianUserDepartment'] = data['departmentId'];
|
||||
pd['workGuardianUserDepartmentName'] = data['departmentName'];
|
||||
if (allowChoosePersonList.length > 0) {
|
||||
allowChoosePersonList[0] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
} }
|
||||
allowChoosePerson['2'] = data;
|
||||
}
|
||||
super.getFlowInit(true);
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class _SxkjGasAddPageState extends State<SxkjGasAddPage> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class _SxkjTzApplyPageState extends State<SxkjTzApplyPage> {
|
|||
Navigator.of(context).pop();
|
||||
} else {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? "提交失败");
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? "作业提交失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
List<dynamic> allPersonList = [];
|
||||
|
||||
/// 常见的“两个可选人员”缓存:比如负责人/监护人、气体分析/措施确认人
|
||||
List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
/// 相关方人员列表
|
||||
List<dynamic> relatedPartiesPersonList = [];
|
||||
|
|
@ -297,7 +297,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
|
||||
// 已选安全措施人员匹配
|
||||
Future<void> _matchSafeMeasurePerson() async {
|
||||
allowChoosePersonList = [];
|
||||
allowChoosePerson = {};
|
||||
if (pd['xgfFlag'] == 1 && pd['xgfId'] != null && pd['xgfId'] != '') {
|
||||
final result = await BasicInfoApi.getDeptUsers(
|
||||
'',
|
||||
|
|
@ -307,24 +307,40 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
for (SafeMeasureOption measure in safeMeasures) {
|
||||
for (Map item in relatedPartiesPersonList) {
|
||||
if (measure.updateId == item['id']) {
|
||||
allowChoosePersonList.add(item);
|
||||
if (pd['workGuardianUser'] == item['id']) {
|
||||
allowChoosePerson['1'] = item;
|
||||
}else{
|
||||
allowChoosePerson['2'] = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (SafeMeasureOption measure in safeMeasures) {
|
||||
for (Map item in allPersonList) {
|
||||
print('measure.updateId: ${measure.updateId}-${item['id']}');
|
||||
if (measure.updateId == item['id']) {
|
||||
allowChoosePersonList.add(item);
|
||||
continue;
|
||||
if (pd['workGuardianUser'] == item['id']) {
|
||||
allowChoosePerson['1'] = item;
|
||||
}else{
|
||||
allowChoosePerson['2'] = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allowChoosePerson.keys.length == 1) { // 作业负责人和作业监护人说明选的是一个人
|
||||
allowChoosePerson['1'] = allowChoosePerson.values.first;
|
||||
allowChoosePerson['2'] = allowChoosePerson.values.first;
|
||||
}
|
||||
safeController.setAllMeasures(safeMeasures);
|
||||
setState(() {
|
||||
});
|
||||
}
|
||||
|
||||
/// 初始化流程数据
|
||||
Future<void> getFlowInit(bool isRefresh) async {
|
||||
if (!FormUtils.hasValue(pd, 'workLevel')) {
|
||||
return;
|
||||
}
|
||||
LoadingDialogHelper.show();
|
||||
try {
|
||||
final res = await SpecialWorkApi.specialWorkFlowInit({
|
||||
|
|
@ -555,15 +571,10 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
groups[index]['actUserDepartmentName'] = data['departmentName'];
|
||||
// 同步更新允许列表,用于安全措施确认人、气体分析人
|
||||
if (stepId == '20') {
|
||||
allowChoosePersonList[0] = data;
|
||||
if (allowChoosePersonList.length > 1) {
|
||||
allowChoosePersonList[1] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
}
|
||||
allowChoosePerson['1'] = data;
|
||||
_clearRelatedPartiesPerson();
|
||||
} else if (stepId == '21') {
|
||||
allowChoosePersonList[1] = data;
|
||||
allowChoosePerson['2'] = data;
|
||||
_clearRelatedPartiesPerson();
|
||||
}
|
||||
});
|
||||
|
|
@ -829,7 +840,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
ToastUtil.showNormal(context, result['errMessage'] ?? '保存失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '提交失败:$e');
|
||||
ToastUtil.showNormal(context, '作业提交失败:$e');
|
||||
} finally {
|
||||
LoadingDialogHelper.dismiss();
|
||||
}
|
||||
|
|
@ -1228,7 +1239,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
/// 你可以在子类里直接复用这个字段重置方法
|
||||
void resetInnerRelatedState() {
|
||||
isInnerWork = false;
|
||||
allowChoosePersonList = [{}, {}];
|
||||
allowChoosePerson = {};
|
||||
}
|
||||
|
||||
/// 如果某个页面需要手动清空人员缓存,可以用这个
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
bool isDelayTime = true;
|
||||
|
||||
if (pd['componentName'] == 'completeDelayTime' && other['isCompleteWork'] == 1) {
|
||||
if (!FormUtils.hasValue(other, 'hotTime')) {
|
||||
if (other['isDelayWork'] == 1 && !FormUtils.hasValue(other, 'hotTime')) {
|
||||
ToastUtil.showNormal(context, '请选择动火日期');
|
||||
return;
|
||||
}
|
||||
|
|
@ -388,7 +388,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
final signResult = await _checkSignature();
|
||||
if (!signResult) {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, '提交失败');
|
||||
ToastUtil.showNormal(context, '作业提交失败');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -399,11 +399,11 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
ToastUtil.showNormal(context, '提交成功');
|
||||
widget.onSubmitSuccess(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, '提交失败');
|
||||
ToastUtil.showNormal(context, '作业提交失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -791,7 +791,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
isEditable: true,
|
||||
onTap: () async {
|
||||
final DateTime? picked = await BottomDateTimePicker.showDate(
|
||||
mode: BottomPickerMode.date,
|
||||
mode: BottomPickerMode.dateTimeWithSeconds,
|
||||
context,
|
||||
allowPast: false,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue