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