2025.9.11 改bug

main
xufei 2025-09-11 15:34:21 +08:00
parent 238662783f
commit aadfb3db52
4 changed files with 170 additions and 100 deletions

View File

@ -578,7 +578,7 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
} }
void _removeOtherHidden(int index) { void _removeOtherHidden(int index) {
if (index == 0) return; // // if (index == 0) return; //
setState(() { setState(() {
otherHidden.removeAt(index); otherHidden.removeAt(index);
}); });

View File

@ -25,9 +25,10 @@ class CustomDriverDrawer extends StatefulWidget {
class _CustomDriverDrawerState extends State<CustomDriverDrawer> { class _CustomDriverDrawerState extends State<CustomDriverDrawer> {
// id // id
String? riskId;
// id
String? dept; String? dept;
// id
String? riskId;
// //
int _levelOption = -1; int _levelOption = -1;
@ -178,6 +179,10 @@ class _CustomDriverDrawerState extends State<CustomDriverDrawer> {
"风险点(单元)", "风险点(单元)",
display: itemNameTwo ?? '请选择', display: itemNameTwo ?? '请选择',
onTap: () { onTap: () {
if(dept==null){
ToastUtil.showNormal(context, "请选择管控部门");
return;
}
showCategoryPickerTwo("2"); showCategoryPickerTwo("2");
} }
), ),

View File

@ -1,11 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/tools.dart';
/// ///
class MineDutyDetailPage extends StatefulWidget { class MineDutyDetailPage extends StatefulWidget {
const MineDutyDetailPage(this.item, {super.key}); const MineDutyDetailPage(this.item, {super.key});
final item; final item;
@override @override
@ -13,63 +15,47 @@ class MineDutyDetailPage extends StatefulWidget {
} }
class _MineDutyDetailPage extends State<MineDutyDetailPage> { class _MineDutyDetailPage extends State<MineDutyDetailPage> {
final TextEditingController _reasonController = TextEditingController(); final TextEditingController _reasonController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: const Color(0xFFF5F7FA), backgroundColor: const Color(0xFFF5F7FA),
appBar:MyAppbar(title: "离岗详情"), appBar: MyAppbar(title: "离岗详情"),
body: SingleChildScrollView( body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// //
_buildInfoRow("申请人", widget.item["USER_NAME"]), _buildInfoRow("申请人:", widget.item["USER_NAME"]),
const SizedBox(height: 24), const SizedBox(height: 10),
// //
_buildDateField( _buildDateField(
label: "离岗开始时间", label: "离岗开始时间",
date: widget.item["STARTTIME"], date: widget.item["STARTTIME"],
onTap: () { onTap: () {},
// () => _selectDate(context, true),
}
// () => _selectDate(context, true),
), ),
const SizedBox(height: 16), const SizedBox(height: 10),
// //
_buildDateField( _buildDateField(
label: "离岗结束时间", label: "离岗结束时间",
date: widget.item["ENDTIME"], date: widget.item["ENDTIME"],
onTap: () { onTap: () {},
// () => _selectDate(context, false),
},
// () => _selectDate(context, false),
), ),
const SizedBox(height: 24), const SizedBox(height: 10),
//
const Text(
"离岗原因",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
),
const SizedBox(height: 8),
//
Container( Container(
width: double.infinity, padding: const EdgeInsets.symmetric(
padding: const EdgeInsets.all(16), horizontal: 5,
vertical: 12,
),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
@ -82,26 +68,107 @@ class _MineDutyDetailPage extends State<MineDutyDetailPage> {
), ),
], ],
), ),
child: Text( child: ItemListWidget.singleLineTitleText(
widget.item["DESCR"], label: "离岗原因:",
style: TextStyle(color: Colors.black), isEditable: false,
// controller: _reasonController, text:widget.item["DESCR"]
// maxLines: 5,
// decoration: const InputDecoration(
// hintText: "请输入离岗原因",
// hintStyle: TextStyle(color: Color(0xFF9E9E9E)),
// border: InputBorder.none,
// ),
), ),
), ),
//
// const Text(
// "离岗原因",
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
// ),
// const SizedBox(height: 8),
//
// //
// Container(
// width: double.infinity,
// padding: const EdgeInsets.all(16),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(12),
// boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.1),
// spreadRadius: 1,
// blurRadius: 6,
// offset: const Offset(0, 2),
// ),
// ],
// ),
// child: Text(
// widget.item["DESCR"],
// style: TextStyle(color: Colors.black),
// // controller: _reasonController,
// // maxLines: 5,
// // decoration: const InputDecoration(
// // hintText: "请输入离岗原因",
// // hintStyle: TextStyle(color: Color(0xFF9E9E9E)),
// // border: InputBorder.none,
// // ),
// ),
// ),
const SizedBox(height: 10),
const SizedBox(height: 24), _buildInfoRow("审批状态:", _getTypeReturn(widget.item)),
const SizedBox(height: 10),
// //
_buildInfoRow("审批状态", _getTypeReturn(widget.item)), if (widget.item["REVIEW_STATUS"] != '2')
Container(
padding: const EdgeInsets.symmetric(
horizontal: 5,
vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: ItemListWidget.singleLineTitleText(
label: '审批人:',
isEditable: false,
text:
"${FormUtils.hasValue(widget.item, "REVIEW_USER_NAME") ? widget.item["REVIEW_USER_NAME"] : "unfind"}[${FormUtils.hasValue(widget.item, "REVIEW_USER_DEPARTMENTNAME") ? widget.item["REVIEW_USER_DEPARTMENTNAME"] : "unfind"}]",
),
),
const SizedBox(height: 10),
// ' : '
if (widget.item["REVIEW_STATUS"] == '1' ||widget.item["REVIEW_STATUS"] == '-1' )
Container(
padding: const EdgeInsets.symmetric(
horizontal: 5,
vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
),
child: ItemListWidget.singleLineTitleText(
label: widget.item["ISDELETE"] == '0' ? '审批意见:' : '取消原因:',
isEditable: false,
text:widget.item["REVIEW_DESC"]
),
),
const SizedBox(height: 40), const SizedBox(height: 40),
@ -119,11 +186,10 @@ class _MineDutyDetailPage extends State<MineDutyDetailPage> {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
), ),
child: Text( child: Text(
"返回", "返回",
style: TextStyle(fontSize: 16, color: Colors.white), style: TextStyle(fontSize: 16, color: Colors.white),
), ),
), ),
), ),
], ],
@ -156,17 +222,11 @@ class _MineDutyDetailPage extends State<MineDutyDetailPage> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(label, style: const TextStyle(fontSize: 16)),
label,
style: const TextStyle(fontSize: 16),
),
Text( Text(
// date != null ? DateFormat('yyyy-MM-dd').format(date) : "请选择日期", // date != null ? DateFormat('yyyy-MM-dd').format(date) : "请选择日期",
date! , date!,
style: TextStyle( style: TextStyle(fontSize: 16, color: Colors.black),
fontSize: 16,
color: Colors.black ,
),
), ),
], ],
), ),
@ -192,10 +252,7 @@ class _MineDutyDetailPage extends State<MineDutyDetailPage> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(title, style: const TextStyle(fontSize: 16)),
title,
style: const TextStyle(fontSize: 16),
),
Text( Text(
value, value,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
@ -206,27 +263,26 @@ class _MineDutyDetailPage extends State<MineDutyDetailPage> {
} }
String _getTypeReturn(final item) { String _getTypeReturn(final item) {
String type=item['REVIEW_STATUS']; String type = item['REVIEW_STATUS'];
if("0"==type){ if ("0" == type) {
return "待审批"; return "待审批";
}else if("1"==type){ } else if ("1" == type) {
return "审批通过"; return "审批通过";
}else if("2"==type){ } else if ("2" == type) {
return "无需审批"; return "无需审批";
}else if("-1"==type){ } else if ("-1" == type) {
String type2=item['ISDELETE']; String type2 = item['ISDELETE'];
if("1"==type2){ if ("1" == type2) {
if(item['CREATOR']==item['OPERATOR']){ if (item['CREATOR'] == item['OPERATOR']) {
return "申请人取消"; return "申请人取消";
}else{ } else {
return "审批人取消"; return "审批人取消";
} }
}else{ } else {
return "审批打回"; return "审批打回";
} }
}else{ } else {
return "审批错误"; return "审批错误";
} }
} }
}
}

View File

@ -81,33 +81,42 @@ class _NotifDetailPageState extends State<NotifDetailPage> {
appBar: MyAppbar(title: "通知详情"), appBar: MyAppbar(title: "通知详情"),
body: SafeArea( body: SafeArea(
child: Container( child: Container(
width: double.infinity, // // color: Colors.white,
color: Colors.white, child: Padding(
padding: const EdgeInsets.all(15), padding: EdgeInsets.all(10),
child: SingleChildScrollView( child: Card(
child: Column( child: Container(
mainAxisSize: MainAxisSize.min, width: double.infinity, //
crossAxisAlignment: CrossAxisAlignment.start, // color: Colors.white,
children: [ padding: const EdgeInsets.all(15),
Padding( child: SingleChildScrollView(
padding: EdgeInsets.only(left: 10,right: 10), child: Column(
child: Text(title,style: TextStyle(color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),), mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, //
children: [
Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child: Text(title,style: TextStyle(color: Colors.black,fontSize: 16,fontWeight: FontWeight.bold),),
),
SizedBox(height: 8),
Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child: Text(time,),
),
SizedBox(height: 8),
Html(
data: text,
),
// Text(item['CONTENT'],),
],
),
), ),
SizedBox(height: 8), ),
Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child: Text(time,),
),
SizedBox(height: 8),
Html(
data: text,
),
// Text(item['CONTENT'],),
],
), ),
),
),
), ),
), ),
); );