危险作业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 {
static const Color detailtextColor = Colors.black54;
/// 1spaceBetween
static Widget createRowSpaceBetweenItem({
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,
bool isEdit,
) async {
final hotworkId = item['id'] ?? '';
final hotworkCodeId = item['workId'] ?? '';
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
final hotworkId = '${item['id'] ?? ''}';
final hotworkCodeId = '${item['workId'] ?? ''}';
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 stepName = isEdit
? (listType == SpecialListType.task
final statusName = listType == SpecialListType.task
? '${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 (isEdit) {
await pushPage(
@ -67,43 +102,63 @@ class DhWaitPage extends SpecialWorkWaitPageBase {
context,
);
} else {
await pushPage(
HotTaskPage(
await _openTaskPage(
context: context,
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
stepName: '查看',
isEdit: false,
type: listType,
),
context,
);
}
return;
}
// task
if (stepId == '12') {
if (isEdit) {
await pushPage(
HotTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
HotDelayPage(data: item, isEdit: true),
context,
);
} 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(
HotTaskPage(
workId: hotworkId,
workId: workId,
stepName: stepName,
workCodeId: hotworkCodeId,
workCodeId: workCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
}
@override
Widget buildCardBody(

View File

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

View File

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