Merge remote-tracking branch 'origin/main'
# Conflicts: # lib/services/auth_service.dartmain
						commit
						a5a8a7ef34
					
				|  | @ -312,7 +312,7 @@ U6Hzm1ninpWeE+awIDAQAB | ||||||
|   static Future<Map<String, dynamic>> getHiddenRoll() { |   static Future<Map<String, dynamic>> getHiddenRoll() { | ||||||
|     return HttpManager().request( |     return HttpManager().request( | ||||||
|       basePath, |       basePath, | ||||||
|       '/app/hidden/getHiddenByCorp', |       '/app/offduty/isRest', | ||||||
|       method: Method.post, |       method: Method.post, | ||||||
|       data: { |       data: { | ||||||
|         'CORPINFO_ID': SessionService.instance.corpinfoId, |         'CORPINFO_ID': SessionService.instance.corpinfoId, | ||||||
|  | @ -321,6 +321,19 @@ U6Hzm1ninpWeE+awIDAQAB | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   static Future<Map<String, dynamic>> getIsRest() { | ||||||
|  |     return HttpManager().request( | ||||||
|  |       basePath, | ||||||
|  |       '/app/offduty/isRest', | ||||||
|  |       method: Method.post, | ||||||
|  |       data: { | ||||||
|  |         'CORPINFO_ID': SessionService.instance.corpinfoId, | ||||||
|  |         'USER_ID': SessionService.instance.loginUserId, | ||||||
|  |       }, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|   /// TODO -------------–-------------------- 首页学习园地 -------------–-------------------- |   /// TODO -------------–-------------------- 首页学习园地 -------------–-------------------- | ||||||
|   /// 我的任务列表 |   /// 我的任务列表 | ||||||
|   static Future<Map<String, dynamic>> getStudyList(int page) { |   static Future<Map<String, dynamic>> getStudyList(int page) { | ||||||
|  |  | ||||||
|  | @ -152,7 +152,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> { | ||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: MyAppbar(title: "隐患等级"), |       appBar: MyAppbar(title: "隐患登记"), | ||||||
|       body: Column( |       body: Column( | ||||||
|         children: [ |         children: [ | ||||||
|           // 详情滚动区域 |           // 详情滚动区域 | ||||||
|  | @ -510,7 +510,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Future<void> _riskListCheckAppAdd() async { |   Future<void> _riskListCheckAppAdd() async { | ||||||
|     LoadingDialogHelper.show(); | 
 | ||||||
|     if(_yinHuanImages.isEmpty){ |     if(_yinHuanImages.isEmpty){ | ||||||
|       ToastUtil.showNormal(context, "请上传隐患图片"); |       ToastUtil.showNormal(context, "请上传隐患图片"); | ||||||
|       return; |       return; | ||||||
|  | @ -576,6 +576,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> { | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     LoadingDialogHelper.show(); | ||||||
|     String yinHuanTypeIds=""; |     String yinHuanTypeIds=""; | ||||||
|     String yinHuanTypeNames=""; |     String yinHuanTypeNames=""; | ||||||
|     for(int i=0;i<_yinHuanTypeIds.length;i++){ |     for(int i=0;i<_yinHuanTypeIds.length;i++){ | ||||||
|  | @ -645,7 +646,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> { | ||||||
|       //   yinHuanTypeIds, hazardLeve, buMenId, buMenPDId, |       //   yinHuanTypeIds, hazardLeve, buMenId, buMenPDId, | ||||||
|       //   yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,); |       //   yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,); | ||||||
| 
 | 
 | ||||||
| 
 |       LoadingDialogHelper.hide(); | ||||||
|       if (result['result'] == 'success') { |       if (result['result'] == 'success') { | ||||||
| 
 | 
 | ||||||
|         String hiddenId = result['pd']['HIDDEN_ID'] ; |         String hiddenId = result['pd']['HIDDEN_ID'] ; | ||||||
|  | @ -669,7 +670,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> { | ||||||
|           ToastUtil.showNormal(context, "提交成功"); |           ToastUtil.showNormal(context, "提交成功"); | ||||||
|           Navigator.pop(context); |           Navigator.pop(context); | ||||||
|           widget.onClose(hiddenId,_standardController.text.trim()); |           widget.onClose(hiddenId,_standardController.text.trim()); | ||||||
|           LoadingDialogHelper.hide(); | 
 | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
|     } catch (e) { |     } catch (e) { | ||||||
|  |  | ||||||
|  | @ -151,7 +151,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> { | ||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: MyAppbar(title: "隐患等级"), |       appBar: MyAppbar(title: "隐患登记"), | ||||||
|       body: Column( |       body: Column( | ||||||
|         children: [ |         children: [ | ||||||
|           // 详情滚动区域 |           // 详情滚动区域 | ||||||
|  | @ -509,7 +509,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Future<void> _riskListCheckAppAdd() async { |   Future<void> _riskListCheckAppAdd() async { | ||||||
|     LoadingDialogHelper.show(); | 
 | ||||||
|     if(_yinHuanImages.isEmpty){ |     if(_yinHuanImages.isEmpty){ | ||||||
|       ToastUtil.showNormal(context, "请上传隐患图片"); |       ToastUtil.showNormal(context, "请上传隐患图片"); | ||||||
|       return; |       return; | ||||||
|  | @ -575,6 +575,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> { | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     LoadingDialogHelper.show(); | ||||||
|     String yinHuanTypeIds=""; |     String yinHuanTypeIds=""; | ||||||
|     String yinHuanTypeNames=""; |     String yinHuanTypeNames=""; | ||||||
|     for(int i=0;i<_yinHuanTypeIds.length;i++){ |     for(int i=0;i<_yinHuanTypeIds.length;i++){ | ||||||
|  | @ -633,7 +634,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'] ; | ||||||
|  | @ -652,7 +653,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> { | ||||||
|               _addImgFiles(_zhengGaiImages[i],"4",hiddenId); |               _addImgFiles(_zhengGaiImages[i],"4",hiddenId); | ||||||
|             } |             } | ||||||
|           } |           } | ||||||
|         LoadingDialogHelper.hide(); | 
 | ||||||
|         setState(() { |         setState(() { | ||||||
|           ToastUtil.showNormal(context, "提交成功"); |           ToastUtil.showNormal(context, "提交成功"); | ||||||
|           Navigator.pop(context); |           Navigator.pop(context); | ||||||
|  |  | ||||||
|  | @ -439,7 +439,7 @@ class _QuickReportPageState extends State<QuickReportPage> { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     if(_hazardLeve.isEmpty){ |     if(_hazardLeve==null||_hazardLeve.isEmpty){ | ||||||
|       ToastUtil.showNormal(context, "请选择隐患级别"); |       ToastUtil.showNormal(context, "请选择隐患级别"); | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -1,4 +1,6 @@ | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:qhd_prevention/customWidget/toast_util.dart'; | ||||||
|  | import 'package:qhd_prevention/http/ApiService.dart'; | ||||||
| import 'package:qhd_prevention/pages/app/Danger_paicha/check_record_page.dart'; | import 'package:qhd_prevention/pages/app/Danger_paicha/check_record_page.dart'; | ||||||
| import 'package:qhd_prevention/pages/app/Danger_paicha/quick_report_page.dart'; | import 'package:qhd_prevention/pages/app/Danger_paicha/quick_report_page.dart'; | ||||||
| import 'package:qhd_prevention/pages/app/danger_wait_list_page.dart'; | import 'package:qhd_prevention/pages/app/danger_wait_list_page.dart'; | ||||||
|  | @ -57,6 +59,11 @@ class _ApplicationPageState extends State<ApplicationPage> { | ||||||
| 
 | 
 | ||||||
|       case AppItem.riskInspection: |       case AppItem.riskInspection: | ||||||
|       // 跳转到隐患排查页面 |       // 跳转到隐患排查页面 | ||||||
|  |         bool isRest= await _getIsRest(); | ||||||
|  |         if(isRest){ | ||||||
|  |           ToastUtil.showNormal(context, "您已经处于离岗状态中"); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|         pushPage(DangerPage(1), context); |         pushPage(DangerPage(1), context); | ||||||
|         break; |         break; | ||||||
|       case AppItem.checkRecord: |       case AppItem.checkRecord: | ||||||
|  | @ -73,6 +80,11 @@ class _ApplicationPageState extends State<ApplicationPage> { | ||||||
|         break; |         break; | ||||||
|       case AppItem.supervisionRectification: |       case AppItem.supervisionRectification: | ||||||
|       // 跳转到监管帮扶隐患整改页面 |       // 跳转到监管帮扶隐患整改页面 | ||||||
|  |         bool isRest= await _getIsRest(); | ||||||
|  |         if(isRest){ | ||||||
|  |           ToastUtil.showNormal(context, "您已经处于离岗状态中"); | ||||||
|  |           return; | ||||||
|  |         } | ||||||
|         pushPage(DangerPage(2), context); |         pushPage(DangerPage(2), context); | ||||||
|         //Navigator.push(context, MaterialPageRoute(builder: (_) => SupervisionRectificationPage())); |         //Navigator.push(context, MaterialPageRoute(builder: (_) => SupervisionRectificationPage())); | ||||||
|         break; |         break; | ||||||
|  | @ -284,4 +296,24 @@ class _ApplicationPageState extends State<ApplicationPage> { | ||||||
|       ), |       ), | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   Future<bool> _getIsRest( )async { | ||||||
|  |     try { | ||||||
|  |       final raw = await ApiService.getIsRest(); | ||||||
|  |       if (raw['result'] == 'success') { | ||||||
|  |         if(  raw['ISREST']=="1"){ | ||||||
|  |           return true; | ||||||
|  |         }else{ | ||||||
|  |           return false; | ||||||
|  |         } | ||||||
|  |       }else{ | ||||||
|  |         return false; | ||||||
|  |       } | ||||||
|  |     } catch (e) { | ||||||
|  |       // 出错时可以 Toast 或者在页面上显示错误状态 | ||||||
|  |       print('加载头像数据失败:$e'); | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | @ -35,7 +35,14 @@ class CheckingInformationOnePage extends StatefulWidget { | ||||||
| class _CheckingInformationOnePageState extends State<CheckingInformationOnePage> { | class _CheckingInformationOnePageState extends State<CheckingInformationOnePage> { | ||||||
| 
 | 
 | ||||||
|   final List<DepartmentEntry> departments = [ |   final List<DepartmentEntry> departments = [ | ||||||
|     DepartmentEntry(department: '请选择', responsible: '请选择',index:'',departmentId: '',responsibleId:''), |   // "DEPARTMENT_NAME" -> "测试部" | ||||||
|  |   // "DEPARTMENT_ID" -> "0a8f669cd1b742f9be4fc063cb0b1afa" | ||||||
|  |   // "NAME" -> "王轩" | ||||||
|  |     //"USER_ID" -> "542627bb14154fcaaf496e3aa105dd2b" | ||||||
|  | 
 | ||||||
|  |     DepartmentEntry(department: SessionService.instance.loginUser?["DEPARTMENT_NAME"], responsible: SessionService.instance.loginUser?["NAME"] | ||||||
|  |             ,index:'', | ||||||
|  |              departmentId:  SessionService.instance.loginUser?["DEPARTMENT_ID"],responsibleId: SessionService.instance.loginUser?["USER_ID"]), | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|   final List<DepartmentEntry> otherHidden = []; |   final List<DepartmentEntry> otherHidden = []; | ||||||
|  | @ -60,7 +67,8 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage> | ||||||
|     dataTime=DateFormat('yyyy-MM-dd').format(now); |     dataTime=DateFormat('yyyy-MM-dd').format(now); | ||||||
|     stringTime=DateFormat('HH:mm').format(now); |     stringTime=DateFormat('HH:mm').format(now); | ||||||
| 
 | 
 | ||||||
|     _getData(); |     //获取其他隐患信息列表 | ||||||
|  |     // _getData(); | ||||||
| 
 | 
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -421,7 +421,7 @@ class DannerRepairState extends State<DannerRepair> { | ||||||
|             borderRadius: BorderRadius.circular(5), |             borderRadius: BorderRadius.circular(5), | ||||||
|           ), |           ), | ||||||
|           child: ListItemFactory.createRowSpaceBetweenItem( |           child: ListItemFactory.createRowSpaceBetweenItem( | ||||||
|             leftText: "整改部门", |             leftText: "验收部门", | ||||||
|             rightText: departments[index].department.isNotEmpty?departments[index].department:"请选择", |             rightText: departments[index].department.isNotEmpty?departments[index].department:"请选择", | ||||||
|             isRight: true, |             isRight: true, | ||||||
|           ), |           ), | ||||||
|  | @ -462,7 +462,7 @@ class DannerRepairState extends State<DannerRepair> { | ||||||
|             borderRadius: BorderRadius.circular(5), |             borderRadius: BorderRadius.circular(5), | ||||||
|           ), |           ), | ||||||
|           child: ListItemFactory.createRowSpaceBetweenItem( |           child: ListItemFactory.createRowSpaceBetweenItem( | ||||||
|             leftText: "整改负责人", |             leftText: "验收部门负责人", | ||||||
|             rightText: departments[index].responsible.isNotEmpty?departments[index].responsible:"请选择", |             rightText: departments[index].responsible.isNotEmpty?departments[index].responsible:"请选择", | ||||||
|             isRight: true, |             isRight: true, | ||||||
|           ), |           ), | ||||||
|  |  | ||||||
|  | @ -179,10 +179,10 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
|     return Scaffold( |     return Scaffold( | ||||||
|       appBar: MyAppbar(title: widget.dangerType.detailTitle), |       appBar: MyAppbar(title: widget.dangerType.detailTitle), | ||||||
|       body: pd.isEmpty |       body: pd.isEmpty | ||||||
|           ? const Center(child: CircularProgressIndicator()) |           ?  Container(color: Colors.white,child: Center(child: CircularProgressIndicator(),)) | ||||||
|           : LayoutBuilder( |           : LayoutBuilder( | ||||||
|         builder: (context, constraints) { |         builder: (context, constraints) { | ||||||
|           return SingleChildScrollView( |           return Container(color: Colors.white,child:SingleChildScrollView( | ||||||
|             child: ConstrainedBox( |             child: ConstrainedBox( | ||||||
|               constraints: BoxConstraints( |               constraints: BoxConstraints( | ||||||
|                 minHeight: constraints.maxHeight, |                 minHeight: constraints.maxHeight, | ||||||
|  | @ -381,6 +381,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
|                 ), |                 ), | ||||||
|               ), |               ), | ||||||
|             ), |             ), | ||||||
|  |           ), | ||||||
|           ); |           ); | ||||||
|         }, |         }, | ||||||
|       ), |       ), | ||||||
|  | @ -393,8 +394,6 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
|     return SizedBox( |     return SizedBox( | ||||||
|       child: Column( |       child: Column( | ||||||
|         children: [ |         children: [ | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|           _getRepairState(), |           _getRepairState(), | ||||||
|           // 整改选项 |           // 整改选项 | ||||||
|           // _accepted ? _getRepairState() : _noAccepet_repair(_accepted), |           // _accepted ? _getRepairState() : _noAccepet_repair(_accepted), | ||||||
|  | @ -419,21 +418,15 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Widget _getRepairState() { |   Widget _getRepairState() { | ||||||
|     return Container( |     return  Column( | ||||||
| 
 |  | ||||||
|       decoration: BoxDecoration( |  | ||||||
|         color: Colors.white, |  | ||||||
|         borderRadius: BorderRadius.circular(5), |  | ||||||
|       ), |  | ||||||
|       child: Column( |  | ||||||
| 
 | 
 | ||||||
|         children: [ |         children: [ | ||||||
| 
 | 
 | ||||||
|           ListItemFactory.createBuildSimpleSection("隐患验收"), |           ListItemFactory.createBuildSimpleSection("隐患验收",horPadding:0), | ||||||
|           Divider(height: 1), |           Divider(height: 1), | ||||||
| 
 | 
 | ||||||
|           ListItemFactory.createYesNoSection( |           ListItemFactory.createYesNoSection( | ||||||
|             horizontalPadding: 5, |             horizontalPadding: 0, | ||||||
|             title: '是否合格', |             title: '是否合格', | ||||||
|             yesLabel: '是', |             yesLabel: '是', | ||||||
|             noLabel: '否', |             noLabel: '否', | ||||||
|  | @ -451,7 +444,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
|             Divider(), |             Divider(), | ||||||
|             Container( |             Container( | ||||||
|               height: 130, |               height: 130, | ||||||
|               padding: EdgeInsets.all(15), |               padding: EdgeInsets.only(top: 15,bottom: 15), | ||||||
|               child: Column( |               child: Column( | ||||||
|                 children: [ |                 children: [ | ||||||
|                   Row( |                   Row( | ||||||
|  | @ -499,7 +492,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
|                 // ); |                 // ); | ||||||
|               }, |               }, | ||||||
|               child: Padding( |               child: Padding( | ||||||
|                 padding: EdgeInsets.symmetric(horizontal: 15), |                 padding: EdgeInsets.symmetric(horizontal: 0), | ||||||
|                 child: ListItemFactory.createRowSpaceBetweenItem( |                 child: ListItemFactory.createRowSpaceBetweenItem( | ||||||
|                   leftText: "验收日期", |                   leftText: "验收日期", | ||||||
|                   rightText: dataTime.isEmpty?"请选择":dataTime, |                   rightText: dataTime.isEmpty?"请选择":dataTime, | ||||||
|  | @ -527,7 +520,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         ], |         ], | ||||||
|       ), | 
 | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -36,6 +36,8 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> { | ||||||
|   List<dynamic> files6 = []; |   List<dynamic> files6 = []; | ||||||
|   List<dynamic> videoList = []; |   List<dynamic> videoList = []; | ||||||
|   List<dynamic> checkList = []; |   List<dynamic> checkList = []; | ||||||
|  |   List<String> files7 = []; | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|   bool modalShow = false; |   bool modalShow = false; | ||||||
|   String videoSrc = ""; |   String videoSrc = ""; | ||||||
|  | @ -90,6 +92,11 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> { | ||||||
|             } |             } | ||||||
|             files6 = data['yImgs'] ?? []; |             files6 = data['yImgs'] ?? []; | ||||||
|             checkList = data['checkList'] ?? []; |             checkList = data['checkList'] ?? []; | ||||||
|  |             if(checkList.isNotEmpty) { | ||||||
|  |               for (var img in checkList[0]['cImgs']) { | ||||||
|  |               files7.add(img["FILEPATH"]); | ||||||
|  |             } | ||||||
|  |             } | ||||||
|           }); |           }); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -357,6 +364,51 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> { | ||||||
|                       // ... 其他整改信息字段 |                       // ... 其他整改信息字段 | ||||||
|                     ], |                     ], | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |           // 验收信息部分 | ||||||
|  |           if (6==widget.dangerType.index&&checkList.isNotEmpty) ...[ | ||||||
|  |           // const Divider(height: 10,color: Colors.grey,), | ||||||
|  |             SizedBox(height: 10,), | ||||||
|  |           Row( | ||||||
|  |           children: [ | ||||||
|  |           Container(width: 3, height: 15, color: Colors.blue), | ||||||
|  |           const SizedBox(width: 8), | ||||||
|  |           Text( | ||||||
|  |           "验收信息", | ||||||
|  |           style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), | ||||||
|  |           ), | ||||||
|  |           ], | ||||||
|  |           ), | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |           // const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), | ||||||
|  |           Divider(height: 1), | ||||||
|  |           _buildInfoItem('验收描述', checkList[0]['CHECKDESCR'] ?? ''), | ||||||
|  |           Divider(height: 1), | ||||||
|  |           _buildInfoItem('是否合格',_getText (checkList[0]['STATUS'] )), | ||||||
|  |           Divider(height: 1), | ||||||
|  |           _buildInfoItem('验收部门', checkList[0]['CHECKDEPTNAME'] ?? ''), | ||||||
|  |           Divider(height: 1), | ||||||
|  |           _buildInfoItem('验收部门负责人', checkList[0]['CHECKORNAME'] ?? ''), | ||||||
|  |           Divider(height: 1), | ||||||
|  |             _buildInfoItem('验收时间', checkList[0]['CHECK_TIME'] ?? ''), | ||||||
|  |             Divider(height: 1), | ||||||
|  |           // const Text('整改后图片', style: TextStyle(fontWeight: FontWeight.bold)), | ||||||
|  |           // _buildImageGrid(files2, onTap: (index) => _showImageGallery(files2, index)), | ||||||
|  |           ListItemFactory.createTextImageItem( | ||||||
|  |           text: "验收图片", | ||||||
|  |           imageUrls: files5, | ||||||
|  |           onImageTapped: (index) { | ||||||
|  |           presentOpaque( | ||||||
|  |           SingleImageViewer(imageUrl: ApiService.baseImgPath +files5[index]), | ||||||
|  |           context, | ||||||
|  |           ); | ||||||
|  |           }, | ||||||
|  |           ), | ||||||
|  |           ], | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|                     // 添加底部安全区域间距 |                     // 添加底部安全区域间距 | ||||||
|                     SizedBox(height: MediaQuery.of(context).padding.bottom + 20), |                     SizedBox(height: MediaQuery.of(context).padding.bottom + 20), | ||||||
|                   ], |                   ], | ||||||
|  | @ -369,10 +421,22 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> { | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   String _getText(String source) { | ||||||
|  |     if(source.isNotEmpty){ | ||||||
|  |       if(source=="1"){ | ||||||
|  |         return "是"; | ||||||
|  |       }else{ | ||||||
|  |         return "否"; | ||||||
|  |       } | ||||||
|  |     }else{ | ||||||
|  |       return ""; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   String _getSourceText(String? source) { |   String _getSourceText(String? source) { | ||||||
|  | 
 | ||||||
|     switch (source) { |     switch (source) { | ||||||
|       case '1': return '隐患快报'; |       case '1': return '隐患快报'; | ||||||
|       case '2': return '隐患排查清单检查'; |       case '2': return '隐患排查清单检查'; | ||||||
|  |  | ||||||
|  | @ -213,14 +213,14 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet | ||||||
|                           Divider(height: 1), |                           Divider(height: 1), | ||||||
|                           // 条件渲染部分 |                           // 条件渲染部分 | ||||||
|                           if (pd['SOURCE'] == '2') ...[ |                           if (pd['SOURCE'] == '2') ...[ | ||||||
|                             _buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''), |                             // _buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''), | ||||||
|                             Divider(height: 1), |                             // Divider(height: 1), | ||||||
|                             _buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''), |                             // _buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''), | ||||||
|                             Divider(height: 1), |                             // Divider(height: 1), | ||||||
|                             _buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''), |                             // _buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''), | ||||||
|                             Divider(height: 1), |                             // Divider(height: 1), | ||||||
|                             _buildInfoItem('风险分级', pd['LEVEL'] ?? ''), |                             // _buildInfoItem('风险分级', pd['LEVEL'] ?? ''), | ||||||
|                             Divider(height: 1), |                             // Divider(height: 1), | ||||||
|                             _buildInfoItem('检查内容', pd['CHECK_CONTENT'] ?? ''), |                             _buildInfoItem('检查内容', pd['CHECK_CONTENT'] ?? ''), | ||||||
|                             Divider(height: 1), |                             Divider(height: 1), | ||||||
|                           ], |                           ], | ||||||
|  |  | ||||||
|  | @ -297,7 +297,7 @@ class _CommitmentWorkshopDetailPageState extends State<CommitmentWorkshopDetailP | ||||||
|                             ), |                             ), | ||||||
|                           const SizedBox(width: 15), |                           const SizedBox(width: 15), | ||||||
|                           if (pd['SIGN_PATH'] != null) |                           if (pd['SIGN_PATH'] != null) | ||||||
|                             Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit: BoxFit.cover,), |                             Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit:  BoxFit.contain,), | ||||||
| 
 | 
 | ||||||
|                         ], |                         ], | ||||||
|                       ), |                       ), | ||||||
|  |  | ||||||
|  | @ -225,7 +225,7 @@ class _CompanySafetyCommitmentDetailState extends State<CompanySafetyCommitmentD | ||||||
|                           ), |                           ), | ||||||
|                           const SizedBox(width: 15), |                           const SizedBox(width: 15), | ||||||
|                           if (pd['SIGN_PATH'] != null) |                           if (pd['SIGN_PATH'] != null) | ||||||
|                           Image.network(ApiService.baseImgPath+pd['SIGN_PATH'] ,width: 230,height: 150,fit: BoxFit.cover,), |                           Image.network(ApiService.baseImgPath+pd['SIGN_PATH'] ,width: 230,height: 150,fit: BoxFit.contain,), | ||||||
| 
 | 
 | ||||||
|                         ], |                         ], | ||||||
|                       ), |                       ), | ||||||
|  |  | ||||||
|  | @ -301,7 +301,7 @@ class _TeamSafetyCommitmentDetailState extends State<TeamSafetyCommitmentDetail> | ||||||
|                           ), |                           ), | ||||||
|                           const SizedBox(width: 15), |                           const SizedBox(width: 15), | ||||||
|                           if (pd['SIGN_PATH'] != null) |                           if (pd['SIGN_PATH'] != null) | ||||||
|                           Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit: BoxFit.cover,), |                           Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit: BoxFit.contain,), | ||||||
| 
 | 
 | ||||||
|                         ], |                         ], | ||||||
|                       ), |                       ), | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| import 'dart:ui'; | import 'dart:ui'; | ||||||
| 
 | 
 | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:intl/intl.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/danner_repain_item.dart'; | import 'package:qhd_prevention/customWidget/danner_repain_item.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/department_picker.dart'; | import 'package:qhd_prevention/customWidget/department_picker.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; | import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; | ||||||
|  | @ -81,6 +82,8 @@ class _HomeDangerPageState extends State<HomeDangerPage> | ||||||
| 
 | 
 | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|   Future<void> _getHazardInvestigationList() async { |   Future<void> _getHazardInvestigationList() async { | ||||||
|     try { |     try { | ||||||
| 
 | 
 | ||||||
|  | @ -264,7 +267,7 @@ class _HomeDangerPageState extends State<HomeDangerPage> | ||||||
|                         '排查周期:${item['PERIODNAME']}', |                         '排查周期:${item['PERIODNAME']}', | ||||||
|                         '包含检查项:${item['count']}', |                         '包含检查项:${item['count']}', | ||||||
|                         '负责人:${item['USER_NAME']}', |                         '负责人:${item['USER_NAME']}', | ||||||
|                         '起始时间:${item['START_DATE']}-${item['END_DATE']}', |                         '起始时间:${changeTimeString(item['START_DATE'])}-${changeTimeString(item['END_DATE'])}', | ||||||
| 
 | 
 | ||||||
|                       ], |                       ], | ||||||
|                       showBottomTags: showBottomTags, |                       showBottomTags: showBottomTags, | ||||||
|  | @ -285,6 +288,15 @@ class _HomeDangerPageState extends State<HomeDangerPage> | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   String changeTimeString(String dataTime) { | ||||||
|  |     final dateFormat = DateFormat('yyyy-MM-dd'); | ||||||
|  |     // 先将字符串转换为 DateTime 对象 | ||||||
|  |     DateTime dateTime = DateTime.parse(dataTime); | ||||||
|  |     // 然后格式化 DateTime 对象 | ||||||
|  |     String newData = dateFormat.format(dateTime); | ||||||
|  |     return newData; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   Widget _itemCell(final item) { |   Widget _itemCell(final item) { | ||||||
|     return Padding( |     return Padding( | ||||||
|       padding: EdgeInsets.only(left: 15, right: 15, bottom: 15), |       padding: EdgeInsets.only(left: 15, right: 15, bottom: 15), | ||||||
|  | @ -401,6 +413,7 @@ class _HomeDangerPageState extends State<HomeDangerPage> | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| // 模拟数据模版 | // 模拟数据模版 | ||||||
| class NotificationItem { | class NotificationItem { | ||||||
|   final String title; |   final String title; | ||||||
|  |  | ||||||
|  | @ -679,8 +679,13 @@ class _HomePageState extends State<HomePage> { | ||||||
|     required int index, |     required int index, | ||||||
|   }) { |   }) { | ||||||
|     return GestureDetector( |     return GestureDetector( | ||||||
|       onTap: () { |       onTap: () async { | ||||||
|         if (index == 1) { |         if (index == 1) { | ||||||
|  |           bool isRest= await _getIsRest(); | ||||||
|  |           if(isRest){ | ||||||
|  |             ToastUtil.showNormal(context, "您已经处于离岗状态中"); | ||||||
|  |             return; | ||||||
|  |           } | ||||||
|           pushPage(HomeDangerPage(), context); |           pushPage(HomeDangerPage(), context); | ||||||
|         } else if (index == 2) { |         } else if (index == 2) { | ||||||
|           pushPage(DangerWaitListPage(DangerType.wait, 2), context); |           pushPage(DangerWaitListPage(DangerType.wait, 2), context); | ||||||
|  | @ -730,4 +735,25 @@ class _HomePageState extends State<HomePage> { | ||||||
|       ), |       ), | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   Future<bool> _getIsRest( )async { | ||||||
|  |     try { | ||||||
|  |       final raw = await ApiService.getIsRest(); | ||||||
|  |       if (raw['result'] == 'success') { | ||||||
|  |         if(  raw['ISREST']=="1"){ | ||||||
|  |           return true; | ||||||
|  |         }else{ | ||||||
|  |           return false; | ||||||
|  |         } | ||||||
|  |       }else{ | ||||||
|  |         return false; | ||||||
|  |       } | ||||||
|  |     } catch (e) { | ||||||
|  |       // 出错时可以 Toast 或者在页面上显示错误状态 | ||||||
|  |       print('加载头像数据失败:$e'); | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| import 'dart:ui'; | import 'dart:ui'; | ||||||
| 
 | 
 | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:intl/intl.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/danner_repain_item.dart'; | import 'package:qhd_prevention/customWidget/danner_repain_item.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/department_picker.dart'; | import 'package:qhd_prevention/customWidget/department_picker.dart'; | ||||||
| import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; | import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; | ||||||
|  | @ -293,7 +294,8 @@ class _DangerPageState extends State<DangerPage> | ||||||
|                         '排查周期:${item['PERIODNAME']}', |                         '排查周期:${item['PERIODNAME']}', | ||||||
|                         '包含检查项:${item['count']}', |                         '包含检查项:${item['count']}', | ||||||
|                         '负责人:${item['USER_NAME']}', |                         '负责人:${item['USER_NAME']}', | ||||||
|                         '起始时间:${item['START_DATE']}-${item['END_DATE']}', |                         // '起始时间:${item['START_DATE']}-${item['END_DATE']}', | ||||||
|  |                         '起始时间:${changeTimeString(item['START_DATE'])}-${changeTimeString(item['END_DATE'])}', | ||||||
| 
 | 
 | ||||||
|                       ], |                       ], | ||||||
|                       showBottomTags: showBottomTags, |                       showBottomTags: showBottomTags, | ||||||
|  | @ -314,6 +316,15 @@ class _DangerPageState extends State<DangerPage> | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   String changeTimeString(String dataTime) { | ||||||
|  |     final dateFormat = DateFormat('yyyy-MM-dd'); | ||||||
|  |     // 先将字符串转换为 DateTime 对象 | ||||||
|  |     DateTime dateTime = DateTime.parse(dataTime); | ||||||
|  |     // 然后格式化 DateTime 对象 | ||||||
|  |     String newData = dateFormat.format(dateTime); | ||||||
|  |     return newData; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   Widget _itemCell(final item) { |   Widget _itemCell(final item) { | ||||||
|     return Padding( |     return Padding( | ||||||
|       padding: EdgeInsets.only(left: 15, right: 15, bottom: 15), |       padding: EdgeInsets.only(left: 15, right: 15, bottom: 15), | ||||||
|  |  | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| import 'package:flutter/material.dart'; | import 'package:flutter/material.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/mine/mine_feedback_page.dart'; | import 'package:qhd_prevention/pages/mine/mine_feedback_page.dart'; | ||||||
| import 'package:qhd_prevention/pages/mine/webViewPage.dart'; | import 'package:qhd_prevention/pages/mine/webViewPage.dart'; | ||||||
|  | @ -57,6 +58,25 @@ class _MinePageState extends State<MinePage> { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |   Future<bool> _getIsRest( )async { | ||||||
|  |     try { | ||||||
|  |       final raw = await ApiService.getIsRest(); | ||||||
|  |       if (raw['result'] == 'success') { | ||||||
|  |         if(  raw['ISREST']=="1"){ | ||||||
|  |           return true; | ||||||
|  |         }else{ | ||||||
|  |           return false; | ||||||
|  |         } | ||||||
|  |       }else{ | ||||||
|  |         return false; | ||||||
|  |       } | ||||||
|  |     } catch (e) { | ||||||
|  |       // 出错时可以 Toast 或者在页面上显示错误状态 | ||||||
|  |       print('加载头像数据失败:$e'); | ||||||
|  |       return false; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|   @override |   @override | ||||||
|   Widget build(BuildContext context) { |   Widget build(BuildContext context) { | ||||||
|  | @ -99,7 +119,13 @@ class _MinePageState extends State<MinePage> { | ||||||
|         SizedBox(height: 10,), |         SizedBox(height: 10,), | ||||||
|         GestureDetector( |         GestureDetector( | ||||||
|           child: _setItemWidget("离岗"), |           child: _setItemWidget("离岗"), | ||||||
|           onTap: () { |           onTap: () async { | ||||||
|  | 
 | ||||||
|  |             bool isRest= await _getIsRest(); | ||||||
|  |             if(isRest){ | ||||||
|  |               ToastUtil.showNormal(context, "您已经处于离岗状态中"); | ||||||
|  |               return; | ||||||
|  |             } | ||||||
|             pushPage(MineDepartureListPage(), context); |             pushPage(MineDepartureListPage(), context); | ||||||
|           }, |           }, | ||||||
|         ), |         ), | ||||||
|  |  | ||||||
|  | @ -1,7 +1,6 @@ | ||||||
| import 'dart:convert'; | import 'dart:convert'; | ||||||
| import 'package:encrypt/encrypt.dart' as encrypt; | import 'package:encrypt/encrypt.dart' as encrypt; | ||||||
| import 'package:pointycastle/asymmetric/api.dart' show RSAPublicKey; | import 'package:pointycastle/asymmetric/api.dart' show RSAPublicKey; | ||||||
| import 'package:qhd_prevention/customWidget/toast_util.dart'; |  | ||||||
| import 'package:qhd_prevention/tools/tools.dart'; | import 'package:qhd_prevention/tools/tools.dart'; | ||||||
| import 'package:shared_preferences/shared_preferences.dart'; | import 'package:shared_preferences/shared_preferences.dart'; | ||||||
| import 'package:fluttertoast/fluttertoast.dart'; | import 'package:fluttertoast/fluttertoast.dart'; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue