Merge remote-tracking branch 'origin/main'

# Conflicts:
#	lib/services/auth_service.dart
main
hs 2025-08-29 10:04:16 +08:00
commit a5a8a7ef34
18 changed files with 233 additions and 46 deletions

View File

@ -312,7 +312,7 @@ U6Hzm1ninpWeE+awIDAQAB
static Future<Map<String, dynamic>> getHiddenRoll() {
return HttpManager().request(
basePath,
'/app/hidden/getHiddenByCorp',
'/app/offduty/isRest',
method: Method.post,
data: {
'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 --------------------------------- ---------------------------------
///
static Future<Map<String, dynamic>> getStudyList(int page) {

View File

@ -152,7 +152,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppbar(title: "隐患等级"),
appBar: MyAppbar(title: "隐患登记"),
body: Column(
children: [
//
@ -510,7 +510,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
}
Future<void> _riskListCheckAppAdd() async {
LoadingDialogHelper.show();
if(_yinHuanImages.isEmpty){
ToastUtil.showNormal(context, "请上传隐患图片");
return;
@ -576,6 +576,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
}
LoadingDialogHelper.show();
String yinHuanTypeIds="";
String yinHuanTypeNames="";
for(int i=0;i<_yinHuanTypeIds.length;i++){
@ -645,7 +646,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
// yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
// yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
String hiddenId = result['pd']['HIDDEN_ID'] ;
@ -669,7 +670,7 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
ToastUtil.showNormal(context, "提交成功");
Navigator.pop(context);
widget.onClose(hiddenId,_standardController.text.trim());
LoadingDialogHelper.hide();
});
}
} catch (e) {

View File

@ -151,7 +151,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppbar(title: "隐患等级"),
appBar: MyAppbar(title: "隐患登记"),
body: Column(
children: [
//
@ -509,7 +509,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
}
Future<void> _riskListCheckAppAdd() async {
LoadingDialogHelper.show();
if(_yinHuanImages.isEmpty){
ToastUtil.showNormal(context, "请上传隐患图片");
return;
@ -575,6 +575,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
}
LoadingDialogHelper.show();
String yinHuanTypeIds="";
String yinHuanTypeNames="";
for(int i=0;i<_yinHuanTypeIds.length;i++){
@ -633,7 +634,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
LoadingDialogHelper.hide();
if (result['result'] == 'success') {
String hiddenId = result['pd']['HIDDEN_ID'] ;
@ -652,7 +653,7 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
_addImgFiles(_zhengGaiImages[i],"4",hiddenId);
}
}
LoadingDialogHelper.hide();
setState(() {
ToastUtil.showNormal(context, "提交成功");
Navigator.pop(context);

View File

@ -439,7 +439,7 @@ class _QuickReportPageState extends State<QuickReportPage> {
}
if(_hazardLeve.isEmpty){
if(_hazardLeve==null||_hazardLeve.isEmpty){
ToastUtil.showNormal(context, "请选择隐患级别");
return;
}

View File

@ -1,4 +1,6 @@
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/quick_report_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:
//
bool isRest= await _getIsRest();
if(isRest){
ToastUtil.showNormal(context, "您已经处于离岗状态中");
return;
}
pushPage(DangerPage(1), context);
break;
case AppItem.checkRecord:
@ -73,6 +80,11 @@ class _ApplicationPageState extends State<ApplicationPage> {
break;
case AppItem.supervisionRectification:
//
bool isRest= await _getIsRest();
if(isRest){
ToastUtil.showNormal(context, "您已经处于离岗状态中");
return;
}
pushPage(DangerPage(2), context);
//Navigator.push(context, MaterialPageRoute(builder: (_) => SupervisionRectificationPage()));
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;
}
}
}

View File

@ -35,7 +35,14 @@ class CheckingInformationOnePage extends StatefulWidget {
class _CheckingInformationOnePageState extends State<CheckingInformationOnePage> {
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 = [];
@ -60,7 +67,8 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
dataTime=DateFormat('yyyy-MM-dd').format(now);
stringTime=DateFormat('HH:mm').format(now);
_getData();
//
// _getData();
}

View File

@ -421,7 +421,7 @@ class DannerRepairState extends State<DannerRepair> {
borderRadius: BorderRadius.circular(5),
),
child: ListItemFactory.createRowSpaceBetweenItem(
leftText: "整改部门",
leftText: "验收部门",
rightText: departments[index].department.isNotEmpty?departments[index].department:"请选择",
isRight: true,
),
@ -462,7 +462,7 @@ class DannerRepairState extends State<DannerRepair> {
borderRadius: BorderRadius.circular(5),
),
child: ListItemFactory.createRowSpaceBetweenItem(
leftText: "整改负责人",
leftText: "验收部门负责人",
rightText: departments[index].responsible.isNotEmpty?departments[index].responsible:"请选择",
isRight: true,
),

View File

@ -179,10 +179,10 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
return Scaffold(
appBar: MyAppbar(title: widget.dangerType.detailTitle),
body: pd.isEmpty
? const Center(child: CircularProgressIndicator())
? Container(color: Colors.white,child: Center(child: CircularProgressIndicator(),))
: LayoutBuilder(
builder: (context, constraints) {
return SingleChildScrollView(
return Container(color: Colors.white,child:SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
@ -381,6 +381,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
),
),
),
),
);
},
),
@ -393,8 +394,6 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
return SizedBox(
child: Column(
children: [
_getRepairState(),
//
// _accepted ? _getRepairState() : _noAccepet_repair(_accepted),
@ -419,21 +418,15 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
Widget _getRepairState() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5),
),
child: Column(
return Column(
children: [
ListItemFactory.createBuildSimpleSection("隐患验收"),
ListItemFactory.createBuildSimpleSection("隐患验收",horPadding:0),
Divider(height: 1),
ListItemFactory.createYesNoSection(
horizontalPadding: 5,
horizontalPadding: 0,
title: '是否合格',
yesLabel: '',
noLabel: '',
@ -451,7 +444,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
Divider(),
Container(
height: 130,
padding: EdgeInsets.all(15),
padding: EdgeInsets.only(top: 15,bottom: 15),
child: Column(
children: [
Row(
@ -499,7 +492,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
// );
},
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 15),
padding: EdgeInsets.symmetric(horizontal: 0),
child: ListItemFactory.createRowSpaceBetweenItem(
leftText: "验收日期",
rightText: dataTime.isEmpty?"请选择":dataTime,
@ -527,7 +520,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
],
),
);
}

View File

@ -36,6 +36,8 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
List<dynamic> files6 = [];
List<dynamic> videoList = [];
List<dynamic> checkList = [];
List<String> files7 = [];
bool modalShow = false;
String videoSrc = "";
@ -90,6 +92,11 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
}
files6 = data['yImgs'] ?? [];
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),
],
@ -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) {
switch (source) {
case '1': return '隐患快报';
case '2': return '隐患排查清单检查';

View File

@ -213,14 +213,14 @@ class _PendingRectificationDetailPageState extends State<PendingRectificationDet
Divider(height: 1),
//
if (pd['SOURCE'] == '2') ...[
_buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''),
Divider(height: 1),
_buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''),
Divider(height: 1),
_buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''),
Divider(height: 1),
_buildInfoItem('风险分级', pd['LEVEL'] ?? ''),
Divider(height: 1),
// _buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''),
// Divider(height: 1),
// _buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''),
// Divider(height: 1),
// _buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''),
// Divider(height: 1),
// _buildInfoItem('风险分级', pd['LEVEL'] ?? ''),
// Divider(height: 1),
_buildInfoItem('检查内容', pd['CHECK_CONTENT'] ?? ''),
Divider(height: 1),
],

View File

@ -297,7 +297,7 @@ class _CommitmentWorkshopDetailPageState extends State<CommitmentWorkshopDetailP
),
const SizedBox(width: 15),
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,),
],
),

View File

@ -225,7 +225,7 @@ class _CompanySafetyCommitmentDetailState extends State<CompanySafetyCommitmentD
),
const SizedBox(width: 15),
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,),
],
),

