2025.8.7 隐患排查完成,隐患排查成功后,表单还在
parent
5365a91e49
commit
d0d8ca36ee
|
@ -2027,7 +2027,7 @@ U6Hzm1ninpWeE+awIDAQAB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// 提交排查项
|
/// 获取排查项
|
||||||
static Future<Map<String, dynamic>> getCheckInformationList(String id) {
|
static Future<Map<String, dynamic>> getCheckInformationList(String id) {
|
||||||
return HttpManager().request(
|
return HttpManager().request(
|
||||||
basePath,
|
basePath,
|
||||||
|
@ -2114,5 +2114,213 @@ U6Hzm1ninpWeE+awIDAQAB
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取隐患排查排查项
|
||||||
|
static Future<Map<String, dynamic>> getInvestigationItemsYinHuan(final item) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/listmanager/goCheck',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"LISTMANAGER_ID": item["LISTMANAGER_ID"],
|
||||||
|
"IDENTIFICATIONPARTS_ID": item["IDENTIFICATIONPARTS_ID"],
|
||||||
|
"USER_NAME": SessionService.instance.username,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID":SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 获取隐患排查暂存隐患记录
|
||||||
|
static Future<Map<String, dynamic>> getYinHuanTemporaryStorageOfHidden(String id) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/hidden/goRiskListCheckEdit',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"HIDDEN_ID": id,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID":SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 暂存隐患排查隐患记录
|
||||||
|
static Future<Map<String, dynamic>> temporaryStorageOfHiddenYinHuan(
|
||||||
|
String msg,item,unqualifiedInspectionItemID,
|
||||||
|
String hazardDescription,String partDescription,String latitude,String longitude,
|
||||||
|
String dangerDetail,String dataTime,String type,String responsibleId,
|
||||||
|
String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId,
|
||||||
|
String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,result) {
|
||||||
|
print("======>$type");
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/hidden/$msg',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"HIDDEN_ID":unqualifiedInspectionItemID,
|
||||||
|
"SOURCE": '2',
|
||||||
|
"STATE": '0',
|
||||||
|
|
||||||
|
"HIDDEN_CATEGORY": result["HIDDEN_CATEGORY"] ?? '',
|
||||||
|
"LISTMANAGER_ID": item["LISTMANAGER_ID"],
|
||||||
|
"RISKITEM_ID": result["LISTCHECKITEM_ID"],
|
||||||
|
"CHECK_CONTENT": item["CHECK_CONTENT"]??"",
|
||||||
|
"RECORDITEM_ID": item["RECORDITEM_ID"]??"",
|
||||||
|
|
||||||
|
"HIDDENDESCR": hazardDescription,
|
||||||
|
"HIDDENPART": partDescription,
|
||||||
|
"LATITUDE": latitude,
|
||||||
|
"LONGITUDE": longitude,
|
||||||
|
|
||||||
|
"RECTIFYDESCR": dangerDetail,
|
||||||
|
"RECTIFICATIONDEADLINE": dataTime,
|
||||||
|
"RECTIFICATIONTYPE": type,
|
||||||
|
"RECTIFICATIONOR": responsibleId,
|
||||||
|
|
||||||
|
"HIDDENTYPE": yinHuanTypeIds,
|
||||||
|
"HIDDENLEVEL":hazardLeve,
|
||||||
|
"RECTIFICATIONDEPT": buMenId,
|
||||||
|
"HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId,
|
||||||
|
|
||||||
|
"CREATOR": SessionService.instance.loginUserId,
|
||||||
|
"CLEARIMG": '1',
|
||||||
|
"HIDDENTYPE_NAME": yinHuanTypeNames,
|
||||||
|
"HIDDENTYPE1": hiddenType1 ,
|
||||||
|
"HIDDENTYPE2": hiddenType2 ,
|
||||||
|
"HIDDENTYPE3": hiddenType3 ,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 提交隐患排查排查项
|
||||||
|
static Future<Map<String, dynamic>> submitInvestigationItemsYinHuan(
|
||||||
|
item,String longitude,String latitude,
|
||||||
|
String itemsString,String idsString,String checkrecordId,) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/checkrecord/add',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
// "CUSTOM_ID": item["CUSTOM_ID"],
|
||||||
|
"LISTMANAGER_ID": item["LISTMANAGER_ID"],
|
||||||
|
"LIST_NAME": SessionService.instance.listItemNameJson,
|
||||||
|
"CREATOR": SessionService.instance.username,
|
||||||
|
"LATITUDE": latitude,
|
||||||
|
"LONGITUDE": longitude,
|
||||||
|
"ITEMS": itemsString,
|
||||||
|
"IDS": idsString,
|
||||||
|
"CHECKRECORD_ID": checkrecordId,
|
||||||
|
"tm": DateTime.now().millisecondsSinceEpoch.toString(),
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取隐患排查项
|
||||||
|
static Future<Map<String, dynamic>> getCheckInformationListYinHuan(String id) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/hidden/getOtherHidden',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"LISTMANAGER_ID": id,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 提交隐患排查项
|
||||||
|
static Future<Map<String, dynamic>> customCheckRecordFinishYinHuan(String time,String text,
|
||||||
|
String CHECKRECORD_ID,String id,String json) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/checkrecord/finish',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"CHECK_TIME": time,
|
||||||
|
"DESCR": text,
|
||||||
|
"CHECKRECORD_ID": CHECKRECORD_ID,
|
||||||
|
"LISTMANAGER_ID": id,
|
||||||
|
"OTHER": json,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// 获取暂存隐患记录
|
||||||
|
static Future<Map<String, dynamic>> getTemporaryStorageOfHiddenYinHuan(String id) {
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/customHidden/goEdit',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
"HIDDEN_ID": id,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID":SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 暂存其他隐患记录
|
||||||
|
static Future<Map<String, dynamic>> checkInformationOneItemDataYinHuan(
|
||||||
|
String msg,String id,unqualifiedInspectionItemID,
|
||||||
|
String hazardDescription,String partDescription,String latitude,String longitude,
|
||||||
|
String dangerDetail,String dataTime,String type,String responsibleId,
|
||||||
|
String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId,
|
||||||
|
String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,) {
|
||||||
|
print("======>$type");
|
||||||
|
return HttpManager().request(
|
||||||
|
basePath,
|
||||||
|
'/app/hidden/$msg',
|
||||||
|
method: Method.post,
|
||||||
|
data: {
|
||||||
|
|
||||||
|
"HIDDEN_ID":unqualifiedInspectionItemID,
|
||||||
|
"SOURCE": '3',
|
||||||
|
"STATE": '0',
|
||||||
|
|
||||||
|
"HIDDENDESCR": hazardDescription,
|
||||||
|
"HIDDENPART": partDescription,
|
||||||
|
"LATITUDE": latitude,
|
||||||
|
"LONGITUDE": longitude,
|
||||||
|
|
||||||
|
"RECTIFYDESCR": dangerDetail,
|
||||||
|
"RECTIFICATIONDEADLINE": dataTime,
|
||||||
|
"RECTIFICATIONTYPE": type,
|
||||||
|
"RECTIFICATIONOR": responsibleId,
|
||||||
|
|
||||||
|
"HIDDENTYPE": yinHuanTypeIds,
|
||||||
|
"HIDDENLEVEL":hazardLeve,
|
||||||
|
"RECTIFICATIONDEPT": buMenId,
|
||||||
|
"HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId,
|
||||||
|
|
||||||
|
"CREATOR": SessionService.instance.loginUserId,
|
||||||
|
"LISTMANAGER_ID": id,
|
||||||
|
"HIDDENTYPE_NAME": yinHuanTypeNames,
|
||||||
|
"HIDDENTYPE1": hiddenType1 ,
|
||||||
|
"HIDDENTYPE2": hiddenType2 ,
|
||||||
|
"HIDDENTYPE3": hiddenType3 ,
|
||||||
|
"CORPINFO_ID": SessionService.instance.corpinfoId,
|
||||||
|
"USER_ID": SessionService.instance.loginUserId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,9 @@ import '../../../customWidget/photo_picker_row.dart';
|
||||||
import '../../../http/ApiService.dart';
|
import '../../../http/ApiService.dart';
|
||||||
|
|
||||||
class CheckInformationOneItem extends StatefulWidget {
|
class CheckInformationOneItem extends StatefulWidget {
|
||||||
const CheckInformationOneItem(this.id,this.item, this.result, {super.key,required this.onClose});
|
const CheckInformationOneItem(this.id,this.item, this.result, this.type, {super.key,required this.onClose});
|
||||||
|
|
||||||
|
final int type;
|
||||||
final String id;
|
final String id;
|
||||||
final item;
|
final item;
|
||||||
final Map<String, dynamic> result;
|
final Map<String, dynamic> result;
|
||||||
|
@ -620,12 +621,29 @@ class _CheckInformationOneItemState extends State<CheckInformationOneItem> {
|
||||||
// yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
// yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
// yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
// yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
||||||
|
|
||||||
final result = await ApiService.checkInformationOneItemData(
|
|
||||||
unqualifiedInspectionItemID.isNotEmpty?"edit":"add",listId,unqualifiedInspectionItemID,
|
final Map<String, dynamic> result;
|
||||||
hazardDescription, partDescription, latitude, longitude,
|
if(widget.type==1){
|
||||||
dangerDetail, dataTime, type, responsibleId,
|
result = await ApiService.checkInformationOneItemDataYinHuan(
|
||||||
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
unqualifiedInspectionItemID.isNotEmpty?"riskListCheckEdit":"riskListCheckAdd",listId,unqualifiedInspectionItemID,
|
||||||
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
hazardDescription, partDescription, latitude, longitude,
|
||||||
|
dangerDetail, dataTime, type, responsibleId,
|
||||||
|
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
|
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
||||||
|
}else{
|
||||||
|
result = await ApiService.checkInformationOneItemData(
|
||||||
|
unqualifiedInspectionItemID.isNotEmpty?"edit":"add",listId,unqualifiedInspectionItemID,
|
||||||
|
hazardDescription, partDescription, latitude, longitude,
|
||||||
|
dangerDetail, dataTime, type, responsibleId,
|
||||||
|
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
|
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
||||||
|
}
|
||||||
|
// final result = await ApiService.checkInformationOneItemData(
|
||||||
|
// unqualifiedInspectionItemID.isNotEmpty?"edit":"add",listId,unqualifiedInspectionItemID,
|
||||||
|
// hazardDescription, partDescription, latitude, longitude,
|
||||||
|
// dangerDetail, dataTime, type, responsibleId,
|
||||||
|
// yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
|
// yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
||||||
|
|
||||||
|
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
|
@ -20,9 +20,10 @@ import '../../../customWidget/photo_picker_row.dart';
|
||||||
import '../../../http/ApiService.dart';
|
import '../../../http/ApiService.dart';
|
||||||
|
|
||||||
class HazardRegistrationPage extends StatefulWidget {
|
class HazardRegistrationPage extends StatefulWidget {
|
||||||
const HazardRegistrationPage(this.item, this.result, {super.key,required this.onClose});
|
const HazardRegistrationPage(this.item, this.result, this.type, {super.key,required this.onClose});
|
||||||
|
|
||||||
final item;
|
final item;
|
||||||
|
final int type;
|
||||||
final Map<String, dynamic> result;
|
final Map<String, dynamic> result;
|
||||||
final Function(String,String) onClose;
|
final Function(String,String) onClose;
|
||||||
@override
|
@override
|
||||||
|
@ -612,12 +613,27 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
||||||
String latitude=position.latitude.toString();
|
String latitude=position.latitude.toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = await ApiService.temporaryStorageOfHidden(
|
|
||||||
unqualifiedInspectionItemID.isNotEmpty?"edit":"add",widget.item,unqualifiedInspectionItemID,
|
final Map<String, dynamic> result;
|
||||||
hazardDescription, partDescription, latitude, longitude,
|
if(widget.type==1){
|
||||||
dangerDetail, dataTime, type, responsibleId,
|
result = await ApiService.temporaryStorageOfHiddenYinHuan(
|
||||||
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
unqualifiedInspectionItemID.isNotEmpty?"riskListCheckEdit":"riskListCheckAdd",widget.item,unqualifiedInspectionItemID,
|
||||||
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
hazardDescription, partDescription, latitude, longitude,
|
||||||
|
dangerDetail, dataTime, type, responsibleId,
|
||||||
|
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
|
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,widget.result);
|
||||||
|
}else{
|
||||||
|
result = await ApiService.temporaryStorageOfHidden(
|
||||||
|
unqualifiedInspectionItemID.isNotEmpty?"edit":"add",widget.item,unqualifiedInspectionItemID,
|
||||||
|
hazardDescription, partDescription, latitude, longitude,
|
||||||
|
dangerDetail, dataTime, type, responsibleId,
|
||||||
|
yinHuanTypeIds, hazardLeve, buMenId, buMenPDId,
|
||||||
|
yinHuanTypeNames, hiddenType1, hiddenType2, hiddenType3,);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
String hiddenId = result['pd']['HIDDEN_ID'] ;
|
String hiddenId = result['pd']['HIDDEN_ID'] ;
|
||||||
|
|
|
@ -22,8 +22,9 @@ import 'danner_repair.dart';
|
||||||
|
|
||||||
|
|
||||||
class CheckingInformationOnePage extends StatefulWidget {
|
class CheckingInformationOnePage extends StatefulWidget {
|
||||||
const CheckingInformationOnePage(this.id,this.checkrecordId, {super.key});
|
const CheckingInformationOnePage(this.id,this.checkrecordId,this.type, {super.key});
|
||||||
|
|
||||||
|
final int type;
|
||||||
final String id;
|
final String id;
|
||||||
final String checkrecordId;
|
final String checkrecordId;
|
||||||
|
|
||||||
|
@ -57,9 +58,57 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
||||||
final now =DateTime.now();
|
final now =DateTime.now();
|
||||||
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);
|
||||||
_getCheckInformationList();
|
|
||||||
|
_getData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void _getData(){
|
||||||
|
listDates.clear();
|
||||||
|
switch(widget.type ){
|
||||||
|
case 1://隐患排查
|
||||||
|
_getCheckInformationListYinHuan();
|
||||||
|
break;
|
||||||
|
case 2://标准排查
|
||||||
|
_getCheckInformationList();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> _getCheckInformationListYinHuan() async {
|
||||||
|
try {
|
||||||
|
|
||||||
|
final result = await ApiService.getCheckInformationListYinHuan(widget.id);
|
||||||
|
if (result['result'] == 'success') {
|
||||||
|
final List<dynamic> newList = result['hiddenList'] ?? [];
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
CHECKRECORD_ID= result['CHECKRECORD_ID'];
|
||||||
|
listDates.addAll(newList);//"HIDDENDESCR" -> "3111111"
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
try{
|
||||||
|
otherHidden.add(DepartmentEntry(department: listDates[i]["HIDDENDESCR"], responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'] ,responsibleId:''));
|
||||||
|
}catch(e){
|
||||||
|
otherHidden.add(DepartmentEntry(department: "", responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'],responsibleId:''));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{
|
||||||
|
ToastUtil.showNormal(context, "加载数据失败");
|
||||||
|
// _showMessage('加载数据失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
|
print('加载数据失败:$e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<void> _getCheckInformationList() async {
|
Future<void> _getCheckInformationList() async {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -513,10 +562,18 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
||||||
void _selectItem(final item,int index) {
|
void _selectItem(final item,int index) {
|
||||||
String hiddenId=item.departmentId;
|
String hiddenId=item.departmentId;
|
||||||
if(hiddenId.isNotEmpty) {
|
if(hiddenId.isNotEmpty) {
|
||||||
_getTemporaryStorageOfHidden(item,hiddenId,index);
|
switch(widget.type ) {
|
||||||
|
case 1: //隐患排查
|
||||||
|
_getTemporaryStorageOfHiddenYinHuan(item, hiddenId, index);
|
||||||
|
break;
|
||||||
|
case 2: //标准排查
|
||||||
|
_getTemporaryStorageOfHidden(item, hiddenId, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
pushPage(CheckInformationOneItem(
|
pushPage(CheckInformationOneItem(
|
||||||
widget.id,item,nullResult,
|
widget.id,item,nullResult,widget.type,
|
||||||
onClose: (String departmentId,String yinHuanText) {
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// this.yinHuanText=yinHuanText;
|
// this.yinHuanText=yinHuanText;
|
||||||
|
@ -533,6 +590,36 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> _getTemporaryStorageOfHiddenYinHuan( item,String hiddenId,int index) async {
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = await ApiService.getYinHuanTemporaryStorageOfHidden(hiddenId);
|
||||||
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
|
pushPage(CheckInformationOneItem(
|
||||||
|
widget.id,item,result,widget.type,
|
||||||
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
|
setState(() {
|
||||||
|
// this.yinHuanText=yinHuanText;
|
||||||
|
// unqualifiedInspectionItemID=departmentId;
|
||||||
|
otherHidden[index].department=yinHuanText;
|
||||||
|
otherHidden[index].departmentId=departmentId;
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
), context);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ToastUtil.showNormal(context, "加载数据失败");
|
||||||
|
// _showMessage('加载数据失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
|
print('加载数据失败:$e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _getTemporaryStorageOfHidden( item,String hiddenId,int index) async {
|
Future<void> _getTemporaryStorageOfHidden( item,String hiddenId,int index) async {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -540,7 +627,7 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
pushPage(CheckInformationOneItem(
|
pushPage(CheckInformationOneItem(
|
||||||
widget.id,item,result,
|
widget.id,item,result,widget.type,
|
||||||
onClose: (String departmentId,String yinHuanText) {
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// this.yinHuanText=yinHuanText;
|
// this.yinHuanText=yinHuanText;
|
||||||
|
@ -621,7 +708,13 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
|
||||||
// 转换为 JSON 字符串
|
// 转换为 JSON 字符串
|
||||||
String json = _convertDepartmentsToJson(departments);
|
String json = _convertDepartmentsToJson(departments);
|
||||||
|
|
||||||
final result = await ApiService.customCheckRecordFinish(time,text,CHECKRECORD_ID,widget.id,json);
|
final Map<String, dynamic> result;
|
||||||
|
if(widget.type==1){
|
||||||
|
result = await ApiService.customCheckRecordFinishYinHuan(time,text,CHECKRECORD_ID,widget.id,json);
|
||||||
|
}else{
|
||||||
|
result = await ApiService.customCheckRecordFinish(time,text,CHECKRECORD_ID,widget.id,json);
|
||||||
|
}
|
||||||
|
// final result = await ApiService.customCheckRecordFinish(time,text,CHECKRECORD_ID,widget.id,json);
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
@ -208,7 +208,8 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
pushPage(ScanPage(), context);
|
// pushPage(ScanPage(), context);
|
||||||
|
_goScan();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"清单扫描",
|
"清单扫描",
|
||||||
|
@ -378,6 +379,37 @@ class _HomeDangerPageState extends State<HomeDangerPage>
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> _goScan() async {
|
||||||
|
final result = await Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (_) => ScanPage()),
|
||||||
|
);
|
||||||
|
|
||||||
|
dynamic item;
|
||||||
|
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
final listItem= listDates[i];
|
||||||
|
String code="";
|
||||||
|
switch(_selectedTab){
|
||||||
|
case 0://隐患排查
|
||||||
|
code= listItem["LISTMANAGER_ID"];
|
||||||
|
break;
|
||||||
|
case 1://标准排查
|
||||||
|
code= listItem["CUSTOM_ID"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(code==result){
|
||||||
|
item=listItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleItemTap(item,0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模拟数据模版
|
// 模拟数据模版
|
||||||
|
|
|
@ -48,22 +48,23 @@ class _ScanPageState extends State<ScanPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showResult(String code) {
|
void _showResult(String code) {
|
||||||
showDialog(
|
Navigator.of(context).pop(code);
|
||||||
context: context,
|
// showDialog(
|
||||||
builder: (_) => AlertDialog(
|
// context: context,
|
||||||
title: const Text('扫描结果'),
|
// builder: (_) => AlertDialog(
|
||||||
content: Text(code),
|
// title: const Text('扫描结果'),
|
||||||
actions: [
|
// content: Text(code),
|
||||||
TextButton(
|
// actions: [
|
||||||
onPressed: () {
|
// TextButton(
|
||||||
Navigator.of(context).pop();
|
// onPressed: () {
|
||||||
_controller.start(); // 恢复扫码
|
// Navigator.of(context).pop(code);
|
||||||
},
|
// _controller.start(); // 恢复扫码
|
||||||
child: const Text('确定'),
|
// },
|
||||||
),
|
// child: const Text('确定'),
|
||||||
],
|
// ),
|
||||||
),
|
// ],
|
||||||
);
|
// ),
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -96,11 +96,11 @@ class _DangerPageState extends State<DangerPage>
|
||||||
listTwo.clear();
|
listTwo.clear();
|
||||||
switch(widget.type ){
|
switch(widget.type ){
|
||||||
case 1://隐患排查
|
case 1://隐患排查
|
||||||
appBarTitle="隐患排查";
|
appBarTitle="隐患排查清单";
|
||||||
_getHazardInvestigationList();
|
_getHazardInvestigationList();
|
||||||
break;
|
break;
|
||||||
case 2://标准排查
|
case 2://标准排查
|
||||||
appBarTitle="标准排查";
|
appBarTitle="标准排查清单";
|
||||||
_getStandardInvestigationList();
|
_getStandardInvestigationList();
|
||||||
break;
|
break;
|
||||||
// case 3://首页-待排查
|
// case 3://首页-待排查
|
||||||
|
@ -225,7 +225,9 @@ class _DangerPageState extends State<DangerPage>
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
pushPage(ScanPage(), context);
|
// pushPage(ScanPage(), context);
|
||||||
|
_goScan();
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
"清单扫描",
|
"清单扫描",
|
||||||
|
@ -395,8 +397,38 @@ class _DangerPageState extends State<DangerPage>
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _goScan() async {
|
||||||
|
final result = await Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (_) => ScanPage()),
|
||||||
|
);
|
||||||
|
|
||||||
|
dynamic item;
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
final listItem= listDates[i];
|
||||||
|
String code="";
|
||||||
|
switch(widget.type ){
|
||||||
|
case 1://隐患排查
|
||||||
|
code= listItem["LISTMANAGER_ID"];
|
||||||
|
break;
|
||||||
|
case 2://标准排查
|
||||||
|
code= listItem["CUSTOM_ID"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(code==result){
|
||||||
|
item=listItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleItemTap(item,0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 模拟数据模版
|
// 模拟数据模版
|
||||||
class NotificationItem {
|
class NotificationItem {
|
||||||
final String title;
|
final String title;
|
||||||
|
|
|
@ -12,8 +12,9 @@ import 'package:qhd_prevention/tools/tools.dart';
|
||||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||||
|
|
||||||
class DangerProjectPage extends StatefulWidget {
|
class DangerProjectPage extends StatefulWidget {
|
||||||
const DangerProjectPage(this.item, {super.key});
|
const DangerProjectPage(this.item, this.type, {super.key});
|
||||||
|
|
||||||
|
final int type;
|
||||||
final item;
|
final item;
|
||||||
@override
|
@override
|
||||||
State<DangerProjectPage> createState() => _DangerProjectPageState();
|
State<DangerProjectPage> createState() => _DangerProjectPageState();
|
||||||
|
@ -21,7 +22,7 @@ class DangerProjectPage extends StatefulWidget {
|
||||||
|
|
||||||
class _DangerProjectPageState extends State<DangerProjectPage> {
|
class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
// 单选按钮的值
|
// 单选按钮的值
|
||||||
String? _selectedValue;
|
// String? _selectedValue;
|
||||||
|
|
||||||
// 单选按钮选项
|
// 单选按钮选项
|
||||||
final List<Map<String, dynamic>> _options = [
|
final List<Map<String, dynamic>> _options = [
|
||||||
|
@ -46,7 +47,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
];
|
];
|
||||||
|
|
||||||
List<dynamic> listDates = [];
|
List<dynamic> listDates = [];
|
||||||
List<dynamic> listDatesTwo = [];
|
List<dynamic> listDatesSelect = [];
|
||||||
String unqualifiedInspectionItemID="";
|
String unqualifiedInspectionItemID="";
|
||||||
Map<String, dynamic> nullResult={};
|
Map<String, dynamic> nullResult={};
|
||||||
List<dynamic> upDataItemList=[];
|
List<dynamic> upDataItemList=[];
|
||||||
|
@ -60,19 +61,84 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
|
|
||||||
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
||||||
|
|
||||||
_getInvestigationItems();
|
_getData();
|
||||||
|
|
||||||
|
if(listDatesSelect.isNotEmpty){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void _getData(){
|
||||||
|
listDates.clear();
|
||||||
|
switch(widget.type ){
|
||||||
|
case 1://隐患排查
|
||||||
|
_getInvestigationItemsYinHuan();
|
||||||
|
break;
|
||||||
|
case 2://标准排查
|
||||||
|
_getInvestigationItems();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _getInvestigationItemsYinHuan( ) async {
|
||||||
|
try {
|
||||||
|
|
||||||
|
final result = await ApiService.getInvestigationItemsYinHuan(widget.item);
|
||||||
|
if (result['result'] == 'success') {
|
||||||
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
|
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
if(newListTwo.isNotEmpty){
|
||||||
|
if( newListTwo[0]["LISTCHECKITEM_ID"]==listDates[0]["LISTCHECKITEM_ID"]){
|
||||||
|
listDatesSelect.addAll(newListTwo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
listDates.addAll(newList);
|
||||||
|
// listDatesTwo.addAll(newListTwo);
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
(listDates[i] as Map<String, dynamic>)["ids"] ="";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}else{
|
||||||
|
ToastUtil.showNormal(context, result['msg']);
|
||||||
|
// _showMessage('加载数据失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
|
print('加载数据失败:$e');
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _getInvestigationItems( ) async {
|
Future<void> _getInvestigationItems( ) async {
|
||||||
try {
|
try {
|
||||||
listDates.clear();
|
|
||||||
final result = await ApiService.getInvestigationItems(widget.item);
|
final result = await ApiService.getInvestigationItems(widget.item);
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final List<dynamic> newList = result['varList'] ?? [];
|
final List<dynamic> newList = result['varList'] ?? [];
|
||||||
// final List<dynamic> newListTwo = result['records'] ?? [];
|
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
||||||
|
if(newListTwo.isNotEmpty){
|
||||||
|
if( newListTwo[0]["CUSTOM_ID"]==listDates[0]["CUSTOM_ID"]){
|
||||||
|
listDatesSelect.addAll(newListTwo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listDates.addAll(newList);
|
listDates.addAll(newList);
|
||||||
// listDatesTwo.addAll(newListTwo);
|
// listDatesTwo.addAll(newListTwo);
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
(listDates[i] as Map<String, dynamic>)["ids"] ="";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -114,7 +180,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
margin: const EdgeInsets.only(bottom: 20),
|
margin: const EdgeInsets.only(bottom: 20),
|
||||||
height: 50,
|
height: 50,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _selectedValue != null ? Colors.green : Colors.grey,
|
color: Colors.green ,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
|
@ -166,6 +232,15 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
if(widget.type==1)
|
||||||
|
Text(
|
||||||
|
"存在风险:${item["RISK_DESCR"]}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: Colors.grey[700],
|
||||||
|
height: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
// 问题描述
|
// 问题描述
|
||||||
Text(
|
Text(
|
||||||
"检查内容:${item["CHECK_CONTENT"]}",
|
"检查内容:${item["CHECK_CONTENT"]}",
|
||||||
|
@ -175,6 +250,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
height: 1.5,
|
height: 1.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if(widget.type==2)
|
||||||
Text(
|
Text(
|
||||||
"检查标准:${item["CHECK_STANDARD"]}",
|
"检查标准:${item["CHECK_STANDARD"]}",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -198,9 +274,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
screenWidth: screenWidth,
|
screenWidth: screenWidth,
|
||||||
item: item,
|
item: item,
|
||||||
onImageTap: () {
|
onImageTap: () {
|
||||||
if(_selectedValue=="option1") {
|
if(item["REFERENCE_BASIS"]=="option1") {
|
||||||
_getAlreadyUpImages(item);
|
_getAlreadyUpImages(item);
|
||||||
}else if(_selectedValue=="option2") {
|
}else if(item["REFERENCE_BASIS"]=="option2") {
|
||||||
_goUnqualifiedPage(item);
|
_goUnqualifiedPage(item);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -208,7 +284,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
|
||||||
if(_selectedValue=="option1")
|
if(item["REFERENCE_BASIS"]=="option1"&& widget.type==2)
|
||||||
Card(
|
Card(
|
||||||
color: const Color(0xFFF1F1F1),
|
color: const Color(0xFFF1F1F1),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -246,6 +322,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pushPage(DangerImageUpdataPage(item["RECORDITEM_ID"], imgList: imgList), context);
|
pushPage(DangerImageUpdataPage(item["RECORDITEM_ID"], imgList: imgList), context);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -269,7 +346,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
required dynamic item,
|
required dynamic item,
|
||||||
VoidCallback? onImageTap,
|
VoidCallback? onImageTap,
|
||||||
}) {
|
}) {
|
||||||
final isSelected = _selectedValue == value;
|
final isSelected = item["REFERENCE_BASIS"] == value;
|
||||||
final buttonWidth = (screenWidth - 60) / 3 - 10; // 计算按钮宽度
|
final buttonWidth = (screenWidth - 60) / 3 - 10; // 计算按钮宽度
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
|
@ -277,7 +354,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
setState(() {
|
setState(() {
|
||||||
if(value!="option2") {
|
if(value!="option2") {
|
||||||
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
||||||
_selectedValue = value;
|
// _selectedValue = value;
|
||||||
item["REFERENCE_BASIS"]=value;
|
item["REFERENCE_BASIS"]=value;
|
||||||
}else{
|
}else{
|
||||||
_goUnqualifiedPage(item);
|
_goUnqualifiedPage(item);
|
||||||
|
@ -305,8 +382,8 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],),
|
],),
|
||||||
if((value=="option1"&&_selectedValue=="option1")||
|
if((value=="option1"&&item["REFERENCE_BASIS"]=="option1")||
|
||||||
(value=="option2"&&_selectedValue=="option2"&&unqualifiedInspectionItemID.isNotEmpty))
|
(value=="option2"&&item["REFERENCE_BASIS"]=="option2"&&item["ids"].isNotEmpty))
|
||||||
// 添加图片点击处理
|
// 添加图片点击处理
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
@ -333,18 +410,29 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
|
|
||||||
|
|
||||||
void _goUnqualifiedPage(item) {
|
void _goUnqualifiedPage(item) {
|
||||||
String hiddenId=SessionService.instance.unqualifiedInspectionItemID.toString();
|
// String hiddenId=SessionService.instance.unqualifiedInspectionItemID.toString();
|
||||||
|
String hiddenId=item["ids"];
|
||||||
if(hiddenId.isNotEmpty) {
|
if(hiddenId.isNotEmpty) {
|
||||||
_getTemporaryStorageOfHidden(item,hiddenId);
|
switch(widget.type ){
|
||||||
|
case 1://隐患排查
|
||||||
|
_getTemporaryStorageOfHiddenYinHuan(item,hiddenId);
|
||||||
|
break;
|
||||||
|
case 2://标准排查
|
||||||
|
_getTemporaryStorageOfHidden(item,hiddenId);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
pushPage(HazardRegistrationPage(
|
pushPage(HazardRegistrationPage(
|
||||||
item,nullResult,
|
item,nullResult,widget.type,
|
||||||
onClose: (String departmentId,String yinHuanText) {
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
setState(() {
|
setState(() {
|
||||||
this.yinHuanText=yinHuanText;
|
this.yinHuanText=yinHuanText;
|
||||||
item["REFERENCE_BASIS"]="option2";
|
item["REFERENCE_BASIS"]="option2";
|
||||||
_selectedValue="option2";
|
// _selectedValue="option2";
|
||||||
unqualifiedInspectionItemID=departmentId;
|
// unqualifiedInspectionItemID=departmentId;
|
||||||
|
item["ids"]=departmentId;
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -352,6 +440,53 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _getTemporaryStorageOfHiddenYinHuan(Map item,String hiddenId) async {
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = await ApiService.getTemporaryStorageOfHiddenYinHuan(hiddenId);
|
||||||
|
if (result['result'] == 'success') {
|
||||||
|
try{
|
||||||
|
dynamic pd=result["pd"];
|
||||||
|
if(pd["HIDDEN_CATEGORY"]!=null){
|
||||||
|
if(pd["HIDDEN_CATEGORY"]=='aa0b9abb642146588bc71a12272942db'){
|
||||||
|
result["pd"]["HIDDEN_CATEGORY_NAME"]= "技术负责人登记隐患";
|
||||||
|
}else if(pd["HIDDEN_CATEGORY"]=='355ff0ead356428fa83a01330cfe10c6'){
|
||||||
|
result["pd"]["HIDDEN_CATEGORY_NAME"]= "主要负责人登记隐患";
|
||||||
|
}else if(pd["HIDDEN_CATEGORY"]=='a92911891ea847cc8f4cfac2455170bd'){
|
||||||
|
result["pd"]["HIDDEN_CATEGORY_NAME"]= "其他隐患";
|
||||||
|
}else if(pd["HIDDEN_CATEGORY"]=='44f8ce46372d4616a654cd07f1ec9a48'){
|
||||||
|
result["pd"]["HIDDEN_CATEGORY_NAME"]= "操作负责人登记隐患";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
print('数据获取失败:$e');
|
||||||
|
}
|
||||||
|
|
||||||
|
pushPage(HazardRegistrationPage(
|
||||||
|
item,result,widget.type,
|
||||||
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
|
setState(() {
|
||||||
|
this.yinHuanText=yinHuanText;
|
||||||
|
item["REFERENCE_BASIS"]="option2";
|
||||||
|
// _selectedValue="option2";
|
||||||
|
// unqualifiedInspectionItemID=departmentId;
|
||||||
|
item["ids"]=departmentId;
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
), context);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ToastUtil.showNormal(context, "加载数据失败");
|
||||||
|
// _showMessage('加载数据失败');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||||
|
print('加载数据失败:$e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _getTemporaryStorageOfHidden(Map item,String hiddenId) async {
|
Future<void> _getTemporaryStorageOfHidden(Map item,String hiddenId) async {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -359,13 +494,14 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
|
|
||||||
pushPage(HazardRegistrationPage(
|
pushPage(HazardRegistrationPage(
|
||||||
item,result,
|
item,result,widget.type,
|
||||||
onClose: (String departmentId,String yinHuanText) {
|
onClose: (String departmentId,String yinHuanText) {
|
||||||
setState(() {
|
setState(() {
|
||||||
this.yinHuanText=yinHuanText;
|
this.yinHuanText=yinHuanText;
|
||||||
item["REFERENCE_BASIS"]="option2";
|
item["REFERENCE_BASIS"]="option2";
|
||||||
_selectedValue="option2";
|
// _selectedValue="option2";
|
||||||
unqualifiedInspectionItemID=departmentId;
|
// unqualifiedInspectionItemID=departmentId;
|
||||||
|
item["ids"]=departmentId;
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -399,7 +535,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
|
|
||||||
|
|
||||||
void _submit() {
|
void _submit() {
|
||||||
if (_selectedValue == null) return;
|
// if (_selectedValue == null) return;
|
||||||
LoadingDialogHelper.show(context);
|
LoadingDialogHelper.show(context);
|
||||||
_submitInvestigationItems();
|
_submitInvestigationItems();
|
||||||
// 这里可以添加导航到下一页的代码
|
// 这里可以添加导航到下一页的代码
|
||||||
|
@ -414,14 +550,17 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
String longitude=position.longitude.toString();
|
String longitude=position.longitude.toString();
|
||||||
String latitude=position.latitude.toString();
|
String latitude=position.latitude.toString();
|
||||||
|
|
||||||
|
upDataItemList.clear();
|
||||||
bool hasNoSelectItem=false;
|
bool hasNoSelectItem=false;
|
||||||
|
String ids="";
|
||||||
for(int i=0;i<listDates.length;i++){
|
for(int i=0;i<listDates.length;i++){
|
||||||
final item=listDates[i];
|
final item=listDates[i];
|
||||||
// final itemTwo=listDatesTwo[i];
|
// final itemTwo=listDatesTwo[i];
|
||||||
if(item["REFERENCE_BASIS"]=="option1"){
|
if(item["REFERENCE_BASIS"]=="option1"){
|
||||||
upDataItemList.add( {
|
upDataItemList.add( {
|
||||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||||
|
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||||
|
|
||||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||||
"ISNORMAL": "0",
|
"ISNORMAL": "0",
|
||||||
"CHECK_RESULT": item["CHECK_QUALIFIED"],
|
"CHECK_RESULT": item["CHECK_QUALIFIED"],
|
||||||
|
@ -429,6 +568,8 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
}else if(item["REFERENCE_BASIS"]=="option2"){
|
}else if(item["REFERENCE_BASIS"]=="option2"){
|
||||||
upDataItemList.add( {
|
upDataItemList.add( {
|
||||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||||
|
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||||
|
|
||||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||||
"ISNORMAL": "1",
|
"ISNORMAL": "1",
|
||||||
"CHECK_RESULT":yinHuanText.isNotEmpty?yinHuanText:item["CHECK_QUALIFIED"],
|
"CHECK_RESULT":yinHuanText.isNotEmpty?yinHuanText:item["CHECK_QUALIFIED"],
|
||||||
|
@ -438,6 +579,8 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
}else if(item["REFERENCE_BASIS"]=="option3"){
|
}else if(item["REFERENCE_BASIS"]=="option3"){
|
||||||
upDataItemList.add( {
|
upDataItemList.add( {
|
||||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||||
|
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||||
|
|
||||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||||
"ISNORMAL": "2",
|
"ISNORMAL": "2",
|
||||||
"CHECK_RESULT":"",
|
"CHECK_RESULT":"",
|
||||||
|
@ -446,6 +589,15 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
}else{
|
}else{
|
||||||
hasNoSelectItem=true;
|
hasNoSelectItem=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(item["ids"].toString().isNotEmpty) {
|
||||||
|
if (ids.isEmpty) {
|
||||||
|
ids = item["ids"];
|
||||||
|
} else {
|
||||||
|
ids = "$ids," + item["ids"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,11 +607,19 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String itemsString= jsonEncode(upDataItemList);
|
String itemsString= jsonEncode(upDataItemList);
|
||||||
|
String CHECKRECORD_ID= widget.item["CHECKRECORD_ID"] ?? "";
|
||||||
try {
|
try {
|
||||||
final result = await ApiService.submitInvestigationItems(widget.item,longitude,latitude,itemsString,"","");
|
|
||||||
if (result['result'] == 'success') {
|
|
||||||
|
|
||||||
|
final Map<String, dynamic> result;
|
||||||
|
if(widget.type==1){
|
||||||
|
result = await ApiService.submitInvestigationItemsYinHuan(
|
||||||
|
widget.item,longitude,latitude,itemsString,ids,CHECKRECORD_ID);
|
||||||
|
}else{
|
||||||
|
result = await ApiService.submitInvestigationItems(
|
||||||
|
widget.item,longitude,latitude,itemsString,ids,CHECKRECORD_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result['result'] == 'success') {
|
||||||
setState(() {
|
setState(() {
|
||||||
ToastUtil.showNormal(context, "提交成功");
|
ToastUtil.showNormal(context, "提交成功");
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
|
|
@ -65,6 +65,36 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
setState(() {
|
setState(() {
|
||||||
listDates.addAll(newList);
|
listDates.addAll(newList);
|
||||||
|
|
||||||
|
try{
|
||||||
|
checkrecordId=result['CHECKRECORD_ID'];
|
||||||
|
checkMap.addAll(result['checkmap'] ?? []);
|
||||||
|
if(checkMap.isNotEmpty){
|
||||||
|
for(int i=0;i<listDates.length;i++){
|
||||||
|
try{
|
||||||
|
(listDates[i] as Map<String, dynamic>)["LISTMANAGER_ID"] =widget.id;
|
||||||
|
if(checkMap[listDates[i]["IDENTIFICATIONPARTS_ID"]]!=null) {
|
||||||
|
String num = checkMap[listDates[i]["IDENTIFICATIONPARTS_ID"]].toString();
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] = num;
|
||||||
|
}else{
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] ="";
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
(listDates[i] as Map<String, dynamic>)["LISTMANAGER_ID"] =widget.id;
|
||||||
|
print('加载数据失败:$e');
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] ="";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
for(int i=0;i<listDates.length;i++) {
|
||||||
|
(listDates[i] as Map<String, dynamic>)["LISTMANAGER_ID"] =widget.id;
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] = "";
|
||||||
|
}
|
||||||
|
print('没有这些数据:$e');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -93,8 +123,14 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
if(checkMap.isNotEmpty){
|
if(checkMap.isNotEmpty){
|
||||||
for(int i=0;i<listDates.length;i++){
|
for(int i=0;i<listDates.length;i++){
|
||||||
try{
|
try{
|
||||||
String num= checkMap[listDates[i]["CHECK_ITEM"]].toString();
|
// String num= checkMap[listDates[i]["CHECK_ITEM"]].toString();
|
||||||
(listDates[i] as Map<String, dynamic>)["checkmap"] =num;
|
// (listDates[i] as Map<String, dynamic>)["checkmap"] =num;
|
||||||
|
if(checkMap[listDates[i]["CHECK_ITEM"]]!=null) {
|
||||||
|
String num = checkMap[listDates[i]["CHECK_ITEM"]].toString();
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] = num;
|
||||||
|
}else{
|
||||||
|
(listDates[i] as Map<String, dynamic>)["checkmap"] ="";
|
||||||
|
}
|
||||||
|
|
||||||
}catch(e){
|
}catch(e){
|
||||||
print('加载数据失败:$e');
|
print('加载数据失败:$e');
|
||||||
|
@ -132,17 +168,17 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
backgroundColor: h_backGroundColor(),
|
backgroundColor: h_backGroundColor(),
|
||||||
appBar: MyAppbar(
|
appBar: MyAppbar(
|
||||||
title: widget.type==1?"风险点(单元)列表":"检查项目列表",
|
title: widget.type==1?"风险点(单元)列表":"检查项目列表",
|
||||||
actions: [
|
// actions: [
|
||||||
TextButton(
|
// TextButton(
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
pushPage(ScanPage(), context);
|
// pushPage(ScanPage(), context);
|
||||||
},
|
// },
|
||||||
child: Text(
|
// child: Text(
|
||||||
"扫描",
|
// "扫描",
|
||||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
// style: TextStyle(color: Colors.white, fontSize: 16),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -191,7 +227,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(item["checkmap"].toString().isEmpty?"assets/images/zt-ing.png":"assets/images/zt-over.png", width: 70, height: 70,),
|
Image.asset(item["checkmap"].toString().isEmpty?"assets/images/zt-ing.png":"assets/images/zt-over.png", width: 50, height: 50,),
|
||||||
const SizedBox(width: 10), // 添加间距
|
const SizedBox(width: 10), // 添加间距
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
|
@ -201,7 +237,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
Text(
|
Text(
|
||||||
_getTitle(item),
|
_getTitle(item),
|
||||||
// item.title,
|
// item.title,
|
||||||
style: const TextStyle(fontSize: 16),
|
style: const TextStyle(fontSize: 13),
|
||||||
maxLines: 2, // 限制两行
|
maxLines: 2, // 限制两行
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
|
@ -220,7 +256,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
|
|
||||||
String _getTitle(final item) {
|
String _getTitle(final item) {
|
||||||
if(widget.type==1 ){
|
if(widget.type==1 ){
|
||||||
return "${item["DEPT_NAME"]}--${item["RISKUNITNAME"]}--${item["PARTSNAME"]}\n所属电子围栏:${item["ELECTRONIC_FENCE_NAME"]}";
|
return "${item["DEPT_NAME"]}--${item["RISKUNITNAME"]}--${item["PARTSNAME"]}${_dianZiString(item)}";
|
||||||
}else{
|
}else{
|
||||||
return item["DICTIONARY_NAMES"];
|
return item["DICTIONARY_NAMES"];
|
||||||
}
|
}
|
||||||
|
@ -231,13 +267,22 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
Future<void> _selectItem(final item) async {
|
Future<void> _selectItem(final item) async {
|
||||||
switch(widget.type ){
|
switch(widget.type ){
|
||||||
case 1://隐患排查
|
case 1://隐患排查
|
||||||
|
if(item["ELECTRONIC_FENCE_ID"]!=null){
|
||||||
_isInElectronicFence(item);
|
_isInElectronicFence(item);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
final result = await Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type )),
|
||||||
|
);
|
||||||
|
_getData();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2://标准排查
|
case 2://标准排查
|
||||||
// pushPage(DangerProjectPage(item), context);
|
// pushPage(DangerProjectPage(item), context);
|
||||||
final result = await Navigator.push(
|
final result = await Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (_) => DangerProjectPage(item)),
|
MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type )),
|
||||||
);
|
);
|
||||||
_getData();
|
_getData();
|
||||||
break;
|
break;
|
||||||
|
@ -267,12 +312,24 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _dianZiString(item) {
|
||||||
|
try{
|
||||||
|
if(item["ELECTRONIC_FENCE_NAME"]==null){
|
||||||
|
return "";
|
||||||
|
}else{
|
||||||
|
return "\n所属电子围栏:${item["ELECTRONIC_FENCE_NAME"]}";
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _nextHandle() {
|
void _nextHandle() {
|
||||||
bool canGo=true;
|
bool canGo=true;
|
||||||
for(int i=0;i<listDates.length;i++){
|
for(int i=0;i<listDates.length;i++){
|
||||||
try{
|
try{
|
||||||
int num= listDates[i]["checkmap"];
|
String num= listDates[i]["checkmap"];
|
||||||
if(1!=num){
|
if(num.isEmpty){
|
||||||
canGo=false;
|
canGo=false;
|
||||||
}
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
|
@ -284,7 +341,7 @@ class _riskListPageState extends State<RiskListPage> {
|
||||||
ToastUtil.showNormal(context, "清单为全部检查,无法提交");
|
ToastUtil.showNormal(context, "清单为全部检查,无法提交");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pushPage(CheckingInformationOnePage(widget.id,checkrecordId), context);
|
pushPage(CheckingInformationOnePage(widget.id,checkrecordId,widget.type), context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
292
pubspec.lock
292
pubspec.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue