1
0

2 Ревизии 47e10b25b0 ... 544c39ec3f

Автор SHA1 Съобщение Дата
  tongfeng 544c39ec3f Merge remote-tracking branch 'origin/master' преди 2 години
  tongfeng 6a375a48f1 巡检任务 维保任务 преди 2 години

+ 3 - 0
lib/main.dart

@@ -1,6 +1,7 @@
 import 'package:deus_app/page/device/device_manage_page.dart';
 import 'package:deus_app/page/home/home_page.dart';
 import 'package:deus_app/page/login/login_page.dart';
+import 'package:deus_app/page/maint/maint_job_page.dart';
 import 'package:deus_app/page/patrol/patrol_job_page.dart';
 import 'package:flutter/material.dart';
 
@@ -39,6 +40,8 @@ class MyApp extends StatelessWidget {
             PatrolJobPage(),
         DeviceManagePage.routeName: (BuildContext context) =>
             DeviceManagePage(),
+        MaintJobPage.routeName: (BuildContext context) =>
+            MaintJobPage(),
       },
     );
   }

+ 468 - 41
lib/model/patrol_response_entity.dart

@@ -1,48 +1,50 @@
 import 'package:deus_app/generated/json/base/json_convert_content.dart';
 import 'package:json2dart_safe/json2dart.dart';
 
