Compare commits
3 Commits
dac4f448b8
...
ab98cc1537
| Author | SHA1 | Date |
|---|---|---|
|
|
ab98cc1537 | |
|
|
7596efb750 | |
|
|
a1fdfef4b6 |
|
|
@ -68,7 +68,7 @@ class DepartmentAllPersonPicker {
|
|||
static Future<void> show(
|
||||
BuildContext context, {
|
||||
required List<dynamic> personsData,
|
||||
List<dynamic>? serverData,
|
||||
required List<dynamic> serverData,
|
||||
bool allowXgfFlag = true,
|
||||
bool multiSelect = false,
|
||||
PersonMultiSelectCallback? onMultiSelected,
|
||||
|
|
@ -113,7 +113,7 @@ class DepartmentAllPersonPicker {
|
|||
|
||||
class _DepartmentAllPersonPickerSheet extends StatefulWidget {
|
||||
final List<dynamic> personsData;
|
||||
final List<dynamic>? serverData;
|
||||
final List<dynamic> serverData;
|
||||
final bool allowXgfFlag;
|
||||
final bool multiSelect;
|
||||
|
||||
|
|
@ -184,12 +184,24 @@ class _DepartmentAllPersonPickerSheetState extends State<_DepartmentAllPersonPic
|
|||
uniqueMap[key] = item;
|
||||
}
|
||||
}
|
||||
final Map<dynamic, dynamic> uniqueMap2 = {};
|
||||
|
||||
if (widget.serverData.length > 0) {
|
||||
for (final item in widget.serverData) {
|
||||
if (item is Map<String, dynamic>) {
|
||||
final key = item['id'] ?? item['actUser']; // id去重
|
||||
uniqueMap2[key] = item;
|
||||
}
|
||||
} }
|
||||
|
||||
|
||||
|
||||
final List<dynamic> list = uniqueMap.values.toList();
|
||||
_personAll = list.map((e) => Person.fromJson(e)).toList();
|
||||
|
||||
final List<dynamic> list2 = uniqueMap2.values.toList();
|
||||
|
||||
_serverAll = (widget.serverData ?? []).map((e) => Person.fromJson(e)).toList();
|
||||
_serverAll = list2.map((e) => Person.fromJson(e)).toList();
|
||||
|
||||
_personFiltered = List.from(_personAll);
|
||||
_serverFiltered = List.from(_serverAll);
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ class _MeasureslistsureState extends State<Measureslistsure> {
|
|||
vertical: 12,
|
||||
horizontal: 5,
|
||||
),
|
||||
child: Text(widget.item['content'] ?? ''),
|
||||
child: Text('${widget.item['content']}'.replaceAll('&&', '____')),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class _MeasuresListWidgetState extends State<MeasuresListWidget> {
|
|||
item['signPath'] =
|
||||
'1983773013086048256/202604/special_operation_process_signature_photo/7da0a8e8eeef403f9c1973f0c566cd24.png';
|
||||
item['signTime'] = DateFormat(
|
||||
'yyyy-MM-dd HH:mm',
|
||||
'yyyy-MM-dd HH:mm:ss',
|
||||
).format(DateTime.now());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -134,6 +134,14 @@ class _HotWorkDetailFormWidgetState extends State<HotWorkDetailFormWidget> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
isEditable: false,
|
||||
|
|
@ -145,14 +153,6 @@ class _HotWorkDetailFormWidgetState extends State<HotWorkDetailFormWidget> {
|
|||
isEditable: false,
|
||||
text: pd['applyUser'] ?? '',
|
||||
),
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !widget.isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: pd['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
const Divider(),
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
label: '申请日期:',
|
||||
|
|
@ -178,7 +178,7 @@ class _HotWorkDetailFormWidgetState extends State<HotWorkDetailFormWidget> {
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -305,31 +305,6 @@ class _HotWorkDetailFormWidgetState extends State<HotWorkDetailFormWidget> {
|
|||
),
|
||||
const Divider(),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
const Divider(),
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -46,37 +46,18 @@ class DhWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final stepId = '${item['stepId'] ?? ''}';
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
if (status == '0' || status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SpecialWorkGasList(data: item, addFlag: stepId == '2'),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
HotTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (status == '0') {
|
||||
await pushPage(
|
||||
HotWorkApplyPage(
|
||||
isReEdit: true,
|
||||
|
|
@ -85,64 +66,36 @@ class DhWaitPage extends SpecialWorkWaitPageBase {
|
|||
),
|
||||
context,
|
||||
);
|
||||
} else if (status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
HotWorkApplyPage(
|
||||
isReEdit: true,
|
||||
workId: hotworkId,
|
||||
status: status,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
HotTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: '查看',
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else if (stepId == '12') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
HotDelayPage(data: item, isEdit: true),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
HotTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
await pushPage(
|
||||
HotTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
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: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
|
|||
|
|
@ -119,6 +119,15 @@ class _HotWorkApplyPageState extends SpecialWorkApplyBaseState<HotWorkApplyPage>
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -132,15 +141,6 @@ class _HotWorkApplyPageState extends SpecialWorkApplyBaseState<HotWorkApplyPage>
|
|||
isEditable: false,
|
||||
text: pd['applyUser'] ?? '',
|
||||
),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
const Divider(),
|
||||
// 申请日期
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -179,7 +179,7 @@ class _HotWorkApplyPageState extends SpecialWorkApplyBaseState<HotWorkApplyPage>
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
|
|||
|
|
@ -211,6 +211,8 @@ class _HotDelayPageState extends State<HotDelayPage> {
|
|||
}
|
||||
|
||||
void _onAdd() async {
|
||||
final time = DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now());
|
||||
addData['delayHotTime'] = time;
|
||||
await SpecialWorkGasAlert.show(
|
||||
context,
|
||||
title: '添加',
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ class _SpecialWorkGasListState extends State<SpecialWorkGasList> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
_getListData();
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class _BreakgroundDetailFormWidgetState extends State<BreakgroundDetailFormWidge
|
|||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '编号:',
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
|
|
@ -163,7 +163,7 @@ class _BreakgroundDetailFormWidgetState extends State<BreakgroundDetailFormWidge
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -270,30 +270,7 @@ class _BreakgroundDetailFormWidgetState extends State<BreakgroundDetailFormWidge
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class DlApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.cutRoadWork;
|
||||
|
|
@ -63,7 +63,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
bool get enableLocation => true; // 使用基类定位组件,但定位跳转需自定义
|
||||
|
||||
@override
|
||||
bool get enableRiskResults => false; // 使用自定义风险辨识结果选择
|
||||
bool get enableRiskResults => true; // 使用自定义风险辨识结果选择
|
||||
|
||||
@override
|
||||
UploadFileType? get imageUploadType => UploadFileType.specialOperationApplyInvolvedPhoto;
|
||||
|
|
@ -74,20 +74,20 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复图片选择状态
|
||||
if (widget.isReEdit && FormUtils.hasValue(pd, 'workScopeAndMethodImage')) {
|
||||
|
|
@ -135,6 +135,15 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -166,7 +175,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -311,7 +320,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -332,7 +341,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -44,41 +44,52 @@ class DlWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (status == '0' || status == '2') {
|
||||
await pushPage(
|
||||
DlApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
if (context.mounted) {
|
||||
(context as Element).markNeedsBuild();
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
DlApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DlTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
await pushPage(
|
||||
DlTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await pushPage(
|
||||
DlTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DlTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class _CutRoadDetailFormWidgetState extends State<CutRoadDetailFormWidget> {
|
|||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '编号:',
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
|
|
@ -163,7 +163,7 @@ class _CutRoadDetailFormWidgetState extends State<CutRoadDetailFormWidget> {
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -250,23 +250,6 @@ class _CutRoadDetailFormWidgetState extends State<CutRoadDetailFormWidget> {
|
|||
controller: null,
|
||||
text: riskShowStr,
|
||||
),
|
||||
const Divider(),
|
||||
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
label: '作业实施开始时间:',
|
||||
isEditable: false,
|
||||
onTap: () async {
|
||||
},
|
||||
text: pd['workStartTime'] ?? '',
|
||||
),
|
||||
const Divider(),
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
label: '作业实施结束时间:',
|
||||
isEditable: false,
|
||||
onTap: () async {
|
||||
},
|
||||
text: pd['workEndTime'] ?? '',
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
|
|
@ -278,30 +261,7 @@ class _CutRoadDetailFormWidgetState extends State<CutRoadDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class DtApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.breakgroundWork;
|
||||
|
|
@ -73,20 +73,20 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复图片选择状态
|
||||
if (widget.isReEdit && FormUtils.hasValue(pd, 'workScopeAndMethodImage')) {
|
||||
|
|
@ -134,6 +134,15 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -165,7 +174,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -297,7 +306,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -318,7 +327,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -44,38 +44,52 @@ class DtWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (status == '0' || status == '2') {
|
||||
await pushPage(
|
||||
DtApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DtTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
DtApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DtTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await pushPage(
|
||||
DtTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DtTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class DzApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.hoistingWork;
|
||||
|
|
@ -73,20 +73,20 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -129,6 +129,15 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -156,11 +165,11 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
if (pd['xgfFlag'] == 1) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createYesNoSection(
|
||||
horizontalPadding: 5,
|
||||
verticalPadding: 0,
|
||||
horizontalPadding: 2,
|
||||
verticalPadding: 7,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -308,7 +317,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -329,7 +338,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -44,43 +44,52 @@ class DzWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (status == '0') {
|
||||
await pushPage(
|
||||
DzApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else if (status == '2') {
|
||||
await pushPage(
|
||||
DzApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DzTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
if (status == '0' || status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
DzApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DzTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await pushPage(
|
||||
DzTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
DzTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class _HoistingDetailFormWidgetState extends State<HoistingDetailFormWidget> {
|
|||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '编号:',
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
|
|
@ -162,7 +162,7 @@ class _HoistingDetailFormWidgetState extends State<HoistingDetailFormWidget> {
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -289,30 +289,7 @@ class _HoistingDetailFormWidgetState extends State<HoistingDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class _HeighWorkDetailFormWidgetState extends State<HeighWorkDetailFormWidget> {
|
|||
if (FormUtils.hasValue(widget.pd, 'checkNo') &&
|
||||
!widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '编号:',
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
|
|
@ -159,7 +159,7 @@ class _HeighWorkDetailFormWidgetState extends State<HeighWorkDetailFormWidget> {
|
|||
groupValue: null,
|
||||
onChanged: (bool value) {},
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -258,30 +258,7 @@ class _HeighWorkDetailFormWidgetState extends State<HeighWorkDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class GcApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.highWork;
|
||||
|
|
@ -70,20 +70,20 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -126,6 +126,15 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -157,7 +166,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -283,7 +292,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -302,7 +311,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -44,74 +44,81 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final stepId = '${item['stepId'] ?? ''}';
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
} else {
|
||||
if (status == '0') {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == '0' || status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
GcApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else if (status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
GcApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: '查看',
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else if (stepId == '12') {
|
||||
if (isEdit) {
|
||||
} else {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (stepId == '12') {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
GcTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
@ -129,9 +136,16 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
Map<String, dynamic> info,
|
||||
String statusName,
|
||||
) {
|
||||
final step10 = Map<String, dynamic>.from(info['step_10'] ?? {});
|
||||
final step4 = Map<String, dynamic>.from(info['step_4'] ?? {});
|
||||
final step6 = Map<String, dynamic>.from(info['step_6'] ?? {});
|
||||
// 获取各个步骤的人员信息(按原逻辑)
|
||||
String actUserUnit = info['step_21']?['actUserDepartmentName'] ?? '';
|
||||
String safeDisclosureUserName = info['step_18']?['actUserName'] ?? '';
|
||||
String acceptDisclosureUserName = info['step_19']?['actUserName'] ?? '';
|
||||
String guardianUserName = info['step_20']?['actUserName'] ?? '';
|
||||
String workUserName = info['step_21']?['actUserName'] ?? '';
|
||||
String unitLeaderUserName = info['step_22']?['actUserName'] ?? '';
|
||||
String auditDepartmentLeaderUserName = info['step_23']?['actUserName'] ?? '';
|
||||
String spDepartmentLeaderUserName = info['step_24']?['actUserName'] ?? '';
|
||||
String acceptDepartmentLeaderUserName = info['step_25']?['actUserName'] ?? '';
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
@ -141,7 +155,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'编号: ${workInfo['checkNo'] ?? ''}',
|
||||
"编号: ${item['checkNo'] ?? ''}",
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -154,8 +168,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
],
|
||||
),
|
||||
Text(
|
||||
'动火等级: ${info['workLevelName'] ?? ''}',
|
||||
textAlign: TextAlign.right,
|
||||
"施工单位: $actUserUnit",
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -168,7 +181,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'申请人: ${info['applyUser'] ?? ''}',
|
||||
"申请人: ${info['applyUser'] ?? ''}",
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
|
|
@ -177,7 +190,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'申请部门: ${info['applyDepartment'] ?? ''}',
|
||||
"申请单位: ${info['applyDepartment'] ?? ''}",
|
||||
textAlign: TextAlign.right,
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
|
|
@ -189,42 +202,41 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'现场负责人: ${step10['actUserName'] ?? ''}',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
textAlign: TextAlign.right,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(
|
||||
'动火单位负责人: ${step4['actUserName'] ?? ''}',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text("作业负责人: $workUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
Text("所在单位负责人: $unitLeaderUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("审核部门负责人: $auditDepartmentLeaderUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
Text("审批部门负责人: $spDepartmentLeaderUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("监护人: $guardianUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
Text("安全交底人: $safeDisclosureUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("接受交底人: $acceptDisclosureUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
Text("验收部门负责人: $acceptDepartmentLeaderUserName",
|
||||
softWrap: true, maxLines: null, overflow: TextOverflow.visible),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'现场管辖单位负责人: ${step6['actUserName'] ?? ''}',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(
|
||||
'作业内容: ${info['workContent'] ?? ''}',
|
||||
textAlign: TextAlign.left,
|
||||
softWrap: true,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(
|
||||
'动火部位: ${info['work_place'] ?? ''}',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(
|
||||
'作业类型: ${info['operationTypeName'] ?? ''}',
|
||||
"作业类型: ${info['operationTypeName'] ?? ''}",
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
|
|
@ -233,7 +245,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
|
|||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'审核状态: $statusName',
|
||||
"审核状态: $statusName",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
|
|
|
|||
|
|
@ -126,6 +126,14 @@ class _LsydWorkDetailFormWidgetState extends State<LsydWorkDetailFormWidget> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
isEditable: false,
|
||||
|
|
@ -137,14 +145,6 @@ class _LsydWorkDetailFormWidgetState extends State<LsydWorkDetailFormWidget> {
|
|||
isEditable: false,
|
||||
text: pd['applyUser'] ?? '',
|
||||
),
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !widget.isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: pd['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
const Divider(),
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
label: '作业类型:',
|
||||
|
|
@ -163,7 +163,7 @@ class _LsydWorkDetailFormWidgetState extends State<LsydWorkDetailFormWidget> {
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -317,30 +317,7 @@ class _LsydWorkDetailFormWidgetState extends State<LsydWorkDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class LsydApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
||||
// 安全措施确认人来源(作业负责人和监护人)
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
// 临时用电特有:台账列表(原代码中有但实际未使用,保留以备扩展)
|
||||
List<dynamic> limitedSpaceList = [];
|
||||
|
|
@ -79,20 +79,20 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -135,6 +135,15 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -166,7 +175,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -335,7 +344,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -354,7 +363,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class _LsydGasAddPageState extends State<LsydGasAddPage> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -46,70 +46,64 @@ class LsydWaitPage extends SpecialWorkWaitPageBase {
|
|||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final stepId = '${item['stepId'] ?? ''}';
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SpecialWorkGasList(data: item, addFlag: stepId == '2'),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
LsydTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (status == '0') {
|
||||
await pushPage(
|
||||
LsydApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else if (status == '2') {
|
||||
await pushPage(
|
||||
LsydApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
LsydTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final String stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
Future<void> openTaskPage({required bool editable}) async {
|
||||
await pushPage(
|
||||
LsydTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
isEdit: editable,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SpecialWorkGasList(data: item, addFlag: true),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await openTaskPage(editable: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == '0' || status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
LsydApplyPage(
|
||||
isReEdit: true,
|
||||
work_id: hotworkId,
|
||||
status: status,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await openTaskPage(editable: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await openTaskPage(editable: isEdit);
|
||||
return;
|
||||
}
|
||||
|
||||
await openTaskPage(editable: isEdit);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class _MbcdDetailFormWidgetState extends State<MbcdDetailFormWidget> {
|
|||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '编号:',
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
|
|
@ -213,7 +213,7 @@ class _MbcdDetailFormWidgetState extends State<MbcdDetailFormWidget> {
|
|||
groupValue: null, onChanged: (bool value) { },
|
||||
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(),
|
||||
|
||||
// 相关方作业
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
|
|
@ -336,30 +336,7 @@ class _MbcdDetailFormWidgetState extends State<MbcdDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class MbcdApplyPage extends SpecialWorkApplyBasePage {
|
|||
|
||||
class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
||||
// 安全措施确认人来源
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
// 盲板抽堵参数动态列表
|
||||
late List<dynamic> boardList = [
|
||||
|
|
@ -89,20 +89,20 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许人员列表
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 重新编辑时恢复盲板参数和图片状态
|
||||
if (widget.isReEdit) {
|
||||
|
|
@ -176,6 +176,15 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -207,7 +216,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -352,7 +361,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
// 安全防护措施模块
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -371,7 +380,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
|
|||
|
|
@ -47,38 +47,52 @@ class MbcdWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? (item['workInfo'] ?? {}) : item;
|
||||
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
final stepName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (status == '0' || status == '2') {
|
||||
await pushPage(
|
||||
MbcdApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
MbcdTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
MbcdApplyPage(isReEdit: true, work_id: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
MbcdTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await pushPage(
|
||||
MbcdTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
MbcdTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
stepName: stepName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
|
|
@ -188,24 +202,6 @@ class MbcdWaitPage extends SpecialWorkWaitPageBase {
|
|||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'审核部门负责人: $auditDepartmentLeaderUserName',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
textAlign: TextAlign.right,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
Text(
|
||||
'审批部门负责人: $spDepartmentLeaderUserName',
|
||||
softWrap: true,
|
||||
maxLines: null,
|
||||
overflow: TextOverflow.visible,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ class _SxkjWorkDetailFormWidgetState extends State<SxkjWorkDetailFormWidget> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
if (FormUtils.hasValue(widget.pd, 'checkNo') && !widget.isEditable) ...[
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: widget.pd['checkNo'] ?? '',
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
isEditable: false,
|
||||
|
|
@ -133,14 +141,6 @@ class _SxkjWorkDetailFormWidgetState extends State<SxkjWorkDetailFormWidget> {
|
|||
isEditable: false,
|
||||
text: pd['applyUser'] ?? '',
|
||||
),
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !widget.isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: pd['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
const Divider(),
|
||||
ItemListWidget.selectableLineTitleTextRightButton(
|
||||
label: '申请日期:',
|
||||
|
|
@ -282,31 +282,6 @@ class _SxkjWorkDetailFormWidgetState extends State<SxkjWorkDetailFormWidget> {
|
|||
isAllowEdit: false,
|
||||
),
|
||||
],
|
||||
if (_otherMeasuresList.isNotEmpty) ...[
|
||||
const Divider(),
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
List<dynamic> limitedSpaceList = [];
|
||||
|
||||
/// 气体分析人和安全措施确认人在作业监护人和作业负责人之中选择
|
||||
late List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
late Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
@override
|
||||
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.confinedspaceWork;
|
||||
|
|
@ -94,38 +94,38 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
@override
|
||||
Future<void> afterInitDataLoaded() async {
|
||||
// 初始化允许选择的人员列表(作业负责人和监护人)
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1' : {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2' : {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
// 如果是重新编辑,从详情中恢复负责人/监护人选择
|
||||
if (widget.isReEdit) {
|
||||
setState(() {
|
||||
allowChoosePersonList = [
|
||||
{
|
||||
allowChoosePerson = {
|
||||
'1': {
|
||||
"actUser": pd['workGuardianUser'] ?? pd['workGuardianUserId'] ?? '',
|
||||
"actUserDepartment": pd['workGuardianUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workGuardianUserDepartmentName'] ?? '',
|
||||
"actUserName": pd['workGuardianUserName'] ?? '',
|
||||
},
|
||||
{
|
||||
'2': {
|
||||
"actUserDepartment": pd['workChargeUserDepartment'] ?? '',
|
||||
"actUserDepartmentName": pd['workChargeUserDepartmentName'] ?? '',
|
||||
"actUser": pd['workChargeUser'] ?? pd['workChargeUserId'] ?? '',
|
||||
"actUserName": pd['workChargeUserName'] ?? '',
|
||||
},
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -175,6 +175,15 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
const Divider(),
|
||||
],
|
||||
ListItemFactory.createBuildSimpleSection('基本信息'),
|
||||
// 作业编号(只读,仅在详情模式下显示)
|
||||
if (FormUtils.hasValue(pd, 'checkNo') && !isEditable) ...[
|
||||
const Divider(),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '作业编号:',
|
||||
isEditable: false,
|
||||
text: initData['checkNo'] ?? '',
|
||||
),
|
||||
],
|
||||
// 申请单位(只读)
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '申请单位:',
|
||||
|
|
@ -226,7 +235,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
verticalPadding: 0,
|
||||
title: '是否项目内作业',
|
||||
isRequired: true,
|
||||
groupValue: isInnerWork,
|
||||
groupValue: pd['internalOperationFlag'] == 1,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
isInnerWork = value;
|
||||
|
|
@ -364,7 +373,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
// 安全防护措施模块(基类 controller 已初始化)
|
||||
SafeProtectionModule(
|
||||
controller: safeController,
|
||||
personList: allowChoosePersonList,
|
||||
personList: allowChoosePerson.values.toList(),
|
||||
isEditable: isEditable,
|
||||
),
|
||||
],
|
||||
|
|
@ -385,7 +394,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
if (item['stepId']?.toString() == '2') {
|
||||
List firmList = [];
|
||||
List xgfList = [];
|
||||
for (final item in allowChoosePersonList) {
|
||||
for (final item in allowChoosePerson.values.toList()) {
|
||||
// 区分出两个数组、企业和相关方
|
||||
if (item['userType'] == 2) {
|
||||
firmList.add(item);
|
||||
|
|
@ -486,21 +495,15 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
|
|||
pd['workChargeUserName'] = name;
|
||||
pd['workChargeUserDepartment'] = data['departmentId'];
|
||||
pd['workChargeUserDepartmentName'] = data['departmentName'];
|
||||
if (allowChoosePersonList.length > 1) {
|
||||
allowChoosePersonList[1] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
}
|
||||
allowChoosePerson['1'] = data;
|
||||
|
||||
} else {
|
||||
pd['workGuardianUserId'] = userId;
|
||||
pd['workGuardianUserName'] = name;
|
||||
pd['workGuardianUserDepartment'] = data['departmentId'];
|
||||
pd['workGuardianUserDepartmentName'] = data['departmentName'];
|
||||
if (allowChoosePersonList.length > 0) {
|
||||
allowChoosePersonList[0] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
} }
|
||||
allowChoosePerson['2'] = data;
|
||||
}
|
||||
super.getFlowInit(true);
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class _SxkjGasAddPageState extends State<SxkjGasAddPage> {
|
|||
ToastUtil.showNormal(context, '添加成功');
|
||||
Navigator.pop(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '添加失败');
|
||||
|
|
|
|||
|
|
@ -45,66 +45,64 @@ class SxkjWaitPage extends SpecialWorkWaitPageBase {
|
|||
) async {
|
||||
final hotworkId = item['id'] ?? '';
|
||||
final hotworkCodeId = item['workId'] ?? '';
|
||||
final hotworkInfo =
|
||||
listType == SpecialListType.task ? item['workInfo'] : item;
|
||||
final hotworkInfo = listType == SpecialListType.task ? item['workInfo'] ?? {} : item;
|
||||
|
||||
final stepId = '${item['stepId'] ?? ''}';
|
||||
final status = '${hotworkInfo['status']}';
|
||||
final String statusName =
|
||||
listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}';
|
||||
final status = '${hotworkInfo['status'] ?? ''}';
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SpecialWorkGasList(data: item, addFlag: stepId == '2'),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
SxkjTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: false,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (status == '0' || status == '2') {
|
||||
await pushPage(
|
||||
SxkjApplyPage(isReEdit: true, workId: hotworkId, status: status),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await pushPage(
|
||||
SxkjTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final String statusName = isEdit
|
||||
? (listType == SpecialListType.task
|
||||
? '${item['stepName'] ?? ''}'
|
||||
: '${hotworkInfo['currentStep'] ?? ''}')
|
||||
: '查看';
|
||||
|
||||
Future<void> openTaskPage({required bool editable}) async {
|
||||
await pushPage(
|
||||
SxkjTaskPage(
|
||||
workId: hotworkId,
|
||||
stepName: statusName,
|
||||
workCodeId: hotworkCodeId,
|
||||
isEdit: isEdit,
|
||||
isEdit: editable,
|
||||
type: listType,
|
||||
),
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
||||
if (listType == SpecialListType.task) {
|
||||
if (stepId == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SpecialWorkGasList(data: item, addFlag: true),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await openTaskPage(editable: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == '0' || status == '2') {
|
||||
if (isEdit) {
|
||||
await pushPage(
|
||||
SxkjApplyPage(
|
||||
isReEdit: true,
|
||||
workId: hotworkId,
|
||||
status: status,
|
||||
),
|
||||
context,
|
||||
);
|
||||
} else {
|
||||
await openTaskPage(editable: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
await openTaskPage(editable: isEdit);
|
||||
return;
|
||||
}
|
||||
|
||||
await openTaskPage(editable: isEdit);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -115,12 +113,7 @@ class SxkjWaitPage extends SpecialWorkWaitPageBase {
|
|||
Map<String, dynamic> info,
|
||||
String statusName,
|
||||
) {
|
||||
final step21 = Map<String, dynamic>.from(info['step_21'] ?? {});
|
||||
final step18 = Map<String, dynamic>.from(info['step_18'] ?? {});
|
||||
final step19 = Map<String, dynamic>.from(info['step_19'] ?? {});
|
||||
final step20 = Map<String, dynamic>.from(info['step_20'] ?? {});
|
||||
final step22 = Map<String, dynamic>.from(info['step_22'] ?? {});
|
||||
final step25 = Map<String, dynamic>.from(info['step_25'] ?? {});
|
||||
|
||||
final chooseLimitedSpace = Map<String, dynamic>.from(
|
||||
info['chooseLimitedSpace'] ?? {},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class _SxkjTzApplyPageState extends State<SxkjTzApplyPage> {
|
|||
Navigator.of(context).pop();
|
||||
} else {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? "提交失败");
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? "作业提交失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
List<dynamic> allPersonList = [];
|
||||
|
||||
/// 常见的“两个可选人员”缓存:比如负责人/监护人、气体分析/措施确认人
|
||||
List<dynamic> allowChoosePersonList = [{}, {}];
|
||||
Map<String, dynamic> allowChoosePerson = {};
|
||||
|
||||
/// 相关方人员列表
|
||||
List<dynamic> relatedPartiesPersonList = [];
|
||||
|
|
@ -297,7 +297,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
|
||||
// 已选安全措施人员匹配
|
||||
Future<void> _matchSafeMeasurePerson() async {
|
||||
allowChoosePersonList = [];
|
||||
allowChoosePerson = {};
|
||||
if (pd['xgfFlag'] == 1 && pd['xgfId'] != null && pd['xgfId'] != '') {
|
||||
final result = await BasicInfoApi.getDeptUsers(
|
||||
'',
|
||||
|
|
@ -307,24 +307,40 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
for (SafeMeasureOption measure in safeMeasures) {
|
||||
for (Map item in relatedPartiesPersonList) {
|
||||
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 (Map item in allPersonList) {
|
||||
print('measure.updateId: ${measure.updateId}-${item['id']}');
|
||||
if (measure.updateId == item['id']) {
|
||||
allowChoosePersonList.add(item);
|
||||
continue;
|
||||
if (pd['workGuardianUser'] == item['id']) {
|
||||
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 {
|
||||
if (!FormUtils.hasValue(pd, 'workLevel')) {
|
||||
return;
|
||||
}
|
||||
LoadingDialogHelper.show();
|
||||
try {
|
||||
final res = await SpecialWorkApi.specialWorkFlowInit({
|
||||
|
|
@ -347,7 +363,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
|
||||
/// 根据 initData 生成签字组
|
||||
void _initGroupsFromInitData(bool isRefresh) {
|
||||
_clearRelatedPartiesPerson();
|
||||
_clearAllPerson();
|
||||
final List steps =
|
||||
(initData['settingSignSteps'] is List)
|
||||
? List.from(initData['settingSignSteps'])
|
||||
|
|
@ -555,15 +571,10 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
groups[index]['actUserDepartmentName'] = data['departmentName'];
|
||||
// 同步更新允许列表,用于安全措施确认人、气体分析人
|
||||
if (stepId == '20') {
|
||||
allowChoosePersonList[0] = data;
|
||||
if (allowChoosePersonList.length > 1) {
|
||||
allowChoosePersonList[1] = data;
|
||||
}else{
|
||||
allowChoosePersonList.add(data);
|
||||
}
|
||||
allowChoosePerson['1'] = data;
|
||||
_clearRelatedPartiesPerson();
|
||||
} else if (stepId == '21') {
|
||||
allowChoosePersonList[1] = data;
|
||||
allowChoosePerson['2'] = data;
|
||||
_clearRelatedPartiesPerson();
|
||||
}
|
||||
});
|
||||
|
|
@ -575,7 +586,8 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
void _clearRelatedPartiesPerson() {
|
||||
setState(() {
|
||||
for (Map item in groups) {
|
||||
if (item['stepId']?.toString() == '2') {
|
||||
final stepId = item['stepId']?.toString() ?? '';
|
||||
if (stepId == '2') { // 气体检测人清空
|
||||
item['actUser'] = '';
|
||||
item['actUserName'] = '';
|
||||
item['actUserDepartment'] = '';
|
||||
|
|
@ -584,9 +596,30 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
}
|
||||
safeController.clearAllGroupUser();
|
||||
});
|
||||
|
||||
// 特殊处理:气体分析人员(stepId=2)只能从作业负责人和监护人中选择
|
||||
}
|
||||
void _clearAllPerson() async {
|
||||
setState(() {
|
||||
for (Map item in groups) {
|
||||
item['actUser'] = '';
|
||||
item['actUserName'] = '';
|
||||
item['actUserDepartment'] = '';
|
||||
item['actUserDepartmentName'] = '';
|
||||
}
|
||||
if (pd['xgfFlag'] == 1) {
|
||||
safeController.clearAllGroupUser();
|
||||
}
|
||||
pd['workChargeUserId'] = '';
|
||||
pd['workChargeUserName'] = '';
|
||||
pd['workChargeUserDepartment'] = '';
|
||||
pd['workChargeUserDepartmentName'] = '';
|
||||
|
||||
pd['workGuardianUserId'] = '';
|
||||
pd['workGuardianUserName'] = '';
|
||||
pd['workGuardianUserDepartment'] = '';
|
||||
pd['workGuardianUserDepartmentName'] = '';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// 选择相关方项目
|
||||
Future<void> getRelatedPartiesList() async {
|
||||
|
|
@ -783,7 +816,10 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
/// 通用提交入口
|
||||
Future<void> submit(String status) async {
|
||||
await beforeSubmit(status);
|
||||
|
||||
if (!FormUtils.hasValue(pd, 'workLevel')) {
|
||||
ToastUtil.showNormal(context, '请选择作业等级');
|
||||
return;
|
||||
}
|
||||
final preparers =
|
||||
enableSafeProtection
|
||||
? safeController.buildPreparers()
|
||||
|
|
@ -829,7 +865,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
ToastUtil.showNormal(context, result['errMessage'] ?? '保存失败');
|
||||
}
|
||||
} catch (e) {
|
||||
ToastUtil.showNormal(context, '提交失败:$e');
|
||||
ToastUtil.showNormal(context, '作业提交失败:$e');
|
||||
} finally {
|
||||
LoadingDialogHelper.dismiss();
|
||||
}
|
||||
|
|
@ -837,33 +873,35 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
|
||||
/// 通用 payload 组装
|
||||
Future<Map<String, dynamic>> buildSubmitPayload(
|
||||
String status,
|
||||
List<Map> signLogs,
|
||||
) async {
|
||||
String status,
|
||||
List<Map> signLogs,
|
||||
) async {
|
||||
|
||||
final extraPayload = await buildExtraPayload();
|
||||
final info = <String, dynamic>{...pd};
|
||||
if (FormUtils.hasValue(info, 'taskWorkLevels')) {
|
||||
info.remove('taskWorkLevels');
|
||||
}
|
||||
|
||||
final payload = <String, dynamic>{
|
||||
'workLevel': info['workLevel'] ?? '',
|
||||
'workType': workType.code,
|
||||
'xgfFlag': info['xgfFlag'] ?? '',
|
||||
'projectId': info['projectId'] ?? '',
|
||||
'projectName': info['projectName'] ?? '',
|
||||
'corpinfoId': info['projectExecutionLocationCorpId'] ?? '',
|
||||
'info': info,
|
||||
'gasFlag': info['gasFlag'] ?? '',
|
||||
'checkNo': info['checkNo'] ?? '',
|
||||
'signLogs': signLogs,
|
||||
'workId': form['workId'] ?? '',
|
||||
};
|
||||
payload.addAll(extraPayload);
|
||||
|
||||
if (pd['internalOperationFlag'] == 1) {
|
||||
payload['xgfId'] = info['xgfId'] ?? '';
|
||||
}
|
||||
|
||||
final extraPayload = await buildExtraPayload();
|
||||
payload.addAll(extraPayload);
|
||||
|
||||
|
||||
if (FormUtils.hasValue(payload, 'workId') && widget.status == '2') {
|
||||
payload.remove('checkNo');
|
||||
|
|
@ -900,9 +938,9 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
for (final measure in uniquePreparers) {
|
||||
final newItem = Map<String, dynamic>.from(item);
|
||||
newItem['updateId'] = measure['updateId'];
|
||||
newItem['updateName'] = measure['userName'];
|
||||
newItem['updateName'] = measure['updateName'];
|
||||
newItem['actUser'] = measure['updateId'];
|
||||
newItem['actUserName'] = measure['userName'];
|
||||
newItem['actUserName'] = measure['updateName'];
|
||||
newItem['actUserDepartment'] = measure['departmentId'];
|
||||
newItem['actUserDepartmentName'] = measure['departmentName'];
|
||||
newGroups.add(newItem);
|
||||
|
|
@ -1176,9 +1214,12 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
buildFormContent(),
|
||||
const SizedBox(height: 20),
|
||||
buildFooterButtons(),
|
||||
if (pd.keys.isNotEmpty) ...[
|
||||
buildFormContent(),
|
||||
const SizedBox(height: 20),
|
||||
buildFooterButtons(),
|
||||
]else
|
||||
NoDataWidget.show()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
@ -1228,7 +1269,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
|
|||
/// 你可以在子类里直接复用这个字段重置方法
|
||||
void resetInnerRelatedState() {
|
||||
isInnerWork = false;
|
||||
allowChoosePersonList = [{}, {}];
|
||||
allowChoosePerson = {};
|
||||
}
|
||||
|
||||
/// 如果某个页面需要手动清空人员缓存,可以用这个
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
/// 安全措施列表
|
||||
List<dynamic> _measures = [];
|
||||
|
||||
/// 已提交的其他安全措施
|
||||
List<dynamic> _otherMeasuresList = [];
|
||||
|
||||
/// 备注/意见输入
|
||||
final TextEditingController _contentController = TextEditingController();
|
||||
|
||||
|
|
@ -194,7 +197,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
await NativeOrientation.setPortrait();
|
||||
|
||||
if (path != null) {
|
||||
final now = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now());
|
||||
final now = DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now());
|
||||
setState(() {
|
||||
signImages = [path];
|
||||
signTimes = [now];
|
||||
|
|
@ -239,6 +242,17 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
});
|
||||
}
|
||||
|
||||
/// 只获取已填写的其他安全措施列表
|
||||
final measuresData = await SpecialWorkApi.specialWorkSignMeasureList({
|
||||
'eqWorkId': pd['workId'] ?? '',
|
||||
'eqType' : 2
|
||||
});
|
||||
if (measuresData['success'] == true) {
|
||||
setState(() {
|
||||
_otherMeasuresList = measuresData['data'] ?? [];
|
||||
});
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_groups = groups;
|
||||
|
|
@ -257,7 +271,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
bool isDelayTime = true;
|
||||
|
||||
if (pd['componentName'] == 'completeDelayTime' && other['isCompleteWork'] == 1) {
|
||||
if (!FormUtils.hasValue(other, 'hotTime')) {
|
||||
if (other['isDelayWork'] == 1 && !FormUtils.hasValue(other, 'hotTime')) {
|
||||
ToastUtil.showNormal(context, '请选择动火日期');
|
||||
return;
|
||||
}
|
||||
|
|
@ -388,7 +402,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
final signResult = await _checkSignature();
|
||||
if (!signResult) {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, '提交失败');
|
||||
ToastUtil.showNormal(context, '作业提交失败');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -399,11 +413,11 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
ToastUtil.showNormal(context, '提交成功');
|
||||
widget.onSubmitSuccess(context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '提交失败');
|
||||
ToastUtil.showNormal(context, res['errMessage'] ?? '作业提交失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
ToastUtil.showNormal(context, '提交失败');
|
||||
ToastUtil.showNormal(context, '作业提交失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -512,6 +526,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
DepartmentAllPersonPicker.show(
|
||||
context,
|
||||
personsData: personList,
|
||||
serverData: [],
|
||||
allowXgfFlag: false,
|
||||
onSelectedWithData: (userId, name, data) {
|
||||
setState(() {
|
||||
|
|
@ -791,7 +806,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
isEditable: true,
|
||||
onTap: () async {
|
||||
final DateTime? picked = await BottomDateTimePicker.showDate(
|
||||
mode: BottomPickerMode.date,
|
||||
mode: BottomPickerMode.dateTimeWithSeconds,
|
||||
context,
|
||||
allowPast: false,
|
||||
);
|
||||
|
|
@ -911,7 +926,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
}
|
||||
return Column(
|
||||
children: [
|
||||
if (pd['measuresStepFlag'] == 1) ... [
|
||||
if (pd['measuresStepFlag'] == 1 && widget.isEdit) ... [
|
||||
Multitextfieldwithtitlewidght(
|
||||
label: '其他安全措施:',
|
||||
isEditable: true,
|
||||
|
|
@ -925,22 +940,23 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
// 签字信息
|
||||
...buildStepSignWidgets(signInfo),
|
||||
|
||||
if (pd['locateStepFlag'] == 1) _locationWidget(),
|
||||
if (pd['componentName'] == 'completeDelayTime') _completeDelayTimeWidget(),
|
||||
if (pd['componentName'] == 'personAnderRecordFile') _personAnderRecordFileWidget(),
|
||||
if (pd['componentName'] == 'completeDelayTime') ...[
|
||||
if (other['isCompleteWork'] == 1) ...[
|
||||
if (other['isDelayWork'] != 1) ...[
|
||||
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
|
||||
if (widget.isEdit) ...[
|
||||
if (pd['locateStepFlag'] == 1) _locationWidget(),
|
||||
if (pd['componentName'] == 'completeDelayTime') _completeDelayTimeWidget(),
|
||||
if (pd['componentName'] == 'personAnderRecordFile') _personAnderRecordFileWidget(),
|
||||
if (pd['componentName'] == 'completeDelayTime') ...[
|
||||
if (other['isCompleteWork'] == 1) ...[
|
||||
if (other['isDelayWork'] != 1) ...[
|
||||
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
|
||||
],
|
||||
_signWidget(),
|
||||
],
|
||||
] else ...[
|
||||
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
|
||||
_signWidget(),
|
||||
],
|
||||
] else ...[
|
||||
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
|
||||
_signWidget(),
|
||||
],
|
||||
|
||||
_bottomButtons(),
|
||||
_bottomButtons(),
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
@ -1003,7 +1019,73 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
if (validEntries.isNotEmpty) {
|
||||
widgets.add(ListItemFactory.createBuildSimpleSection('签字信息'));
|
||||
}
|
||||
if (FormUtils.hasValue(pd, 'applyUserSignImage')) {
|
||||
|
||||
final stepName = '申请部门负责人';
|
||||
final imageUrl = ApiService.baseImgPath + pd['applyUserSignImage'];
|
||||
String signTime = pd['applyTime'] ?? '';
|
||||
if (FormUtils.hasValue(pd, 'step_1')) {
|
||||
final workInfo = pd['step_1'] ?? {};
|
||||
signTime = workInfo['signTime'] ?? '';
|
||||
}
|
||||
widgets.add(
|
||||
Container(
|
||||
margin: const EdgeInsets.only(top: 10, left: 5, right: 5),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
stepName,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
presentOpaque(SingleImageViewer(imageUrl: imageUrl), context);
|
||||
},
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: 220,
|
||||
maxHeight: 140,
|
||||
),
|
||||
child: Image.network(
|
||||
imageUrl,
|
||||
fit: BoxFit.contain,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const Text('签字图片加载失败');
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
signTime,
|
||||
style: const TextStyle(fontSize: 12, color: Colors.black54),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
for (final entry in validEntries) {
|
||||
final raw = entry.value;
|
||||
if (raw is! Map) continue;
|
||||
|
|
@ -1095,6 +1177,38 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
return widgets;
|
||||
}
|
||||
|
||||
// 其他安全措施回显
|
||||
Widget _otherMeasureWidgets() {
|
||||
if (_otherMeasuresList.isNotEmpty) {
|
||||
return Column(
|
||||
children: [
|
||||
ListItemFactory.createBuildSimpleSection('其他安全措施'),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
_otherMeasuresList.map<Widget>((item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6.0,
|
||||
horizontal: 12.0,
|
||||
),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'${item['stepName'] ?? ''}:${item['content'] ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -1110,7 +1224,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
children: [
|
||||
widget.buildDetailForm(pd),
|
||||
const Divider(height: 1),
|
||||
if (pd['specialStepCode'] == 'measures') ...[
|
||||
if (pd['specialStepCode'] == 'measures' && widget.isEdit) ...[
|
||||
MeasuresListWidget(
|
||||
measuresList: _measures,
|
||||
isAllowEdit: true,
|
||||
|
|
@ -1130,9 +1244,10 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
|
|||
},
|
||||
),
|
||||
],
|
||||
if (widget.isEdit) ...[
|
||||
_operationWidget(),
|
||||
] else ...[
|
||||
_otherMeasureWidgets(),
|
||||
_operationWidget(),
|
||||
|
||||
if (!widget.isEdit) ...[
|
||||
const SizedBox(height: 10),
|
||||
CustomButton(
|
||||
text: '返回',
|
||||
|
|
|
|||
Loading…
Reference in New Issue