View File

@ -301,7 +301,7 @@ class _TeamSafetyCommitmentDetailState extends State<TeamSafetyCommitmentDetail>
),
const SizedBox(width: 15),
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,),
],
),

View File

@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/customWidget/danner_repain_item.dart';
import 'package:qhd_prevention/customWidget/department_picker.dart';
import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
@ -81,6 +82,8 @@ class _HomeDangerPageState extends State<HomeDangerPage>
}
Future<void> _getHazardInvestigationList() async {
try {
@ -264,7 +267,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
'排查周期:${item['PERIODNAME']}',
'包含检查项:${item['count']}',
'负责人:${item['USER_NAME']}',
'起始时间:${item['START_DATE']}-${item['END_DATE']}',
'起始时间:${changeTimeString(item['START_DATE'])}-${changeTimeString(item['END_DATE'])}',
],
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) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15, bottom: 15),
@ -401,6 +413,7 @@ class _HomeDangerPageState extends State<HomeDangerPage>
}
//
class NotificationItem {
final String title;

View File

@ -679,8 +679,13 @@ class _HomePageState extends State<HomePage> {
required int index,
}) {
return GestureDetector(
onTap: () {
onTap: () async {
if (index == 1) {
bool isRest= await _getIsRest();
if(isRest){
ToastUtil.showNormal(context, "您已经处于离岗状态中");
return;
}
pushPage(HomeDangerPage(), context);
} else if (index == 2) {
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;
}
}
}

View File

@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/customWidget/danner_repain_item.dart';
import 'package:qhd_prevention/customWidget/department_picker.dart';
import 'package:qhd_prevention/customWidget/search_bar_widget.dart';
@ -293,7 +294,8 @@ class _DangerPageState extends State<DangerPage>
'排查周期:${item['PERIODNAME']}',
'包含检查项:${item['count']}',
'负责人:${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,
@ -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) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15, bottom: 15),

View File

@ -1,4 +1,5 @@
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/mine/mine_feedback_page.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
Widget build(BuildContext context) {
@ -99,7 +119,13 @@ class _MinePageState extends State<MinePage> {
SizedBox(height: 10,),
GestureDetector(
child: _setItemWidget("离岗"),
onTap: () {
onTap: () async {
bool isRest= await _getIsRest();
if(isRest){
ToastUtil.showNormal(context, "您已经处于离岗状态中");
return;
}
pushPage(MineDepartureListPage(), context);
},
),

View File

@ -1,7 +1,6 @@
import 'dart:convert';
import 'package:encrypt/encrypt.dart' as encrypt;
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:shared_preferences/shared_preferences.dart';
import 'package:fluttertoast/fluttertoast.dart';