Browse Source

修改扦样单列表页筛选条件检验指标字段;

maqiang 7 months ago
parent
commit
200cbb7e27

+ 2 - 2
lib/model/req/sample_task_list_req.dart

@@ -20,7 +20,7 @@ class SampleTaskListReq {
20 20
   String? cypzName;
21 21
 
22 22
   /// 检验指标
23
-  String? jyzb;
23
+  int? sjbj;
24 24
 
25 25
   /// 样品等级
26 26
   int? ypdj;
@@ -34,7 +34,7 @@ class SampleTaskListReq {
34 34
     this.deliveryStatus,
35 35
     this.rwlx,
36 36
     this.cypzName,
37
-    this.jyzb,
37
+    this.sjbj,
38 38
     this.ypdj,
39 39
     this.qydq,
40 40
   });

+ 2 - 2
lib/model/req/sample_task_list_req.g.dart

@@ -13,7 +13,7 @@ SampleTaskListReq _$SampleTaskListReqFromJson(Map<String, dynamic> json) =>
13 13
       deliveryStatus: (json['deliveryStatus'] as num?)?.toInt(),
14 14
       rwlx: (json['rwlx'] as num?)?.toInt(),
15 15
       cypzName: json['cypzName'] as String?,
16
-      jyzb: json['jyzb'] as String?,
16
+      sjbj: (json['sjbj'] as num?)?.toInt(),
17 17
       ypdj: (json['ypdj'] as num?)?.toInt(),
18 18
       qydq: json['qydq'] as String?,
19 19
     );
@@ -25,7 +25,7 @@ Map<String, dynamic> _$SampleTaskListReqToJson(SampleTaskListReq instance) =>
25 25
       'deliveryStatus': instance.deliveryStatus,
26 26
       'rwlx': instance.rwlx,
27 27
       'cypzName': instance.cypzName,
28
-      'jyzb': instance.jyzb,
28
+      'sjbj': instance.sjbj,
29 29
       'ypdj': instance.ypdj,
30 30
       'qydq': instance.qydq,
31 31
     };

+ 20 - 14
lib/page/filter/filter_page.dart

@@ -28,8 +28,8 @@ class _FilterPageState extends BaseState<FilterPage> {
28 28
   final cypz = null.notifier<CardMenuData?>();
29 29
 
30 30
   /// 检验指标
31
-  final jyzbList = <CardMenuData>[].notifier<List<CardMenuData>>();
32
-  final jyzb = null.notifier<CardMenuData?>();
31
+  final sjbjList = <CardMenuData>[].notifier<List<CardMenuData>>();
32
+  final sjbj = null.notifier<CardMenuData?>();
33 33
 
34 34
   /// 样品等级
35 35
   final ypdjList = <CardMenuData>[].notifier<List<CardMenuData>>();
@@ -48,13 +48,19 @@ class _FilterPageState extends BaseState<FilterPage> {
48 48
     }
49 49
   }
50 50
 
51
-  void getJyzbList() {
52
-    jyzbList.value = (DictService.getDictList(DictType.jylx) ?? []).map((e) => CardMenuData(e.label, e.value)).toList();
53
-    if (vm.reqList.first.jyzb == null) return;
54
-
55
-    for (var item in jyzbList.value) {
56
-      if (vm.reqList.first.jyzb == item.name) {
57
-        jyzb.value = item;
51
+  void getSjbjList() {
52
+    // 1-质量,2-品质,3-食品安全,4-储存
53
+    sjbjList.value = [
54
+      CardMenuData('质量', 1),
55
+      CardMenuData('品质', 2),
56
+      CardMenuData('食品安全', 3),
57
+      CardMenuData('储存', 4),
58
+    ];
59
+    if (vm.reqList.first.sjbj == null) return;
60
+
61
+    for (var item in sjbjList.value) {
62
+      if (vm.reqList.first.sjbj == item.value) {
63
+        sjbj.value = item;
58 64
         break;
59 65
       }
60 66
     }
@@ -74,7 +80,7 @@ class _FilterPageState extends BaseState<FilterPage> {
74 80
   void onReset() {
75 81
     for (var req in vm.reqList) {
76 82
       req.cypzName = null;
77
-      req.jyzb = null;
83
+      req.sjbj = null;
78 84
       req.ypdj = null;
79 85
       req.qydq = null;
80 86
     }
@@ -85,7 +91,7 @@ class _FilterPageState extends BaseState<FilterPage> {
85 91
   void onConfirm() {
86 92
     for (var req in vm.reqList) {
87 93
       req.cypzName = cypz.value?.name;
88
-      req.jyzb = jyzb.value?.name;
94
+      req.sjbj = sjbj.value?.value;
89 95
       req.ypdj = ypdj.value == null ? null : int.parse(ypdj.value!.value);
90 96
       req.qydq = qydq;
91 97
     }
@@ -101,7 +107,7 @@ class _FilterPageState extends BaseState<FilterPage> {
101 107
     // 采样品种
102 108
     getCypzList();
103 109
     // 检验指标
104
-    getJyzbList();
110
+    getSjbjList();
105 111
     // 样品等级
106 112
     getYpdjList();
107 113
     qydq = vm.reqList.first.qydq;
@@ -133,8 +139,8 @@ class _FilterPageState extends BaseState<FilterPage> {
133 139
             CardWidgets.buildMenu(
134 140
               false,
135 141
               '检验指标',
136
-              jyzbList,
137
-              jyzb,
142
+              sjbjList,
143
+              sjbj,
138 144
               (_, sel) {},
139 145
               hint: '请选择',
140 146
             ),