危险作业bug修改7
parent
ab98cc1537
commit
c063cdf1bd
|
|
@ -6,6 +6,8 @@ import '../tools/tools.dart';
|
|||
|
||||
/// 自定义组件
|
||||
class ListItemFactory {
|
||||
static const Color detailtextColor = Colors.black54;
|
||||
|
||||
/// 类型1:横向spaceBetween布局两个文本加按钮
|
||||
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)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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) {},
|
||||
|
|
|
|||
Loading…
Reference in New Issue