Compare commits

..

No commits in common. "ab98cc153765716f12987d42c28d95ccfbb4e5a8" and "dac4f448b865f0c5feda1d96b9b4db4b3eda3bd7" have entirely different histories.

34 changed files with 754 additions and 758 deletions

View File

@ -68,7 +68,7 @@ class DepartmentAllPersonPicker {
static Future<void> show(
BuildContext context, {
required List<dynamic> personsData,
required List<dynamic> serverData,
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,24 +184,12 @@ 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 = list2.map((e) => Person.fromJson(e)).toList();
_serverAll = (widget.serverData ?? []).map((e) => Person.fromJson(e)).toList();
_personFiltered = List.from(_personAll);
_serverFiltered = List.from(_serverAll);

View File

@ -296,7 +296,7 @@ class _MeasureslistsureState extends State<Measureslistsure> {
vertical: 12,
horizontal: 5,
),
child: Text('${widget.item['content']}'.replaceAll('&&', '____')),
child: Text(widget.item['content'] ?? ''),
),
Padding(
padding: const EdgeInsets.all(0),

View File

@ -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:ss',
'yyyy-MM-dd HH:mm',
).format(DateTime.now());
}
});

View File

@ -134,14 +134,6 @@ 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,
@ -153,6 +145,14 @@ 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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -305,6 +305,31 @@ 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(),
],
],

View File

@ -46,18 +46,37 @@ 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 status = '${hotworkInfo['status'] ?? ''}';
final stepName = isEdit
? (listType == SpecialListType.task
final stepId = '${item['stepId'] ?? ''}';
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (status == '0' || status == '2') {
if (stepId == '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,
@ -66,36 +85,64 @@ 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: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: false,
isEdit: isEdit,
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,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,

View File

@ -119,15 +119,6 @@ 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: '申请单位:',
@ -141,6 +132,15 @@ 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: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;

View File

@ -211,8 +211,6 @@ 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: '添加',

View File

@ -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, '添加失败');

View File

@ -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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -270,7 +270,30 @@ 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(),
),
],
],
),

View File

@ -36,7 +36,7 @@ class DlApplyPage extends SpecialWorkApplyBasePage {
class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
@override
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.cutRoadWork;
@ -63,7 +63,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
bool get enableLocation => true; // 使
@override
bool get enableRiskResults => true; // 使
bool get enableRiskResults => false; // 使
@override
UploadFileType? get imageUploadType => UploadFileType.specialOperationApplyInvolvedPhoto;
@ -74,20 +74,20 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +135,6 @@ 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: '申请单位:',
@ -175,7 +166,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -320,7 +311,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -341,7 +332,7 @@ class _DlApplyPageState extends SpecialWorkApplyBaseState<DlApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -44,52 +44,41 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (status == '0' || status == '2') {
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,
);
await pushPage(
DlApplyPage(isReEdit: true, work_id: hotworkId, status: status),
context,
);
if (context.mounted) {
(context as Element).markNeedsBuild();
}
return;
} else {
await pushPage(
DlTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
await pushPage(
DlTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
} else {
await pushPage(
DlTaskPage(
workId: hotworkId,
stepName: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,

View File

@ -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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -250,6 +250,23 @@ 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'] ?? '',
),
],
@ -261,7 +278,30 @@ 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(),
),
],
],
),

View File

@ -34,7 +34,7 @@ class DtApplyPage extends SpecialWorkApplyBasePage {
class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
@override
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.breakgroundWork;
@ -73,20 +73,20 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +134,6 @@ 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: '申请单位:',
@ -174,7 +165,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -306,7 +297,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -327,7 +318,7 @@ class _DtApplyPageState extends SpecialWorkApplyBaseState<DtApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -44,52 +44,38 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (status == '0' || status == '2') {
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(
DtApplyPage(isReEdit: true, work_id: hotworkId, status: status),
context,
);
} else {
await pushPage(
DtTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
await pushPage(
DtTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
} else {
await pushPage(
DtTaskPage(
workId: hotworkId,
stepName: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,

View File

@ -33,7 +33,7 @@ class DzApplyPage extends SpecialWorkApplyBasePage {
class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
@override
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.hoistingWork;
@ -73,20 +73,20 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +129,6 @@ 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: '申请单位:',
@ -165,11 +156,11 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
if (pd['xgfFlag'] == 1) ...[
const Divider(),
ListItemFactory.createYesNoSection(
horizontalPadding: 2,
verticalPadding: 7,
horizontalPadding: 5,
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -317,7 +308,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -338,7 +329,7 @@ class _DzApplyPageState extends SpecialWorkApplyBaseState<DzApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -44,52 +44,43 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
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;
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,
);
}
await pushPage(
DzTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
} else {
await pushPage(
DzTaskPage(
workId: hotworkId,
stepName: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,

View File

@ -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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -289,7 +289,30 @@ 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(),
),
],
],

View File

@ -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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -258,7 +258,30 @@ 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(),
),
],
],
),
);

View File

@ -33,7 +33,7 @@ class GcApplyPage extends SpecialWorkApplyBasePage {
class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
@override
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.highWork;
@ -70,20 +70,20 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +126,6 @@ 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: '申请单位:',
@ -166,7 +157,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -292,7 +283,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -311,7 +302,7 @@ class _GcApplyPageState extends SpecialWorkApplyBaseState<GcApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -44,81 +44,74 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (stepId == '2') {
await pushPage(
GcTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: false,
type: listType,
),
context,
);
return;
}
if (status == '0' || status == '2') {
if (isEdit) {
} else {
if (status == '0') {
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: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: false,
isEdit: isEdit,
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: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
@ -136,16 +129,9 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
Map<String, dynamic> info,
String statusName,
) {
//
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'] ?? '';
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'] ?? {});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -155,7 +141,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
children: [
Expanded(
child: Text(
"编号: ${item['checkNo'] ?? ''}",
'编号: ${workInfo['checkNo'] ?? ''}',
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
@ -168,7 +154,8 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
],
),
Text(
"施工单位: $actUserUnit",
'动火等级: ${info['workLevelName'] ?? ''}',
textAlign: TextAlign.right,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
@ -181,7 +168,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
children: [
Expanded(
child: Text(
"申请人: ${info['applyUser'] ?? ''}",
'申请人: ${info['applyUser'] ?? ''}',
softWrap: true,
maxLines: null,
overflow: TextOverflow.visible,
@ -190,7 +177,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
const SizedBox(width: 8),
Expanded(
child: Text(
"申请单位: ${info['applyDepartment'] ?? ''}",
'申请部门: ${info['applyDepartment'] ?? ''}',
textAlign: TextAlign.right,
softWrap: true,
maxLines: null,
@ -202,41 +189,42 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
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(
'现场负责人: ${step10['actUserName'] ?? ''}',
softWrap: true,
maxLines: null,
textAlign: TextAlign.right,
overflow: TextOverflow.visible,
),
Text(
'动火单位负责人: ${step4['actUserName'] ?? ''}',
softWrap: true,
maxLines: null,
overflow: TextOverflow.visible,
),
],
),
Text(
"作业类型: ${info['operationTypeName'] ?? ''}",
'现场管辖单位负责人: ${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'] ?? ''}',
softWrap: true,
maxLines: null,
overflow: TextOverflow.visible,
@ -245,7 +233,7 @@ class GcWaitPage extends SpecialWorkWaitPageBase {
children: [
Expanded(
child: Text(
"审核状态: $statusName",
'审核状态: $statusName',
overflow: TextOverflow.ellipsis,
softWrap: true,
maxLines: null,

View File

@ -126,14 +126,6 @@ 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,
@ -145,6 +137,14 @@ 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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -317,7 +317,30 @@ 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(),
),
],
],
),

View File

@ -33,7 +33,7 @@ class LsydApplyPage extends SpecialWorkApplyBasePage {
class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
// 使
List<dynamic> limitedSpaceList = [];
@ -79,20 +79,20 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +135,6 @@ 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: '申请单位:',
@ -175,7 +166,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -344,7 +335,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -363,7 +354,7 @@ class _LsydApplyPageState extends SpecialWorkApplyBaseState<LsydApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -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, '添加失败');

View File

@ -46,64 +46,70 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
Future<void> openTaskPage({required bool editable}) async {
await pushPage(
LsydTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: editable,
type: listType,
),
context,
);
}
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (stepId == '2') {
if (isEdit) {
await pushPage(
SpecialWorkGasList(data: item, addFlag: true),
SpecialWorkGasList(data: item, addFlag: stepId == '2'),
context,
);
} else {
await openTaskPage(editable: false);
}
return;
}
if (status == '0' || status == '2') {
if (isEdit) {
await pushPage(
LsydApplyPage(
isReEdit: true,
work_id: hotworkId,
status: status,
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 {
await openTaskPage(editable: false);
}
return;
}
await openTaskPage(editable: isEdit);
return;
} else {
await pushPage(
LsydTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
await openTaskPage(editable: isEdit);
}
@override

View File

@ -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(),
const Divider(height: 1),
//
ItemListWidget.selectableLineTitleTextRightButton(
@ -336,7 +336,30 @@ 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(),
),
],
],

View File

@ -37,7 +37,7 @@ class MbcdApplyPage extends SpecialWorkApplyBasePage {
class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
//
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
//
late List<dynamic> boardList = [
@ -89,20 +89,20 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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,15 +176,6 @@ 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: '申请单位:',
@ -216,7 +207,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -361,7 +352,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
//
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -380,7 +371,7 @@ class _MbcdApplyPageState extends SpecialWorkApplyBaseState<MbcdApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);

View File

@ -47,52 +47,38 @@ 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 stepName = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (status == '0' || status == '2') {
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(
MbcdApplyPage(isReEdit: true, work_id: hotworkId, status: status),
context,
);
} else {
await pushPage(
MbcdTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
await pushPage(
MbcdTaskPage(
workId: hotworkId,
stepName: stepName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
} else {
await pushPage(
MbcdTaskPage(
workId: hotworkId,
stepName: stepName,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
@ -202,6 +188,24 @@ 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: [

View File

@ -122,14 +122,6 @@ 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,
@ -141,6 +133,14 @@ 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,6 +282,31 @@ 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(),
),
],
],
),

View File

@ -49,7 +49,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
List<dynamic> limitedSpaceList = [];
///
late Map<String, dynamic> allowChoosePerson = {};
late List<dynamic> allowChoosePersonList = [{}, {}];
@override
SpecialWorkTypeEnum get workType => SpecialWorkTypeEnum.confinedspaceWork;
@ -94,38 +94,38 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
@override
Future<void> afterInitDataLoaded() async {
//
allowChoosePerson = {
'1' : {
allowChoosePersonList = [
{
"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(() {
allowChoosePerson = {
'1': {
allowChoosePersonList = [
{
"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,15 +175,6 @@ 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: '申请单位:',
@ -235,7 +226,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
verticalPadding: 0,
title: '是否项目内作业',
isRequired: true,
groupValue: pd['internalOperationFlag'] == 1,
groupValue: isInnerWork,
onChanged: (value) {
setState(() {
isInnerWork = value;
@ -373,7 +364,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
// controller
SafeProtectionModule(
controller: safeController,
personList: allowChoosePerson.values.toList(),
personList: allowChoosePersonList,
isEditable: isEditable,
),
],
@ -394,7 +385,7 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
if (item['stepId']?.toString() == '2') {
List firmList = [];
List xgfList = [];
for (final item in allowChoosePerson.values.toList()) {
for (final item in allowChoosePersonList) {
//
if (item['userType'] == 2) {
firmList.add(item);
@ -495,15 +486,21 @@ class _SxkjApplyPageState extends SpecialWorkApplyBaseState<SxkjApplyPage> {
pd['workChargeUserName'] = name;
pd['workChargeUserDepartment'] = data['departmentId'];
pd['workChargeUserDepartmentName'] = data['departmentName'];
allowChoosePerson['1'] = data;
if (allowChoosePersonList.length > 1) {
allowChoosePersonList[1] = data;
}else{
allowChoosePersonList.add(data);
}
} else {
pd['workGuardianUserId'] = userId;
pd['workGuardianUserName'] = name;
pd['workGuardianUserDepartment'] = data['departmentId'];
pd['workGuardianUserDepartmentName'] = data['departmentName'];
allowChoosePerson['2'] = data;
}
if (allowChoosePersonList.length > 0) {
allowChoosePersonList[0] = data;
}else{
allowChoosePersonList.add(data);
} }
super.getFlowInit(true);
});
},

View File

@ -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, '添加失败');

View File

@ -45,64 +45,66 @@ 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 = isEdit
? (listType == SpecialListType.task
final status = '${hotworkInfo['status']}';
final String statusName =
listType == SpecialListType.task
? '${item['stepName'] ?? ''}'
: '${hotworkInfo['currentStep'] ?? ''}')
: '查看';
Future<void> openTaskPage({required bool editable}) async {
await pushPage(
SxkjTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: editable,
type: listType,
),
context,
);
}
: '${hotworkInfo['currentStep'] ?? ''}';
if (listType == SpecialListType.task) {
if (stepId == '2') {
if (isEdit) {
await pushPage(
SpecialWorkGasList(data: item, addFlag: true),
SpecialWorkGasList(data: item, addFlag: stepId == '2'),
context,
);
} else {
await openTaskPage(editable: false);
}
return;
}
if (status == '0' || status == '2') {
if (isEdit) {
await pushPage(
SxkjApplyPage(
isReEdit: true,
SxkjTaskPage(
workId: hotworkId,
status: status,
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 {
await openTaskPage(editable: false);
}
return;
}
await openTaskPage(editable: isEdit);
return;
} else {
await pushPage(
SxkjTaskPage(
workId: hotworkId,
stepName: statusName,
workCodeId: hotworkCodeId,
isEdit: isEdit,
type: listType,
),
context,
);
}
await openTaskPage(editable: isEdit);
}
@override
@ -113,7 +115,12 @@ 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'] ?? {},
);

View File

@ -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'] ?? "提交失败");
}
}
}

View File

@ -74,7 +74,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
List<dynamic> allPersonList = [];
/// //
Map<String, dynamic> allowChoosePerson = {};
List<dynamic> allowChoosePersonList = [{}, {}];
///
List<dynamic> relatedPartiesPersonList = [];
@ -297,7 +297,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
//
Future<void> _matchSafeMeasurePerson() async {
allowChoosePerson = {};
allowChoosePersonList = [];
if (pd['xgfFlag'] == 1 && pd['xgfId'] != null && pd['xgfId'] != '') {
final result = await BasicInfoApi.getDeptUsers(
'',
@ -307,40 +307,24 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
for (SafeMeasureOption measure in safeMeasures) {
for (Map item in relatedPartiesPersonList) {
if (measure.updateId == item['id']) {
if (pd['workGuardianUser'] == item['id']) {
allowChoosePerson['1'] = item;
}else{
allowChoosePerson['2'] = item;
}
allowChoosePersonList.add(item);
}
}
}
}
for (SafeMeasureOption measure in safeMeasures) {
for (Map item in allPersonList) {
print('measure.updateId: ${measure.updateId}-${item['id']}');
if (measure.updateId == item['id']) {
if (pd['workGuardianUser'] == item['id']) {
allowChoosePerson['1'] = item;
}else{
allowChoosePerson['2'] = item;
}
allowChoosePersonList.add(item);
continue;
}
}
}
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({
@ -363,7 +347,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
/// initData
void _initGroupsFromInitData(bool isRefresh) {
_clearAllPerson();
_clearRelatedPartiesPerson();
final List steps =
(initData['settingSignSteps'] is List)
? List.from(initData['settingSignSteps'])
@ -571,10 +555,15 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
groups[index]['actUserDepartmentName'] = data['departmentName'];
//
if (stepId == '20') {
allowChoosePerson['1'] = data;
allowChoosePersonList[0] = data;
if (allowChoosePersonList.length > 1) {
allowChoosePersonList[1] = data;
}else{
allowChoosePersonList.add(data);
}
_clearRelatedPartiesPerson();
} else if (stepId == '21') {
allowChoosePerson['2'] = data;
allowChoosePersonList[1] = data;
_clearRelatedPartiesPerson();
}
});
@ -586,8 +575,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
void _clearRelatedPartiesPerson() {
setState(() {
for (Map item in groups) {
final stepId = item['stepId']?.toString() ?? '';
if (stepId == '2') { //
if (item['stepId']?.toString() == '2') {
item['actUser'] = '';
item['actUserName'] = '';
item['actUserDepartment'] = '';
@ -596,31 +584,10 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
}
safeController.clearAllGroupUser();
});
}
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'] = '';
});
// stepId=2
}
///
Future<void> getRelatedPartiesList() async {
try {
@ -816,10 +783,7 @@ 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()
@ -865,7 +829,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();
}
@ -873,35 +837,33 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
/// payload
Future<Map<String, dynamic>> buildSubmitPayload(
String status,
List<Map> signLogs,
) async {
final extraPayload = await buildExtraPayload();
String status,
List<Map> signLogs,
) async {
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');
@ -938,9 +900,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['updateName'];
newItem['updateName'] = measure['userName'];
newItem['actUser'] = measure['updateId'];
newItem['actUserName'] = measure['updateName'];
newItem['actUserName'] = measure['userName'];
newItem['actUserDepartment'] = measure['departmentId'];
newItem['actUserDepartmentName'] = measure['departmentName'];
newGroups.add(newItem);
@ -1214,12 +1176,9 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
padding: const EdgeInsets.all(12),
child: Column(
children: [
if (pd.keys.isNotEmpty) ...[
buildFormContent(),
const SizedBox(height: 20),
buildFooterButtons(),
]else
NoDataWidget.show()
buildFormContent(),
const SizedBox(height: 20),
buildFooterButtons(),
],
),
),
@ -1269,7 +1228,7 @@ abstract class SpecialWorkApplyBaseState<T extends SpecialWorkApplyBasePage>
///
void resetInnerRelatedState() {
isInnerWork = false;
allowChoosePerson = {};
allowChoosePersonList = [{}, {}];
}
///

View File

@ -126,9 +126,6 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
///
List<dynamic> _measures = [];
///
List<dynamic> _otherMeasuresList = [];
/// /
final TextEditingController _contentController = TextEditingController();
@ -197,7 +194,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
await NativeOrientation.setPortrait();
if (path != null) {
final now = DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now());
final now = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now());
setState(() {
signImages = [path];
signTimes = [now];
@ -242,17 +239,6 @@ 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;
@ -271,7 +257,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
bool isDelayTime = true;
if (pd['componentName'] == 'completeDelayTime' && other['isCompleteWork'] == 1) {
if (other['isDelayWork'] == 1 && !FormUtils.hasValue(other, 'hotTime')) {
if (!FormUtils.hasValue(other, 'hotTime')) {
ToastUtil.showNormal(context, '请选择动火日期');
return;
}
@ -402,7 +388,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
final signResult = await _checkSignature();
if (!signResult) {
LoadingDialogHelper.hide();
ToastUtil.showNormal(context, '作业提交失败');
ToastUtil.showNormal(context, '提交失败');
return;
}
@ -413,11 +399,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, '提交失败');
}
}
@ -526,7 +512,6 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
DepartmentAllPersonPicker.show(
context,
personsData: personList,
serverData: [],
allowXgfFlag: false,
onSelectedWithData: (userId, name, data) {
setState(() {
@ -806,7 +791,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
isEditable: true,
onTap: () async {
final DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.dateTimeWithSeconds,
mode: BottomPickerMode.date,
context,
allowPast: false,
);
@ -926,7 +911,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
}
return Column(
children: [
if (pd['measuresStepFlag'] == 1 && widget.isEdit) ... [
if (pd['measuresStepFlag'] == 1) ... [
Multitextfieldwithtitlewidght(
label: '其他安全措施:',
isEditable: true,
@ -940,23 +925,22 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
//
...buildStepSignWidgets(signInfo),
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(),
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()],
],
] else ...[
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
_signWidget(),
],
_bottomButtons(),
]
] else ...[
if (_groups.isNotEmpty) ...[_buildDeptList(), const Divider()],
_signWidget(),
],
_bottomButtons(),
],
);
}
@ -1019,73 +1003,7 @@ 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;
@ -1177,38 +1095,6 @@ 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) {
@ -1224,7 +1110,7 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
children: [
widget.buildDetailForm(pd),
const Divider(height: 1),
if (pd['specialStepCode'] == 'measures' && widget.isEdit) ...[
if (pd['specialStepCode'] == 'measures') ...[
MeasuresListWidget(
measuresList: _measures,
isAllowEdit: true,
@ -1244,10 +1130,9 @@ class _SpecialWorkTaskPageBaseState extends State<SpecialWorkTaskPageBase> {
},
),
],
_otherMeasureWidgets(),
_operationWidget(),
if (!widget.isEdit) ...[
if (widget.isEdit) ...[
_operationWidget(),
] else ...[
const SizedBox(height: 10),
CustomButton(
text: '返回',