危险作业bug修改7

master
hs 2026-04-28 09:02:17 +08:00
parent ab98cc1537
commit c063cdf1bd
4 changed files with 119 additions and 65 deletions

View File

@ -6,6 +6,8 @@ import '../tools/tools.dart';
/// ///
class ListItemFactory { class ListItemFactory {
static const Color detailtextColor = Colors.black54;
/// 1spaceBetween /// 1spaceBetween
static Widget createRowSpaceBetweenItem({ static Widget createRowSpaceBetweenItem({
required String leftText, required String leftText,
@ -333,7 +335,7 @@ class ListItemFactory {
), ),
], ],
), ),
if (!isEdit) Text(text, style: TextStyle()), if (!isEdit) Text(text, style: TextStyle(color: detailtextColor)),
], ],
), ),
), ),

View File

@ -44,18 +44,53 @@ class DhWaitPage extends SpecialWorkWaitPageBase {
Map<String, dynamic> item, Map<String, dynamic> item,
bool isEdit, bool isEdit,
) async { ) async {
final hotworkId = item['id'] ?? ''; final hotworkId = '${item['id'] ?? ''}';
final hotworkCodeId = item['workId'] ?? ''; final hotworkCodeId = '${item['workId'] ?? ''}';
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
final Map<String, dynamic> hotworkInfo =
listType == SpecialListType.task
? (item['workInfo'] as Map<String, dynamic>? ?? <String, dynamic>{})
: item;
final stepId = '${item['stepId'] ?? ''}';
final status = '${hotworkInfo['status'] ?? ''}'; final status = '${hotworkInfo['status'] ?? ''}';
final stepName = isEdit final statusName = listType == SpecialListType.task
? (listType == SpecialListType.task
? '${item['stepName'] ?? ''}' ? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}') : '${hotworkInfo['currentStep'] ?? ''}';
: '查看';
if (listType == SpecialListType.task) { // task
if (listType != SpecialListType.task) {
await _openTaskPage(
context: context,
workId: hotworkId,
workCodeId: hotworkCodeId,
stepName: statusName,
isEdit: isEdit,
);
return;
}
// task
if (stepId == '2') {
if (isEdit) {
await pushPage(
SpecialWorkGasList(data: item, addFlag: true),
context,
);
} else {
await _openTaskPage(
context: context,
workId: hotworkId,
workCodeId: hotworkCodeId,
stepName: statusName,
isEdit: false,
);
}
return;
}
// task 0 / 2
if (status == '0' || status == '2') { if (status == '0' || status == '2') {
if (isEdit) { if (isEdit) {
await pushPage( await pushPage(
@ -67,43 +102,63 @@ class DhWaitPage extends SpecialWorkWaitPageBase {
context, context,
); );
} else { } else {
await pushPage( await _openTaskPage(
HotTaskPage( context: context,
workId: hotworkId, workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId, workCodeId: hotworkCodeId,
stepName: '查看',
isEdit: false, isEdit: false,
type: listType,
),
context,
); );
} }
return; return;
} }
// task
if (stepId == '12') {
if (isEdit) {
await pushPage( await pushPage(
HotTaskPage( HotDelayPage(data: item, isEdit: true),
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context, context,
); );
} else { } else {
await _openTaskPage(
context: context,
workId: hotworkId,
workCodeId: hotworkCodeId,
stepName: statusName,
isEdit: false,
);
}
return;
}
//
await _openTaskPage(
context: context,
workId: hotworkId,
workCodeId: hotworkCodeId,
stepName: statusName,
isEdit: isEdit,
);
}
Future<void> _openTaskPage({
required BuildContext context,
required String workId,
required String workCodeId,
required String stepName,
required bool isEdit,
}) async {
await pushPage( await pushPage(
HotTaskPage( HotTaskPage(
workId: hotworkId, workId: workId,
stepName: stepName, stepName: stepName,
workCodeId: hotworkCodeId, workCodeId: workCodeId,
isEdit: isEdit, isEdit: isEdit,
type: listType, type: listType,
), ),
context, context,
); );
} }
}
@override @override
Widget buildCardBody( Widget buildCardBody(

View File

@ -75,15 +75,12 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
@override @override
Future<void> loadExtraData() async { Future<void> loadExtraData() async {
final parentPerm =
'dashboard:hazardous:work:confined-space-operations:Confined-Space-Work-Ledger';
final targetPerm = '';
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
final data = { final data = {
"eqWorkType": SpecialWorkTypeEnum.confinedspaceWork.code, "eqWorkType": SpecialWorkTypeEnum.confinedspaceWork.code,
"pageSize": 999, "pageSize": 999,
"pageIndex": 1, "pageIndex": 1,
"menuPath": menuPath, "eqCorpinfoId": pd['projectExecutionLocationCorpId'],
}; };
final limitedSpaceRes = await SpecialWorkApi.specialWorkLimitedSpaceList(data); final limitedSpaceRes = await SpecialWorkApi.specialWorkLimitedSpaceList(data);
if (limitedSpaceRes['success'] == true) { if (limitedSpaceRes['success'] == true) {
@ -426,7 +423,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
/// ///
Future<void> _chooseFromLedger() async { Future<void> _chooseFromLedger() async {
if (limitedSpaceList.isEmpty) { if (limitedSpaceList.isEmpty) {
ToastUtil.showNormal(context, '暂无可选台账'); ToastUtil.showNormal(context, '暂无可选台账,请选择正确的相关方项目');
return; return;
} }
final result = await BottomPicker.show<String>( final result = await BottomPicker.show<String>(
@ -504,7 +501,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
pd['workGuardianUserDepartmentName'] = data['departmentName']; pd['workGuardianUserDepartmentName'] = data['departmentName'];
allowChoosePerson['2'] = data; allowChoosePerson['2'] = data;
} }
super.getFlowInit(true); super.clearRelatedPartiesPerson();
}); });
}, },
); );

View File

@ -236,7 +236,6 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
await getFlowInit(false); await getFlowInit(false);
} }
await loadExtraData();
await afterInitDataLoaded(); await afterInitDataLoaded();
if (enableSafeProtection) { if (enableSafeProtection) {
@ -572,10 +571,10 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
// //
if (stepId == '20') { if (stepId == '20') {
allowChoosePerson['1'] = data; allowChoosePerson['1'] = data;
_clearRelatedPartiesPerson(); clearRelatedPartiesPerson();
} else if (stepId == '21') { } else if (stepId == '21') {
allowChoosePerson['2'] = data; allowChoosePerson['2'] = data;
_clearRelatedPartiesPerson(); clearRelatedPartiesPerson();
} }
}); });
}, },
@ -583,7 +582,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
} }
// //
void _clearRelatedPartiesPerson() { void clearRelatedPartiesPerson() {
setState(() { setState(() {
for (Map item in groups) { for (Map item in groups) {
final stepId = item['stepId']?.toString() ?? ''; final stepId = item['stepId']?.toString() ?? '';
@ -642,6 +641,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
pd['projectExecutionLocationCorpName'] = pd['projectExecutionLocationCorpName'] =
json['projectExecutionLocationCorpName']; json['projectExecutionLocationCorpName'];
}); });
loadExtraData();
_getRelatedPartiesUserList(); _getRelatedPartiesUserList();
}, },
onSelected: (id, name, pdId) {}, onSelected: (id, name, pdId) {},