危险作业bug修改5

master
hs 2026-04-24 11:42:04 +08:00
parent b1b00ec469
commit a1fdfef4b6
14 changed files with 93 additions and 88 deletions

View File

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

View File

@ -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, '添加失败');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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, '添加失败');

View File

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

View File

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

View File

@ -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, '添加失败');

View File

@ -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'] ?? "作业提交失败");
}
}
}

View File

@ -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 = {};
}
///

View File

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