-class PatrolJobDataResponseEntity with JsonConvert<PatrolJobDataResponseEntity>{
+class PatrolJobDataResponseEntity
+    with JsonConvert<PatrolJobDataResponseEntity> {
   late int code;
   late PatrolJobDataVO data;
   late String msg;
 }
 
-class PatrolJobDataVO with JsonConvert<PatrolJobDataVO>{
+class PatrolJobDataVO with JsonConvert<PatrolJobDataVO> {
   late PatrolJobData query;
   late List<PatrolJobData> list;
 }
 
-class PatrolJobDetailResponseEntity with JsonConvert<PatrolJobDetailResponseEntity>{
+class PatrolJobDetailResponseEntity
+    with JsonConvert<PatrolJobDetailResponseEntity> {
   late int code;
   late PatrolJobDetailData data;
   late String msg;
 }
 
-class PatrolJobDeviceResponseData with JsonConvert<PatrolJobDeviceData>{
+class PatrolJobDeviceResponseData with JsonConvert<PatrolJobDeviceData> {
   late int code;
   late List<PatrolJobDeviceData> data;
   late String msg;
 }
 
-class PatrolJobItemResponseData with JsonConvert<PatrolJobItemData>{
+class PatrolJobItemResponseData with JsonConvert<PatrolJobItemData> {
   late int code;
   late List<PatrolJobItemData> data;
   late String msg;
 }
 
-
-
-class PatrolJobDeviceData with JsonConvert<PatrolJobDeviceData>{
+class PatrolJobDeviceData with JsonConvert<PatrolJobDeviceData> {
   late int id;
   late String name;
   late String showName;
   late String deviceKey;
   late String itemCompleteTime;
   late String itemPerson;
-  PatrolJobDeviceData(this.name,this.showName,this.deviceKey,this.itemCompleteTime,this.itemPerson,this.id);
+
+  PatrolJobDeviceData(this.name, this.showName, this.deviceKey,
+      this.itemCompleteTime, this.itemPerson);
 }
 
-class PatrolJobDetailData with JsonConvert<PatrolJobDetailData>{
+class PatrolJobDetailData with JsonConvert<PatrolJobDetailData> {
   late String name;
   late String number;
   late String planName;
@@ -55,63 +57,488 @@ class PatrolJobDetailData with JsonConvert<PatrolJobDetailData>{
   late int status;
   late String remark;
   late List<PatrolJobImageData> fileUrls;
-  PatrolJobDetailData(this.name,this.number,this.planName,this.planNumber,this.termType,this.startDate,this.endDate,this.personnel,this.finishTime,this.status,this.remark);
+
+  PatrolJobDetailData(
+      this.name,
+      this.number,
+      this.planName,
+      this.planNumber,
+      this.termType,
+      this.startDate,
+      this.endDate,
+      this.personnel,
+      this.finishTime,
+      this.status,
+      this.remark);
 }
 
-class PatrolJobItemData with JsonConvert<PatrolJobItemData>{
+class PatrolJobItemData with JsonConvert<PatrolJobItemData> {
   late String name;
   late String result;
   late int id;
   PatrolJobItemData(this.name,this.result,this.id);
 }
 
-class PatrolJobImageData with JsonConvert<PatrolJobImageData>{
+class PatrolJobImageData with JsonConvert<PatrolJobImageData> {
   late int id;
   late String url;
-  PatrolJobImageData(this.id,this.url);
-}
 
+  PatrolJobImageData(this.id, this.url);
+}
 
 /**
- * 巡检任务列表数据
+ * 巡检任务列表响应
  */
-class PatrolJobData{
+class PatrolJobResponse {
+  int? code;
+  PatrolJobQuery? data;
+  String? msg;
+
+  PatrolJobResponse({
+    this.code,
+    this.data,
+    this.msg,
+  });
+
+  Map<String, dynamic> toJson() {
+    return Map<String, dynamic>()
+      ..put('code', this.code)
+      ..put('data', this.data?.toJson())
+      ..put('msg', this.msg);
+  }
+
+  PatrolJobResponse.fromJson(Map<String, dynamic> json) {
+    if (json['code'] != null) {
+      this.code = json.asInt('code');
+    }
+    if (json['data'] != null) {
+      this.data = PatrolJobQuery.fromJson(json['data']);
+    }
+    if (json['msg'] != null) {
+      this.msg = json.asString('msg');
+    }
+  }
+
+  @override
+  String toString(){
+    return  'PatrolJobResponse{code: $code,data: $data,msg: $msg}';
+  }
+
+  static PatrolJobResponse toBean(Map<String, dynamic> json) =>
+      PatrolJobResponse.fromJson(json);
+}
+
+class PatrolJobQuery {
+  int? total;
+  int? index;
+  int? size;
+  String? sortBy;
+  int? sort;
+  PatrolJobData? query;
+  List<PatrolJobData>? patrolJobVOS;
+
+  @override
+  String toString(){
+    return 'PatrolJobQuery{total: $total,index: $index,size: $size,sortBy: $sortBy,sort: $sort,query: $query,patrolJobVOS: $patrolJobVOS}';
+  }
+
+  PatrolJobQuery({
+    this.total,
+    this.index,
+    this.size,
+    this.sortBy,
+    this.sort,
+    this.query,
+    this.patrolJobVOS,
+  });
+
+  Map<String, dynamic> toJson() {
+    return Map<String, dynamic>()
+      ..put('total', this.total)
+      ..put('index', this.index)
+      ..put('size', this.size)
+      ..put('sortBy', this.sortBy)
+      ..put('sort', this.sort)
+      ..put('query', this.query?.toJson())
+      ..put('patrolJobVOS', this.patrolJobVOS?.map((v) => v.toJson()).toList());
+  }
+
+  PatrolJobQuery.fromJson(Map<String, dynamic> json) {
+    if (null != json['total']) {
+      this.total = json.asInt('total');
+    }
+    if (null != json['index']) {
+      this.index = json.asInt('index');
+    }
+    if (null != json['size']) {
+      this.size = json.asInt('size');
+    }
+    if (null != json['sortBy']) {
+      this.sortBy = json.asString('sortBy');
+    }
+    if (null != json['sort']) {
+      this.sort = json.asInt('sort');
+    }
+    if (null != json['query']) {
+      this.query = PatrolJobData.fromJson(json['query']);
+    }
+    if (null != json['patrolJobVOS']) {
+      this.patrolJobVOS = (json['patrolJobVOS'] as List)
+          .map((v) => PatrolJobData.fromJson(v))
+          .toList();
+    }
+  }
+}
+
+class PatrolJobData {
+  int? id;
   String? name;
   String? number;
-  int? count;
   String? planName;
   String? planNumber;
   int? termType;
+  int? personnelId;
+  String? personnel;
+  String? remarks;
+  String? finishTime;
+  List<FileUrls>? fileUrls;
   String? startDate;
   String? endDate;
   int? status;
+  String? closeReason;
+  String? customerName;
+  String? channelName;
+  String? closeUser;
+  String? closeUserName;
+  String? closeTime;
+  String? createTime;
+  int? creator;
+  String? creatorName;
+  List<PatrolItemVOS>? patrolItemVOS;
+  List<EquipmentVOS>? equipmentVOS;
 
-  PatrolJobData({this.name,this.number,this.count,this.planName,this.planNumber,this.termType,this.startDate,this.endDate,this.status,});
+  @override
+  String toString(){
+    return 'PatrolJobData{id: $id,name: $name,number: $number,planName: $planName,planNumber: $planNumber,termType: $termType,personnelId: $personnelId,personnel: $personnel'
+        ',remarks: $remarks,finishTime: $finishTime,fileUrls: $fileUrls,startDate: $startDate,endDate: $endDate,status $status,closeReson: $closeReason'
+        ',customerName: $customerName,channelName: $channelName,closeUser: $closeUser,closeUserName: $closeUserName,patrolItemVOS: $patrolItemVOS,equipmentVOS: $equipmentVOS}';
+  }
+
+  PatrolJobData({
+    this.id,
+    this.name,
+    this.number,
+    this.planName,
+    this.planNumber,
+    this.termType,
+    this.personnelId,
+    this.personnel,
+    this.remarks,
+    this.finishTime,
+    this.fileUrls,
+    this.startDate,
+    this.endDate,
+    this.status,
+    this.closeReason,
+    this.customerName,
+    this.channelName,
+    this.closeUser,
+    this.closeUserName,
+    this.closeTime,
+    this.createTime,
+    this.creator,
+    this.creatorName,
+    this.patrolItemVOS,
+    this.equipmentVOS,
+  });
 
   Map<String, dynamic> toJson() {
     return Map<String, dynamic>()
-      ..put('name',this.name)
-      ..put('number',this.number)
-      ..put('count',this.count)
-      ..put('planName',this.planName)
-      ..put('planNumber',this.planNumber)
-      ..put('termType',this.termType)
-      ..put('startDate',this.startDate)
-      ..put('endDate',this.endDate)
-      ..put('status',this.status);
+      ..put('id', this.id)
+      ..put('name', this.name)
+      ..put('number', this.number)
+      ..put('planName', this.planName)
+      ..put('planNumber', this.planNumber)
+      ..put('termType', this.termType)
+      ..put('personnelId', this.personnelId)
+      ..put('personnel', this.personnel)
+      ..put('remarks', this.remarks)
+      ..put('finishTime', this.finishTime)
+      ..put('fileUrls', this.fileUrls?.map((v) => v.toJson()).toList())
+      ..put('startDate', this.startDate)
+      ..put('endDate', this.endDate)
+      ..put('status', this.status)
+      ..put('closeReason', this.closeReason)
+      ..put('customerName', this.customerName)
+      ..put('channelName', this.channelName)
+      ..put('closeUser', this.closeUser)
+      ..put('closeUserName', this.closeUserName)
+      ..put('closeTime', this.closeTime)
+      ..put('createTime', this.createTime)
+      ..put('creator', this.creator)
+      ..put('creatorName', this.creatorName)
+      ..put(
+          'patrolItemVOS', this.patrolItemVOS?.map((v) => v.toJson()).toList())
+      ..put('equipmentVOS', this.equipmentVOS?.map((v) => v.toJson()).toList());
   }
 
   PatrolJobData.fromJson(Map<String, dynamic> json) {
-    this.name=json.asString('name');
-    this.number=json.asString('number');
-    this.count=json.asInt('count');
-    this.planName=json.asString('planName');
-    this.planNumber=json.asString('planNumber');
-    this.termType=json.asInt('termType');
-    this.startDate=json.asString('startDate');
-    this.endDate=json.asString('endDate');
-    this.status=json.asInt('status');
-  }
-
-  static PatrolJobData toBean(Map<String, dynamic> json) => PatrolJobData.fromJson(json);
-}
+    if (null != json['id']) {
+      this.id = json.asInt('id');
+    }
+    if (null != json['name']) {
+      this.name = json.asString('name');
+    }
+    if (null != json['number']) {
+      this.number = json.asString('number');
+    }
+    if (null != json['planName']) {
+      this.planName = json.asString('planName');
+    }
+    if (null != json['planNumber']) {
+      this.planNumber = json.asString('planNumber');
+    }
+    if (null != json['termType']) {
+      this.termType = json.asInt('termType');
+    }
+    if (null != json['personnelId']) {
+      this.personnelId = json.asInt('personnelId');
+    }
+    if (null != json['personnel']) {
+      this.personnel = json.asString('personnel');
+    }
+    if (null != json['remarks']) {
+      this.remarks = json.asString('remarks');
+    }
+    if (null != json['finishTime']) {
+      this.finishTime = json.asString('finishTime');
+    }
+    if (null != json['fileUrls']) {
+      this.fileUrls =
+          (json['fileUrls'] as List).map((v) => FileUrls.fromJson(v)).toList();
+    }
+    if (null != json['startDate']) {
+      this.startDate = json.asString('startDate');
+    }
+    if (null != json['endDate']) {
+      this.endDate = json.asString('endDate');
+    }
+    if (null != json['status']) {
+      this.status = json.asInt('status');
+    }
+    if (null != json['closeReason']) {
+      this.closeReason = json.asString('closeReason');
+    }
+    if (null != json['customerName']) {
+      this.customerName = json.asString('customerName');
+    }
+    if (null != json['channelName']) {
+      this.channelName = json.asString('channelName');
+    }
+    if (null != json['closeUser']) {
+      this.closeUser = json.asString('closeUser');
+    }
+    if (null != json['closeUserName']) {
+      this.closeUserName = json.asString('closeUserName');
+    }
+    if (null != json['closeTime']) {
+      this.closeTime = json.asString('closeTime');
+    }
+    if (null != json['createTime']) {
+      this.createTime = json.asString('createTime');
+    }
+    if (null != json['creator']) {
+      this.creator = json.asInt('creator');
+    }
+    if (null != json['creatorName']) {
+      this.creatorName = json.asString('creatorName');
+    }
+    if (null != json['patrolItemVOS']) {
+      this.patrolItemVOS = (json['patrolItemVOS'] as List)
+          .map((v) => PatrolItemVOS.fromJson(v))
+          .toList();
+    }
+    if (null != json['equipmentVOS']) {
+      this.equipmentVOS = (json['equipmentVOS'] as List)
+          .map((v) => EquipmentVOS.fromJson(v))
+          .toList();
+    }
+  }
+}
+
+/**
+ * 巡检任务实体类
+ */
+class FileUrls {
+  int? imgId;
+  String? url;
+  int? step;
+
+  @override
+  String toString(){
+    return 'FilrUrls{imgId: $imgId,url: $url,step: $step}';
+  }
+
+  FileUrls({
+    this.imgId,
+    this.url,
+    this.step,
+  });
+
+  Map<String, dynamic> toJson() {
+    return Map<String, dynamic>()
+      ..put('imgId', this.imgId)
+      ..put('url', this.url)
+      ..put('step', this.step);
+  }
+
+  FileUrls.fromJson(Map<String, dynamic> json) {
+    if (null != json['imgId']) {
+      this.imgId = json.asInt('imgId');
+    }
+    if (null != json['url']) {
+      this.url = json.asString('url');
+    }
+    if (null != json['step']) {
+      this.step = json.asInt('step');
+    }
+  }
+}
+
+class PatrolItemVOS {
+  int? id;
+  String? number;
+  String? name;
+  String? requirement;
+  String? result;
+  int? patrolJobId;
+  String? results;
+
+  @override
+  String toString(){
+    return 'PatrolItemVOS{id: $id,number: $number,name: $name,requirement: $requirement,result: $result,patrolJobId: $patrolJobId,results: $results}';
+  }
+
+  PatrolItemVOS({
+    this.id,
+    this.number,
+    this.name,
+    this.requirement,
+    this.result,
+    this.patrolJobId,
+    this.results,
+  });
+
+  Map<String, dynamic> toJson() {
+    return Map<String, dynamic>()
+      ..put('id', this.id)
+      ..put('number', this.number)
+      ..put('name', this.name)
+      ..put('requirement', this.requirement)
+      ..put('result', this.result)
+      ..put('patrolJobId', this.patrolJobId)
+      ..put('results', this.results);
+  }
+
+  PatrolItemVOS.fromJson(Map<String, dynamic> json) {
+    if (null != json['id']) {
+      this.id = json.asInt('id');
+    }
+    if (null != json['number']) {
+      this.number = json.asString('number');
+    }
+    if (null != json['name']) {
+      this.name = json.asString('name');
+    }
+    if (null != json['requirement']) {
+      this.requirement = json.asString('requirement');
+    }
+    if (null != json['result']) {
+      this.result = json.asString('result');
+    }
+    if (null != json['patrolJobId']) {
+      this.patrolJobId = json.asInt('patrolJobId');
+    }
+    if (null != json['results']) {
+      this.results = json.asString('results');
+    }
+  }
+}
+
+class EquipmentVOS {
+  int? id;
+  int? equipmentId;
+  String? name;
+  String? showName;
+  String? deviceKey;
+  String? productName;
+  String? itemCompleteTime;
+  String? itemPerson;
+  int? patrolJobId;
+  int? isComplete;
+
+  @override
+  String toString(){
+    return 'EquipmentVOS{id: $id,equipmentId: $equipmentId,name: $name,showName: $showName, deviceKey: $deviceKey,productName: $productName, itemCompleteTime: $itemCompleteTime,itemPerson: $itemPerson,patrolJobId: $patrolJobId,isComplete: $isComplete}';
+  }
+
+  EquipmentVOS({
+    this.id,
+    this.equipmentId,
+    this.name,
+    this.showName,
+    this.deviceKey,
+    this.productName,
+    this.itemCompleteTime,
+    this.itemPerson,
+    this.patrolJobId,
+    this.isComplete,
+  });
+
+  Map<String, dynamic> toJson() {
+    return Map<String, dynamic>()
+      ..put('id', this.id)
+      ..put('equipmentId', this.equipmentId)
+      ..put('name', this.name)
+      ..put('showName', this.showName)
+      ..put('deviceKey', this.deviceKey)
+      ..put('productName', this.productName)
+      ..put('itemCompleteTime', this.itemCompleteTime)
+      ..put('itemPerson', this.itemPerson)
+      ..put('patrolJobId', this.patrolJobId)
+      ..put('isComplete', this.isComplete);
+  }
+
+  EquipmentVOS.fromJson(Map<String, dynamic> json) {
+    if (null != json['id']) {
+      this.id = json.asInt('id');
+    }
+    if (null != json['equipmentId']) {
+      this.equipmentId = json.asInt('equipmentId');
+    }
+    if (null != json['name']) {
+      this.name = json.asString('name');
+    }
+    if (null != json['showName']) {
+      this.showName = json.asString('showName');
+    }
+    if (null != json['deviceKey']) {
+      this.deviceKey = json.asString('deviceKey');
+    }
+    if (null != json['productName']) {
+      this.productName = json.asString('productName');
+    }
+    if (null != json['itemCompleteTime']) {
+      this.itemCompleteTime = json.asString('itemCompleteTime');
+    }
+    if (null != json['itemPerson']) {
+      this.itemPerson = json.asString('itemPerson');
+    }
+    if (null != json['patrolJobId']) {
+      this.patrolJobId = json.asInt('patrolJobId');
+    }
+    if (null != json['isComplete']) {
+      this.isComplete = json.asInt('isComplete');
+    }
+  }
+}

+ 6 - 1
lib/page/home/home_page.dart

@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
 import '../device/device_manage_page.dart';
+import '../maint/maint_job_page.dart';
 
 class HomePage extends StatefulWidget {
   static var routeName = '/HomePage';
@@ -27,7 +28,11 @@ class _MineViewPageState extends State<HomePage> {
       "image": "images/device_manage.png",
       'jump': DeviceManagePage.routeName
     },
-    {"name": "维保任务", "image": "images/maintenance.png", 'jump': ''},
+    {
+      "name": "维保任务",
+      "image": "images/maintenance.png",
+      'jump': MaintJobPage.routeName
+    },
     {
       "name": "巡检任务",
       "image": "images/patrol_inspect.png",

+ 239 - 0
lib/page/maint/maint_job_page.dart

@@ -0,0 +1,239 @@
+//巡检任务列表
+import 'package:deus_app/common/style/TitleBar.dart';
+import 'package:deus_app/page/patrol/patrol_job_detail.dart';
+import 'package:flutter/material.dart';
+import '../../common/style/gsy_style.dart';
+import '../../common/utils/ConstantString.dart';
+import '../../common/utils/DioUtil.dart';
+import '../../common/utils/ToastUtils.dart';
+import '../../model/patrol_response_entity.dart';
+import '../../widget/MaintJobDrawer.dart';
+
+
+class MaintJobPage extends StatefulWidget {
+  const MaintJobPage({super.key});
+
+  static var routeName = '/MaintJobPage';
+
+  @override
+  State createState() {
+    return _MaintJobPage();
+  }
+}
+
+List<PatrolJobData> patrol_job_list = [];
+class _MaintJobPage extends State<MaintJobPage> {
+  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
+
+  _load() async {
+    var result = await DioUtil().request('patrolJob/appPatrolJobList',
+        method: DioMethod.post, data: {'query': {}, 'index': 1, 'size': 5});
+
+
+    //var patrolJobResponse = PatrolJobResponse.fromJson(result);
+    //print(patrolJobResponse);
+  }
+
+  @override
+  void initState() {
+    // TODO: implement initState
+    super.initState();
+    Future.delayed(
+        Duration.zero,
+            () => setState(() {
+          _load();
+        }));
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+        key: _scaffoldKey,
+        appBar: TitleBar().drawAppBar(ConstantString.patrolJobText, () {
+          _scaffoldKey.currentState?.openEndDrawer();
+        }),
+        endDrawer: MaintJobDrawer(
+          callback: (index, str) {
+            showToast(str);
+          },
+        ),
+        //抽屉
+        backgroundColor: const Color(0xfff2f2f2),
+        body: Column(
+          children: [
+            SizedBox(
+              height: 10,
+            ),
+            Row(
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: [
+                SizedBox(
+                  width: 15,
+                ),
+                Text(ConstantString.patrolJobTitle,
+                    style: GSYConstant.smallActionLightText),
+              ],
+            ),
+            Expanded(
+                child: Container(
+                    child: ListView.builder(
+                      itemCount: patrol_job_list.length,
+                      itemBuilder: (context, index) {
+                        PatrolJobData patrolJobData = patrol_job_list[index];
+                        return _patrol_job_list(patrolJobData);
+                      },
+                    )))
+          ],
+        ));
+  }
+
+  Widget _patrol_job_list(PatrolJobData patrolJobData) {
+    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: [
+              Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
+                Container(
+                  child: Text(
+                    patrolJobData.name!,
+                    style: TextStyle(
+                      color: Colors.black,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                ),
+                Container(
+                  padding:
+                  EdgeInsets.only(top: 3, bottom: 3, left: 5, right: 5),
+                  child: Text(
+                    patrolJobData.status == 0
+                        ? '已关闭'
+                        : patrolJobData.status == 1
+                        ? '执行中'
+                        : patrolJobData.status == 2
+                        ? '已完成'
+                        : patrolJobData.status == 3
+                        ? '待执行'
+                        : patrolJobData.status == 4
+                        ? '已逾期'
+                        : '未知',
+                    textAlign: TextAlign.right,
+                    style: TextStyle(
+                      color:
+                      patrolJobData.status == 0 || patrolJobData.status == 4
+                          ? Colors.red
+                          : patrolJobData.status == 1
+                          ? Colors.orange
+                          : patrolJobData.status == 2
+                          ? Colors.green
+                          : Colors.black, //边框颜色
+                      fontSize: GSYConstant.minTextSize,
+                    ),
+                  ),
+                  decoration: BoxDecoration(
+                    border: new Border.all(
+                      color:
+                      patrolJobData.status == 0 || patrolJobData.status == 4
+                          ? Colors.red
+                          : patrolJobData.status == 1
+                          ? Colors.orange
+                          : patrolJobData.status == 2
+                          ? Colors.green
+                          : Colors.black, //边框颜色
+                      width: 1.0, //边框粗细
+                    ),
+                    borderRadius: const BorderRadius.all(
+                        const Radius.circular(3.0)), //边框的弧度
+                  ),
+                )
+              ]),
+              SizedBox(
+                height: 12,
+              ),
+              Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
+                Container(
+                  child: Text(
+                    '任务编号:',
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+                Container(
+                  child: Text(
+                    patrolJobData.number!,
+                    textAlign: TextAlign.right,
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+              ]),
+              SizedBox(
+                height: 10,
+              ),
+              Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
+                Container(
+                  child: Text(
+                    '任务开始时间:',
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+                Container(
+                  child: Text(
+                    patrolJobData.startDate!,
+                    textAlign: TextAlign.right,
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+              ]),
+              SizedBox(
+                height: 10,
+              ),
+              Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
+                Container(
+                  child: Text(
+                    '任务结束时间:',
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+                Container(
+                  child: Text(
+                    patrolJobData.endDate!,
+                    textAlign: TextAlign.right,
+                    style: TextStyle(
+                      color: GSYColors.primaryLightValue,
+                      fontSize: GSYConstant.middleTextWhiteSize,
+                    ),
+                  ),
+                ),
+              ]),
+              SizedBox(
+                height: 5,
+              ),
+            ],
+          ),
+          onTap: () {
+            Navigator.push(
+                context,
+                MaterialPageRoute(
+                    builder: (context) => new PatrolJobDetail(id:patrolJobData.id)));
+          },
+        ));
+  }
+}

+ 33 - 54
lib/page/patrol/patrol_job_detail.dart

@@ -5,17 +5,21 @@ import 'package:deus_app/model/drop_menu_item.dart';
 import 'package:deus_app/model/patrol_response_entity.dart';
 import 'package:flutter/material.dart';
 
+import '../../common/utils/DioUtil.dart';
+
 /**
  * 巡检任务详情页面
  */
 class PatrolJobDetail extends StatefulWidget {
-  const PatrolJobDetail({super.key});
+  var id ;
+  PatrolJobDetail({super.key, @required this.id});
 
   static var routeName = '/PatrolJobDetail';
 
   @override
   State createState() {
-    return _PatrolJobDetail();
+    print(id);
+    return new _PatrolJobDetail(id);
   }
 }
 
@@ -69,6 +73,33 @@ List<String> sexSelects = ['男', '女', '奥特曼'];
 DropMenuItem sexSelect = DropMenuItem('男', 1);
 
 class _PatrolJobDetail extends State<PatrolJobDetail> {
+
+  var id;
+  _PatrolJobDetail(this.id);
+
+  _load() async {
+    var result = await DioUtil().request('patrolJob/appPatrolJobList',
+        method: DioMethod.get, params: {'id':id});
+
+    PatrolJobResponse patrolJobResponse = PatrolJobResponse.fromJson(result);
+
+    //var patrolJobResponse = PatrolJobResponse.fromJson(result);
+    //print(patrolJobResponse);
+  }
+
+  @override
+  void initState() {
+    // TODO: implement initState
+    super.initState();
+    Future.delayed(
+        Duration.zero,
+            () => setState(() {
+          _load();
+        }));
+  }
+
+
+
   @override
   Widget build(BuildContext context) {
     return Scaffold(
@@ -137,7 +168,6 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
     ws.add(_item());
     ws.add(_remark());
     ws.add(_url());
-    // ws.add(dropDownButtonsColumn(sexMenuItems,'性别',sexSelect));
     return ws;
   }
 
@@ -563,55 +593,4 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
         child: Image.network(imageData.url));
   }
 
-  Widget dropDownButtonsColumn(
-      List<DropMenuItem> list, String hint, DropMenuItem select) {
-    return Padding(
-      padding: const EdgeInsets.only(left: 40, right: 40, bottom: 24, top: 12),
-      child: Container(
-        height: 60,
-        //gives the height of the dropdown button
-        width: MediaQuery.of(context).size.width,
-        //gives the width of the dropdown button
-        decoration: BoxDecoration(
-            borderRadius: BorderRadius.all(Radius.circular(3)),
-            color: Color(0xFFF2F2F2)),
-        // padding: const EdgeInsets.symmetric(horizontal: 13), //you can include padding to control the menu items
-        child: Theme(
-            data: Theme.of(context).copyWith(
-                canvasColor: Colors.white70,
-                // background color for the dropdown items
-                buttonTheme: ButtonTheme.of(context).copyWith(
-                  alignedDropdown:
-                      true, //If false (the default), then the dropdown's menu will be wider than its button.
-                )),
-            child: DropdownButtonHideUnderline(
-              // to hide the default underline of the dropdown button
-              child: DropdownButton<String>(
-                iconEnabledColor: Color(0xFF595959),
-                // icon color of the dropdown button
-                items: list.map((dropMenuItem) {
-                  return DropdownMenuItem<String>(
-                    value: dropMenuItem.label,
-                    child: Text(
-                      dropMenuItem.label,
-                      style: TextStyle(fontSize: 15),
-                    ),
-                  );
-                }).toList(),
-                hint: Text(
-                  hint,
-                  style: TextStyle(fontSize: 15),
-                ),
-                // setting hint
-                onChanged: (String? value) {
-                  setState(() {
-                    sexSelect.label = value!; // saving the selected value
-                  });
-                },
-                value: sexSelect.label, // displaying the selected value
-              ),
-            )),
-      ),
-    );
-  }
 }

+ 44 - 83
lib/page/patrol/patrol_job_page.dart

@@ -1,9 +1,11 @@
 //巡检任务列表
 import 'package:deus_app/common/style/TitleBar.dart';
+import 'package:deus_app/page/patrol/patrol_job_detail.dart';
 import 'package:flutter/material.dart';
 import '../../common/style/gsy_style.dart';
 import '../../common/utils/ConstantString.dart';
 import '../../common/utils/DioUtil.dart';
+import '../../common/utils/ToastUtils.dart';
 import '../../model/patrol_response_entity.dart';
 import '../../widget/PatrolJobDrawer.dart';
 
@@ -18,24 +20,7 @@ class PatrolJobPage extends StatefulWidget {
   }
 }
 
-
-
-Map<String,dynamic> map1 = {
-  'name':'巡检任务',
-  'number':'巡检任务编号',
-  'count':3,
-  'planName':'巡检计划名称',
-  'planNumber':'巡检计划编号',
-  'termType':1,
-  'startDate':'2023-05-29 00:00:00',
-  'endDate':'2023-05-20 23:59:59',
-  'status':1
-};
-
-PatrolJobData p = PatrolJobData.toBean(map1);
-
-List<PatrolJobData> patrol_job_list = [p];
-
+List<PatrolJobData> patrol_job_list = [];
 
 PatrolJobData query = PatrolJobData();
 
@@ -43,23 +28,25 @@ class _PatrolJobPage extends State<PatrolJobPage> {
   final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
 
   _load() async {
-    var result = await DioUtil()
-        .request('patrolJob/getJobList', method: DioMethod.post, data: {
-      'query': query,
-      'index':1,
-      'size':5
-    });
-
-
+    var result = await DioUtil().request('patrolJob/appPatrolJobList',
+        method: DioMethod.post, data: {'query': query, 'index': 1, 'size': 5});
+
+    PatrolJobResponse patrolJobResponse = PatrolJobResponse.fromJson(result);
+    print(patrolJobResponse);
+    patrol_job_list = patrolJobResponse.data!.patrolJobVOS!;
+    //var patrolJobResponse = PatrolJobResponse.fromJson(result);
+    //print(patrolJobResponse);
   }
 
   @override
   void initState() {
     // TODO: implement initState
     super.initState();
-    Future.delayed(Duration.zero,()=> setState((){
-      _load();
-    }));
+    Future.delayed(
+        Duration.zero,
+        () => setState(() {
+              _load();
+            }));
   }
 
   @override
@@ -69,7 +56,12 @@ class _PatrolJobPage extends State<PatrolJobPage> {
         appBar: TitleBar().drawAppBar(ConstantString.patrolJobText, () {
           _scaffoldKey.currentState?.openEndDrawer();
         }),
-        endDrawer: PatrolJobDrawer(), //抽屉
+        endDrawer: PatrolJobDrawer(
+          callback: (index, str) {
+            showToast(str);
+          },
+        ),
+        //抽屉
         backgroundColor: const Color(0xfff2f2f2),
         body: Column(
           children: [
@@ -110,7 +102,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
               Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
                 Container(
                   child: Text(
-                    '此处展示巡检任务名称',
+                    patrolJobData.name!,
                     style: TextStyle(
                       color: Colors.black,
                       fontSize: GSYConstant.middleTextWhiteSize,
@@ -135,33 +127,27 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                                         : '未知',
                     textAlign: TextAlign.right,
                     style: TextStyle(
-                      color: patrolJobData.status == 0
-                          ? Colors.red
-                          : patrolJobData.status == 1
-                              ? Colors.blue
-                              : patrolJobData.status == 2
-                                  ? Colors.green
-                                  : patrolJobData.status == 3
-                                      ? Colors.pinkAccent
-                                      : patrolJobData.status == 4
-                                          ? Colors.purpleAccent
-                                          : Colors.black, //边框颜色
+                      color:
+                          patrolJobData.status == 0 || patrolJobData.status == 4
+                              ? Colors.red
+                              : patrolJobData.status == 1
+                                  ? Colors.orange
+                                  : patrolJobData.status == 2
+                                      ? Colors.green
+                                      : Colors.black, //边框颜色
                       fontSize: GSYConstant.minTextSize,
                     ),
                   ),
                   decoration: BoxDecoration(
                     border: new Border.all(
-                      color: patrolJobData.status == 0
-                          ? Colors.red
-                          : patrolJobData.status == 1
-                              ? Colors.blue
-                              : patrolJobData.status == 2
-                                  ? Colors.green
-                                  : patrolJobData.status == 3
-                                      ? Colors.pinkAccent
-                                      : patrolJobData.status == 4
-                                          ? Colors.purpleAccent
-                                          : Colors.black, //边框颜色
+                      color:
+                          patrolJobData.status == 0 || patrolJobData.status == 4
+                              ? Colors.red
+                              : patrolJobData.status == 1
+                                  ? Colors.orange
+                                  : patrolJobData.status == 2
+                                      ? Colors.green
+                                      : Colors.black, //边框颜色
                       width: 1.0, //边框粗细
                     ),
                     borderRadius: const BorderRadius.all(
@@ -184,31 +170,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                 ),
                 Container(
                   child: Text(
-                    '任务编号001',
-                    textAlign: TextAlign.right,
-                    style: TextStyle(
-                      color: GSYColors.primaryLightValue,
-                      fontSize: GSYConstant.middleTextWhiteSize,
-                    ),
-                  ),
-                ),
-              ]),
-              SizedBox(
-                height: 10,
-              ),
-              Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
-                Container(
-                  child: Text(
-                    '巡检产品数量:',
-                    style: TextStyle(
-                      color: GSYColors.primaryLightValue,
-                      fontSize: GSYConstant.middleTextWhiteSize,
-                    ),
-                  ),
-                ),
-                Container(
-                  child: Text(
-                    '3',
+                    patrolJobData.number!,
                     textAlign: TextAlign.right,
                     style: TextStyle(
                       color: GSYColors.primaryLightValue,
@@ -232,7 +194,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                 ),
                 Container(
                   child: Text(
-                    '2023-2-9',
+                    patrolJobData.startDate!,
                     textAlign: TextAlign.right,
                     style: TextStyle(
                       color: GSYColors.primaryLightValue,
@@ -256,7 +218,7 @@ class _PatrolJobPage extends State<PatrolJobPage> {
                 ),
                 Container(
                   child: Text(
-                    '2023-2-9',
+                    patrolJobData.endDate!,
                     textAlign: TextAlign.right,
                     style: TextStyle(
                       color: GSYColors.primaryLightValue,
@@ -271,11 +233,10 @@ class _PatrolJobPage extends State<PatrolJobPage> {
             ],
           ),
           onTap: () {
-            /*Navigator.push(
+            Navigator.push(
                 context,
                 MaterialPageRoute(
-                    builder: (context) => const PatrolJobDetail()));*/
-
+                    builder: (context) => new PatrolJobDetail(id:patrolJobData.id)));
           },
         ));
   }

+ 242 - 0
lib/widget/MaintJobDrawer.dart

@@ -0,0 +1,242 @@
+import 'package:deus_app/common/style/gsy_style.dart';
+import 'package:deus_app/common/utils/ConstantString.dart';
+import 'package:flutter/material.dart';
+
+import '../model/drop_menu_item.dart';
+
+class MaintJobDrawer extends StatefulWidget {
+
+  final _CallBack callback;
+
+  const MaintJobDrawer({super.key, required this.callback});
+
+  @override
+  State createState() {
+    return _maintJobDrawer();
+  }
+
+}
+
+DropMenuItem boy = DropMenuItem('男', 1);
+DropMenuItem girl = DropMenuItem('女', 2);
+DropMenuItem sexSelect = DropMenuItem('男', 1);
+List<DropMenuItem> sexMenuItems = [boy, girl];
+
+typedef _CallBack = void Function(int selectIndex, String selectStr);
+
+
+class _maintJobDrawer extends State<MaintJobDrawer> {
+
+
+  @override
+  Widget build(BuildContext context) {
+    return Drawer(
+      child: MediaQuery.removePadding(
+        context: context,
+        //移除抽屉菜单顶部默认留白
+        removeTop: true,
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: <Widget>[
+            Padding(
+              padding: const EdgeInsets.only(top: 50.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(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      decoration: InputDecoration(
+                        border: OutlineInputBorder(),
+                      ),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        _name = value;
+                      },
+                    ),
+                  ),
+                  flex: 7,
+                ),
+              ]),
+            ),
+            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(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        _number = value;
+                      },
+                    ),
+                  ),
+                  flex: 7,
+                ),
+              ]),
+            ),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(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        _planName = value;
+                      },
+                    ),
+                  ),
+                  flex: 7,
+                ),
+              ]),
+            ),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(
+                  child: Container(
+                    height: 40,
+                    child: TextField(
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
+                      onChanged: (value) {
+                        _planNumber = value;
+                      },
+                    ),
+                  ),
+                  flex: 7,
+                ),
+              ]),
+            ),
+            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(sexMenuItems, '性别', jobMenu),
+                  ),
+                ),
+              ]),
+            ),
+
+          ],
+        ),
+      ),
+    );
+  }
+
+  Widget dropDownButtonsColumn(List<DropMenuItem> list, String hint, DropMenuItem select) {
+    return Container(
+      height: 40,
+      //gives the height of the dropdown button
+      width: MediaQuery.of(context).size.width,
+      //gives the width of the dropdown button
+      decoration: BoxDecoration(
+        border: new Border.all(
+          color: Colors.grey, //边框颜色
+          width: 1.0, //边框粗细
+        ),
+        borderRadius:
+        const BorderRadius.all(const Radius.circular(4.0)), //边框的弧度
+      ),
+      // padding: const EdgeInsets.symmetric(horizontal: 13), //you can include padding to control the menu items
+      child: Theme(
+          data: Theme.of(context).copyWith(
+            // canvasColor: Colors.white, // background color for the dropdown items
+              buttonTheme: ButtonTheme.of(context).copyWith(
+                alignedDropdown:
+                true, //If false (the default), then the dropdown's menu will be wider than its button.
+              )),
+          child: DropdownButtonHideUnderline(
+            // to hide the default underline of the dropdown button
+            child: DropdownButton<String>(
+              iconEnabledColor: Color(0xFF595959),
+              // icon color of the dropdown button
+              items: list.map((dropMenuItem) {
+                return DropdownMenuItem<String>(
+                  value: dropMenuItem.label,
+                  child: Text(
+                    dropMenuItem.label,
+                    style: TextStyle(fontSize: 15),
+                  ),
+                );
+              }).toList(),
+              hint: Text(
+                hint,
+                style: TextStyle(fontSize: 15),
+              ),
+              // setting hint
+              onChanged: (String? value) {
+                setState(() {
+                  select.label = value; // saving the selected value
+                });
+              },
+              value: select.label, // displaying the selected value
+            ),
+          )),
+    );
+  }
+
+  String  _name = '',_number = '', _planName = '', _planNumber = '';
+  int _status = 1,_termType = 1;
+  DropMenuItem jobMenu = DropMenuItem('男', 1);
+
+}

