Browse Source

bug修复

yangyang 2 years ago
parent
commit
25ed6b6b08

BIN
android/app/Keystore.jks


+ 9 - 0
android/app/build.gradle

@@ -52,6 +52,15 @@ android {
             signingConfig signingConfigs.debug
             signingConfig signingConfigs.debug
         }
         }
     }
     }
+
+    signingConfigs {
+        debug {
+            storeFile file('keystore.jks')
+            storePassword "123456"
+            keyAlias "keystore"
+            keyPassword "123456"
+        }
+    }
 }
 }
 
 
 flutter {
 flutter {

+ 17 - 1
android/app/src/debug/AndroidManifest.xml

@@ -4,5 +4,21 @@
          the Flutter tool needs it to communicate with the running application
          the Flutter tool needs it to communicate with the running application
          to allow setting breakpoints, to provide hot reload, etc.
          to allow setting breakpoints, to provide hot reload, etc.
     -->
     -->
-    <uses-permission android:name="android.permission.INTERNET"/>
+    <uses-feature android:name="android.hardware.camera" />
+
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CAMERA" />
+
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 </manifest>
 </manifest>

+ 18 - 0
android/app/src/main/AndroidManifest.xml

@@ -33,4 +33,22 @@
             android:name="flutterEmbedding"
             android:name="flutterEmbedding"
             android:value="2" />
             android:value="2" />
     </application>
     </application>
+
+    <uses-feature android:name="android.hardware.camera" />
+
+    <uses-feature android:name="android.hardware.camera.autofocus" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CAMERA" />
+
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 </manifest>
 </manifest>

BIN
images/head.png


+ 8 - 1
lib/PhotoTool.dart

@@ -9,11 +9,16 @@ class PhotoTool extends StatefulWidget {
   @required final int imageCount;//最多几张
   @required final int imageCount;//最多几张
   @required  final int lineCount;//一行几个
   @required  final int lineCount;//一行几个
 
 
+  @required final FocusNode focusNode;
+
   final _AddCall addCall;
   final _AddCall addCall;
   final _RemoveCall removeCall;
   final _RemoveCall removeCall;
   //注:最好把图片和文字这些都拿出来,方便更改,这里就不搞了
   //注:最好把图片和文字这些都拿出来,方便更改,这里就不搞了
+  // const PhotoTool({required this.imageCount,required this.lineCount
+  //   ,required this.addCall,required this.removeCall});
+
   const PhotoTool({required this.imageCount,required this.lineCount
   const PhotoTool({required this.imageCount,required this.lineCount
-    ,required this.addCall,required this.removeCall});
+    ,required this.addCall,required this.removeCall,required this.focusNode});
   @override
   @override
   _PhotoToolState createState() => _PhotoToolState();
   _PhotoToolState createState() => _PhotoToolState();
 }
 }
@@ -145,6 +150,7 @@ class _PhotoToolState extends State<PhotoTool> {
   }
   }
   /// 选择图片
   /// 选择图片
   _onPickImage() async {
   _onPickImage() async {
+    widget.focusNode.unfocus();
     List<AssetEntity>? assets = await AssetPicker.pickAssets(
     List<AssetEntity>? assets = await AssetPicker.pickAssets(
       context,
       context,
       pickerConfig:AssetPickerConfig(maxAssets:widget.imageCount - _imageFiles.length,themeColor: Theme.of(context).primaryColor, requestType: RequestType.image,)
       pickerConfig:AssetPickerConfig(maxAssets:widget.imageCount - _imageFiles.length,themeColor: Theme.of(context).primaryColor, requestType: RequestType.image,)
@@ -159,6 +165,7 @@ class _PhotoToolState extends State<PhotoTool> {
   }
   }
   /// 删除图片
   /// 删除图片
   _deleteImage(int index) {
   _deleteImage(int index) {
+    widget.focusNode.unfocus();
     if (_imageFiles == null || _imageFiles.length <= index) return;
     if (_imageFiles == null || _imageFiles.length <= index) return;
     setState(() {
     setState(() {
       _imageFiles.removeAt(index);
       _imageFiles.removeAt(index);

+ 3 - 3
lib/common/utils/ConstantString.dart

@@ -13,8 +13,8 @@ class ConstantString {
   static const String maintJobText = "维保任务";
   static const String maintJobText = "维保任务";
   static const String repairJobText = "报修管理";
   static const String repairJobText = "报修管理";
 
 
-  static const String patrolJobTitle = "巡检任务来自于'巡检计划管理',计划信息请登录pc端查看";
-  static const String maintJobTitle = "维保任务来自于'维保计划管理',计划信息请登录pc端查看";
+  static const String patrolJobTitle = "巡检任务来自于巡检计划,请登录PC端查看";
+  static const String maintJobTitle = "维保任务来自于巡检计划,请登录PC端查看";
   static const String repairJobTitle = "巡检任务来自于'巡检计划管理',计划信息请登录pc端查看";
   static const String repairJobTitle = "巡检任务来自于'巡检计划管理',计划信息请登录pc端查看";
   static const String patrolListTitle = "请针对以下设备进行巡检记录";
   static const String patrolListTitle = "请针对以下设备进行巡检记录";
 
 
@@ -56,7 +56,7 @@ class ConstantString {
 
 
   static const String patrolAddNull = "请输入活选择结果";
   static const String patrolAddNull = "请输入活选择结果";
 
 
-  static const String newRepair = "新建修单";
+  static const String newRepair = "新建修单";
 
 
   static const String submit = "提交";
   static const String submit = "提交";
 
 

+ 14 - 0
lib/common/utils/DioUtil.dart

@@ -1,5 +1,7 @@
 import 'package:deus_app/common/local/StoreHelper.dart';
 import 'package:deus_app/common/local/StoreHelper.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
+import 'package:deus_app/main.dart';
+import 'package:deus_app/page/login/login_page.dart';
 import 'package:dio/dio.dart';
 import 'package:dio/dio.dart';
 import 'package:flutter_easyloading/flutter_easyloading.dart';
 import 'package:flutter_easyloading/flutter_easyloading.dart';
 import 'package:pretty_dio_logger/pretty_dio_logger.dart';
 import 'package:pretty_dio_logger/pretty_dio_logger.dart';
@@ -111,10 +113,22 @@ class DioUtil {
           onSendProgress: onSendProgress,
           onSendProgress: onSendProgress,
           onReceiveProgress: onReceiveProgress);
           onReceiveProgress: onReceiveProgress);
       EasyLoading.dismiss();
       EasyLoading.dismiss();
+      if(response.data['code']==403){
+        // 跳转登录页面并清空栈
+        globalNavigatorKey.currentState
+            ?.pushNamedAndRemoveUntil(LoginPage.routeName, (route) => false);
+        // showToast('登录超时,请重新登录');
+      }
         return response.data;
         return response.data;
     } on DioError catch (e) {
     } on DioError catch (e) {
       EasyLoading.dismiss();
       EasyLoading.dismiss();
       // showToast(e.message);
       // showToast(e.message);
+      if(e.response?.data['code']==403){
+        // 跳转登录页面并清空栈
+        globalNavigatorKey.currentState
+            ?.pushNamedAndRemoveUntil(LoginPage.routeName, (route) => false);
+        // showToast('登录超时,请重新登录');
+      }
       return e.response?.data;
       return e.response?.data;
     }
     }
   }
   }

+ 5 - 0
lib/main.dart

@@ -16,6 +16,8 @@ void main() {
 //创建EventBus对象
 //创建EventBus对象
 final EventBus eventBus = EventBus();
 final EventBus eventBus = EventBus();
 
 
+final GlobalKey<NavigatorState> globalNavigatorKey = GlobalKey();
+
 class MyApp extends StatelessWidget {
 class MyApp extends StatelessWidget {
   const MyApp({super.key});
   const MyApp({super.key});
 
 
@@ -24,6 +26,7 @@ class MyApp extends StatelessWidget {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return MaterialApp(
     return MaterialApp(
       title: 'Flutter Demo',
       title: 'Flutter Demo',
+      navigatorKey: globalNavigatorKey,
       theme: ThemeData(
       theme: ThemeData(
         // This is the theme of your application.
         // This is the theme of your application.
         //
         //
@@ -42,6 +45,8 @@ class MyApp extends StatelessWidget {
       builder: EasyLoading.init(),
       builder: EasyLoading.init(),
       routes: <String, WidgetBuilder>{
       routes: <String, WidgetBuilder>{
         // 对应路由/NavigatorPushNamedPage
         // 对应路由/NavigatorPushNamedPage
+        LoginPage.routeName: (BuildContext context) =>
+            LoginPage(),
         HomePage.routeName: (BuildContext context) =>
         HomePage.routeName: (BuildContext context) =>
             HomePage(),
             HomePage(),
         PatrolJobPage.routeName: (BuildContext context) =>
         PatrolJobPage.routeName: (BuildContext context) =>

+ 6 - 6
lib/model/equipment_info_entity.dart

@@ -27,12 +27,12 @@ class EquipmentInfoData with JsonConvert<EquipmentInfoData> {
 	late String activationOn='';
 	late String activationOn='';
 	late dynamic positionId;
 	late dynamic positionId;
 	late dynamic number;
 	late dynamic number;
-	late String speedA;
-	late String speedB;
-	late String finenessA;
-	late String finenessB;
-	late String holeCountA;
-	late String holeCountB;
+	late String speedA='';
+	late String speedB='';
+	late String finenessA='';
+	late String finenessB='';
+	late String holeCountA='';
+	late String holeCountB='';
 	late dynamic activePeriod;
 	late dynamic activePeriod;
 	late String createdOn;
 	late String createdOn;
 	late String lastOnlineOn='';
 	late String lastOnlineOn='';

+ 1 - 1
lib/model/maint_job_detail_response.dart

@@ -260,7 +260,7 @@ class DeviceList {
     productName = json['productName'];
     productName = json['productName'];
     productKey = json['productKey'];
     productKey = json['productKey'];
     if(null==json['finishTime']){
     if(null==json['finishTime']){
-      finishTime='暂无';
+      finishTime='--';
     }else{
     }else{
       finishTime = json['finishTime'];
       finishTime = json['finishTime'];
     }
     }

+ 1 - 1
lib/model/patrol_job_detail_response_entity.dart

@@ -51,7 +51,7 @@ class PatrolJobDetailResponseDataEquipmentVOS with JsonConvert<PatrolJobDetailRe
 	late String showName;
 	late String showName;
 	late String deviceKey;
 	late String deviceKey;
 	late String productName;
 	late String productName;
-	late String itemCompleteTime='';
+	late String itemCompleteTime='--';
 	late String itemPerson;
 	late String itemPerson;
 	late int patrolJobId;
 	late int patrolJobId;
 	late int isComplete;
 	late int isComplete;

+ 7 - 7
lib/page/device/device_manage_detail_page.dart

@@ -202,7 +202,7 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
                     new Text('A侧速度:', style: GSYConstant.smallTextLight),
                     new Text('A侧速度:', style: GSYConstant.smallTextLight),
-                    new Text(data.speedA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    new Text(data.speedA==''?'未设置':data.speedA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 ),
                 ),
                 SizedBox(
                 SizedBox(
@@ -212,7 +212,7 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
                     new Text('B侧速度:', style: GSYConstant.smallTextLight),
                     new Text('B侧速度:', style: GSYConstant.smallTextLight),
-                    new Text(data.speedB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    Text(data.speedB==''?'未设置':data.speedB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 ),
                 ),
                 SizedBox(
                 SizedBox(
@@ -222,7 +222,7 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
                     new Text('A侧纤度:', style: GSYConstant.smallTextLight),
                     new Text('A侧纤度:', style: GSYConstant.smallTextLight),
-                    new Text(data.finenessA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    Text(data.finenessA==''?'未设置':data.finenessA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 ),
                 ),
                 SizedBox(
                 SizedBox(
@@ -231,8 +231,8 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                 Row(
                 Row(
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
-                    new Text('B侧纤度:', style: GSYConstant.smallTextLight),
-                    new Text(data.finenessB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    const Text('B侧纤度:', style: GSYConstant.smallTextLight),
+                    Text(data.finenessB==''?'未设置':data.finenessB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 ),
                 ),
                 SizedBox(
                 SizedBox(
@@ -242,7 +242,7 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
                     new Text('A侧孔数:', style: GSYConstant.smallTextLight),
                     new Text('A侧孔数:', style: GSYConstant.smallTextLight),
-                    new Text(data.holeCountA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    new Text(data.holeCountA==''?'未设置':data.holeCountA, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 ),
                 ),
                 SizedBox(
                 SizedBox(
@@ -252,7 +252,7 @@ class _DeviceManageDetailPage extends State<DeviceManageDetailPage> {
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   mainAxisAlignment: MainAxisAlignment.spaceBetween,
                   children: [
                   children: [
                     new Text('B侧孔数:', style: GSYConstant.smallTextLight),
                     new Text('B侧孔数:', style: GSYConstant.smallTextLight),
-                    new Text(data.holeCountB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
+                    new Text(data.holeCountB==''?'未设置':data.holeCountB, style: GSYConstant.smallTextLight,textAlign: TextAlign.right),
                   ],
                   ],
                 )
                 )
               ],
               ],

+ 2 - 1
lib/page/device/device_manage_page.dart

@@ -236,12 +236,13 @@ class _DeviceManage extends State<DeviceManagePage> {
   equipmentList() async {
   equipmentList() async {
     // LoadingDialogHelper.showLoading(context);
     // LoadingDialogHelper.showLoading(context);
     var result = await DioUtil().request("equipment/equipmentList",
     var result = await DioUtil().request("equipment/equipmentList",
-        method: DioMethod.post, data: {'index': 1, 'size': 50,'query':{'status':_satus,'name':_username,'isEnable':_isEnabled,'showName':_device}});
+        method: DioMethod.post, data: {'index': 1, 'size': 50,'query':{'status':_satus,'name':_device,'isEnable':_isEnabled,'showName':_username}});
     EquipmentListEntity entity =
     EquipmentListEntity entity =
         equipmentListEntityFromJson(EquipmentListEntity(), result,);
         equipmentListEntityFromJson(EquipmentListEntity(), result,);
     // LoadingDialogHelper.dismissLoading(context);
     // LoadingDialogHelper.dismissLoading(context);
     if (entity.code == 0) {
     if (entity.code == 0) {
       setState(() {
       setState(() {
+        deviceNum=entity.data.total.toString();
         equipmentVOS.clear();
         equipmentVOS.clear();
         equipmentVOS.addAll(entity.data.equipmentVOS);
         equipmentVOS.addAll(entity.data.equipmentVOS);
       });
       });

+ 0 - 2
lib/page/device/device_manage_update_page.dart

@@ -252,11 +252,9 @@ class _DeviceManageUpdatePage extends State<DeviceManageUpdatePage>{
   }
   }
 
 
   parameter() async {
   parameter() async {
-    // LoadingDialogHelper.showLoading(context);
     var result = await DioUtil().request("equipment/parameter",
     var result = await DioUtil().request("equipment/parameter",
         method: DioMethod.post, data: {'id':data.id,'finenessA':data.finenessA,'finenessB':data.finenessB
         method: DioMethod.post, data: {'id':data.id,'finenessA':data.finenessA,'finenessB':data.finenessB
     ,'holeCountA':data.holeCountA,'holeCountB':data.holeCountB,'speedA':data.speedA,'speedB':data.speedB});
     ,'holeCountA':data.holeCountA,'holeCountB':data.holeCountB,'speedA':data.speedA,'speedB':data.speedB});
-    // LoadingDialogHelper.dismissLoading(context);
     if (result['code']== 0) {
     if (result['code']== 0) {
       setState(() {
       setState(() {
         //发出事件
         //发出事件

+ 13 - 12
lib/page/home/home_page.dart

@@ -112,18 +112,19 @@ class _MineViewPageState extends State<HomePage> {
                   ),
                   ),
                   child: Column(
                   child: Column(
                     children: [
                     children: [
+                      // Row(
+                      //   mainAxisAlignment: MainAxisAlignment.end,
+                      //   children: [
+                      //     IconButton(
+                      //       icon: Icon(Icons.settings),
+                      //       color: Colors.white,
+                      //       onPressed: () => {},
+                      //     ),
+                      //   ],
+                      // ),
+                      SizedBox(height: 35),
                       Row(
                       Row(
-                        mainAxisAlignment: MainAxisAlignment.end,
-                        children: [
-                          IconButton(
-                            icon: Icon(Icons.settings),
-                            color: Colors.white,
-                            onPressed: () => {},
-                          ),
-                        ],
-                      ),
-                      SizedBox(width: 5),
-                      Row(
+                        crossAxisAlignment:CrossAxisAlignment.start,
                         children: [
                         children: [
                           Image.asset(
                           Image.asset(
                             "images/head.png",
                             "images/head.png",
@@ -136,7 +137,7 @@ class _MineViewPageState extends State<HomePage> {
                             style: TextStyle(
                             style: TextStyle(
                                 color: Colors.white,
                                 color: Colors.white,
                                 fontWeight: FontWeight.bold,
                                 fontWeight: FontWeight.bold,
-                                fontSize: 15),
+                                fontSize: 18),
                           )
                           )
                         ],
                         ],
                       ),
                       ),

+ 1 - 0
lib/page/login/login_page.dart

@@ -19,6 +19,7 @@ import '../../generated/json/login_response_entity_helper.dart';
 /// Created by Ocean
 /// Created by Ocean
 class LoginPage extends StatefulWidget {
 class LoginPage extends StatefulWidget {
   static const String sName = "login";
   static const String sName = "login";
+  static var routeName = '/LoginPage';
 
 
   const LoginPage({super.key});
   const LoginPage({super.key});
 
 

+ 12 - 9
lib/page/maint/maint_job_detail.dart

@@ -62,6 +62,8 @@ class _MaintJobDetail extends State<MaintJobDetail> {
       }
       }
       if (maintJobDetail.status == 1 || maintJobDetail.status == 3|| maintJobDetail.status == 4) {
       if (maintJobDetail.status == 1 || maintJobDetail.status == 3|| maintJobDetail.status == 4) {
         type = true;
         type = true;
+      }else{
+        type = false;
       }
       }
     });
     });
   }
   }
@@ -166,7 +168,7 @@ class _MaintJobDetail extends State<MaintJobDetail> {
     ws.add(_maintJobDetail(maintJobDetail));
     ws.add(_maintJobDetail(maintJobDetail));
     ws.add(_device());
     ws.add(_device());
     ws.add(_item());
     ws.add(_item());
-    if ('' != maintJobDetail.remarks) {
+    if (null!= maintJobDetail.remarks&&'' != maintJobDetail.remarks) {
       ws.add(_remark());
       ws.add(_remark());
     }
     }
     ws.add(_url());
     ws.add(_url());
@@ -446,16 +448,17 @@ class _MaintJobDetail extends State<MaintJobDetail> {
                 child: Row(
                 child: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: [
                     children: [
-                      new Text(
-                        '设备名称:',
+                      Text(
+                        device.showName!,
                         style: GSYConstant.smallTextBold,
                         style: GSYConstant.smallTextBold,
                       ),
                       ),
-                      Container(
-                        child: Text(
-                          device.showName!,
-                          style: GSYConstant.smallTextBold,
-                          textAlign: TextAlign.right,
-                        ),
+                      Text(
+                        device.isMainted == 0 ? '未完成' : '已完成',
+                        style: TextStyle(
+                            fontSize: GSYConstant.smallTextSize,
+                            color: device.isMainted == 0
+                                ? Colors.red
+                                : Colors.blue),
                       ),
                       ),
                     ]),
                     ]),
               ),
               ),

+ 88 - 72
lib/page/maint/maint_job_edit.dart

@@ -21,32 +21,34 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 
 
-
 class MairintJobEdit extends StatefulWidget {
 class MairintJobEdit extends StatefulWidget {
-
   static var routeName = "/PatrolJobEdit";
   static var routeName = "/PatrolJobEdit";
 
 
   var id;
   var id;
+
   @override
   @override
   State createState() {
   State createState() {
     return _MairintJobEdit(id);
     return _MairintJobEdit(id);
   }
   }
+
   MairintJobEdit({super.key, @required this.id});
   MairintJobEdit({super.key, @required this.id});
 }
 }
 
 
 class _MairintJobEdit extends State<MairintJobEdit> {
 class _MairintJobEdit extends State<MairintJobEdit> {
-
-  List<MaintJobItemsListResponseData> patrolItemVOS = <MaintJobItemsListResponseData>[];
+  List<MaintJobItemsListResponseData> patrolItemVOS =
+      <MaintJobItemsListResponseData>[];
 
 
   List<AssetEntity> imageFiles = [];
   List<AssetEntity> imageFiles = [];
 
 
-  List<int>mList=[];
+  List<int> mList = [];
 
 
   var id;
   var id;
 
 
   var _event;
   var _event;
 
 
-  String note='';
+  String note = '';
+
+  FocusNode focusNode = FocusNode();
 
 
   _MairintJobEdit(this.id);
   _MairintJobEdit(this.id);
 
 
@@ -73,7 +75,9 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                     child: SizedBox(
                     child: SizedBox(
                       height: 50,
                       height: 50,
                       child: TextButton(
                       child: TextButton(
-                        onPressed: () {},
+                        onPressed: () {
+                          Navigator.pop(context);
+                        },
                         child: Text(ConstantString.back),
                         child: Text(ConstantString.back),
                         style: ButtonStyle(
                         style: ButtonStyle(
                           backgroundColor: MaterialStateProperty.all<Color>(
                           backgroundColor: MaterialStateProperty.all<Color>(
@@ -82,7 +86,7 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                               BeveledRectangleBorder(
                               BeveledRectangleBorder(
                                   borderRadius: BorderRadius.circular(0))),
                                   borderRadius: BorderRadius.circular(0))),
                           foregroundColor:
                           foregroundColor:
-                          MaterialStateProperty.all<Color>(Colors.white),
+                              MaterialStateProperty.all<Color>(Colors.white),
                           // padding: MaterialStateProperty.all(EdgeInsets.zero)
                           // padding: MaterialStateProperty.all(EdgeInsets.zero)
                         ),
                         ),
                       ),
                       ),
@@ -90,29 +94,29 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                   ),
                   ),
                   Expanded(
                   Expanded(
                       child: SizedBox(
                       child: SizedBox(
-                        height: 50,
-                        child: TextButton(
-                          onPressed: () {
-                            CloseTaskDialog.showAlertDialog(context, () {
-                              if(imageFiles.isNotEmpty){
-                                uploadList();
-                              }else{
-                                patrolJobRemark();
-                              }
-                            }, '您确认完成维保?');
-                          },
-                          child: Text(ConstantString.complete),
-                          style: ButtonStyle(
-                            backgroundColor:
+                    height: 50,
+                    child: TextButton(
+                      onPressed: () {
+                        CloseTaskDialog.showAlertDialog(context, () {
+                          if (imageFiles.isNotEmpty) {
+                            uploadList();
+                          } else {
+                            patrolJobRemark();
+                          }
+                        }, '您确认完成维保?');
+                      },
+                      child: Text(ConstantString.complete),
+                      style: ButtonStyle(
+                        backgroundColor:
                             MaterialStateProperty.all<Color>(Colors.blue),
                             MaterialStateProperty.all<Color>(Colors.blue),
-                            foregroundColor:
+                        foregroundColor:
                             MaterialStateProperty.all<Color>(Colors.white),
                             MaterialStateProperty.all<Color>(Colors.white),
-                            shape: MaterialStateProperty.all(BeveledRectangleBorder(
-                                borderRadius: BorderRadius.circular(0))),
-                            // padding: MaterialStateProperty.all(EdgeInsets.zero)
-                          ),
-                        ),
-                      )),
+                        shape: MaterialStateProperty.all(BeveledRectangleBorder(
+                            borderRadius: BorderRadius.circular(0))),
+                        // padding: MaterialStateProperty.all(EdgeInsets.zero)
+                      ),
+                    ),
+                  )),
                 ],
                 ],
               ),
               ),
             )
             )
@@ -130,34 +134,39 @@ class _MairintJobEdit extends State<MairintJobEdit> {
     return ws;
     return ws;
   }
   }
 
 
-  Widget _picture(){
+  Widget _picture() {
     return Container(
     return Container(
         child: Column(
         child: Column(
-          children: [
-            Container(
-              height: 50,
-              padding: EdgeInsets.only(left: 12),
-              alignment: Alignment.centerLeft,
-              child: Text('巡检图片',style: TextStyle(
+      children: [
+        Container(
+          height: 50,
+          padding: EdgeInsets.only(left: 12),
+          alignment: Alignment.centerLeft,
+          child: Text('巡检图片',
+              style: TextStyle(
                 color: Colors.black,
                 color: Colors.black,
                 fontSize: GSYConstant.TextSize15,
                 fontSize: GSYConstant.TextSize15,
               )),
               )),
-            ),
-            Container(
-              // padding: EdgeInsets.only(left: 12,right: 12),
-              decoration: BoxDecoration(color: Colors.white),
-              child: PhotoTool(imageCount: 5, lineCount: 5, addCall: (List<AssetEntity> _imageFiles){
+        ),
+        Container(
+          padding: EdgeInsets.only(left: 12, right: 12),
+          decoration: BoxDecoration(color: Colors.white),
+          child: PhotoTool(
+              imageCount: 5,
+              lineCount: 5,
+              addCall: (List<AssetEntity> _imageFiles) {
                 imageFiles.addAll(_imageFiles);
                 imageFiles.addAll(_imageFiles);
-              }, removeCall:(int index){
+              },
+              removeCall: (int index) {
                 imageFiles.remove(index);
                 imageFiles.remove(index);
-              }),
-            )
-          ],
+              },
+              focusNode: focusNode),
         )
         )
-    );
+      ],
+    ));
   }
   }
 
 
-  Widget _notes(){
+  Widget _notes() {
     return Container(
     return Container(
       child: Column(
       child: Column(
         children: <Widget>[
         children: <Widget>[
@@ -165,13 +174,14 @@ class _MairintJobEdit extends State<MairintJobEdit> {
             height: 50,
             height: 50,
             padding: EdgeInsets.only(left: 12),
             padding: EdgeInsets.only(left: 12),
             alignment: Alignment.centerLeft,
             alignment: Alignment.centerLeft,
-            child: Text('任务结果备注',style: TextStyle(
-              color: Colors.black,
-              fontSize: GSYConstant.TextSize15,
-            )),
+            child: Text('任务结果备注',
+                style: TextStyle(
+                  color: Colors.black,
+                  fontSize: GSYConstant.TextSize15,
+                )),
           ),
           ),
           Container(
           Container(
-            padding: EdgeInsets.only(left: 12,right: 12,bottom: 12),
+            padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
             decoration: BoxDecoration(color: Colors.white),
             decoration: BoxDecoration(color: Colors.white),
             child: Column(
             child: Column(
               children: [
               children: [
@@ -180,6 +190,7 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                 ),
                 ),
                 TextField(
                 TextField(
                   maxLines: 5,
                   maxLines: 5,
+                  focusNode: focusNode,
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   style: TextStyle(fontSize: 14),
                   style: TextStyle(fontSize: 14),
                   onChanged: (value) {
                   onChanged: (value) {
@@ -194,11 +205,11 @@ class _MairintJobEdit extends State<MairintJobEdit> {
     );
     );
   }
   }
 
 
-  Widget _mainPatrolAdd(){
+  Widget _mainPatrolAdd() {
     return Column(
     return Column(
       children: [
       children: [
         Container(
         Container(
-          padding: EdgeInsets.fromLTRB(12,0, 12, 0),
+          padding: EdgeInsets.fromLTRB(12, 0, 12, 0),
           height: 50,
           height: 50,
           child: Row(
           child: Row(
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -213,11 +224,13 @@ class _MairintJobEdit extends State<MairintJobEdit> {
               Container(
               Container(
                 child: TextButton(
                 child: TextButton(
                   onPressed: () {
                   onPressed: () {
+                    focusNode.unfocus();
                     Navigator.push(
                     Navigator.push(
                         context,
                         context,
                         MaterialPageRoute(
                         MaterialPageRoute(
-                            builder: (context) =>
-                                MaintJobSelect(id: id,)));
+                            builder: (context) => MaintJobSelect(
+                                  id: id,
+                                )));
                   },
                   },
                   child: Row(
                   child: Row(
                     children: [
                     children: [
@@ -261,12 +274,13 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                         style: TextStyle(
                         style: TextStyle(
                             fontSize: GSYConstant.middleTextWhiteSize,
                             fontSize: GSYConstant.middleTextWhiteSize,
                             fontWeight: FontWeight.bold)),
                             fontWeight: FontWeight.bold)),
-                    IconButton(onPressed: (){
-                      deletePatrolItem(item.id);
-                    }, icon: new Icon(Icons.delete))
+                    IconButton(
+                        onPressed: () {
+                          deletePatrolItem(item.id);
+                        },
+                        icon: new Icon(Icons.delete))
                   ],
                   ],
                 ),
                 ),
-
               ),
               ),
               Container(
               Container(
                 margin: const EdgeInsets.fromLTRB(0, 10.0, 0, 0),
                 margin: const EdgeInsets.fromLTRB(0, 10.0, 0, 0),
@@ -292,7 +306,9 @@ class _MairintJobEdit extends State<MairintJobEdit> {
     var result = await DioUtil().request('maintJob/app-items-list',
     var result = await DioUtil().request('maintJob/app-items-list',
         method: DioMethod.get, params: {'maintJobId': id});
         method: DioMethod.get, params: {'maintJobId': id});
     if (0 == result['code']) {
     if (0 == result['code']) {
-      MaintJobItemsListResponseEntity jobEdit=maintJobItemsListResponseEntityFromJson(MaintJobItemsListResponseEntity(),result);
+      MaintJobItemsListResponseEntity jobEdit =
+          maintJobItemsListResponseEntityFromJson(
+              MaintJobItemsListResponseEntity(), result);
       setState(() {
       setState(() {
         patrolItemVOS.clear();
         patrolItemVOS.clear();
         patrolItemVOS.addAll(jobEdit.data);
         patrolItemVOS.addAll(jobEdit.data);
@@ -315,7 +331,7 @@ class _MairintJobEdit extends State<MairintJobEdit> {
 
 
   deletePatrolItem(int itemId) async {
   deletePatrolItem(int itemId) async {
     var result = await DioUtil().request('maintJob/deleteItems',
     var result = await DioUtil().request('maintJob/deleteItems',
-        method: DioMethod.post, data: {'id': itemId,'jobId':id});
+        method: DioMethod.post, data: {'id': itemId, 'jobId': id});
     if (result['code'] == 0) {
     if (result['code'] == 0) {
       setState(() {
       setState(() {
         patrolItem();
         patrolItem();
@@ -335,17 +351,16 @@ class _MairintJobEdit extends State<MairintJobEdit> {
     List<MultipartFile> files = [];
     List<MultipartFile> files = [];
     for (var element in imageFiles) {
     for (var element in imageFiles) {
       File? imgFile = await element.file;
       File? imgFile = await element.file;
-      String? s=imgFile?.path;
-      MultipartFile file =MultipartFile.fromFileSync(s!);
+      String? s = imgFile?.path;
+      MultipartFile file = MultipartFile.fromFileSync(s!);
       files.add(file);
       files.add(file);
     }
     }
-    var formData =FormData.fromMap({
-      'files': files
-    });
+    var formData = FormData.fromMap({'files': files});
     var result = await DioUtil().request('uploadImg/uploadList',
     var result = await DioUtil().request('uploadImg/uploadList',
         method: DioMethod.post, data: formData);
         method: DioMethod.post, data: formData);
     if (result['code'] == 0) {
     if (result['code'] == 0) {
-      UploadListEntityEntity data=uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
+      UploadListEntityEntity data =
+          uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
       setState(() {
       setState(() {
         mList.clear();
         mList.clear();
         mList.addAll(data.data);
         mList.addAll(data.data);
@@ -358,17 +373,18 @@ class _MairintJobEdit extends State<MairintJobEdit> {
 
 
   patrolJobRemark() async {
   patrolJobRemark() async {
     var result = await DioUtil().request('maintJob/complete',
     var result = await DioUtil().request('maintJob/complete',
-        method: DioMethod.post, data: {'id': id,'fileIds':mList,'remarks':note});
+        method: DioMethod.post,
+        data: {'id': id, 'fileIds': mList, 'remarks': note});
     if (result['code'] == 0) {
     if (result['code'] == 0) {
       setState(() {
       setState(() {
         eventBus.fire(RefreshMaintDetail());
         eventBus.fire(RefreshMaintDetail());
         eventBus.fire(RefreshMaintPage());
         eventBus.fire(RefreshMaintPage());
-        Navigator.of(context)..pop()..pop();
+        Navigator.of(context)
+          ..pop()
+          ..pop();
       });
       });
     } else {
     } else {
       showToast(result['msg']);
       showToast(result['msg']);
     }
     }
   }
   }
-
-
 }
 }

+ 2 - 2
lib/page/maint/maint_job_list.dart

@@ -1,4 +1,4 @@
-import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
+import 'package:deus_app/common/event/RefreshMaintDetail.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
@@ -148,7 +148,7 @@ class _MaintlJobList extends State<MaintlJobList> {
           ],
           ],
         ))
         ))
         , onWillPop: () async{
         , onWillPop: () async{
-          eventBus.fire(RefreshPatrolEdit());
+          eventBus.fire(RefreshMaintDetail());
           return true;
           return true;
         });
         });
   }
   }

+ 3 - 3
lib/page/maint/maint_job_page.dart

@@ -110,7 +110,7 @@ class _MaintJobPage extends State<MaintJobPage> {
             _device = device;
             _device = device;
             _num = num;
             _num = num;
             _stase = stase;
             _stase = stase;
-            index = 0;
+            index = 1;
             _load();
             _load();
           },
           },
         ),
         ),
@@ -212,7 +212,7 @@ class _MaintJobPage extends State<MaintJobPage> {
                     style: TextStyle(
                     style: TextStyle(
                       color: maintJobVO.status == 0 || maintJobVO.status == 4
                       color: maintJobVO.status == 0 || maintJobVO.status == 4
                           ? Colors.red
                           ? Colors.red
-                          : maintJobVO.status == 3
+                          :maintJobVO.status == 1|| maintJobVO.status == 3
                               ? Colors.orange
                               ? Colors.orange
                               : maintJobVO.status == 2
                               : maintJobVO.status == 2
                                   ? Colors.blue
                                   ? Colors.blue
@@ -224,7 +224,7 @@ class _MaintJobPage extends State<MaintJobPage> {
                     border: new Border.all(
                     border: new Border.all(
                       color: maintJobVO.status == 0 || maintJobVO.status == 4
                       color: maintJobVO.status == 0 || maintJobVO.status == 4
                           ? Colors.red
                           ? Colors.red
-                          : maintJobVO.status == 3
+                          :maintJobVO.status == 1|| maintJobVO.status == 3
                               ? Colors.orange
                               ? Colors.orange
                               : maintJobVO.status == 2
                               : maintJobVO.status == 2
                                   ? Colors.blue
                                   ? Colors.blue

+ 21 - 25
lib/page/patrol/patrol_job_detail.dart

@@ -62,6 +62,8 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
         fileUrls.addAll(responseData.fileUrls);
         fileUrls.addAll(responseData.fileUrls);
         if (responseData.status == 1 || responseData.status == 4) {
         if (responseData.status == 1 || responseData.status == 4) {
           type = true;
           type = true;
+        }else{
+          type = false;
         }
         }
       });
       });
     } else {
     } else {
@@ -474,31 +476,25 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
                       ),
                       ),
                     ]),
                     ]),
               ),
               ),
-              Container(
-                margin: const EdgeInsets.only(top: 10),
-                // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 10.0),
-                // alignment: Alignment.centerLeft,
-                child: Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      new Text(
-                        '完成时间:',
-                        style: GSYConstant.smallTextLight,
-                      ),
-                      Container(
-                        child: Text(
-                          device.itemCompleteTime,
-                          style: GSYConstant.smallTextLight,
-                          textAlign: TextAlign.right,
-                        ),
-                      ),
-                    ]),
-              ),
-              // Divider(
-              //   height: 0.8,
-              //   indent: 10.0,
-              //   endIndent: 10.0,
-              //   color: Colors.grey,
+              // Container(
+              //   margin: const EdgeInsets.only(top: 10),
+              //   // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 10.0),
+              //   // alignment: Alignment.centerLeft,
+              //   child: Row(
+              //       mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              //       children: [
+              //         new Text(
+              //           '完成时间:',
+              //           style: GSYConstant.smallTextLight,
+              //         ),
+              //         Container(
+              //           child: Text(
+              //             device.itemCompleteTime,
+              //             style: GSYConstant.smallTextLight,
+              //             textAlign: TextAlign.right,
+              //           ),
+              //         ),
+              //       ]),
               // ),
               // ),
             ],
             ],
           ),
           ),

+ 88 - 72
lib/page/patrol/patrol_job_edit.dart

@@ -2,6 +2,7 @@ import 'dart:io';
 
 
 import 'package:deus_app/PhotoTool.dart';
 import 'package:deus_app/PhotoTool.dart';
 import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
 import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
+import 'package:deus_app/common/event/RefreshPatrol.dart';
 import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
@@ -19,32 +20,33 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 
 
-
 class PatrolJobEdit extends StatefulWidget {
 class PatrolJobEdit extends StatefulWidget {
-
   static var routeName = "/PatrolJobEdit";
   static var routeName = "/PatrolJobEdit";
 
 
   var id;
   var id;
+
   @override
   @override
   State createState() {
   State createState() {
     return _PatrolJobEdit(id);
     return _PatrolJobEdit(id);
   }
   }
+
   PatrolJobEdit({super.key, @required this.id});
   PatrolJobEdit({super.key, @required this.id});
 }
 }
 
 
-class _PatrolJobEdit extends State<PatrolJobEdit> {
-
+class _PatrolJobEdit extends State<PatrolJobEdit> with WidgetsBindingObserver {
   List<PatrolJobEditEmtityData> patrolItemVOS = <PatrolJobEditEmtityData>[];
   List<PatrolJobEditEmtityData> patrolItemVOS = <PatrolJobEditEmtityData>[];
 
 
   List<AssetEntity> imageFiles = [];
   List<AssetEntity> imageFiles = [];
 
 
-  List<int>mList=[];
+  List<int> mList = [];
 
 
   var id;
   var id;
 
 
   var _event;
   var _event;
 
 
-  String note='';
+  String note = '';
+
+  FocusNode focusNode = FocusNode();
 
 
   _PatrolJobEdit(this.id);
   _PatrolJobEdit(this.id);
 
 
@@ -71,7 +73,9 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                     child: SizedBox(
                     child: SizedBox(
                       height: 50,
                       height: 50,
                       child: TextButton(
                       child: TextButton(
-                        onPressed: () {},
+                        onPressed: () {
+                          Navigator.pop(context);
+                        },
                         child: Text(ConstantString.back),
                         child: Text(ConstantString.back),
                         style: ButtonStyle(
                         style: ButtonStyle(
                           backgroundColor: MaterialStateProperty.all<Color>(
                           backgroundColor: MaterialStateProperty.all<Color>(
@@ -80,7 +84,7 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                               BeveledRectangleBorder(
                               BeveledRectangleBorder(
                                   borderRadius: BorderRadius.circular(0))),
                                   borderRadius: BorderRadius.circular(0))),
                           foregroundColor:
                           foregroundColor:
-                          MaterialStateProperty.all<Color>(Colors.white),
+                              MaterialStateProperty.all<Color>(Colors.white),
                           // padding: MaterialStateProperty.all(EdgeInsets.zero)
                           // padding: MaterialStateProperty.all(EdgeInsets.zero)
                         ),
                         ),
                       ),
                       ),
@@ -88,29 +92,29 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                   ),
                   ),
                   Expanded(
                   Expanded(
                       child: SizedBox(
                       child: SizedBox(
-                        height: 50,
-                        child: TextButton(
-                          onPressed: () {
-                            CloseTaskDialog.showAlertDialog(context, () {
-                              if(imageFiles.isNotEmpty){
-                                uploadList();
-                              }else{
-                                patrolJobRemark();
-                              }
-                            }, '您确认完成当前巡检?');
-                          },
-                          child: Text(ConstantString.complete),
-                          style: ButtonStyle(
-                            backgroundColor:
+                    height: 50,
+                    child: TextButton(
+                      onPressed: () {
+                        CloseTaskDialog.showAlertDialog(context, () {
+                          if (imageFiles.isNotEmpty) {
+                            uploadList();
+                          } else {
+                            patrolJobRemark();
+                          }
+                        }, '您确认完成当前巡检?');
+                      },
+                      child: Text(ConstantString.complete),
+                      style: ButtonStyle(
+                        backgroundColor:
                             MaterialStateProperty.all<Color>(Colors.blue),
                             MaterialStateProperty.all<Color>(Colors.blue),
-                            foregroundColor:
+                        foregroundColor:
                             MaterialStateProperty.all<Color>(Colors.white),
                             MaterialStateProperty.all<Color>(Colors.white),
-                            shape: MaterialStateProperty.all(BeveledRectangleBorder(
-                                borderRadius: BorderRadius.circular(0))),
-                            // padding: MaterialStateProperty.all(EdgeInsets.zero)
-                          ),
-                        ),
-                      )),
+                        shape: MaterialStateProperty.all(BeveledRectangleBorder(
+                            borderRadius: BorderRadius.circular(0))),
+                        // padding: MaterialStateProperty.all(EdgeInsets.zero)
+                      ),
+                    ),
+                  )),
                 ],
                 ],
               ),
               ),
             )
             )
@@ -128,34 +132,38 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
     return ws;
     return ws;
   }
   }
 
 
-  Widget _picture(){
+  Widget _picture() {
     return Container(
     return Container(
         child: Column(
         child: Column(
-          children: [
-            Container(
-              height: 50,
-              padding: EdgeInsets.only(left: 12),
-              alignment: Alignment.centerLeft,
-              child: Text('巡检图片',style: TextStyle(
+      children: [
+        Container(
+          height: 50,
+          padding: EdgeInsets.only(left: 12),
+          alignment: Alignment.centerLeft,
+          child: Text('巡检图片',
+              style: TextStyle(
                 color: Colors.black,
                 color: Colors.black,
                 fontSize: GSYConstant.TextSize15,
                 fontSize: GSYConstant.TextSize15,
               )),
               )),
-            ),
-            Container(
-              // padding: EdgeInsets.only(left: 12,right: 12),
-              decoration: BoxDecoration(color: Colors.white),
-              child: PhotoTool(imageCount: 5, lineCount: 5, addCall: (List<AssetEntity> _imageFiles){
+        ),
+        Container(
+          // padding: EdgeInsets.only(left: 12,right: 12),
+          decoration: BoxDecoration(color: Colors.white),
+          child: PhotoTool(
+              imageCount: 5,
+              lineCount: 5,
+              addCall: (List<AssetEntity> _imageFiles) {
                 imageFiles.addAll(_imageFiles);
                 imageFiles.addAll(_imageFiles);
-              }, removeCall:(int index){
+              },
+              removeCall: (int index) {
                 imageFiles.remove(index);
                 imageFiles.remove(index);
-              }),
-            )
-          ],
+              },focusNode:focusNode),
         )
         )
-    );
+      ],
+    ));
   }
   }
 
 
-  Widget _notes(){
+  Widget _notes() {
     return Container(
     return Container(
       child: Column(
       child: Column(
         children: <Widget>[
         children: <Widget>[
@@ -163,13 +171,14 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
             height: 50,
             height: 50,
             padding: EdgeInsets.only(left: 12),
             padding: EdgeInsets.only(left: 12),
             alignment: Alignment.centerLeft,
             alignment: Alignment.centerLeft,
-            child: Text('任务结果备注',style: TextStyle(
-              color: Colors.black,
-              fontSize: GSYConstant.TextSize15,
-            )),
+            child: Text('任务结果备注',
+                style: TextStyle(
+                  color: Colors.black,
+                  fontSize: GSYConstant.TextSize15,
+                )),
           ),
           ),
           Container(
           Container(
-            padding: EdgeInsets.only(left: 12,right: 12,bottom: 12),
+            padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
             decoration: BoxDecoration(color: Colors.white),
             decoration: BoxDecoration(color: Colors.white),
             child: Column(
             child: Column(
               children: [
               children: [
@@ -178,6 +187,7 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                 ),
                 ),
                 TextField(
                 TextField(
                   maxLines: 5,
                   maxLines: 5,
+                  focusNode: focusNode,
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   style: TextStyle(fontSize: 14),
                   style: TextStyle(fontSize: 14),
                   onChanged: (value) {
                   onChanged: (value) {
@@ -192,11 +202,11 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
     );
     );
   }
   }
 
 
-  Widget _mainPatrolAdd(){
+  Widget _mainPatrolAdd() {
     return Column(
     return Column(
       children: [
       children: [
         Container(
         Container(
-          padding: EdgeInsets.fromLTRB(12,0, 12, 0),
+          padding: EdgeInsets.fromLTRB(12, 0, 12, 0),
           height: 50,
           height: 50,
           child: Row(
           child: Row(
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -211,11 +221,13 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
               Container(
               Container(
                 child: TextButton(
                 child: TextButton(
                   onPressed: () {
                   onPressed: () {
+                    focusNode.unfocus();
                     Navigator.push(
                     Navigator.push(
                         context,
                         context,
                         MaterialPageRoute(
                         MaterialPageRoute(
-                            builder: (context) =>
-                            PatrolJobSelect(id: id,)));
+                            builder: (context) => PatrolJobSelect(
+                                  id: id,
+                                )));
                   },
                   },
                   child: Row(
                   child: Row(
                     children: [
                     children: [
@@ -259,12 +271,13 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                         style: TextStyle(
                         style: TextStyle(
                             fontSize: GSYConstant.middleTextWhiteSize,
                             fontSize: GSYConstant.middleTextWhiteSize,
                             fontWeight: FontWeight.bold)),
                             fontWeight: FontWeight.bold)),
-                    IconButton(onPressed: (){
-                      deletePatrolItem(item.id);
-                    }, icon: new Icon(Icons.delete))
+                    IconButton(
+                        onPressed: () {
+                          deletePatrolItem(item.id);
+                        },
+                        icon: new Icon(Icons.delete))
                   ],
                   ],
                 ),
                 ),
-
               ),
               ),
               Container(
               Container(
                 margin: const EdgeInsets.fromLTRB(0, 10.0, 0, 0),
                 margin: const EdgeInsets.fromLTRB(0, 10.0, 0, 0),
@@ -290,7 +303,8 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
     var result = await DioUtil().request('patrolItem/list',
     var result = await DioUtil().request('patrolItem/list',
         method: DioMethod.post, data: {'patrolJobId': id});
         method: DioMethod.post, data: {'patrolJobId': id});
     if (0 == result['code']) {
     if (0 == result['code']) {
-      PatrolJobEditEmtityEntity jobEdit=patrolJobEditEmtityEntityFromJson(PatrolJobEditEmtityEntity(),result);
+      PatrolJobEditEmtityEntity jobEdit = patrolJobEditEmtityEntityFromJson(
+          PatrolJobEditEmtityEntity(), result);
       setState(() {
       setState(() {
         patrolItemVOS.clear();
         patrolItemVOS.clear();
         patrolItemVOS.addAll(jobEdit.data);
         patrolItemVOS.addAll(jobEdit.data);
@@ -329,21 +343,21 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
     _event.cancel();
     _event.cancel();
   }
   }
 
 
+
   uploadList() async {
   uploadList() async {
     List<MultipartFile> files = [];
     List<MultipartFile> files = [];
     for (var element in imageFiles) {
     for (var element in imageFiles) {
       File? imgFile = await element.file;
       File? imgFile = await element.file;
-      String? s=imgFile?.path;
-      MultipartFile file =MultipartFile.fromFileSync(s!);
+      String? s = imgFile?.path;
+      MultipartFile file = MultipartFile.fromFileSync(s!);
       files.add(file);
       files.add(file);
-     }
-    var formData =FormData.fromMap({
-      'files': files
-    });
+    }
+    var formData = FormData.fromMap({'files': files});
     var result = await DioUtil().request('uploadImg/uploadList',
     var result = await DioUtil().request('uploadImg/uploadList',
         method: DioMethod.post, data: formData);
         method: DioMethod.post, data: formData);
     if (result['code'] == 0) {
     if (result['code'] == 0) {
-      UploadListEntityEntity data=uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
+      UploadListEntityEntity data =
+          uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
       setState(() {
       setState(() {
         mList.clear();
         mList.clear();
         mList.addAll(data.data);
         mList.addAll(data.data);
@@ -356,16 +370,18 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
 
 
   patrolJobRemark() async {
   patrolJobRemark() async {
     var result = await DioUtil().request('patrolJob/patrolJobRemark',
     var result = await DioUtil().request('patrolJob/patrolJobRemark',
-        method: DioMethod.post, data: {'id': id,'fileIds':mList,'remarks':note});
+        method: DioMethod.post,
+        data: {'id': id, 'fileIds': mList, 'remarks': note});
     if (result['code'] == 0) {
     if (result['code'] == 0) {
       setState(() {
       setState(() {
         eventBus.fire(RefreshPatrolEdit());
         eventBus.fire(RefreshPatrolEdit());
-        Navigator.of(context)..pop()..pop();
+        eventBus.fire(RefreshPatrol());
+        Navigator.of(context)
+          ..pop()
+          ..pop();
       });
       });
     } else {
     } else {
       showToast(result['msg']);
       showToast(result['msg']);
     }
     }
   }
   }
-
-
 }
 }

+ 148 - 117
lib/page/patrol/patrol_job_list.dart

@@ -1,8 +1,10 @@
+import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/main.dart';
 import 'package:deus_app/model/patrol_job_detail_response_entity.dart';
 import 'package:deus_app/model/patrol_job_detail_response_entity.dart';
 import 'package:deus_app/page/patrol/patrol_job_edit.dart';
 import 'package:deus_app/page/patrol/patrol_job_edit.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
@@ -25,126 +27,154 @@ class _PatrolJobList extends State<PatrolJobList> {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return Scaffold(
-        appBar: TitleBar().backAppbar("巡检设备详情"),
-        backgroundColor: const Color(0xfff2f2f2),
-        body: Stack(
-          children: [
-            Column(
+    return WillPopScope(
+        child: Scaffold(
+            appBar: TitleBar().backAppbar("巡检设备详情"),
+            backgroundColor: const Color(0xfff2f2f2),
+            body: Stack(
               children: [
               children: [
-                SizedBox(
-                  height: 10,
-                ),
-                Row(
-                  mainAxisAlignment: MainAxisAlignment.start,
+                Column(
                   children: [
                   children: [
                     SizedBox(
                     SizedBox(
-                      width: 15,
+                      height: 10,
+                    ),
+                    Row(
+                      mainAxisAlignment: MainAxisAlignment.start,
+                      children: [
+                        SizedBox(
+                          width: 15,
+                        ),
+                        Text(ConstantString.patrolJobTitle,
+                            style: GSYConstant.smallActionLightText),
+                      ],
                     ),
                     ),
-                    Text(ConstantString.patrolJobTitle,
-                        style: GSYConstant.smallActionLightText),
+                    Expanded(
+                      child: Container(
+                          margin: EdgeInsets.only(bottom: 50),
+                          child: ListView.builder(
+                            itemCount: responseData.equipmentVOS.length,
+                            itemBuilder: (context, index) {
+                              return Container(
+                                  margin: EdgeInsets.only(
+                                      top: 12, left: 10, right: 10),
+                                  padding: EdgeInsets.only(top: 12, bottom: 10),
+                                  color: Colors.white,
+                                  child: ListTile(
+                                    title: Column(
+                                      children: [
+                                        Container(
+                                          // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 0.0),
+                                          alignment: Alignment.centerLeft,
+                                          child: Row(
+                                              mainAxisAlignment:
+                                                  MainAxisAlignment
+                                                      .spaceBetween,
+                                              children: [
+                                                Text(
+                                                    responseData
+                                                        .equipmentVOS[index]
+                                                        .showName,
+                                                    style: GSYConstant
+                                                        .smallTextBold),
+                                                Text(
+                                                  responseData
+                                                              .equipmentVOS[
+                                                                  index]
+                                                              .isComplete ==
+                                                          0
+                                                      ? '未完成'
+                                                      : '已完成',
+                                                  style: TextStyle(
+                                                      fontSize: GSYConstant
+                                                          .smallTextSize,
+                                                      color: responseData
+                                                                  .equipmentVOS[
+                                                                      index]
+                                                                  .isComplete ==
+                                                              0
+                                                          ? Colors.red
+                                                          : Colors.blue),
+                                                ),
+                                              ]),
+                                        ),
+                                        Container(
+                                          margin:
+                                              const EdgeInsets.only(top: 10),
+                                          // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 10.0),
+                                          // alignment: Alignment.centerLeft,
+                                          child: Row(
+                                              mainAxisAlignment:
+                                                  MainAxisAlignment
+                                                      .spaceBetween,
+                                              children: [
+                                                new Text(
+                                                  '完成时间:',
+                                                  style: GSYConstant
+                                                      .smallTextLight,
+                                                ),
+                                                Container(
+                                                  child: Text(
+                                                    responseData
+                                                        .equipmentVOS[index]
+                                                        .itemCompleteTime,
+                                                    style: GSYConstant
+                                                        .smallTextLight,
+                                                    textAlign: TextAlign.right,
+                                                  ),
+                                                ),
+                                              ]),
+                                        ),
+                                        SizedBox(
+                                          height: 5,
+                                        ),
+                                      ],
+                                    ),
+                                    onTap: () {
+                                      completeEquipment(index);
+                                    },
+                                  ));
+                            },
+                          )),
+                    )
                   ],
                   ],
                 ),
                 ),
-                Expanded(
-                  child:  Container(
-                      margin: EdgeInsets.only(bottom: 50),
-                      child: ListView.builder(
-                        itemCount: responseData.equipmentVOS.length,
-                        itemBuilder: (context, index) {
-                          return Container(
-                              margin: EdgeInsets.only(top: 12, left: 10, right: 10),
-                              padding: EdgeInsets.only(top: 12, bottom: 10),
-                              color: Colors.white,
-                              child: ListTile(
-                                title: Column(
-                                  children: [
-                                    Container(
-                                      // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 0.0),
-                                      alignment: Alignment.centerLeft,
-                                      child: Row(
-                                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                                          children: [
-                                            Text(responseData.equipmentVOS[index].showName,
-                                                style: GSYConstant.smallTextBold),
-                                            Text(
-                                              responseData
-                                                  .equipmentVOS[index].isComplete==0?'未完成':'已完成',
-                                              style: TextStyle(
-                                                  fontSize: GSYConstant.smallTextSize,
-                                                  color: responseData.equipmentVOS[index].isComplete==0?Colors.red:Colors.blue),
-                                            ),
-                                          ]),
-                                    ),
-                                    Container(
-                                      margin: const EdgeInsets.only(top: 10),
-                                      // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 10.0),
-                                      // alignment: Alignment.centerLeft,
-                                      child: Row(
-                                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                                          children: [
-                                            new Text(
-                                              '完成时间:',
-                                              style: GSYConstant.smallTextLight,
-                                            ),
-                                            Container(
-                                              child: Text(
-                                                responseData.equipmentVOS[index].itemCompleteTime,
-                                                style: GSYConstant.smallTextLight,
-                                                textAlign: TextAlign.right,
-                                              ),
-                                            ),
-                                          ]),
-                                    ),
-                                    SizedBox(
-                                      height: 5,
-                                    ),
-                                  ],
-                                ),
-                                onTap: () {
-                                  completeEquipment(index);
-                                },
-                              ));
-                        },
-                      )
+                Positioned(
+                  left: 0,
+                  right: 0,
+                  bottom: 0,
+                  // flex: 7,
+                  child: SizedBox(
+                    height: 50,
+                    width: double.infinity,
+                    child: TextButton(
+                      onPressed: () {
+                        if (next()) {
+                          Navigator.push(
+                              context,
+                              MaterialPageRoute(
+                                  builder: (context) =>
+                                      PatrolJobEdit(id: responseData.id)));
+                        }
+                      },
+                      style: ButtonStyle(
+                        backgroundColor:
+                            MaterialStateProperty.all<Color>(Color(0xFF4875EC)),
+                        shape: MaterialStateProperty.all(BeveledRectangleBorder(
+                            borderRadius: BorderRadius.circular(0))),
+                        foregroundColor:
+                            MaterialStateProperty.all<Color>(Colors.white),
+                        // padding: MaterialStateProperty.all(EdgeInsets.zero)
+                      ),
+                      child: const Text(ConstantString.next),
+                    ),
                   ),
                   ),
                 )
                 )
-
               ],
               ],
-            ),
-            Positioned(
-              left: 0,
-              right: 0,
-              bottom:0,
-              // flex: 7,
-              child:SizedBox(
-              height: 50,
-              width: double.infinity,
-              child: TextButton(
-                onPressed: () {
-                  if(next()){
-                    Navigator.push(
-                        context,
-                        MaterialPageRoute(
-                            builder: (context) =>
-                                PatrolJobEdit(id: responseData.id)));
-                  }
-                },
-                style: ButtonStyle(
-                  backgroundColor: MaterialStateProperty.all<Color>(
-                      Color(0xFF4875EC)),
-                  shape: MaterialStateProperty.all(
-                      BeveledRectangleBorder(
-                          borderRadius: BorderRadius.circular(0))),
-                  foregroundColor:
-                  MaterialStateProperty.all<Color>(Colors.white),
-                  // padding: MaterialStateProperty.all(EdgeInsets.zero)
-                ),
-                child: const Text(ConstantString.next),
-              ),
-            ),
-            )
-          ],
-        ));
+            )),
+        onWillPop: () async {
+          eventBus.fire(RefreshPatrolEdit());
+          return true;
+        });
   }
   }
 
 
   completeEquipment(int index) async {
   completeEquipment(int index) async {
@@ -155,6 +185,7 @@ class _PatrolJobList extends State<PatrolJobList> {
       if (result['code'] == 0) {
       if (result['code'] == 0) {
         setState(() {
         setState(() {
           responseData.equipmentVOS[index].isComplete = 1;
           responseData.equipmentVOS[index].isComplete = 1;
+          responseData.equipmentVOS[index].itemCompleteTime = result['data'];
         });
         });
       } else {
       } else {
         showToast(result['msg']);
         showToast(result['msg']);
@@ -162,13 +193,13 @@ class _PatrolJobList extends State<PatrolJobList> {
     }
     }
   }
   }
 
 
-  bool next(){
-    bool isNext=true;
+  bool next() {
+    bool isNext = true;
     for (var element in responseData.equipmentVOS) {
     for (var element in responseData.equipmentVOS) {
-        if(element.isComplete==0){
-          isNext=false;
-          break;
-        }
+      if (element.isComplete == 0) {
+        isNext = false;
+        break;
+      }
     }
     }
     return isNext;
     return isNext;
   }
   }

+ 2 - 3
lib/page/patrol/patrol_job_page.dart

@@ -62,7 +62,6 @@ class _PatrolJobPage extends State<PatrolJobPage> {
 
 
   @override
   @override
   void initState() {
   void initState() {
-    // TODO: implement initState
     super.initState();
     super.initState();
     _load();
     _load();
     _event = eventBus.on<RefreshPatrol>().listen((event) {
     _event = eventBus.on<RefreshPatrol>().listen((event) {
@@ -187,7 +186,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                       color:
                       color:
                           patrolJobData.status == 0 || patrolJobData.status == 4
                           patrolJobData.status == 0 || patrolJobData.status == 4
                               ? Colors.red
                               ? Colors.red
-                              : patrolJobData.status == 1
+                              : patrolJobData.status == 1||patrolJobData.status == 3
                                   ? Colors.orange
                                   ? Colors.orange
                                   : patrolJobData.status == 2
                                   : patrolJobData.status == 2
                                       ? Colors.blue
                                       ? Colors.blue
@@ -200,7 +199,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                       color:
                       color:
                           patrolJobData.status == 0 || patrolJobData.status == 4
                           patrolJobData.status == 0 || patrolJobData.status == 4
                               ? Colors.red
                               ? Colors.red
-                              : patrolJobData.status == 1
+                              : patrolJobData.status == 1 ||patrolJobData.status == 3
                                   ? Colors.orange
                                   ? Colors.orange
                                   : patrolJobData.status == 2
                                   : patrolJobData.status == 2
                                       ? Colors.blue
                                       ? Colors.blue

+ 80 - 67
lib/page/repair/repair_add_page.dart

@@ -27,13 +27,15 @@ class RepairAddPage extends StatefulWidget {
 }
 }
 
 
 class _RepairAddPage extends State<RepairAddPage> {
 class _RepairAddPage extends State<RepairAddPage> {
-
   int groupValue = 1;
   int groupValue = 1;
-  String note='',theme='';
+  String note = '', theme = '';
   List<AssetEntity> imageFiles = [];
   List<AssetEntity> imageFiles = [];
-  List<int>mList=[];
+  List<int> mList = [];
   var _event;
   var _event;
-  RepairQueryDeviceResponseDataList _dataList=RepairQueryDeviceResponseDataList();
+  RepairQueryDeviceResponseDataList _dataList =
+      RepairQueryDeviceResponseDataList();
+
+  FocusNode focusNode = FocusNode();
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
@@ -54,31 +56,30 @@ class _RepairAddPage extends State<RepairAddPage> {
           Positioned(
           Positioned(
             left: 0,
             left: 0,
             right: 0,
             right: 0,
-            bottom:0,
+            bottom: 0,
             // flex: 7,
             // flex: 7,
-            child:SizedBox(
+            child: SizedBox(
               height: 50,
               height: 50,
               width: double.infinity,
               width: double.infinity,
               child: TextButton(
               child: TextButton(
                 onPressed: () {
                 onPressed: () {
-                  if(isAddDevice){
-                    if(imageFiles.isNotEmpty){
+                  if (isAddDevice) {
+                    if (imageFiles.isNotEmpty) {
                       uploadList();
                       uploadList();
-                    }else{
+                    } else {
                       patrolJobRemark();
                       patrolJobRemark();
                     }
                     }
-                  }else{
+                  } else {
                     showToast('请选择设备');
                     showToast('请选择设备');
                   }
                   }
                 },
                 },
                 style: ButtonStyle(
                 style: ButtonStyle(
-                  backgroundColor: MaterialStateProperty.all<Color>(
-                      Color(0xFF4875EC)),
-                  shape: MaterialStateProperty.all(
-                      BeveledRectangleBorder(
-                          borderRadius: BorderRadius.circular(0))),
+                  backgroundColor:
+                      MaterialStateProperty.all<Color>(Color(0xFF4875EC)),
+                  shape: MaterialStateProperty.all(BeveledRectangleBorder(
+                      borderRadius: BorderRadius.circular(0))),
                   foregroundColor:
                   foregroundColor:
-                  MaterialStateProperty.all<Color>(Colors.white),
+                      MaterialStateProperty.all<Color>(Colors.white),
                 ),
                 ),
                 child: const Text(ConstantString.submit),
                 child: const Text(ConstantString.submit),
               ),
               ),
@@ -92,24 +93,26 @@ class _RepairAddPage extends State<RepairAddPage> {
     super.initState();
     super.initState();
     _event = eventBus.on<RepairQueryDeviceResponseDataList>().listen((event) {
     _event = eventBus.on<RepairQueryDeviceResponseDataList>().listen((event) {
       setState(() {
       setState(() {
-        _dataList=event;
-        isAddDevice=true;
+        _dataList = event;
+        isAddDevice = true;
       });
       });
     });
     });
   }
   }
-  bool isAddDevice=false;
+
+  bool isAddDevice = false;
+
   List<Widget> _Ws() {
   List<Widget> _Ws() {
     List<Widget> ws = [];
     List<Widget> ws = [];
     ws.add(_basicInformation());
     ws.add(_basicInformation());
     ws.add(_patrolAddTitle());
     ws.add(_patrolAddTitle());
-    if(isAddDevice){
+    if (isAddDevice) {
       ws.add(_patrolAdd());
       ws.add(_patrolAdd());
     }
     }
     ws.add(_notes());
     ws.add(_notes());
     return ws;
     return ws;
   }
   }
 
 
-  Widget _notes(){
+  Widget _notes() {
     return Container(
     return Container(
       child: Column(
       child: Column(
         children: <Widget>[
         children: <Widget>[
@@ -117,13 +120,14 @@ class _RepairAddPage extends State<RepairAddPage> {
             height: 50,
             height: 50,
             padding: EdgeInsets.only(left: 12),
             padding: EdgeInsets.only(left: 12),
             alignment: Alignment.centerLeft,
             alignment: Alignment.centerLeft,
-            child: Text('报修说明',style: TextStyle(
-              color: Colors.black,
-              fontSize: GSYConstant.TextSize15,
-            )),
+            child: Text('报修说明',
+                style: TextStyle(
+                  color: Colors.black,
+                  fontSize: GSYConstant.TextSize15,
+                )),
           ),
           ),
           Container(
           Container(
-            padding: EdgeInsets.only(left: 12,right: 12,bottom: 12),
+            padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
             decoration: BoxDecoration(color: Colors.white),
             decoration: BoxDecoration(color: Colors.white),
             child: Column(
             child: Column(
               children: [
               children: [
@@ -134,6 +138,7 @@ class _RepairAddPage extends State<RepairAddPage> {
                   maxLines: 5,
                   maxLines: 5,
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   style: TextStyle(fontSize: 14),
                   style: TextStyle(fontSize: 14),
+                  focusNode: focusNode,
                   onChanged: (value) {
                   onChanged: (value) {
                     note = value;
                     note = value;
                   },
                   },
@@ -144,11 +149,16 @@ class _RepairAddPage extends State<RepairAddPage> {
           Container(
           Container(
             // padding: EdgeInsets.only(left: 12,right: 12),
             // padding: EdgeInsets.only(left: 12,right: 12),
             decoration: BoxDecoration(color: Colors.white),
             decoration: BoxDecoration(color: Colors.white),
-            child: PhotoTool(imageCount: 5, lineCount: 5, addCall: (List<AssetEntity> _imageFiles){
-              imageFiles.addAll(_imageFiles);
-            }, removeCall:(int index){
-              imageFiles.remove(index);
-            }),
+            child: PhotoTool(
+                imageCount: 5,
+                lineCount: 5,
+                addCall: (List<AssetEntity> _imageFiles) {
+                  imageFiles.addAll(_imageFiles);
+                },
+                removeCall: (int index) {
+                  imageFiles.remove(index);
+                },
+                focusNode: focusNode),
           )
           )
         ],
         ],
       ),
       ),
@@ -244,7 +254,7 @@ class _RepairAddPage extends State<RepairAddPage> {
                   textAlignVertical: TextAlignVertical.center,
                   textAlignVertical: TextAlignVertical.center,
                   textAlign: TextAlign.left,
                   textAlign: TextAlign.left,
                   onChanged: (value) {
                   onChanged: (value) {
-                    theme=value;
+                    theme = value;
                   },
                   },
                 ),
                 ),
               )
               )
@@ -275,11 +285,11 @@ class _RepairAddPage extends State<RepairAddPage> {
           Container(
           Container(
             child: TextButton(
             child: TextButton(
               onPressed: () {
               onPressed: () {
+                focusNode.unfocus();
                 Navigator.push(
                 Navigator.push(
                     context,
                     context,
                     MaterialPageRoute(
                     MaterialPageRoute(
-                        builder: (context) =>
-                        new RepairJobDeviceList()));
+                        builder: (context) => new RepairJobDeviceList()));
               },
               },
               child: Row(
               child: Row(
                 children: [
                 children: [
@@ -320,37 +330,37 @@ class _RepairAddPage extends State<RepairAddPage> {
           padding: EdgeInsets.only(top: 3, bottom: 3, left: 5, right: 5),
           padding: EdgeInsets.only(top: 3, bottom: 3, left: 5, right: 5),
           child: Text(
           child: Text(
             _dataList.status == 0
             _dataList.status == 0
-                  ? '在线'
-                  : _dataList.status == 1
-                  ? '离线'
-                  : _dataList.status == 2
-                  ? '未激活'
-                  : '未知',
-              textAlign: TextAlign.right,
-              style: TextStyle(
-                color: _dataList.status == 0
-                    ? Colors.blue
-                    : _dataList.status == 1
-                    ? Colors.orange
+                ? '在线'
+                : _dataList.status == 1
+                    ? '离线'
                     : _dataList.status == 2
                     : _dataList.status == 2
-                    ? Colors.red
-                    : Colors.black,
-                fontSize: GSYConstant.minTextSize,
-              ),
-              ),
+                        ? '未激活'
+                        : '未知',
+            textAlign: TextAlign.right,
+            style: TextStyle(
+              color: _dataList.status == 0
+                  ? Colors.blue
+                  : _dataList.status == 1
+                      ? Colors.orange
+                      : _dataList.status == 2
+                          ? Colors.red
+                          : Colors.black,
+              fontSize: GSYConstant.minTextSize,
+            ),
+          ),
           decoration: BoxDecoration(
           decoration: BoxDecoration(
             border: new Border.all(
             border: new Border.all(
               color: _dataList.status == 0
               color: _dataList.status == 0
                   ? Colors.blue
                   ? Colors.blue
                   : _dataList.status == 1
                   : _dataList.status == 1
-                  ? Colors.orange
-                  : _dataList.status == 2
-                  ? Colors.red
-                  : Colors.black, //边框颜色
+                      ? Colors.orange
+                      : _dataList.status == 2
+                          ? Colors.red
+                          : Colors.black, //边框颜色
               width: 1.0, //边框粗细
               width: 1.0, //边框粗细
             ),
             ),
-            borderRadius: const BorderRadius.all(
-                const Radius.circular(3.0)), //边框的弧度
+            borderRadius:
+                const BorderRadius.all(const Radius.circular(3.0)), //边框的弧度
           ),
           ),
         )
         )
       ]),
       ]),
@@ -364,9 +374,14 @@ class _RepairAddPage extends State<RepairAddPage> {
   }
   }
 
 
   patrolJobRemark() async {
   patrolJobRemark() async {
-    var result = await DioUtil().request('repair-bill/create',
-        method: DioMethod.post, data: {'deviceId': _dataList.id,'repairImgIds':mList,'instructions':note,
-          'urg':groupValue,'theme':theme});
+    var result = await DioUtil()
+        .request('repair-bill/create', method: DioMethod.post, data: {
+      'deviceId': _dataList.id,
+      'repairImgIds': mList,
+      'instructions': note,
+      'urg': groupValue,
+      'theme': theme
+    });
     if (result['code'] == 0) {
     if (result['code'] == 0) {
       setState(() {
       setState(() {
         eventBus.fire(RefreshRepairPage());
         eventBus.fire(RefreshRepairPage());
@@ -381,17 +396,16 @@ class _RepairAddPage extends State<RepairAddPage> {
     List<MultipartFile> files = [];
     List<MultipartFile> files = [];
     for (var element in imageFiles) {
     for (var element in imageFiles) {
       File? imgFile = await element.file;
       File? imgFile = await element.file;
-      String? s=imgFile?.path;
-      MultipartFile file =MultipartFile.fromFileSync(s!);
+      String? s = imgFile?.path;
+      MultipartFile file = MultipartFile.fromFileSync(s!);
       files.add(file);
       files.add(file);
     }
     }
-    var formData =FormData.fromMap({
-      'files': files
-    });
+    var formData = FormData.fromMap({'files': files});
     var result = await DioUtil().request('uploadImg/uploadList',
     var result = await DioUtil().request('uploadImg/uploadList',
         method: DioMethod.post, data: formData);
         method: DioMethod.post, data: formData);
     if (result['code'] == 0) {
     if (result['code'] == 0) {
-      UploadListEntityEntity data=uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
+      UploadListEntityEntity data =
+          uploadListEntityEntityFromJson(UploadListEntityEntity(), result);
       setState(() {
       setState(() {
         mList.clear();
         mList.clear();
         mList.addAll(data.data);
         mList.addAll(data.data);
@@ -401,5 +415,4 @@ class _RepairAddPage extends State<RepairAddPage> {
       showToast(result['msg']);
       showToast(result['msg']);
     }
     }
   }
   }
-
 }
 }

+ 2 - 0
lib/page/repair/repair_detail.dart

@@ -521,6 +521,8 @@ class _RepairDetail extends State<RepairDetail> {
           }else if(responseData.status==3){
           }else if(responseData.status==3){
             buttonText='登记维修';
             buttonText='登记维修';
           }
           }
+        }else{
+          type = false;
         }
         }
       });
       });
     } else {
     } else {

+ 4 - 1
lib/page/repair/repair_job_edit.dart

@@ -45,6 +45,8 @@ class _RepairJobEdit extends State<RepairJobEdit> {
 
 
   String note='';
   String note='';
 
 
+  FocusNode focusNode = FocusNode();
+
   _RepairJobEdit(this.responseData);
   _RepairJobEdit(this.responseData);
 
 
   @override
   @override
@@ -127,7 +129,7 @@ class _RepairJobEdit extends State<RepairJobEdit> {
                 imageFiles.addAll(_imageFiles);
                 imageFiles.addAll(_imageFiles);
               }, removeCall:(int index){
               }, removeCall:(int index){
                 imageFiles.remove(index);
                 imageFiles.remove(index);
-              }),
+              },  focusNode: focusNode),
             )
             )
           ],
           ],
         )
         )
@@ -159,6 +161,7 @@ class _RepairJobEdit extends State<RepairJobEdit> {
                   maxLines: 5,
                   maxLines: 5,
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   decoration: InputDecoration(border: OutlineInputBorder()),
                   style: TextStyle(fontSize: 14),
                   style: TextStyle(fontSize: 14),
+                  focusNode: focusNode,
                   onChanged: (value) {
                   onChanged: (value) {
                     note = value;
                     note = value;
                   },
                   },

+ 1 - 1
lib/widget/MaintJobDrawer.dart

@@ -20,7 +20,7 @@ DropMenuItem close = DropMenuItem('已完成', 2);
 DropMenuItem on = DropMenuItem('执行中', 1);
 DropMenuItem on = DropMenuItem('执行中', 1);
 DropMenuItem overdue = DropMenuItem('待执行', 3);
 DropMenuItem overdue = DropMenuItem('待执行', 3);
 DropMenuItem complete = DropMenuItem('已逾期', 4);
 DropMenuItem complete = DropMenuItem('已逾期', 4);
-List<DropMenuItem> sexMenuItems = [not, close, on, overdue, complete];
+List<DropMenuItem> sexMenuItems = [not, close, on, complete];
 
 
 typedef _CallBack = void Function(String device, String name,dynamic stase);
 typedef _CallBack = void Function(String device, String name,dynamic stase);
 
 

+ 1 - 0
lib/widget/MyDrawer.dart

@@ -176,6 +176,7 @@ class _myDrawer extends State<MyDrawer> {
                   onPressed: () {
                   onPressed: () {
                     if (widget.callback != null) {
                     if (widget.callback != null) {
                       widget.callback(_device,_username,satus,isEnabled);
                       widget.callback(_device,_username,satus,isEnabled);
+                      Navigator.pop(context);
                     }
                     }
                   },
                   },
                   child: Text(ConstantString.query),
                   child: Text(ConstantString.query),

+ 1 - 23
lib/widget/PatrolJobDrawer.dart

@@ -20,7 +20,7 @@ DropMenuItem close = DropMenuItem('已完成', 2);
 DropMenuItem on = DropMenuItem('执行中', 1);
 DropMenuItem on = DropMenuItem('执行中', 1);
 DropMenuItem overdue = DropMenuItem('待执行', 3);
 DropMenuItem overdue = DropMenuItem('待执行', 3);
 DropMenuItem complete = DropMenuItem('已逾期', 4);
 DropMenuItem complete = DropMenuItem('已逾期', 4);
-List<DropMenuItem> sexMenuItems = [not, close, on, overdue, complete];
+List<DropMenuItem> sexMenuItems = [not, close, on, complete];
 
 
 DropMenuItem day = DropMenuItem('日计划', 0);
 DropMenuItem day = DropMenuItem('日计划', 0);
 DropMenuItem circumference = DropMenuItem('周计划', 1);
 DropMenuItem circumference = DropMenuItem('周计划', 1);
@@ -122,28 +122,6 @@ class _patrolJobDrawer extends State<PatrolJobDrawer> {
                 ),
                 ),
               ]),
               ]),
             ),
             ),
-            Padding(
-              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
-              child: Row(children: [
-                Expanded(
-                  flex: 2,
-                  child: Text(
-                    '周期规则',
-                    style: TextStyle(
-                      color: Colors.black,
-                      fontSize: GSYConstant.minTextSize,
-                      fontWeight: FontWeight.bold,
-                    ),
-                  ),
-                ),
-                Expanded(
-                  flex: 7,
-                  child: Container(
-                    child: dropDownButtonsColumn(sexMenuItems2, '请选择周期规则', 1),
-                  ),
-                ),
-              ]),
-            ),
             SizedBox(
             SizedBox(
               height: 80,
               height: 80,
             ),
             ),

+ 1 - 1
lib/widget/RepairJobDrawer.dart

@@ -20,7 +20,7 @@ DropMenuItem close = DropMenuItem('待执行', 2);
 DropMenuItem on = DropMenuItem('维修中', 3);
 DropMenuItem on = DropMenuItem('维修中', 3);
 DropMenuItem overdue = DropMenuItem('已关闭', 4);
 DropMenuItem overdue = DropMenuItem('已关闭', 4);
 DropMenuItem complete = DropMenuItem('已完成', 5);
 DropMenuItem complete = DropMenuItem('已完成', 5);
-List<DropMenuItem> sexMenuItems = [not, close, on, overdue, complete];
+List<DropMenuItem> sexMenuItems = [not, on, overdue, complete];
 
 
 typedef _CallBack = void Function(String device, String name,dynamic stase);
 typedef _CallBack = void Function(String device, String name,dynamic stase);