Merge remote-tracking branch 'origin/main'
commit
73cb235820
|
@ -486,6 +486,8 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
|||
|
||||
}
|
||||
|
||||
LoadingDialogHelper.show(context);
|
||||
|
||||
String yinHuanTypeIds="";
|
||||
String yinHuanTypeNames="";
|
||||
for(int i=0;i<_yinHuanTypeIds.length;i++){
|
||||
|
@ -546,11 +548,15 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
|||
}
|
||||
}
|
||||
setState(() {
|
||||
LoadingDialogHelper.hide(context);
|
||||
ToastUtil.showNormal(context, "提交成功");
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}else{
|
||||
LoadingDialogHelper.hide(context);
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide(context);
|
||||
print('Error fetching data: $e');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -675,6 +675,8 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
|||
Future<void> _customCheckRecordFinish( ) async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show(context);
|
||||
|
||||
bool departmentsAllInput=true;
|
||||
bool departmentsSameMan=false;
|
||||
for(int i=0;i<departments.length;i++){
|
||||
|
@ -723,10 +725,12 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
|||
});
|
||||
|
||||
} else {
|
||||
LoadingDialogHelper.hide(context);
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide(context);
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
@ -568,7 +568,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
|
|||
}
|
||||
|
||||
|
||||
|
||||
LoadingDialogHelper.show(context);
|
||||
|
||||
final data = await ApiService.addHazardAcceptance( type, miaoshu, dataTime,widget.item['HIDDEN_ID']);
|
||||
if (data['result'] == 'success') {
|
||||
|
@ -590,9 +590,12 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
|
|||
widget.onClose('关闭详情'); // 触发回调
|
||||
});
|
||||
|
||||
}else{
|
||||
LoadingDialogHelper.hide(context);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide(context);
|
||||
print('Error fetching data: $e');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -549,6 +549,8 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
String acceptedPlanType="0";
|
||||
List<String> jiHuaImages =[];
|
||||
// 是否有整改计划
|
||||
|
@ -562,7 +564,9 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
setState(() {
|
||||
LoadingDialogHelper.show(context);
|
||||
});
|
||||
|
||||
List<DepartmentEntry> departments = dannerRepairKey.currentState!.departments;
|
||||
bool departmentsAllInput=true;
|
||||
|
@ -581,11 +585,17 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
|
||||
|
||||
if(!departmentsAllInput){
|
||||
setState(() {
|
||||
LoadingDialogHelper.hide(context);
|
||||
});
|
||||
ToastUtil.showNormal(context, "请添加验收部门负责人");
|
||||
return;
|
||||
}
|
||||
|
||||
if(departmentsSameMan){
|
||||
setState(() {
|
||||
LoadingDialogHelper.hide(context);
|
||||
});
|
||||
ToastUtil.showNormal(context, "不能选择重复的验收部门负责人");
|
||||
return;
|
||||
}
|
||||
|
@ -625,9 +635,11 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
});
|
||||
|
||||
}else{
|
||||
LoadingDialogHelper.hide(context);
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide(context);
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
@ -635,7 +647,7 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
|
||||
Future<void> _rectificationSubmission() async {
|
||||
try {
|
||||
|
||||
LoadingDialogHelper.show(context);
|
||||
final result = await ApiService.rectificationSubmission(pd["HIDDEN_ID"],buMenId,renYuanId);
|
||||
if (result['result'] == 'success') {
|
||||
setState(() {
|
||||
|
@ -646,9 +658,11 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
|
|||
});
|
||||
|
||||
}else{
|
||||
LoadingDialogHelper.hide(context);
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide(context);
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
|
|
|
@ -0,0 +1,278 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
import 'package:qhd_prevention/pages/notif/notif_detail_page.dart';
|
||||
import 'package:qhd_prevention/tools/tools.dart';
|
||||
|
||||
|
||||
class SafetyMeetingListPage extends StatefulWidget {
|
||||
const SafetyMeetingListPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SafetyMeetingListPage> createState() => _SafetyMeetingListPageState();
|
||||
}
|
||||
|
||||
class _SafetyMeetingListPageState extends State<SafetyMeetingListPage>
|
||||
with SingleTickerProviderStateMixin{
|
||||
|
||||
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
late List<dynamic> _list = [];
|
||||
late TabController _tabController= TabController(length: 2, vsync: this);
|
||||
int _selectedTab = 0;
|
||||
int pageNum = 1;
|
||||
|
||||
// 模拟数据
|
||||
final List<Map<String, dynamic>> _notifications = List.generate(10, (i) {
|
||||
bool read = i % 3 == 0;
|
||||
return {
|
||||
'title': '测试数据标题标题 ${i + 1}',
|
||||
'time': '2025-06-${10 + i} 12:3${i}',
|
||||
'read': read,
|
||||
};
|
||||
});
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// _tabController = TabController(length: 2, vsync: this);
|
||||
_tabController.addListener(() {
|
||||
// if (!_tabController.indexIsChanging) {
|
||||
// setState(() => _selectedTab = _tabController.index);
|
||||
// }
|
||||
|
||||
if (_tabController.indexIsChanging) {
|
||||
setState(() => _selectedTab = _tabController.index);
|
||||
print('切换到标签:${_tabController.index}');
|
||||
reRefreshData();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
_getNotifList("");
|
||||
}
|
||||
|
||||
void reRefreshData(){
|
||||
pageNum=1;
|
||||
_list.clear();
|
||||
searchController.text="";
|
||||
if(0==_selectedTab){
|
||||
_getNotifList("");
|
||||
}else{
|
||||
_getNotifEnterprise("");
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getNotifList(String keyWord) async {
|
||||
// LoadingDialogHelper.show(context);
|
||||
try {
|
||||
final result = await ApiService.getNotifList("-1", pageNum.toString(),keyWord);
|
||||
if (result['result'] == 'success') {
|
||||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
setState(() {
|
||||
_list.addAll(newList);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print('加载出错: $e');
|
||||
} finally {
|
||||
LoadingDialogHelper.hide(context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getNotifEnterprise(String keyWord) async {
|
||||
// LoadingDialogHelper.show(context);
|
||||
try {
|
||||
final result = await ApiService.getNotifEnterprise("-1", pageNum.toString(),keyWord);
|
||||
if (result['result'] == 'success') {
|
||||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
setState(() {
|
||||
_list.addAll(newList);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print('加载出错: $e');
|
||||
} finally {
|
||||
LoadingDialogHelper.hide(context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _deleteNotif(String id) async {
|
||||
// LoadingDialogHelper.show(context);
|
||||
try {
|
||||
final result = await ApiService.deleteNotif(id);
|
||||
if (result['result'] == 'success') {
|
||||
setState(() {
|
||||
reRefreshData();
|
||||
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print('加载出错: $e');
|
||||
} finally {
|
||||
LoadingDialogHelper.hide(context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: MyAppbar(title: "安全例会"),
|
||||
body:
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
FocusScope.of(context).unfocus(); // 收起键盘
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Scaffold(
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// Tab bar
|
||||
TabBar(
|
||||
controller: _tabController,
|
||||
labelStyle: TextStyle(fontSize: 16),
|
||||
indicator: UnderlineTabIndicator(
|
||||
borderSide: BorderSide(width: 3.0, color: Colors.blue),
|
||||
insets: EdgeInsets.symmetric(horizontal: 100.0),
|
||||
),
|
||||
labelColor: Colors.blue,
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: const [Tab(text: '待反馈'), Tab(text: '已反馈')],
|
||||
),
|
||||
|
||||
// Search bar
|
||||
// List
|
||||
Expanded(
|
||||
child:
|
||||
_list.isEmpty
|
||||
? NoDataWidget.show()
|
||||
: ListView.builder(
|
||||
itemCount: _list.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _itemCell(_list[index]);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _itemCell(final item) {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => NotifDetailPage(
|
||||
item,_selectedTab,
|
||||
onClose: (result) {
|
||||
print('详情页面已关闭,返回结果: $result');
|
||||
reRefreshData();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// pushPage(NotifDetailPage(item,_selectedTab), context);
|
||||
},
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20), // 减小底部间距
|
||||
child: Text(item['SYNOPSIS'], style: const TextStyle(fontSize: 14)),
|
||||
),
|
||||
|
||||
subtitle: Text(item['CREATTIME'], style: TextStyle(fontSize: 13)),
|
||||
|
||||
trailing: Container(
|
||||
constraints: const BoxConstraints(minHeight: 100), // 确保最小高度
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min, // 关键修改:使用最小尺寸
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (0 != _selectedTab)
|
||||
Text(
|
||||
item['TYPE'] == 1 ? '已读' : '未读',
|
||||
style: TextStyle(
|
||||
fontSize: 12, // 稍微减小字体大小
|
||||
color: item['TYPE'] == 1 ? Colors.grey : Colors.red,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
|
||||
if (0 != _selectedTab && item['TYPE'] == 1)
|
||||
SizedBox(
|
||||
height: 24, // 固定按钮高度
|
||||
child: TextButton(
|
||||
onPressed: () async{
|
||||
// 显示确认对话框
|
||||
bool? confirm = await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text("确认删除"),
|
||||
content: Text("确定要删除这条通知吗?"),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
// onPressed: () => Navigator.pop(context, false),
|
||||
child: Text("取消"),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
// onPressed: () => Navigator.pop(context, true),
|
||||
child: Text("确定", style: TextStyle(color: Colors.red)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirm == true) {
|
||||
_deleteNotif(item['NOTICECORPUSERID_ID']);
|
||||
}
|
||||
|
||||
},
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
backgroundColor: Colors.red,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Text( '删除', style: TextStyle(fontSize: 13, color: Colors.white),),
|
||||
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(height: 1, color: Colors.black12),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -15,6 +15,7 @@ import 'package:qhd_prevention/pages/app/danger_wait_list_page.dart';
|
|||
import 'package:qhd_prevention/pages/home/work/laws_regulations_page.dart';
|
||||
import 'package:qhd_prevention/pages/home/workSet_page.dart';
|
||||
|
||||
import 'Safetymeeting/safety_meeting_list_page.dart';
|
||||
import 'hidden_roll_widget.dart';
|
||||
import '../../http/ApiService.dart';
|
||||
import '../../tools/tools.dart';
|
||||
|
@ -337,6 +338,9 @@ class _HomePageState extends State<HomePage> {
|
|||
case 7:
|
||||
pushPage(StudyGardenPage(), context);
|
||||
break;
|
||||
case 10:
|
||||
pushPage(SafetyMeetingListPage(), context);
|
||||
break;
|
||||
case 11:
|
||||
pushPage(HomeNfcListPage(), context);
|
||||
break;
|
||||
|
|
|
@ -90,17 +90,35 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||
setState(() {
|
||||
listDates.addAll(newList);
|
||||
|
||||
if(newListTwo.isNotEmpty){
|
||||
if(newListTwo.isNotEmpty&&newListTwo[0]["LISTCHECKITEM_ID"]!=null){
|
||||
if( newListTwo[0]["LISTCHECKITEM_ID"]==listDates[0]["LISTCHECKITEM_ID"]){
|
||||
listDatesSelect.addAll(newListTwo);
|
||||
}
|
||||
}
|
||||
|
||||
listDates.addAll(newList);
|
||||
// listDatesTwo.addAll(newListTwo);
|
||||
|
||||
// listDatesTwo.addAll(newListTwo);option1
|
||||
for(int i=0;i<listDates.length;i++){
|
||||
if(listDatesSelect.isNotEmpty){
|
||||
switch(listDatesSelect[i]["ISNORMAL"] ){
|
||||
case 0:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option1";
|
||||
break;
|
||||
case 1:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option2";
|
||||
break;
|
||||
case 2:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option3";
|
||||
break;
|
||||
}
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = listDatesSelect[i]["HIDDEN_ID"];
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[i]["HIDDEN_ID"]);
|
||||
}else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -125,17 +143,36 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||
setState(() {
|
||||
listDates.addAll(newList);
|
||||
|
||||
if(newListTwo.isNotEmpty){
|
||||
if(newListTwo.isNotEmpty&&newListTwo[0]["CUSTOM_ID"]!=null){
|
||||
if( newListTwo[0]["CUSTOM_ID"]==listDates[0]["CUSTOM_ID"]){
|
||||
listDatesSelect.addAll(newListTwo);
|
||||
}
|
||||
}
|
||||
|
||||
listDates.addAll(newList);
|
||||
|
||||
// listDatesTwo.addAll(newListTwo);
|
||||
for(int i=0;i<listDates.length;i++){
|
||||
if(listDatesSelect.isNotEmpty){
|
||||
switch(listDatesSelect[i]["ISNORMAL"] ){
|
||||
case 0:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option1";
|
||||
break;
|
||||
case 1:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option2";
|
||||
break;
|
||||
case 2:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option3";
|
||||
break;
|
||||
|
||||
}
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = listDatesSelect[i]["HIDDEN_ID"];
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[i]["HIDDEN_ID"]);
|
||||
}else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue