diff --git a/lib/http/ApiService.dart b/lib/http/ApiService.dart index 05cfe2e..840b726 100644 --- a/lib/http/ApiService.dart +++ b/lib/http/ApiService.dart @@ -1950,6 +1950,7 @@ U6Hzm1ninpWeE+awIDAQAB "REVIEW_STATUS": type, "REVIEW_DESC": text, "OPERATOR": SessionService.instance.loginUserId, + "REVIEW_USER_ID": SessionService.instance.loginUserId, }, ); } @@ -1969,6 +1970,7 @@ U6Hzm1ninpWeE+awIDAQAB "REVIEW_STATUS": type, "REVIEW_DESC": text, "OPERATOR": SessionService.instance.loginUserId, + }, ); } @@ -2839,13 +2841,14 @@ U6Hzm1ninpWeE+awIDAQAB } /// 获取检查项目列表 - static Future> getRiskPointsList(String id) { + static Future> getRiskPointsList(String id,String IDENTIFICATIONPARTS_ID) { return HttpManager().request( basePath, '/app/listmanager/getRisk', method: Method.post, data: { "LISTMANAGER_ID": id, + "IDENTIFICATIONPARTS_ID":IDENTIFICATIONPARTS_ID, "USER_NAME": SessionService.instance.username, "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, @@ -3075,6 +3078,7 @@ U6Hzm1ninpWeE+awIDAQAB "SOURCE": '3', "STATE": '0', + "IS_OTHER_HIDDEN":"1", "HIDDENDESCR": hazardDescription, "HIDDENPART": partDescription, "LATITUDE": latitude, diff --git a/lib/pages/app/Danger_paicha/hazard_registration_page.dart b/lib/pages/app/Danger_paicha/hazard_registration_page.dart index 5b54cf0..5e3a333 100644 --- a/lib/pages/app/Danger_paicha/hazard_registration_page.dart +++ b/lib/pages/app/Danger_paicha/hazard_registration_page.dart @@ -88,7 +88,8 @@ class _HazardRegistrationPageState extends State { super.initState(); neiRong=widget.item['CHECK_CONTENT'] ?? ''; _standardController.text=widget.item["CHECK_UNQUALIFIED"]??""; - unqualifiedInspectionItemID=SessionService.instance.unqualifiedInspectionItemID.toString(); + // unqualifiedInspectionItemID=SessionService.instance.unqualifiedInspectionItemID.toString(); + unqualifiedInspectionItemID=widget.item['ids'] ?? ''; if(unqualifiedInspectionItemID.isNotEmpty && widget.result.isNotEmpty){ List hImgs=widget.result["hImgs"] ?? []; List rImgs=widget.result["rImgs"]?? []; diff --git a/lib/pages/home/EquipmentInspection/equiment_detail_list_page.dart b/lib/pages/home/EquipmentInspection/equiment_detail_list_page.dart index 2861d4e..140f84d 100644 --- a/lib/pages/home/EquipmentInspection/equiment_detail_list_page.dart +++ b/lib/pages/home/EquipmentInspection/equiment_detail_list_page.dart @@ -157,6 +157,7 @@ class _EquimentDetailListPageState extends State child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(FormUtils.hasValue(record, 'INSPECTOR')) _buildInfoRow('人员:${record['INSPECTOR']}'), const SizedBox(height: 8), _buildInfoRow( @@ -167,7 +168,9 @@ class _EquimentDetailListPageState extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + if(FormUtils.hasValue(record, 'INSPECTIONTIME')) _buildInfoRow('检查时间:${record['INSPECTIONTIME']}'), + if(FormUtils.hasValue(record, 'INSPECTIONTIME')) _buildInfoRow('是否故障:${record['ISFAULT']}'), ], ), diff --git a/lib/pages/home/SafeCheck/CheckPersonSure/check_person_detail.dart b/lib/pages/home/SafeCheck/CheckPersonSure/check_person_detail.dart index 8c0cf44..823fd72 100644 --- a/lib/pages/home/SafeCheck/CheckPersonSure/check_person_detail.dart +++ b/lib/pages/home/SafeCheck/CheckPersonSure/check_person_detail.dart @@ -188,8 +188,13 @@ class _CheckPersonDetailState extends State { LoadingDialogHelper.show(); inspectorForm['OPERATOR'] = SessionService.instance.loginUserId; - inspectorForm['ACTION_USER'] = SessionService.instance.username; - inspectorForm['INSPECTION_USER_SIGN_TIME'] = DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()); + inspectorForm['ACTION_USER'] = SessionService.instance.username;// inspectorForm['INSPECTION_STATUS'] = val ? '1' : '-1'; + if(inspectorForm['INSPECTION_STATUS'] =='-1'){ + inspectorForm['INSPECTION_USER_SIGN_TIME'] =""; + }else{ + inspectorForm['INSPECTION_USER_SIGN_TIME'] = DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()); + } + try { // 准备上传文件路径(兼容多种 signImgList 存法) String filePath = signImages.first; diff --git a/lib/pages/home/home_danger_page.dart b/lib/pages/home/home_danger_page.dart index f987a30..a7dacf5 100644 --- a/lib/pages/home/home_danger_page.dart +++ b/lib/pages/home/home_danger_page.dart @@ -166,14 +166,14 @@ class _HomeDangerPageState extends State // pushPage(RiskListPage(1,item["LISTMANAGER_ID"]), context); final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => RiskListPage(1,item["LISTMANAGER_ID"])), + MaterialPageRoute(builder: (_) => RiskListPage(1,item["LISTMANAGER_ID"],FormUtils.hasValue(item, "IDENTIFICATIONPARTS_ID")?item["IDENTIFICATIONPARTS_ID"]:"")), ); break; case 1://标准排查 // pushPage(RiskListPage(2,item["CUSTOM_ID"]), context); final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => RiskListPage(2,item["CUSTOM_ID"])), + MaterialPageRoute(builder: (_) => RiskListPage(2,item["CUSTOM_ID"],FormUtils.hasValue(item, "IDENTIFICATIONPARTS_ID")?item["IDENTIFICATIONPARTS_ID"]:"")), ); break; diff --git a/lib/pages/home/scan_page.dart b/lib/pages/home/scan_page.dart index 0068b2e..06c8a79 100644 --- a/lib/pages/home/scan_page.dart +++ b/lib/pages/home/scan_page.dart @@ -124,7 +124,7 @@ class _ScanPageState extends State { void goToList({required String listId, required String listName}) { print('navigate to list: $listId, name: $listName'); Navigator.pop(context,Animation); - pushPage(RiskListPage(1, listId), context); + pushPage(RiskListPage(1, listId,""), context); } @override diff --git a/lib/pages/home/work/danger_page.dart b/lib/pages/home/work/danger_page.dart index 42ef9b6..fae3e90 100644 --- a/lib/pages/home/work/danger_page.dart +++ b/lib/pages/home/work/danger_page.dart @@ -198,14 +198,14 @@ class _DangerPageState extends State // pushPage(RiskListPage(widget.type,item["LISTMANAGER_ID"]), context); final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => RiskListPage(widget.type,item["LISTMANAGER_ID"])), + MaterialPageRoute(builder: (_) => RiskListPage(widget.type,item["LISTMANAGER_ID"],FormUtils.hasValue(item, "IDENTIFICATIONPARTS_ID")?item["IDENTIFICATIONPARTS_ID"]:"")), ); break; case 2://标准排查 // pushPage(RiskListPage(widget.type,item["CUSTOM_ID"]), context); final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => RiskListPage(widget.type,item["CUSTOM_ID"])), + MaterialPageRoute(builder: (_) => RiskListPage(widget.type,item["CUSTOM_ID"],FormUtils.hasValue(item, "IDENTIFICATIONPARTS_ID")?item["IDENTIFICATIONPARTS_ID"]:"")), ); break; } diff --git a/lib/pages/home/work/danger_project_page.dart b/lib/pages/home/work/danger_project_page.dart index 1c546d8..098fda8 100644 --- a/lib/pages/home/work/danger_project_page.dart +++ b/lib/pages/home/work/danger_project_page.dart @@ -91,10 +91,12 @@ class _DangerProjectPageState extends State { } for (int i = 0; i < listDates.length; i++) { + (listDates[i] as Map)["ids"] = ""; if (newListTwo.isNotEmpty) { for (int m = 0; m < newListTwo.length; m++) { if (newListTwo.isNotEmpty && newListTwo[m]["LISTCHECKITEM_ID"] != null) { if (newListTwo[m]["LISTCHECKITEM_ID"] == listDates[i]["LISTCHECKITEM_ID"]) { + listDates[i]["RECORDITEM_ID"]=newListTwo[m]["RECORDITEM_ID"]; if (listDatesSelect.isNotEmpty) { switch (listDatesSelect[m]["ISNORMAL"]) { @@ -116,17 +118,18 @@ class _DangerProjectPageState extends State { (listDates[i] as Map)["ids"] = listDatesSelect[m]["HIDDEN_ID"]; SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]); } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } - } else { - (listDates[i] as Map)["ids"] = ""; } + // else { + // (listDates[i] as Map)["ids"] = ""; + // } } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } } } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } } }); @@ -155,6 +158,7 @@ class _DangerProjectPageState extends State { } for (int i = 0; i < listDates.length; i++) { + (listDates[i] as Map)["ids"] = ""; if (newListTwo.isNotEmpty) { for (int m = 0; m < newListTwo.length; m++) { if (newListTwo.isNotEmpty && newListTwo[m]["CUSTOM_ITEM_ID"] != null) { @@ -180,17 +184,18 @@ class _DangerProjectPageState extends State { (listDates[i] as Map)["ids"] = listDatesSelect[m]["HIDDEN_ID"]; SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]); } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } + } } else { - (listDates[i] as Map)["ids"] = ""; + // (listDates[i] as Map)["ids"] = ""; } } }); @@ -522,7 +527,9 @@ class _DangerProjectPageState extends State { Future _getTemporaryStorageOfHiddenYinHuan(Map item, String hiddenId) async { try { + LoadingDialogHelper.show(); final result = await ApiService.getTemporaryStorageOfHiddenYinHuan(hiddenId); + LoadingDialogHelper.hide(); if (result['result'] == 'success') { try { dynamic pd = result["pd"]; @@ -552,13 +559,16 @@ class _DangerProjectPageState extends State { ToastUtil.showNormal(context, "加载数据失败"); } } catch (e) { + LoadingDialogHelper.hide(); print('加载数据失败:$e'); } } Future _getTemporaryStorageOfHidden(Map item, String hiddenId) async { try { + LoadingDialogHelper.show(); final result = await ApiService.getTemporaryStorageOfHidden(hiddenId); + LoadingDialogHelper.hide(); if (result['result'] == 'success') { pushPage(HazardRegistrationPage(item, result, widget.type, onClose: (String departmentId, String yinHuanText) { setState(() { @@ -571,6 +581,7 @@ class _DangerProjectPageState extends State { ToastUtil.showNormal(context, "加载数据失败"); } } catch (e) { + LoadingDialogHelper.hide(); print('加载数据失败:$e'); } } diff --git a/lib/pages/home/work/risk_list_page.dart b/lib/pages/home/work/risk_list_page.dart index 1dfccd8..9c8c990 100644 --- a/lib/pages/home/work/risk_list_page.dart +++ b/lib/pages/home/work/risk_list_page.dart @@ -11,11 +11,11 @@ import 'package:qhd_prevention/tools/h_colors.dart'; import 'package:qhd_prevention/tools/tools.dart'; class RiskListPage extends StatefulWidget { - const RiskListPage(this.type, this.id, {super.key}); + const RiskListPage(this.type, this.id, this.IDENTIFICATIONPARTS_ID, {super.key}); final int type; final String id; - + final String IDENTIFICATIONPARTS_ID; @override State createState() => _riskListPageState(); @@ -54,7 +54,7 @@ class _riskListPageState extends State { try { LoadingDialogHelper.show(); - final result = await ApiService.getRiskPointsList(widget.id); + final result = await ApiService.getRiskPointsList(widget.id,widget.IDENTIFICATIONPARTS_ID); LoadingDialogHelper.hide(); if (result['result'] == 'success') { final List newList = result['varList'] ?? []; diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index e52fb41..bb97439 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -55,6 +55,9 @@ class _LoginPageState extends State { void initState() { super.initState(); _phoneController.addListener(_onTextChanged); + + _phoneController.text= SessionService.instance.loginPhone ?? ""; + _passwordController.text= SessionService.instance.loginPass?? ""; _checkUpdata(); } void dispose() { @@ -189,7 +192,8 @@ class _LoginPageState extends State { height: 48, child: ElevatedButton( onPressed: - (!_isLoading && _agreed) ? _handleLogin : null, + _handleLogin, + // (!_isLoading && _agreed) ? _handleLogin : null, style: ElevatedButton.styleFrom( backgroundColor: Colors.blue, shape: RoundedRectangleBorder( @@ -217,8 +221,13 @@ class _LoginPageState extends State { activeColor: Colors.white, checkColor: Colors.blueAccent, side: const BorderSide(color: Colors.white), - onChanged: - (v) => setState(() => _agreed = v ?? false), + onChanged:(value) { + setState(() { + _agreed = value??false; + }); + + }, + // (v) => setState(() => _agreed = v ?? false), ), Expanded( child: RichText( @@ -339,11 +348,23 @@ class _LoginPageState extends State { } Future _handleLogin() async { + if(_isLoading){ + return; + } if (!(_formKey.currentState?.validate() ?? false)) return; + if(!_agreed){ + ToastUtil.showNormal(context, "请先阅读并同意《服务协议》和《隐私政策》"); + return; + } + + final userName = _phoneController.text.trim(); final userPwd = _passwordController.text; + SessionService.instance.setSavePhone(userName); + SessionService.instance.setSavePass(userPwd); + setState(() => _isLoading = true); showDialog( context: context, diff --git a/lib/pages/mine/mine_departure_record.dart b/lib/pages/mine/mine_departure_record.dart index 5969465..10c24ca 100644 --- a/lib/pages/mine/mine_departure_record.dart +++ b/lib/pages/mine/mine_departure_record.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; import '../../http/ApiService.dart'; @@ -430,6 +431,7 @@ class _DutyDialogState extends State { // 输入框 TextField( + textAlign: TextAlign.center, // 文字居中 controller: _reasonController, decoration: InputDecoration( border: OutlineInputBorder(), @@ -449,9 +451,10 @@ class _DutyDialogState extends State { child: ElevatedButton( onPressed: (){ if(_reasonController.text.isEmpty){ - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text(widget.type==1?'请输入审批意见':'请输入原因')) - ); + ToastUtil.showNormal(context, widget.type==1?'请输入审批意见':'请输入原因'); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar(content: Text(widget.type==1?'请输入审批意见':'请输入原因')) + // ); return; } diff --git a/lib/pages/mine/mine_duty_detail.dart b/lib/pages/mine/mine_duty_detail.dart index f60824b..66a925a 100644 --- a/lib/pages/mine/mine_duty_detail.dart +++ b/lib/pages/mine/mine_duty_detail.dart @@ -27,148 +27,86 @@ class _MineDutyDetailPage extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + + // 申请人信息 - _buildInfoRow("申请人:", widget.item["USER_NAME"]), + _buildInfoRowTwo("申请人:", widget.item["USER_NAME"]), const SizedBox(height: 10), // 离岗开始时间 - _buildDateField( - label: "离岗开始时间:", - date: widget.item["STARTTIME"], - onTap: () {}, - // () => _selectDate(context, true), - ), + _buildInfoRowTwo("离岗开始时间:", widget.item["STARTTIME"]), const SizedBox(height: 10), // 离岗结束时间 - _buildDateField( - label: "离岗结束时间:", - date: widget.item["ENDTIME"], - onTap: () {}, - // () => _selectDate(context, false), - ), + _buildInfoRowTwo("离岗结束时间:", widget.item["ENDTIME"]), const SizedBox(height: 10), - 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:widget.item["DESCR"] - - ), - ), - // 离岗原因标题 - // 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, - // // ), - // ), - // ), + _buildInfoRowTwo("离岗原因:", widget.item["DESCR"]), const SizedBox(height: 10), - _buildInfoRow("审批状态:", _getTypeReturn(widget.item)), + _buildInfoRowTwo("审批状态:", _getTypeReturn(widget.item)), const SizedBox(height: 10), + + // 申请人信息 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"}]", - ), - ), + _buildInfoRowTwo("审批人:", "${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"}]",), + // 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"] - - ), - ), + _buildInfoRowTwo(widget.item["ISDELETE"] == '0' ? '审批意见:' : '取消原因:', widget.item["REVIEW_DESC"]), + // 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), @@ -234,6 +172,35 @@ class _MineDutyDetailPage extends State { ); } + + + + + Widget _buildInfoRowTwo(String title, String value) { + return 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:title, + isEditable: false, + text:value + + ), + ); + } + + Widget _buildInfoRow(String title, String value) { return Container( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), diff --git a/lib/pages/mine/mine_duty_management.dart b/lib/pages/mine/mine_duty_management.dart index 7d33c94..b79ced2 100644 --- a/lib/pages/mine/mine_duty_management.dart +++ b/lib/pages/mine/mine_duty_management.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; import '../../http/ApiService.dart'; @@ -518,6 +519,7 @@ class _DutyDialogState extends State { // 输入框 TextField( + textAlign: TextAlign.center, // 文字居中 controller: _reasonController, decoration: InputDecoration( border: OutlineInputBorder(), @@ -540,20 +542,21 @@ class _DutyDialogState extends State { child: ElevatedButton( onPressed: () { if (_reasonController.text.isEmpty) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - widget.type == 1 ? '请输入审批意见' : '请输入原因', - ), - ), - ); + ToastUtil.showNormal(context, widget.type == 1 ? '请输入审批意见' : '请输入原因'); + // ScaffoldMessenger.of(context).showSnackBar( + // SnackBar( + // content: Text( + // widget.type == 1 ? '请输入审批意见' : '请输入原因', + // ), + // ), + // ); return; } if (1 == widget.type) { _dutyApproval(); //审批 } else { - _dutyReturned(); //打回 + _dutyReturned(); //取消 } Navigator.pop(context); }, diff --git a/lib/tools/tools.dart b/lib/tools/tools.dart index 031a6b9..5729d4e 100644 --- a/lib/tools/tools.dart +++ b/lib/tools/tools.dart @@ -203,6 +203,9 @@ class SessionService { String? unqualifiedInspectionItemID; String? listItemNameJson; String? studyToken; + String? loginPhone; + String? loginPass; + @@ -251,6 +254,11 @@ class SessionService { void setListItemNameJson(String json) => listItemNameJson = json; + void setSavePhone(String phone) => loginPhone = phone; + + void setSavePass(String pass) => loginPass = pass; + + } /// ------------------------------------------------------