+ 107 - 72
lib/widget/PatrolJobDrawer.dart

@@ -1,7 +1,33 @@
 import 'package:deus_app/common/style/gsy_style.dart';
+import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:flutter/material.dart';
 
-class PatrolJobDrawer extends StatelessWidget{
+import '../model/drop_menu_item.dart';
+
+class PatrolJobDrawer extends StatefulWidget {
+
+  final _CallBack callback;
+
+  const PatrolJobDrawer({super.key, required this.callback});
+
+  @override
+  State createState() {
+    return _patrolJobDrawer();
+  }
+
+}
+
+DropMenuItem boy = DropMenuItem('男', 1);
+DropMenuItem girl = DropMenuItem('女', 2);
+DropMenuItem sexSelect = DropMenuItem('男', 1);
+List<DropMenuItem> sexMenuItems = [boy, girl];
+
+typedef _CallBack = void Function(int selectIndex, String selectStr);
+
+
+class _patrolJobDrawer extends State<PatrolJobDrawer> {
+
+
   @override
   Widget build(BuildContext context) {
     return Drawer(
@@ -13,10 +39,10 @@ class PatrolJobDrawer extends StatelessWidget{
           crossAxisAlignment: CrossAxisAlignment.start,
           children: <Widget>[
             Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
+              padding: const EdgeInsets.only(top: 50.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
-                  flex: 1,
+                  flex: 2,
                   child: Text(
                     '任务名称',
                     style: TextStyle(
@@ -32,22 +58,22 @@ class PatrolJobDrawer extends StatelessWidget{
                     child: TextField(
                       decoration: InputDecoration(
                         border: OutlineInputBorder(),
-                      ),style: TextStyle(fontSize: 14),
+                      ),
+                      style: TextStyle(fontSize: 14),
                       onChanged: (value) {
                         _name = value;
                       },
                     ),
                   ),
-                  flex: 4,
-
+                  flex: 7,
                 ),
               ]),
             ),
             Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
-                  flex: 1,
+                  flex: 2,
                   child: Text(
                     '任务编号',
                     style: TextStyle(
@@ -61,24 +87,21 @@ class PatrolJobDrawer extends StatelessWidget{
                   child: Container(
                     height: 40,
                     child: TextField(
-                      decoration: InputDecoration(
-                          border: OutlineInputBorder()
-                      ),style: TextStyle(fontSize: 14),
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
                       onChanged: (value) {
                         _number = value;
                       },
                     ),
                   ),
-                  flex: 4,
-
+                  flex: 7,
                 ),
               ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
+            ),Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
-                  flex: 1,
+                  flex: 2,
                   child: Text(
                     '计划名称',
                     style: TextStyle(
@@ -92,23 +115,21 @@ class PatrolJobDrawer extends StatelessWidget{
                   child: Container(
                     height: 40,
                     child: TextField(
-                      decoration: InputDecoration(
-                          border: OutlineInputBorder()
-                      ),style: TextStyle(fontSize: 14),
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
                       onChanged: (value) {
                         _planName = value;
                       },
                     ),
                   ),
-                  flex: 4,
+                  flex: 7,
                 ),
               ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
+            ),Padding(
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
-                  flex: 1,
+                  flex: 2,
                   child: Text(
                     '计划编号',
                     style: TextStyle(
@@ -119,28 +140,27 @@ class PatrolJobDrawer extends StatelessWidget{
                   ),
                 ),
                 Expanded(
-                  flex: 4,
                   child: Container(
                     height: 40,
                     child: TextField(
-                      decoration: InputDecoration(
-                          border: OutlineInputBorder()
-                      ),style: TextStyle(fontSize: 14),
+                      decoration: InputDecoration(border: OutlineInputBorder()),
+                      style: TextStyle(fontSize: 14),
                       onChanged: (value) {
                         _planNumber = value;
                       },
                     ),
                   ),
+                  flex: 7,
                 ),
               ]),
             ),
             Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
+              padding: const EdgeInsets.only(top: 20.0, left: 10, right: 10),
               child: Row(children: [
                 Expanded(
-                  flex: 1,
+                  flex: 2,
                   child: Text(
-                    '计划编号',
+                    '任务状态',
                     style: TextStyle(
                       color: Colors.black,
                       fontSize: GSYConstant.minTextSize,
@@ -149,47 +169,9 @@ class PatrolJobDrawer extends StatelessWidget{
                   ),
                 ),
                 Expanded(
-                  flex: 4,
+                  flex: 7,
                   child: Container(
-                    height: 40,
-                    child: TextField(
-                      decoration: InputDecoration(
-                          border: OutlineInputBorder()
-                      ),style: TextStyle(fontSize: 14),
-                      onChanged: (value) {
-                        _planNumber = value;
-                      },
-                    ),
-                  ),
-                ),
-              ]),
-            ),
-            Padding(
-              padding: const EdgeInsets.only(top: 38.0,left: 10,right: 10),
-              child: Row(children: [
-                Expanded(
-                  flex: 1,
-                  child: Text(
-                    '计划编号',
-                    style: TextStyle(
-                      color: Colors.black,
-                      fontSize: GSYConstant.minTextSize,
-                      fontWeight: FontWeight.bold,
-                    ),
-                  ),
-                ),
-                Expanded(
-                  flex: 4,
-                  child: Container(
-                    height: 40,
-                    child: TextField(
-                      decoration: InputDecoration(
-                          border: OutlineInputBorder()
-                      ),style: TextStyle(fontSize: 14),
-                      onChanged: (value) {
-                        _planNumber = value;
-                      },
-                    ),
+                    child: dropDownButtonsColumn(sexMenuItems, '性别', jobMenu),
                   ),
                 ),
               ]),
@@ -201,7 +183,60 @@ class PatrolJobDrawer extends StatelessWidget{
     );
   }
 
+  Widget dropDownButtonsColumn(List<DropMenuItem> list, String hint, DropMenuItem select) {
+    return Container(
+      height: 40,
+      //gives the height of the dropdown button
+      width: MediaQuery.of(context).size.width,
+      //gives the width of the dropdown button
+      decoration: BoxDecoration(
+        border: new Border.all(
+          color: Colors.grey, //边框颜色
+          width: 1.0, //边框粗细
+        ),
+        borderRadius:
+        const BorderRadius.all(const Radius.circular(4.0)), //边框的弧度
+      ),
+      // padding: const EdgeInsets.symmetric(horizontal: 13), //you can include padding to control the menu items
+      child: Theme(
+          data: Theme.of(context).copyWith(
+            // canvasColor: Colors.white, // background color for the dropdown items
+              buttonTheme: ButtonTheme.of(context).copyWith(
+                alignedDropdown:
+                true, //If false (the default), then the dropdown's menu will be wider than its button.
+              )),
+          child: DropdownButtonHideUnderline(
+            // to hide the default underline of the dropdown button
+            child: DropdownButton<String>(
+              iconEnabledColor: Color(0xFF595959),
+              // icon color of the dropdown button
+              items: list.map((dropMenuItem) {
+                return DropdownMenuItem<String>(
+                  value: dropMenuItem.label,
+                  child: Text(
+                    dropMenuItem.label,
+                    style: TextStyle(fontSize: 15),
+                  ),
+                );
+              }).toList(),
+              hint: Text(
+                hint,
+                style: TextStyle(fontSize: 15),
+              ),
+              // setting hint
+              onChanged: (String? value) {
+                setState(() {
+                  select.label = value; // saving the selected value
+                });
+              },
+              value: select.label, // displaying the selected value
+            ),
+          )),
+    );
+  }
+
   String  _name = '',_number = '', _planName = '', _planNumber = '';
   int _status = 1,_termType = 1;
+  DropMenuItem jobMenu = DropMenuItem('男', 1);
 
 }