危险作业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, 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),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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