2025.9.6 修改bug

main
xufei 2025-09-06 16:52:08 +08:00
parent 4055de6723
commit 945edcd968
23 changed files with 449 additions and 177 deletions

BIN
assets/images/document.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -446,6 +446,7 @@ class ListItemFactory {
String hint,
TextEditingController controller, {
bool isRequired = false,
int inputNum=120,
}) {
return Container(
height: 130,
@ -469,6 +470,7 @@ class ListItemFactory {
child: TextField(
autofocus: false,
controller: controller,
maxLength: inputNum,
keyboardType: TextInputType.multiline,
maxLines: null,
expands: true,

View File

@ -23,9 +23,10 @@ class ApiService {
static const String baseFacePath =
"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 = "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";
@ -1981,9 +1982,10 @@ U6Hzm1ninpWeE+awIDAQAB
data: {
//
"STARTTIME": startDate,
"ENDTIME": endDate,
"ENDTIME": endDate.isEmpty?"":"$endDate 23:59:59",
"HIDDENLEVEL": level,
"HIDDEN_RISKSTANDARD": riskStandard,
// "SOURCE": riskStandard,
"STATE": state,
"DEPARTMENT_ID": departmentId,
"RECTIFICATIONDEPT": correctiveDepartment,
@ -3005,7 +3007,7 @@ U6Hzm1ninpWeE+awIDAQAB
"HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId,
"CREATOR": SessionService.instance.loginUserId,
"LISTMANAGER_ID": id,
"CUSTOM_ID": id,
"HIDDENTYPE_NAME": yinHuanTypeNames,
"HIDDENTYPE1": hiddenType1,
"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,
},
);
}
}

View File

@ -90,7 +90,8 @@ class _KeyprojectListPageState extends State<KeyprojectListPage> {
}
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) {

View File

@ -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_two.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/pages/home/tap/item_list_widget.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
@ -245,6 +246,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "隐患照片",
maxCount: 4,
mediaType: MediaType.image,
@ -321,6 +323,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患描述",
"请对隐患进行详细描述(必填项)",
_standardController,
@ -328,6 +331,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患部位",
"请对隐患部位进行详细描述(必填项)",
_partController,
@ -363,6 +367,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患级别",
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
isRight: true,
@ -396,6 +401,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患类型",
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
isRight: true,
@ -424,6 +430,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
children: [
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"整改描述",
"请对隐患进行整改描述(必填项)",
_dangerDetailController,
@ -432,6 +439,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
SizedBox(height: 10),
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "整改后图片",
maxCount: 4,
horizontalPadding: 0,
@ -499,6 +507,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改责任部门",
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
isRight: true,
@ -538,6 +547,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
borderRadius: BorderRadius.circular(5),
),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改负责人",
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
isRight: true,
@ -546,28 +556,43 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
),
GestureDetector(
onTap: () {
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);
});
},
),
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.date,
context,
allowPast:false,
);
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: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改期限",
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
isRight: true,
@ -734,26 +759,27 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
// SessionService.instance.setUnqualifiedInspectionItemIDJson(hiddenId);
bool success = true;
for (int i=0;i<_yinHuanImages.length;i++){
success = await _addImgFiles(_yinHuanImages[i],"3",hiddenId);
_addImgFiles(_yinHuanImages[i],"3",hiddenId);
}
if(_yinHuanVido.isNotEmpty) {
success = await _addImgFiles(_yinHuanVido[0],"3",hiddenId);
_addImgFiles(_yinHuanVido[0],"3",hiddenId);
}
if(_isDanger){
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(() {
ToastUtil.showNormal(context, "提交成功");
Navigator.pop(context);
widget.onClose(hiddenId,_standardController.text.trim());
});
}
// }
}
} catch (e) {

View File

@ -71,11 +71,13 @@ class _CheckRecordDetailPageState extends State<CheckRecordDetailPage> {
}
Future<void> _fetchAll() async {
//
await Future.wait([
_getInspectRecordsDetail(),
_getInspectRecordsDetailTwo(),
_getMapData(),
]);
}
Future<void> _getMapData() async {

View File

@ -82,8 +82,9 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
Future<void> _getCheckRecordListOne() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getCheckRecordListOne(widget.id,keyWord);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -103,6 +104,7 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -110,8 +112,9 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
Future<void> _getCheckRecordList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getCheckRecordList(widget.id,keyWord);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -131,6 +134,7 @@ class _CheckRecordListPageState extends State<CheckRecordListPage>
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}

View File

@ -192,7 +192,8 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
} ,
// => _handleItemTap(item),
child: DannerRepainItem(
showTitleIcon: true,
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
// showTitleIcon: true,
title: '清单名称:${item['NAME']}',
details: [
'清单类型:${item['TYPENAME']}',
@ -318,8 +319,9 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
Future<void> _getListType() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getListType();
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
setState(() {
listType= result['list'];
@ -330,6 +332,7 @@ class _CheckRecordPageState extends State<CheckRecordPage> {
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}

View File

@ -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_two.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/toast_util.dart';
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
@ -235,6 +236,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "隐患照片",
maxCount: 4,
mediaType: MediaType.image,
@ -291,6 +293,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患描述",
"请对隐患进行详细描述(必填项)",
_standardController,
@ -298,6 +301,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患部位",
"请对隐患部位进行详细描述(必填项)",
_partController,
@ -333,6 +337,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患级别",
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
isRight: true,
@ -366,6 +371,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患类型",
rightText: yinHuanName.isNotEmpty?truncateText(yinHuanName):"请选择",
isRight: true,
@ -394,6 +400,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
children: [
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"整改描述",
"请对隐患进行整改描述(必填项)",
_dangerDetailController,
@ -402,6 +409,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
SizedBox(height: 10),
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "整改后图片",
maxCount: 4,
horizontalPadding: 0,
@ -467,6 +475,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改责任部门",
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
isRight: true,
@ -506,6 +515,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
borderRadius: BorderRadius.circular(5),
),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改负责人",
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
isRight: true,
@ -514,28 +524,43 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
),
GestureDetector(
onTap: () {
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);
});
},
),
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.date,
context,
allowPast:false,
);
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: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改期限",
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
isRight: true,
@ -684,7 +709,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
String hiddenId = result['pd']['HIDDEN_ID'] ;
@ -692,27 +717,32 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
bool success = true;
for (int i=0;i<_yinHuanImages.length;i++){
success = await _addImgFiles(_yinHuanImages[i],"3",hiddenId);
_addImgFiles(_yinHuanImages[i],"3",hiddenId);
}
if(_yinHuanVido.isNotEmpty) {
success = await _addImgFiles(_yinHuanVido[0],"3",hiddenId);
_addImgFiles(_yinHuanVido[0],"3",hiddenId);
}
if(_isDanger){
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(() {
ToastUtil.showNormal(context, "提交成功");
Navigator.pop(context);
widget.onClose(hiddenId, _standardController.text.trim());
});
}
}else{
// }
}else{
LoadingDialogHelper.hide();
ToastUtil.showNormal(context, "提交失败");
}
} catch (e) {

View File

@ -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_two.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/toast_util.dart';
import 'package:qhd_prevention/pages/my_appbar.dart';
@ -129,6 +130,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
children: [
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "隐患照片",
maxCount: 4,
mediaType: MediaType.image,
@ -170,6 +172,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患描述",
"请对隐患进行详细描述(必填项)",
_standardController,
@ -177,6 +180,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
),
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"隐患部位",
"请对隐患部位进行详细描述(必填项)",
_partController,
@ -211,6 +215,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患级别",
rightText: _repairLevelName.isNotEmpty?_repairLevelName:"请选择",
isRight: true,
@ -244,6 +249,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "隐患类型",
rightText: yinHuanName.isNotEmpty?yinHuanName:"请选择",
isRight: true,
@ -272,6 +278,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
children: [
_buildSectionContainer(
child: ListItemFactory.createBuildMultilineInput(
isRequired:true,
"整改描述",
"请对隐患进行整改描述(必填项)",
_dangerDetailController,
@ -280,6 +287,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
SizedBox(height: 10),
_buildSectionContainer(
child: RepairedPhotoSection(
isRequired:true,
title: "整改后图片",
maxCount: 4,
horizontalPadding: 0,
@ -332,6 +340,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改责任部门",
rightText: buMenName.isNotEmpty ? buMenName : "请选择",
isRight: true,
@ -371,6 +380,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
borderRadius: BorderRadius.circular(5),
),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改负责人",
rightText: responsibleName.isNotEmpty?responsibleName:"请选择",
isRight: true,
@ -379,28 +389,24 @@ class _QuickReportPageState extends State<QuickReportPage> {
),
GestureDetector(
onTap: () {
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);
});
},
),
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.date,
context,
allowPast:false,
);
if (picked != null) {
setState(() {
dataTime = DateFormat(
'yyyy-MM-dd',
).format(picked);
});
//FocusHelper.clearFocus(context);
}
},
child: _buildSectionContainer(
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改期限",
rightText: dataTime.isNotEmpty ? dataTime : "请选择",
isRight: true,

View File

@ -370,11 +370,11 @@ class _DangerWaitListPageState extends State<DangerWaitListPage> {
if (_isLoading) return;
_isLoading = true;
LoadingDialogHelper.show();
final result = await ApiService.getHiddenTreatmentList( type, currentPage,
startDate, endDate, level, riskStandard, state,
departmentId, correctiveDepartment, isIndex, keyWord);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
_totalPage =result["page"]['totalPage'] ?? 1;
@ -398,6 +398,7 @@ class _DangerWaitListPageState extends State<DangerWaitListPage> {
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
} finally {

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/customWidget/department_person_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/http/ApiService.dart';
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
@ -145,7 +146,9 @@ class DannerRepairState extends State<DannerRepair> {
child: Column(
children: [
Row(
children: [HhTextStyleUtils.mainTitle("隐患描述", fontSize: 15)],
children: [
Text('* ', style: TextStyle(color: Colors.red)),
HhTextStyleUtils.mainTitle("隐患描述", fontSize: 15)],
),
TextField(
controller: miaoShuController,
@ -162,27 +165,40 @@ class DannerRepairState extends State<DannerRepair> {
),
Divider(height: 1),
GestureDetector(
onTap: () {
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);
});
},
),
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(
mode: BottomPickerMode.date,
context,
allowPast:false,
);
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(
padding: EdgeInsets.symmetric(horizontal: 15),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "整改日期",
rightText: dataTime.isEmpty?"请选择":dataTime,
isRight: true,
@ -192,6 +208,7 @@ class DannerRepairState extends State<DannerRepair> {
Divider(),
ItemListWidget.itemContainer(
RepairedPhotoSection(
isRequired:true,
title: "整改后照片",
maxCount: 4,
mediaType: MediaType.image,

View File

@ -487,7 +487,9 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
child: Column(
children: [
Row(
children: [HhTextStyleUtils.mainTitle("验收描述", fontSize: 15)],
children: [
Text('* ', style: TextStyle(color: Colors.red)),
HhTextStyleUtils.mainTitle("验收描述", fontSize: 15)],
),
TextField(
controller: miaoShuController,
@ -518,6 +520,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: ListItemFactory.createRowSpaceBetweenItem(
isRequired:true,
leftText: "验收日期",
rightText: dataTime.isEmpty?"请选择":dataTime,
isRight: true,
@ -526,6 +529,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
),
Divider(),
RepairedPhotoSection(
isRequired:true,
title: "验收照片",
maxCount: 4,
mediaType: MediaType.image,

View File

@ -91,8 +91,9 @@ class _HomeDangerPageState extends State<HomeDangerPage>
Future<void> _getHazardInvestigationList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getHazardInvestigationList(id,searchKey);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -112,6 +113,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -119,8 +121,9 @@ class _HomeDangerPageState extends State<HomeDangerPage>
Future<void> _getStandardInvestigationList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getStandardInvestigationList(id,searchKey);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -140,6 +143,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -273,6 +277,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
return GestureDetector(
onTap: () => _handleItemTap(item, index),
child: DannerRepainItem(
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
title: item['NAME'],
details: [
'清单类型:${item['TYPENAME']}',

View File

@ -113,8 +113,9 @@ class _DangerPageState extends State<DangerPage>
Future<void> _getHazardInvestigationList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getHazardInvestigationList(id,searchKey);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
allList.addAll(newList);
@ -135,10 +136,11 @@ class _DangerPageState extends State<DangerPage>
});
}else{
ToastUtil.showNormal(context, "加载数据失败");
ToastUtil.showNormal(context, result['msg']??"加载数据失败");
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -146,8 +148,9 @@ class _DangerPageState extends State<DangerPage>
Future<void> _getStandardInvestigationList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getStandardInvestigationList(id,searchKey);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
allList.addAll(newList);
@ -172,6 +175,7 @@ class _DangerPageState extends State<DangerPage>
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -305,6 +309,7 @@ class _DangerPageState extends State<DangerPage>
return GestureDetector(
onTap: () => _handleItemTap(item, index),
child: DannerRepainItem(
showTitleIcon: (SessionService.instance.username==item['USER_NAME']),
title: item['NAME'],
details: [
'清单类型:${item['TYPENAME']}',

View File

@ -77,7 +77,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
Future<void> _getInvestigationItemsYinHuan() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getInvestigationItemsYinHuan(widget.item);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
final List<dynamic> newListTwo = result['records'] ?? [];
@ -132,13 +134,16 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
ToastUtil.showNormal(context, result['msg']);
}
} catch (e) {
LoadingDialogHelper.hide();
print('加载数据失败:$e');
}
}
Future<void> _getInvestigationItems() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getInvestigationItems(widget.item);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
final List<dynamic> newListTwo = result['records'] ?? [];
@ -193,6 +198,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
ToastUtil.showNormal(context, result['msg']);
}
} catch (e) {
LoadingDialogHelper.hide();
print('加载数据失败:$e');
}
}

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/customWidget/department_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 '../../../tools/h_colors.dart';
import '/customWidget/custom_button.dart';
@ -125,7 +126,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
late List<Map<String, dynamic>> departmentList ;
// final List<String> investigationMethod = ["隐患快报", "隐患排查", "标准排查", "专项检查", "安全检查"];
final List<String> investigationMethod = ["风险排查隐患", "隐患排查隐患"];
final List<String> hazardLevel = [" 一般风险 ", " 重大风险 "];
final List<String> dangerStatus = ["未整改", "已整改", "已验收", "已过期"];
@override
void initState() {
@ -181,12 +185,6 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
@override
Widget build(BuildContext context) {
final List<String> investigationMethod = ["风险排查隐患", "隐患排查隐患"];
final List<String> hazardLevel = [" 一般风险 ", " 重大风险 "];
final List<String> dangerStatus = ["未整改", "已整改", "已验收", "已过期"];
// final List<WaitListBean> data = [
// Category(
// id: '1',
@ -238,7 +236,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
}
return SafeArea(
child: Padding(
child:
SingleChildScrollView( //
child:
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -295,39 +296,52 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
const SizedBox(height: 6),
//
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(investigationMethod.length, (idx) {
final bool selected = _investigationMethodOption == idx;
return GestureDetector(
onTap: (){
setState(() {
_investigationMethodOption = idx;
GridView.builder(
shrinkWrap: true, //
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 2,
childAspectRatio: 3.0,
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,
),
),
),
);
}),
),
itemCount: investigationMethod.length,
itemBuilder: _itemGridviewItem
),
// 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 Text(
@ -441,10 +455,10 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
}),
),
const Spacer(),
const SizedBox(height: 20),
Row(
children: [
Expanded(
Flexible(
flex: 1,
child: CustomButton(
text: "重置",
@ -474,7 +488,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
),
),
const SizedBox(width: 12),
Expanded(
Flexible(
flex: 2,
child: CustomButton(
text: "完成",
@ -490,6 +504,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
],
),
),
),
);
}
@ -508,7 +523,7 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
child: Row(
children: [
Text(title, style: const TextStyle(fontSize: 14)),
const Spacer(),
const SizedBox(height: 20),
Row(
children: [
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) {
@ -637,6 +685,8 @@ class DangerWaitDrawerState extends State<DangerWaitDrawer> {
); //
}
}

View File

@ -86,7 +86,27 @@ class _LawsListPickerState extends State<LawsListPicker> {
children: [
//
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(
width: 24,
child: hasChildren
@ -97,14 +117,7 @@ class _LawsListPickerState extends State<LawsListPicker> {
)
: const SizedBox.shrink(),
),
const SizedBox(width: 8),
//
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: Text(cat.name),
),
),
//
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 16),
@ -131,7 +144,7 @@ class _LawsListPickerState extends State<LawsListPicker> {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.7,
color: Colors.transparent,
color: Colors.white,
child: Column(
children: [
//
@ -155,13 +168,17 @@ class _LawsListPickerState extends State<LawsListPicker> {
// const Divider(height: 1),
//
Expanded(
child: Container(
child:Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child:
Container(
color: Colors.white,
child: ListView.builder(
itemCount: widget.data.length,
itemBuilder: (ctx, idx) => _buildRow(widget.data[idx], 0),
),
),
),
),
],
),

View File

@ -53,7 +53,9 @@ class _riskListPageState extends State<RiskListPage> {
Future<void> _getRiskPointsList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getRiskPointsList(widget.id);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -96,6 +98,7 @@ class _riskListPageState extends State<RiskListPage> {
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}
@ -103,8 +106,9 @@ class _riskListPageState extends State<RiskListPage> {
Future<void> _getInspectionItemList() async {
try {
LoadingDialogHelper.show();
final result = await ApiService.getInspectionItemList(widget.id);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? [];
setState(() {
@ -149,6 +153,7 @@ class _riskListPageState extends State<RiskListPage> {
// _showMessage('加载数据失败');
}
} catch (e) {
LoadingDialogHelper.hide();
// Toast
print('加载数据失败:$e');
}

View File

@ -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 {
const FeedbackPage({super.key});
@ -98,7 +87,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
crossAxisAlignment: CrossAxisAlignment.start,
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),
TextFormField(
maxLength: 50,
@ -117,10 +113,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
const SizedBox(height: 24),
//
const Text(
'详细问题和意见',
style: TextStyle(fontWeight: FontWeight.bold),
Row(
children: [
Text('* ', style: TextStyle(color: Colors.red)),
//
const Text('详细问题和意见', style: TextStyle(fontWeight: FontWeight.bold),),
],
),
const SizedBox(height: 8),
TextFormField(
controller: _descriptionController,
@ -142,10 +142,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
const SizedBox(height: 24),
//
const Text(
'反馈类型',
style: TextStyle(fontWeight: FontWeight.bold),
Row(
children: [
Text('* ', style: TextStyle(color: Colors.red)),
//
const Text('反馈类型', style: TextStyle(fontWeight: FontWeight.bold),),
],
),
const SizedBox(height: 8),
Wrap(
spacing: 16,
@ -183,6 +187,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
const SizedBox(height: 16),
RepairedPhotoSection(
isRequired:true,
horizontalPadding: 0,
title: "请提供相关问题的截图或照片",
maxCount: 4,

View File

@ -18,11 +18,43 @@ class FirstSignPage extends StatefulWidget {
class _SignatureUpdatePageState extends State<FirstSignPage> {
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 {
if (imagePath.isEmpty) {
ToastUtil.showNormal(context, '请签字');
return;
}
if(imagePath.startsWith('http')){
ToastUtil.showSuccess(context, '保存成功');
Navigator.pop(context);
return;
}
LoadingDialogHelper.show();
final result = await ApiService.refreshSignInfo(imagePath);
LoadingDialogHelper.hide();
@ -62,13 +94,21 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
),
),
const SizedBox(width: 15),
if (imagePath.isNotEmpty)
if (imagePath.isNotEmpty&&!imagePath.startsWith('http'))
Image.file(
File(imagePath),
width: 230,
height: 150,
width: 200,
height: 100,
fit: BoxFit.fill,
),
if (imagePath.isNotEmpty&&imagePath.startsWith('http'))
Image.network(
imagePath,
width: 200,
height: 100,
fit: BoxFit.fill,
),
],
),

View File

@ -302,7 +302,7 @@ class _SignatureConfirmPageState extends State<SignatureConfirmPage> {
}
}
//
// -
class SignaturePainter extends CustomPainter {
final List<Offset?> points;
@ -310,6 +310,10 @@ class SignaturePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
//
canvas.save();
canvas.clipRect(Rect.fromLTWH(0, 0, size.width, size.height));
Paint paint = Paint()
..color = Colors.black
..strokeCap = StrokeCap.round
@ -317,9 +321,20 @@ class SignaturePainter extends CustomPainter {
for (int i = 0; i < points.length - 1; i++) {
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

View File

@ -44,7 +44,13 @@ class _WebViewPageState extends State<WebViewPage> {
Widget build(BuildContext context) {
return Column(
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),),
// ValueListenableBuilder<bool>(
// valueListenable: isLoading,