2025.9.6 修改bug
parent
4055de6723
commit
945edcd968
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
|
|
@ -446,6 +446,7 @@ class ListItemFactory {
|
||||||
String hint,
|
String hint,
|
||||||
TextEditingController controller, {
|
TextEditingController controller, {
|
||||||
bool isRequired = false,
|
bool isRequired = false,
|
||||||
|
int inputNum=120,
|
||||||
}) {
|
}) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 130,
|
height: 130,
|
||||||
|
|
@ -469,6 +470,7 @@ class ListItemFactory {
|
||||||
child: TextField(
|
child: TextField(
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
maxLength: inputNum,
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
expands: true,
|
expands: true,
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,10 @@ class ApiService {
|
||||||
static const String baseFacePath =
|
static const String baseFacePath =
|
||||||
"http://192.168.20.240:8500/whb_stu_face/";
|
"http://192.168.20.240:8500/whb_stu_face/";
|
||||||
/// 登录及其他管理后台接口
|
/// 登录及其他管理后台接口
|
||||||
|
// static const String basePath = "http://192.168.20.240:8500/integrated_whb";//测试服务器
|
||||||
// static const String basePath = "https://qaaqwh.qhdsafety.com/integrated_whb";
|
// static const String basePath = "https://qaaqwh.qhdsafety.com/integrated_whb";
|
||||||
// static const String basePath = "http://192.168.20.240:8500/integrated_whb";
|
// static const String basePath = "http://192.168.20.240:8500/integrated_whb";
|
||||||
static const String basePath = "http://192.168.20.240:8500/integrated_whb";
|
static const String basePath = "http://192.168.0.45:28199";//长久服务器
|
||||||
|
|
||||||
// static const String basePath = "http://192.168.0.37:8099/api";
|
// static const String basePath = "http://192.168.0.37:8099/api";
|
||||||
|
|
||||||
|
|
@ -1981,9 +1982,10 @@ U6Hzm1ninpWeE+awIDAQAB
|
||||||
data: {
|
data: {
|
||||||
//隐患记录
|
//隐患记录
|
||||||
"STARTTIME": startDate,
|
"STARTTIME": startDate,
|
||||||
"ENDTIME": endDate,
|
"ENDTIME": endDate.isEmpty?"":"$endDate 23:59:59",
|
||||||
"HIDDENLEVEL": level,
|
"HIDDENLEVEL": level,
|
||||||
"HIDDEN_RISKSTANDARD": riskStandard,
|
"HIDDEN_RISKSTANDARD": riskStandard,
|
||||||
|
// "SOURCE": riskStandard,
|
||||||
"STATE": state,
|
"STATE": state,
|
||||||
"DEPARTMENT_ID": departmentId,
|
"DEPARTMENT_ID": departmentId,
|
||||||
"RECTIFICATIONDEPT": correctiveDepartment,
|
"RECTIFICATIONDEPT": correctiveDepartment,
|
||||||
|
|
@ -3005,7 +3007,7 @@ U6Hzm1ninpWeE+awIDAQAB
|
||||||
"HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId,
|
"HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId,
|
||||||
|
|
||||||
"CREATOR": SessionService.instance.loginUserId,
|
"CREATOR": SessionService.instance.loginUserId,
|
||||||
"LISTMANAGER_ID": id,
|
"CUSTOM_ID": id,
|
||||||
"HIDDENTYPE_NAME": yinHuanTypeNames,
|
"HIDDENTYPE_NAME": yinHuanTypeNames,
|
||||||
"HIDDENTYPE1": hiddenType1,
|
"HIDDENTYPE1": hiddenType1,
|
||||||
"HIDDENTYPE2": hiddenType2,
|
"HIDDENTYPE2": hiddenType2,
|
||||||
|
|
@ -3905,4 +3907,24 @@ U6Hzm1ninpWeE+awIDAQAB
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取个人签字
|
||||||
|
static Future<Map<String, dynamic>> getMySignature() {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/user/geUserInfoSign',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,8 @@ class _KeyprojectListPageState extends State<KeyprojectListPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _goToDetail(Map<String, dynamic> item) async {
|
void _goToDetail(Map<String, dynamic> item) async {
|
||||||
pushPage(KeyprojectDetail(OUTSOURCED_ID: item['OUTSOURCED_ID']), context);
|
await pushPage(KeyprojectDetail(OUTSOURCED_ID: item['OUTSOURCED_ID']), context);
|
||||||
|
_search();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildListItem(Map<String, dynamic> item) {
|
Widget _buildListItem(Map<String, dynamic> item) {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import 'package:qhd_prevention/customWidget/department_picker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
||||||
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||||
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
||||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||||
|
|
@ -245,6 +246,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
|
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "隐患照片",
|
title: "隐患照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
mediaType: MediaType.image,
|
mediaType: MediaType.image,
|
||||||
|
|
@ -321,6 +323,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患描述",
|
"隐患描述",
|
||||||
"请对隐患进行详细描述(必填项)",
|
"请对隐患进行详细描述(必填项)",
|
||||||
_standardController,
|
_standardController,
|
||||||
|
|
@ -328,6 +331,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患部位",
|
"隐患部位",
|
||||||
"请对隐患部位进行详细描述(必填项)",
|
"请对隐患部位进行详细描述(必填项)",
|
||||||
_partController,
|
_partController,
|
||||||
|
|
@ -363,6 +367,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患级别",
|
leftText: "隐患级别",
|
||||||
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -396,6 +401,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患类型",
|
leftText: "隐患类型",
|
||||||
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
|
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -424,6 +430,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
children: [
|
children: [
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"整改描述",
|
"整改描述",
|
||||||
"请对隐患进行整改描述(必填项)",
|
"请对隐患进行整改描述(必填项)",
|
||||||
_dangerDetailController,
|
_dangerDetailController,
|
||||||
|
|
@ -432,6 +439,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "整改后图片",
|
title: "整改后图片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
horizontalPadding: 0,
|
horizontalPadding: 0,
|
||||||
|
|
@ -499,6 +507,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改责任部门",
|
leftText: "整改责任部门",
|
||||||
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -538,6 +547,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改负责人",
|
leftText: "整改负责人",
|
||||||
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -546,28 +556,43 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
),
|
),
|
||||||
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
DateTime? picked = await BottomDateTimePicker.showDate(
|
||||||
context: context,
|
mode: BottomPickerMode.date,
|
||||||
builder:
|
context,
|
||||||
(_) => HDatePickerDialog(
|
allowPast:false,
|
||||||
initialDate: DateTime.now(),
|
|
||||||
onCancel: () => Navigator.of(context).pop(),
|
|
||||||
onConfirm: (selected) async {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
setState(() {
|
|
||||||
dataTime = DateFormat(
|
|
||||||
'yyyy-MM-dd',
|
|
||||||
).format(selected);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (picked != null) {
|
||||||
|
setState(() {
|
||||||
|
dataTime = DateFormat(
|
||||||
|
'yyyy-MM-dd',
|
||||||
|
).format(picked);
|
||||||
|
});
|
||||||
|
//FocusHelper.clearFocus(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder:
|
||||||
|
// (_) => HDatePickerDialog(
|
||||||
|
// initialDate: DateTime.now(),
|
||||||
|
// onCancel: () => Navigator.of(context).pop(),
|
||||||
|
// onConfirm: (selected) async {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// setState(() {
|
||||||
|
// dataTime = DateFormat(
|
||||||
|
// 'yyyy-MM-dd',
|
||||||
|
// ).format(selected);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改期限",
|
leftText: "整改期限",
|
||||||
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -734,26 +759,27 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
// SessionService.instance.setUnqualifiedInspectionItemIDJson(hiddenId);
|
// SessionService.instance.setUnqualifiedInspectionItemIDJson(hiddenId);
|
||||||
bool success = true;
|
bool success = true;
|
||||||
for (int i=0;i<_yinHuanImages.length;i++){
|
for (int i=0;i<_yinHuanImages.length;i++){
|
||||||
success = await _addImgFiles(_yinHuanImages[i],"3",hiddenId);
|
_addImgFiles(_yinHuanImages[i],"3",hiddenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_yinHuanVido.isNotEmpty) {
|
if(_yinHuanVido.isNotEmpty) {
|
||||||
success = await _addImgFiles(_yinHuanVido[0],"3",hiddenId);
|
_addImgFiles(_yinHuanVido[0],"3",hiddenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_isDanger){
|
if(_isDanger){
|
||||||
for (int i=0;i<_zhengGaiImages.length;i++){
|
for (int i=0;i<_zhengGaiImages.length;i++){
|
||||||
success = await _addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
_addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
||||||
|
// success = await _addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (success) {
|
// if (success) {
|
||||||
setState(() {
|
setState(() {
|
||||||
ToastUtil.showNormal(context, "提交成功");
|
ToastUtil.showNormal(context, "提交成功");
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
widget.onClose(hiddenId,_standardController.text.trim());
|
widget.onClose(hiddenId,_standardController.text.trim());
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,13 @@ class _CheckRecordDetailPageState extends State<CheckRecordDetailPage> {
|
||||||
}
|
}
|
||||||
Future<void> _fetchAll() async {
|
Future<void> _fetchAll() async {
|
||||||
// 并行发请求,界面加载更快
|
// 并行发请求,界面加载更快
|
||||||
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
_getInspectRecordsDetail(),
|
_getInspectRecordsDetail(),
|
||||||
_getInspectRecordsDetailTwo(),
|
_getInspectRecordsDetailTwo(),
|
||||||
_getMapData(),
|
_getMapData(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _getMapData() async {
|
Future<void> _getMapData() async {
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,9 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
|
||||||
|
|
||||||
Future<void> _getCheckRecordListOne() async {
|
Future<void> _getCheckRecordListOne() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getCheckRecordListOne(widget.id,keyWord);
|
final result = await ApiService.getCheckRecordListOne(widget.id,keyWord);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -103,6 +104,7 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -110,8 +112,9 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
|
||||||
|
|
||||||
Future<void> _getCheckRecordList() async {
|
Future<void> _getCheckRecordList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getCheckRecordList(widget.id,keyWord);
|
final result = await ApiService.getCheckRecordList(widget.id,keyWord);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -131,6 +134,7 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,8 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
|
||||||
} ,
|
} ,
|
||||||
// => _handleItemTap(item),
|
// => _handleItemTap(item),
|
||||||
child: DannerRepainItem(
|
child: DannerRepainItem(
|
||||||
showTitleIcon: true,
|
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
|
||||||
|
// showTitleIcon: true,
|
||||||
title: '清单名称:${item['NAME']}',
|
title: '清单名称:${item['NAME']}',
|
||||||
details: [
|
details: [
|
||||||
'清单类型:${item['TYPENAME']}',
|
'清单类型:${item['TYPENAME']}',
|
||||||
|
|
@ -318,8 +319,9 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
|
||||||
|
|
||||||
Future<void> _getListType() async {
|
Future<void> _getListType() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getListType();
|
final result = await ApiService.getListType();
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
setState(() {
|
setState(() {
|
||||||
listType= result['list'];
|
listType= result['list'];
|
||||||
|
|
@ -330,6 +332,7 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import 'package:qhd_prevention/customWidget/department_picker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
||||||
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/single_image_viewer.dart';
|
import 'package:qhd_prevention/customWidget/single_image_viewer.dart';
|
||||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||||
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
||||||
|
|
@ -235,6 +236,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
|
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "隐患照片",
|
title: "隐患照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
mediaType: MediaType.image,
|
mediaType: MediaType.image,
|
||||||
|
|
@ -291,6 +293,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患描述",
|
"隐患描述",
|
||||||
"请对隐患进行详细描述(必填项)",
|
"请对隐患进行详细描述(必填项)",
|
||||||
_standardController,
|
_standardController,
|
||||||
|
|
@ -298,6 +301,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患部位",
|
"隐患部位",
|
||||||
"请对隐患部位进行详细描述(必填项)",
|
"请对隐患部位进行详细描述(必填项)",
|
||||||
_partController,
|
_partController,
|
||||||
|
|
@ -333,6 +337,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患级别",
|
leftText: "隐患级别",
|
||||||
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -366,6 +371,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患类型",
|
leftText: "隐患类型",
|
||||||
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
|
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -394,6 +400,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
children: [
|
children: [
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"整改描述",
|
"整改描述",
|
||||||
"请对隐患进行整改描述(必填项)",
|
"请对隐患进行整改描述(必填项)",
|
||||||
_dangerDetailController,
|
_dangerDetailController,
|
||||||
|
|
@ -402,6 +409,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "整改后图片",
|
title: "整改后图片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
horizontalPadding: 0,
|
horizontalPadding: 0,
|
||||||
|
|
@ -467,6 +475,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改责任部门",
|
leftText: "整改责任部门",
|
||||||
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -506,6 +515,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改负责人",
|
leftText: "整改负责人",
|
||||||
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -514,28 +524,43 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
),
|
),
|
||||||
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
DateTime? picked = await BottomDateTimePicker.showDate(
|
||||||
context: context,
|
mode: BottomPickerMode.date,
|
||||||
builder:
|
context,
|
||||||
(_) => HDatePickerDialog(
|
allowPast:false,
|
||||||
initialDate: DateTime.now(),
|
|
||||||
onCancel: () => Navigator.of(context).pop(),
|
|
||||||
onConfirm: (selected) async {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
setState(() {
|
|
||||||
dataTime = DateFormat(
|
|
||||||
'yyyy-MM-dd',
|
|
||||||
).format(selected);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (picked != null) {
|
||||||
|
setState(() {
|
||||||
|
dataTime = DateFormat(
|
||||||
|
'yyyy-MM-dd',
|
||||||
|
).format(picked);
|
||||||
|
});
|
||||||
|
//FocusHelper.clearFocus(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder:
|
||||||
|
// (_) => HDatePickerDialog(
|
||||||
|
// initialDate: DateTime.now(),
|
||||||
|
// onCancel: () => Navigator.of(context).pop(),
|
||||||
|
// onConfirm: (selected) async {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// setState(() {
|
||||||
|
// dataTime = DateFormat(
|
||||||
|
// 'yyyy-MM-dd',
|
||||||
|
// ).format(selected);
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改期限",
|
leftText: "整改期限",
|
||||||
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -684,7 +709,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LoadingDialogHelper.hide();
|
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
String hiddenId = result['pd']['HIDDEN_ID'] ;
|
String hiddenId = result['pd']['HIDDEN_ID'] ;
|
||||||
|
|
@ -692,27 +717,32 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
for (int i=0;i<_yinHuanImages.length;i++){
|
for (int i=0;i<_yinHuanImages.length;i++){
|
||||||
success = await _addImgFiles(_yinHuanImages[i],"3",hiddenId);
|
_addImgFiles(_yinHuanImages[i],"3",hiddenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_yinHuanVido.isNotEmpty) {
|
if(_yinHuanVido.isNotEmpty) {
|
||||||
success = await _addImgFiles(_yinHuanVido[0],"3",hiddenId);
|
_addImgFiles(_yinHuanVido[0],"3",hiddenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_isDanger){
|
if(_isDanger){
|
||||||
for (int i=0;i<_zhengGaiImages.length;i++){
|
for (int i=0;i<_zhengGaiImages.length;i++){
|
||||||
success = await _addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
_addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
||||||
|
// success = await _addImgFiles(_zhengGaiImages[i],"4",hiddenId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (success) {
|
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
|
|
||||||
|
// if (success) {
|
||||||
setState(() {
|
setState(() {
|
||||||
ToastUtil.showNormal(context, "提交成功");
|
ToastUtil.showNormal(context, "提交成功");
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
widget.onClose(hiddenId, _standardController.text.trim());
|
widget.onClose(hiddenId, _standardController.text.trim());
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
}else{
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
ToastUtil.showNormal(context, "提交失败");
|
ToastUtil.showNormal(context, "提交失败");
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import 'package:qhd_prevention/customWidget/department_picker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_hidden_type.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
import 'package:qhd_prevention/customWidget/department_picker_two.dart';
|
||||||
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
import 'package:qhd_prevention/customWidget/full_screen_video_page.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/single_image_viewer.dart';
|
import 'package:qhd_prevention/customWidget/single_image_viewer.dart';
|
||||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||||
|
|
@ -129,6 +130,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
children: [
|
children: [
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "隐患照片",
|
title: "隐患照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
mediaType: MediaType.image,
|
mediaType: MediaType.image,
|
||||||
|
|
@ -170,6 +172,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患描述",
|
"隐患描述",
|
||||||
"请对隐患进行详细描述(必填项)",
|
"请对隐患进行详细描述(必填项)",
|
||||||
_standardController,
|
_standardController,
|
||||||
|
|
@ -177,6 +180,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
),
|
),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"隐患部位",
|
"隐患部位",
|
||||||
"请对隐患部位进行详细描述(必填项)",
|
"请对隐患部位进行详细描述(必填项)",
|
||||||
_partController,
|
_partController,
|
||||||
|
|
@ -211,6 +215,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患级别",
|
leftText: "隐患级别",
|
||||||
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -244,6 +249,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "隐患类型",
|
leftText: "隐患类型",
|
||||||
rightText: yinHuanName.isNotEmpty?yinHuanName:"请选择",
|
rightText: yinHuanName.isNotEmpty?yinHuanName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -272,6 +278,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
children: [
|
children: [
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: ListItemFactory.createBuildMultilineInput(
|
child: ListItemFactory.createBuildMultilineInput(
|
||||||
|
isRequired:true,
|
||||||
"整改描述",
|
"整改描述",
|
||||||
"请对隐患进行整改描述(必填项)",
|
"请对隐患进行整改描述(必填项)",
|
||||||
_dangerDetailController,
|
_dangerDetailController,
|
||||||
|
|
@ -280,6 +287,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
_buildSectionContainer(
|
_buildSectionContainer(
|
||||||
child: RepairedPhotoSection(
|
child: RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "整改后图片",
|
title: "整改后图片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
horizontalPadding: 0,
|
horizontalPadding: 0,
|
||||||
|
|
@ -332,6 +340,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改责任部门",
|
leftText: "整改责任部门",
|
||||||
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -371,6 +380,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改负责人",
|
leftText: "整改负责人",
|
||||||
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -379,28 +389,24 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
||||||
),
|
),
|
||||||
|
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
DateTime? picked = await BottomDateTimePicker.showDate(
|
||||||
context: context,
|
mode: BottomPickerMode.date,
|
||||||
builder:
|
context,
|
||||||
(_) => HDatePickerDialog(
|
allowPast:false,
|
||||||
initialDate: DateTime.now(),
|
|
||||||
onCancel: () => Navigator.of(context).pop(),
|
|
||||||
onConfirm: (selected) async {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
setState(() {
|
|
||||||
dataTime = DateFormat(
|
|
||||||
'yyyy-MM-dd',
|
|
||||||
).format(selected);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (picked != null) {
|
||||||
|
setState(() {
|
||||||
|
dataTime = DateFormat(
|
||||||
|
'yyyy-MM-dd',
|
||||||
|
).format(picked);
|
||||||
|
});
|
||||||
|
//FocusHelper.clearFocus(context);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: _buildSectionContainer(
|
child: _buildSectionContainer(
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改期限",
|
leftText: "整改期限",
|
||||||
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
|
||||||
|
|
@ -370,11 +370,11 @@ class _DangerWaitListPageState extends State<DangerWaitListPage> {
|
||||||
if (_isLoading) return;
|
if (_isLoading) return;
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
|
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getHiddenTreatmentList( type, currentPage,
|
final result = await ApiService.getHiddenTreatmentList( type, currentPage,
|
||||||
startDate, endDate, level, riskStandard, state,
|
startDate, endDate, level, riskStandard, state,
|
||||||
departmentId, correctiveDepartment, isIndex, keyWord);
|
departmentId, correctiveDepartment, isIndex, keyWord);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
_totalPage =result["page"]['totalPage'] ?? 1;
|
_totalPage =result["page"]['totalPage'] ?? 1;
|
||||||
|
|
@ -398,6 +398,7 @@ class _DangerWaitListPageState extends State<DangerWaitListPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_person_picker.dart';
|
import 'package:qhd_prevention/customWidget/department_person_picker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker.dart';
|
import 'package:qhd_prevention/customWidget/department_picker.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart';
|
||||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||||
import 'package:qhd_prevention/http/ApiService.dart';
|
import 'package:qhd_prevention/http/ApiService.dart';
|
||||||
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
||||||
|
|
@ -145,7 +146,9 @@ class DannerRepairState extends State<DannerRepair> {
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [HhTextStyleUtils.mainTitle("隐患描述", fontSize: 15)],
|
children: [
|
||||||
|
Text('* ', style: TextStyle(color: Colors.red)),
|
||||||
|
HhTextStyleUtils.mainTitle("隐患描述", fontSize: 15)],
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: miaoShuController,
|
controller: miaoShuController,
|
||||||
|
|
@ -162,27 +165,40 @@ class DannerRepairState extends State<DannerRepair> {
|
||||||
),
|
),
|
||||||
Divider(height: 1),
|
Divider(height: 1),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
showDialog(
|
DateTime? picked = await BottomDateTimePicker.showDate(
|
||||||
context: context,
|
mode: BottomPickerMode.date,
|
||||||
builder:
|
context,
|
||||||
(_) => HDatePickerDialog(
|
allowPast:false,
|
||||||
initialDate: DateTime.now(),
|
|
||||||
onCancel: () => Navigator.of(context).pop(),
|
|
||||||
onConfirm: (selected) {
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
setState(() {
|
|
||||||
_selectData = selected;
|
|
||||||
dataTime= DateFormat('yyyy-MM-dd').format(selected);
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (picked != null) {
|
||||||
|
setState(() {
|
||||||
|
_selectData = picked;
|
||||||
|
dataTime= DateFormat('yyyy-MM-dd').format(picked);
|
||||||
|
});
|
||||||
|
//FocusHelper.clearFocus(context);
|
||||||
|
}
|
||||||
|
// showDialog(
|
||||||
|
// context: context,
|
||||||
|
// builder:
|
||||||
|
// (_) => HDatePickerDialog(
|
||||||
|
// initialDate: DateTime.now(),
|
||||||
|
// onCancel: () => Navigator.of(context).pop(),
|
||||||
|
// onConfirm: (selected) {
|
||||||
|
// Navigator.of(context).pop();
|
||||||
|
// setState(() {
|
||||||
|
// _selectData = selected;
|
||||||
|
// dataTime= DateFormat('yyyy-MM-dd').format(selected);
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "整改日期",
|
leftText: "整改日期",
|
||||||
rightText: dataTime.isEmpty?"请选择":dataTime,
|
rightText: dataTime.isEmpty?"请选择":dataTime,
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -192,6 +208,7 @@ class DannerRepairState extends State<DannerRepair> {
|
||||||
Divider(),
|
Divider(),
|
||||||
ItemListWidget.itemContainer(
|
ItemListWidget.itemContainer(
|
||||||
RepairedPhotoSection(
|
RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "整改后照片",
|
title: "整改后照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
mediaType: MediaType.image,
|
mediaType: MediaType.image,
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,9 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [HhTextStyleUtils.mainTitle("验收描述", fontSize: 15)],
|
children: [
|
||||||
|
Text('* ', style: TextStyle(color: Colors.red)),
|
||||||
|
HhTextStyleUtils.mainTitle("验收描述", fontSize: 15)],
|
||||||
),
|
),
|
||||||
TextField(
|
TextField(
|
||||||
controller: miaoShuController,
|
controller: miaoShuController,
|
||||||
|
|
@ -518,6 +520,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: ListItemFactory.createRowSpaceBetweenItem(
|
child: ListItemFactory.createRowSpaceBetweenItem(
|
||||||
|
isRequired:true,
|
||||||
leftText: "验收日期",
|
leftText: "验收日期",
|
||||||
rightText: dataTime.isEmpty?"请选择":dataTime,
|
rightText: dataTime.isEmpty?"请选择":dataTime,
|
||||||
isRight: true,
|
isRight: true,
|
||||||
|
|
@ -526,6 +529,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
|
||||||
),
|
),
|
||||||
Divider(),
|
Divider(),
|
||||||
RepairedPhotoSection(
|
RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
title: "验收照片",
|
title: "验收照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
mediaType: MediaType.image,
|
mediaType: MediaType.image,
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,9 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
|
|
||||||
Future<void> _getHazardInvestigationList() async {
|
Future<void> _getHazardInvestigationList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getHazardInvestigationList(id,searchKey);
|
final result = await ApiService.getHazardInvestigationList(id,searchKey);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -112,6 +113,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -119,8 +121,9 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
|
|
||||||
Future<void> _getStandardInvestigationList() async {
|
Future<void> _getStandardInvestigationList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getStandardInvestigationList(id,searchKey);
|
final result = await ApiService.getStandardInvestigationList(id,searchKey);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -140,6 +143,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -273,6 +277,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _handleItemTap(item, index),
|
onTap: () => _handleItemTap(item, index),
|
||||||
child: DannerRepainItem(
|
child: DannerRepainItem(
|
||||||
|
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
|
||||||
title: item['NAME'],
|
title: item['NAME'],
|
||||||
details: [
|
details: [
|
||||||
'清单类型:${item['TYPENAME']}',
|
'清单类型:${item['TYPENAME']}',
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,9 @@ class _DangerPageState extends State<DangerPage>
|
||||||
|
|
||||||
Future<void> _getHazardInvestigationList() async {
|
Future<void> _getHazardInvestigationList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getHazardInvestigationList(id,searchKey);
|
final result = await ApiService.getHazardInvestigationList(id,searchKey);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
allList.addAll(newList);
|
allList.addAll(newList);
|
||||||
|
|
@ -135,10 +136,11 @@ class _DangerPageState extends State<DangerPage>
|
||||||
});
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
ToastUtil.showNormal(context, "加载数据失败");
|
ToastUtil.showNormal(context, result['msg']??"加载数据失败");
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +148,9 @@ class _DangerPageState extends State<DangerPage>
|
||||||
|
|
||||||
Future<void> _getStandardInvestigationList() async {
|
Future<void> _getStandardInvestigationList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getStandardInvestigationList(id,searchKey);
|
final result = await ApiService.getStandardInvestigationList(id,searchKey);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
allList.addAll(newList);
|
allList.addAll(newList);
|
||||||
|
|
@ -172,6 +175,7 @@ class _DangerPageState extends State<DangerPage>
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -305,6 +309,7 @@ class _DangerPageState extends State<DangerPage>
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _handleItemTap(item, index),
|
onTap: () => _handleItemTap(item, index),
|
||||||
child: DannerRepainItem(
|
child: DannerRepainItem(
|
||||||
|
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
|
||||||
title: item['NAME'],
|
title: item['NAME'],
|
||||||
details: [
|
details: [
|
||||||
'清单类型:${item['TYPENAME']}',
|
'清单类型:${item['TYPENAME']}',
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
|
|
||||||
Future<void> _getInvestigationItemsYinHuan() async {
|
Future<void> _getInvestigationItemsYinHuan() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getInvestigationItemsYinHuan(widget.item);
|
final result = await ApiService.getInvestigationItemsYinHuan(widget.item);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
final List<dynamic> newListTwo = result['records'] ?? [];
|
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||||
|
|
@ -132,13 +134,16 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
ToastUtil.showNormal(context, result['msg']);
|
ToastUtil.showNormal(context, result['msg']);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _getInvestigationItems() async {
|
Future<void> _getInvestigationItems() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getInvestigationItems(widget.item);
|
final result = await ApiService.getInvestigationItems(widget.item);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
final List<dynamic> newListTwo = result['records'] ?? [];
|
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||||
|
|
@ -193,6 +198,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
ToastUtil.showNormal(context, result['msg']);
|
ToastUtil.showNormal(context, result['msg']);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:qhd_prevention/customWidget/department_picker.dart';
|
import 'package:qhd_prevention/customWidget/department_picker.dart';
|
||||||
import 'package:qhd_prevention/pages/home/work/wait_list_picker.dart';
|
import 'package:qhd_prevention/pages/home/work/wait_list_picker.dart';
|
||||||
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
import '../../../customWidget/bottom_picker.dart';
|
import '../../../customWidget/bottom_picker.dart';
|
||||||
import '../../../tools/h_colors.dart';
|
import '../../../tools/h_colors.dart';
|
||||||
import '/customWidget/custom_button.dart';
|
import '/customWidget/custom_button.dart';
|
||||||
|
|
@ -125,7 +126,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
late List<Map<String, dynamic>> departmentList ;
|
late List<Map<String, dynamic>> departmentList ;
|
||||||
|
|
||||||
|
|
||||||
|
// final List<String> investigationMethod = ["隐患快报", "隐患排查", "标准排查", "专项检查", "安全检查"];
|
||||||
|
final List<String> investigationMethod = ["风险排查隐患", "隐患排查隐患"];
|
||||||
|
final List<String> hazardLevel = [" 一般风险 ", " 重大风险 "];
|
||||||
|
final List<String> dangerStatus = ["未整改", "已整改", "已验收", "已过期"];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
@ -181,12 +185,6 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
final List<String> investigationMethod = ["风险排查隐患", "隐患排查隐患"];
|
|
||||||
final List<String> hazardLevel = [" 一般风险 ", " 重大风险 "];
|
|
||||||
final List<String> dangerStatus = ["未整改", "已整改", "已验收", "已过期"];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// final List<WaitListBean> data = [
|
// final List<WaitListBean> data = [
|
||||||
// Category(
|
// Category(
|
||||||
// id: '1',
|
// id: '1',
|
||||||
|
|
@ -238,7 +236,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Padding(
|
child:
|
||||||
|
SingleChildScrollView( // 添加这一行
|
||||||
|
child:
|
||||||
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|
@ -295,39 +296,52 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
|
|
||||||
// 风险等级:一行两个
|
// 风险等级:一行两个
|
||||||
Row(
|
GridView.builder(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
shrinkWrap: true, // 添加这一行
|
||||||
children: List.generate(investigationMethod.length, (idx) {
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
final bool selected = _investigationMethodOption == idx;
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
return GestureDetector(
|
crossAxisSpacing: 10,
|
||||||
onTap: (){
|
mainAxisSpacing: 10,
|
||||||
setState(() {
|
crossAxisCount: 2,
|
||||||
_investigationMethodOption = idx;
|
childAspectRatio: 3.0,
|
||||||
|
|
||||||
investigationMethodId=idx+1;
|
),
|
||||||
setResult();
|
itemCount: investigationMethod.length,
|
||||||
});
|
itemBuilder: _itemGridviewItem
|
||||||
} ,
|
|
||||||
// => setState(() => _investigationMethodOption = idx),
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: selected ? Colors.blue : Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
border: Border.all(color: Colors.blue, width: 1),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
investigationMethod[idx],
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: selected ? Colors.white : Colors.blue,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
),
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
// children: List.generate(investigationMethod.length, (idx) {
|
||||||
|
// final bool selected = _investigationMethodOption == idx;
|
||||||
|
// return GestureDetector(
|
||||||
|
// onTap: (){
|
||||||
|
// setState(() {
|
||||||
|
// _investigationMethodOption = idx;
|
||||||
|
//
|
||||||
|
// investigationMethodId=idx+1;
|
||||||
|
// setResult();
|
||||||
|
// });
|
||||||
|
// } ,
|
||||||
|
// // => setState(() => _investigationMethodOption = idx),
|
||||||
|
// child: Container(
|
||||||
|
// margin: const EdgeInsets.only(bottom: 8),
|
||||||
|
// padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: selected ? Colors.blue : Colors.transparent,
|
||||||
|
// borderRadius: BorderRadius.circular(4),
|
||||||
|
// border: Border.all(color: Colors.blue, width: 1),
|
||||||
|
// ),
|
||||||
|
// child: Text(
|
||||||
|
// investigationMethod[idx],
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 14,
|
||||||
|
// color: selected ? Colors.white : Colors.blue,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }),
|
||||||
|
// ),
|
||||||
|
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
const Text(
|
const Text(
|
||||||
|
|
@ -441,10 +455,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
||||||
const Spacer(),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: CustomButton(
|
child: CustomButton(
|
||||||
text: "重置",
|
text: "重置",
|
||||||
|
|
@ -474,7 +488,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Flexible(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
child: CustomButton(
|
child: CustomButton(
|
||||||
text: "完成",
|
text: "完成",
|
||||||
|
|
@ -490,6 +504,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -508,7 +523,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(title, style: const TextStyle(fontSize: 14)),
|
Text(title, style: const TextStyle(fontSize: 14)),
|
||||||
const Spacer(),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(_truncateText(display,9)),
|
Text(_truncateText(display,9)),
|
||||||
|
|
@ -522,6 +537,39 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _itemGridviewItem(BuildContext context, int idx) {
|
||||||
|
final bool selected = _investigationMethodOption == idx;
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: (){
|
||||||
|
setState(() {
|
||||||
|
_investigationMethodOption = idx;
|
||||||
|
|
||||||
|
investigationMethodId=idx+1;
|
||||||
|
setResult();
|
||||||
|
});
|
||||||
|
} ,
|
||||||
|
// => setState(() => _investigationMethodOption = idx),
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 8),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: selected ? Colors.blue : Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
border: Border.all(color: Colors.blue, width: 1),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
investigationMethod[idx],
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: selected ? Colors.white : Colors.blue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 文本截取函数
|
// 文本截取函数
|
||||||
String _truncateText(String text, int maxLength) {
|
String _truncateText(String text, int maxLength) {
|
||||||
|
|
@ -637,6 +685,8 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
|
||||||
); // 触发回调
|
); // 触发回调
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,27 @@ class _LawsListPickerState extends State<LawsListPicker> {
|
||||||
children: [
|
children: [
|
||||||
// 左侧缩进
|
// 左侧缩进
|
||||||
SizedBox(width: 16.0 * indent),
|
SizedBox(width: 16.0 * indent),
|
||||||
|
|
||||||
|
if(hasChildren)
|
||||||
|
Image.asset(
|
||||||
|
"assets/images/document.png",
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
// 展开/占位图标
|
// 展开/占位图标
|
||||||
|
|
||||||
|
if(hasChildren)
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
// 标题
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
child: Text(cat.name),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
child: hasChildren
|
child: hasChildren
|
||||||
|
|
@ -97,14 +117,7 @@ class _LawsListPickerState extends State<LawsListPicker> {
|
||||||
)
|
)
|
||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
|
||||||
// 标题
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
||||||
child: Text(cat.name),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// 单选圈保持右侧对齐
|
// 单选圈保持右侧对齐
|
||||||
// Padding(
|
// Padding(
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
|
@ -131,7 +144,7 @@ class _LawsListPickerState extends State<LawsListPicker> {
|
||||||
return Container(
|
return Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height * 0.7,
|
height: MediaQuery.of(context).size.height * 0.7,
|
||||||
color: Colors.transparent,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// 顶部操作栏
|
// 顶部操作栏
|
||||||
|
|
@ -155,13 +168,17 @@ class _LawsListPickerState extends State<LawsListPicker> {
|
||||||
// const Divider(height: 1),
|
// const Divider(height: 1),
|
||||||
// 列表区
|
// 列表区
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child:Padding(
|
||||||
|
padding: EdgeInsets.only(left: 10,right: 10),
|
||||||
|
child:
|
||||||
|
Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: widget.data.length,
|
itemCount: widget.data.length,
|
||||||
itemBuilder: (ctx, idx) => _buildRow(widget.data[idx], 0),
|
itemBuilder: (ctx, idx) => _buildRow(widget.data[idx], 0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
Future<void> _getRiskPointsList() async {
|
Future<void> _getRiskPointsList() async {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getRiskPointsList(widget.id);
|
final result = await ApiService.getRiskPointsList(widget.id);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -96,6 +98,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
@ -103,8 +106,9 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
|
|
||||||
Future<void> _getInspectionItemList() async {
|
Future<void> _getInspectionItemList() async {
|
||||||
try {
|
try {
|
||||||
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.getInspectionItemList(widget.id);
|
final result = await ApiService.getInspectionItemList(widget.id);
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
@ -149,6 +153,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
// _showMessage('加载数据失败');
|
// _showMessage('加载数据失败');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
LoadingDialogHelper.hide();
|
||||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,6 @@ enum FeedbackType {
|
||||||
}
|
}
|
||||||
|
|
||||||
///问题反馈
|
///问题反馈
|
||||||
class FeedbackApp extends StatelessWidget {
|
|
||||||
const FeedbackApp({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: MyAppbar(title:'问题反馈' ),
|
|
||||||
body: const FeedbackPage(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class FeedbackPage extends StatefulWidget {
|
class FeedbackPage extends StatefulWidget {
|
||||||
const FeedbackPage({super.key});
|
const FeedbackPage({super.key});
|
||||||
|
|
@ -98,7 +87,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// 标题输入
|
// 标题输入
|
||||||
const Text('标题', style: TextStyle(fontWeight: FontWeight.bold)),
|
Row(
|
||||||
|
children: [
|
||||||
|
Text('* ', style: TextStyle(color: Colors.red)),
|
||||||
|
// 标题
|
||||||
|
Text('标题', style: TextStyle(fontWeight: FontWeight.bold)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
maxLength: 50,
|
maxLength: 50,
|
||||||
|
|
@ -117,10 +113,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// 问题描述
|
// 问题描述
|
||||||
const Text(
|
Row(
|
||||||
'详细问题和意见',
|
children: [
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
Text('* ', style: TextStyle(color: Colors.red)),
|
||||||
|
// 标题
|
||||||
|
const Text('详细问题和意见', style: TextStyle(fontWeight: FontWeight.bold),),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: _descriptionController,
|
controller: _descriptionController,
|
||||||
|
|
@ -142,10 +142,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// 反馈类型
|
// 反馈类型
|
||||||
const Text(
|
Row(
|
||||||
'反馈类型',
|
children: [
|
||||||
style: TextStyle(fontWeight: FontWeight.bold),
|
Text('* ', style: TextStyle(color: Colors.red)),
|
||||||
|
// 标题
|
||||||
|
const Text('反馈类型', style: TextStyle(fontWeight: FontWeight.bold),),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
|
|
@ -183,6 +187,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
RepairedPhotoSection(
|
RepairedPhotoSection(
|
||||||
|
isRequired:true,
|
||||||
horizontalPadding: 0,
|
horizontalPadding: 0,
|
||||||
title: "请提供相关问题的截图或照片",
|
title: "请提供相关问题的截图或照片",
|
||||||
maxCount: 4,
|
maxCount: 4,
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,43 @@ class FirstSignPage extends StatefulWidget {
|
||||||
class _SignatureUpdatePageState extends State<FirstSignPage> {
|
class _SignatureUpdatePageState extends State<FirstSignPage> {
|
||||||
String imagePath = "";
|
String imagePath = "";
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_getMySignature();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> _getMySignature() async {
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await ApiService.getMySignature( );
|
||||||
|
if (response['result'] == 'success') {
|
||||||
|
setState(() {
|
||||||
|
imagePath= ApiService.baseImgPath +response['IMGURL'];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
print("错误:${e.toString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> refreshSign() async {
|
Future<void> refreshSign() async {
|
||||||
if (imagePath.isEmpty) {
|
if (imagePath.isEmpty) {
|
||||||
ToastUtil.showNormal(context, '请签字');
|
ToastUtil.showNormal(context, '请签字');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(imagePath.startsWith('http')){
|
||||||
|
ToastUtil.showSuccess(context, '保存成功');
|
||||||
|
Navigator.pop(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LoadingDialogHelper.show();
|
LoadingDialogHelper.show();
|
||||||
final result = await ApiService.refreshSignInfo(imagePath);
|
final result = await ApiService.refreshSignInfo(imagePath);
|
||||||
LoadingDialogHelper.hide();
|
LoadingDialogHelper.hide();
|
||||||
|
|
@ -62,13 +94,21 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
const SizedBox(width: 15),
|
||||||
if (imagePath.isNotEmpty)
|
if (imagePath.isNotEmpty&&!imagePath.startsWith('http'))
|
||||||
Image.file(
|
Image.file(
|
||||||
File(imagePath),
|
File(imagePath),
|
||||||
width: 230,
|
width: 200,
|
||||||
height: 150,
|
height: 100,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
|
if (imagePath.isNotEmpty&&imagePath.startsWith('http'))
|
||||||
|
Image.network(
|
||||||
|
imagePath,
|
||||||
|
width: 200,
|
||||||
|
height: 100,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ class _SignatureConfirmPageState extends State<SignatureConfirmPage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 签名绘制器
|
// 签名绘制器 - 修改后的版本
|
||||||
class SignaturePainter extends CustomPainter {
|
class SignaturePainter extends CustomPainter {
|
||||||
final List<Offset?> points;
|
final List<Offset?> points;
|
||||||
|
|
||||||
|
|
@ -310,6 +310,10 @@ class SignaturePainter extends CustomPainter {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
|
// 创建裁剪区域,确保只在画布范围内绘制
|
||||||
|
canvas.save();
|
||||||
|
canvas.clipRect(Rect.fromLTWH(0, 0, size.width, size.height));
|
||||||
|
|
||||||
Paint paint = Paint()
|
Paint paint = Paint()
|
||||||
..color = Colors.black
|
..color = Colors.black
|
||||||
..strokeCap = StrokeCap.round
|
..strokeCap = StrokeCap.round
|
||||||
|
|
@ -317,9 +321,20 @@ class SignaturePainter extends CustomPainter {
|
||||||
|
|
||||||
for (int i = 0; i < points.length - 1; i++) {
|
for (int i = 0; i < points.length - 1; i++) {
|
||||||
if (points[i] != null && points[i + 1] != null) {
|
if (points[i] != null && points[i + 1] != null) {
|
||||||
canvas.drawLine(points[i]!, points[i + 1]!, paint);
|
// 确保点都在画布范围内
|
||||||
|
Offset start = Offset(
|
||||||
|
points[i]!.dx.clamp(0, size.width),
|
||||||
|
points[i]!.dy.clamp(0, size.height),
|
||||||
|
);
|
||||||
|
Offset end = Offset(
|
||||||
|
points[i + 1]!.dx.clamp(0, size.width),
|
||||||
|
points[i + 1]!.dy.clamp(0, size.height),
|
||||||
|
);
|
||||||
|
canvas.drawLine(start, end, paint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
canvas.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,13 @@ class _WebViewPageState extends State<WebViewPage> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
MyAppbar(title: name),
|
MyAppbar(title: name,onBackPressed: () async {
|
||||||
|
if (await _controller.canGoBack()) {
|
||||||
|
_controller.goBack();
|
||||||
|
} else{
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
},),
|
||||||
Expanded( child: WebViewWidget(controller: _controller),),
|
Expanded( child: WebViewWidget(controller: _controller),),
|
||||||
// ValueListenableBuilder<bool>(
|
// ValueListenableBuilder<bool>(
|
||||||
// valueListenable: isLoading,
|
// valueListenable: isLoading,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue