危险作业bug修改7
parent
ab98cc1537
commit
c063cdf1bd
|
|
@ -6,6 +6,8 @@ import '../tools/tools.dart';
|
||||||
|
|
||||||
/// 自定义组件
|
/// 自定义组件
|
||||||
class ListItemFactory {
|
class ListItemFactory {
|
||||||
|
static const Color detailtextColor = Colors.black54;
|
||||||
|
|
||||||
/// 类型1:横向spaceBetween布局两个文本加按钮
|
/// 类型1:横向spaceBetween布局两个文本加按钮
|
||||||
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)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -44,65 +44,120 @@ 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 (status == '0' || status == '2') {
|
if (listType != SpecialListType.task) {
|
||||||
if (isEdit) {
|
await _openTaskPage(
|
||||||
await pushPage(
|
context: context,
|
||||||
HotWorkApplyPage(
|
workId: hotworkId,
|
||||||
isReEdit: true,
|
workCodeId: hotworkCodeId,
|
||||||
workId: hotworkId,
|
stepName: statusName,
|
||||||
status: status,
|
isEdit: isEdit,
|
||||||
),
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await pushPage(
|
|
||||||
HotTaskPage(
|
|
||||||
workId: hotworkId,
|
|
||||||
stepName: stepName,
|
|
||||||
workCodeId: hotworkCodeId,
|
|
||||||
isEdit: false,
|
|
||||||
type: listType,
|
|
||||||
),
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await pushPage(
|
|
||||||
HotTaskPage(
|
|
||||||
workId: hotworkId,
|
|
||||||
stepName: stepName,
|
|
||||||
workCodeId: hotworkCodeId,
|
|
||||||
isEdit: isEdit,
|
|
||||||
type: listType,
|
|
||||||
),
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
await pushPage(
|
|
||||||
HotTaskPage(
|
|
||||||
workId: hotworkId,
|
|
||||||
stepName: stepName,
|
|
||||||
workCodeId: hotworkCodeId,
|
|
||||||
isEdit: isEdit,
|
|
||||||
type: listType,
|
|
||||||
),
|
|
||||||
context,
|
|
||||||
);
|
);
|
||||||
|
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(
|
||||||
|
HotWorkApplyPage(
|
||||||
|
isReEdit: true,
|
||||||
|
workId: hotworkId,
|
||||||
|
status: status,
|
||||||
|
),
|
||||||
|
context,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await _openTaskPage(
|
||||||
|
context: context,
|
||||||
|
workId: hotworkId,
|
||||||
|
workCodeId: hotworkCodeId,
|
||||||
|
stepName: '查看',
|
||||||
|
isEdit: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// task 类型:延期步骤
|
||||||
|
if (stepId == '12') {
|
||||||
|
if (isEdit) {
|
||||||
|
await pushPage(
|
||||||
|
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: workId,
|
||||||
|
stepName: stepName,
|
||||||
|
workCodeId: workCodeId,
|
||||||
|
isEdit: isEdit,
|
||||||
|
type: listType,
|
||||||
|
),
|
||||||
|
context,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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) {},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue