Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
A
anchor_collect_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hywang
anchor_collect_flutter
Commits
af5d64f6
Commit
af5d64f6
authored
Apr 07, 2024
by
hywang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.配种冻精信息可关键字搜索;
2.修改列表页面耳标筛选bug; 3.增加牛只照片列表功能。
parent
733d7006
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
4277 additions
and
196 deletions
+4277
-196
iconfont.json
fonts/iconfont.json
+14
-0
iconfont.ttf
fonts/iconfont.ttf
+0
-0
congifs.dart
lib/congifs.dart
+4
-6
global_service.dart
lib/controllers/global_service.dart
+2
-0
json_convert_content.dart
lib/generated/json/base/json_convert_content.dart
+5
-0
cattle_photo_entity.g.dart
lib/generated/json/cattle_photo_entity.g.dart
+133
-0
cattle_photo_entity.dart
lib/models/cattle_photo_entity.dart
+72
-0
cattle_photo_entity.g.dart
lib/models/cattle_photo_entity.g.dart
+3138
-0
breeding_record_detail_view.dart
...d/breeding_record_detail/breeding_record_detail_view.dart
+65
-49
breeding_record_list_logic.dart
...cord/breeding_record_list/breeding_record_list_logic.dart
+18
-9
breeding_record_list_state.dart
...cord/breeding_record_list/breeding_record_list_state.dart
+2
-0
cattle_photo_binding.dart
lib/pages/cattle_photo/cattle_photo_binding.dart
+10
-0
cattle_photo_list_binding.dart
...le_photo/cattle_photo_list/cattle_photo_list_binding.dart
+10
-0
cattle_photo_list_logic.dart
...ttle_photo/cattle_photo_list/cattle_photo_list_logic.dart
+213
-0
cattle_photo_list_state.dart
...ttle_photo/cattle_photo_list/cattle_photo_list_state.dart
+26
-0
cattle_photo_list_view.dart
...attle_photo/cattle_photo_list/cattle_photo_list_view.dart
+178
-0
cattle_photo_logic.dart
lib/pages/cattle_photo/cattle_photo_logic.dart
+7
-0
cattle_photo_state.dart
lib/pages/cattle_photo/cattle_photo_state.dart
+5
-0
cattle_photo_view.dart
lib/pages/cattle_photo/cattle_photo_view.dart
+16
-0
cattle_resume_list_logic.dart
...e_resume/cattle_resume_list/cattle_resume_list_logic.dart
+18
-9
home_logic.dart
lib/pages/home/home_logic.dart
+3
-0
home_view.dart
lib/pages/home/home_view.dart
+62
-37
like_search_dict_binding.dart
lib/pages/like_search_dict/like_search_dict_binding.dart
+10
-0
like_search_dict_logic.dart
lib/pages/like_search_dict/like_search_dict_logic.dart
+66
-0
like_search_dict_state.dart
lib/pages/like_search_dict/like_search_dict_state.dart
+18
-0
like_search_dict_view.dart
lib/pages/like_search_dict/like_search_dict_view.dart
+78
-0
like_search_farmer_logic.dart
lib/pages/like_search_farmer/like_search_farmer_logic.dart
+0
-7
login_logic.dart
lib/pages/login/login_logic.dart
+2
-1
medical_record_list_logic.dart
...record/medical_record_list/medical_record_list_logic.dart
+21
-9
medical_record_list_state.dart
...record/medical_record_list/medical_record_list_state.dart
+2
-0
performance_list_logic.dart
.../performance/performance_list/performance_list_logic.dart
+32
-24
performance_list_state.dart
.../performance/performance_list/performance_list_state.dart
+1
-2
performance_list_view.dart
...s/performance/performance_list/performance_list_view.dart
+0
-28
weight_man_list_logic.dart
...ges/weight_man/weight_man_list/weight_man_list_logic.dart
+17
-8
weight_man_list_state.dart
...ges/weight_man/weight_man_list/weight_man_list_state.dart
+2
-0
pages.dart
lib/routes/pages.dart
+19
-5
routes.dart
lib/routes/routes.dart
+8
-2
No files found.
fonts/iconfont.json
View file @
af5d64f6
...
...
@@ -5,6 +5,20 @@
"css_prefix_text"
:
"hred-"
,
"description"
:
""
,
"glyphs"
:
[
{
"icon_id"
:
"2448144"
,
"name"
:
"照片墙"
,
"font_class"
:
"zhaopianqiang"
,
"unicode"
:
"e641"
,
"unicode_decimal"
:
58945
},
{
"icon_id"
:
"16038063"
,
"name"
:
"同步1"
,
"font_class"
:
"tongbu1"
,
"unicode"
:
"e63b"
,
"unicode_decimal"
:
58939
},
{
"icon_id"
:
"13719920"
,
"name"
:
"待诊疗"
,
...
...
fonts/iconfont.ttf
View file @
af5d64f6
No preview for this file type
lib/congifs.dart
View file @
af5d64f6
...
...
@@ -58,6 +58,7 @@ class IconFont {
static
const
IconData
breeding_record
=
IconData
(
0xe76b
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
immune
=
IconData
(
0xe616
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
weight
=
IconData
(
0xe9fb
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
cattle_photo
=
IconData
(
0xe641
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
///tab
static
const
IconData
home
=
IconData
(
0xe9fb
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
...
...
@@ -74,8 +75,7 @@ class IconFont {
static
const
IconData
postpartum_breeding_warn
=
IconData
(
0xe62f
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
postpartum_check_warn
=
IconData
(
0xe76b
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
gravidity_initial_check_warn
=
IconData
(
0xe65a
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
gravidity_initial_check_warn
=
IconData
(
0xe65a
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
gravidity_recheck_warn
=
IconData
(
0xe65b
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
cow_estrus_warn
=
IconData
(
0xe632
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
...
...
@@ -84,10 +84,8 @@ class IconFont {
static
const
IconData
anestrus_warn
=
IconData
(
0xe6ea
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
cow_weed_out_count_warn
=
IconData
(
0xe6ba
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
cow_weed_out_moom_age_warn
=
IconData
(
0xe7b8
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
bull_weed_out_moom_age_warn
=
IconData
(
0xe659
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
cow_weed_out_moom_age_warn
=
IconData
(
0xe7b8
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
static
const
IconData
bull_weed_out_moom_age_warn
=
IconData
(
0xe659
,
fontFamily:
_fontFamily
,
matchTextDirection:
true
);
///
}
lib/controllers/global_service.dart
View file @
af5d64f6
...
...
@@ -5,6 +5,7 @@ import 'package:isar/isar.dart';
import
'../models/breeding_record_detail_entity.dart'
;
import
'../models/breeding_record_entity.dart'
;
import
'../models/cattle_photo_entity.dart'
;
import
'../models/cattle_resume_entity.dart'
;
import
'../models/dict_entity.dart'
;
import
'../models/immune_batch_detail_entity.dart'
;
...
...
@@ -35,6 +36,7 @@ class GlobalService extends GetxService {
ImmuneBatchDetailEntitySchema
,
BreedingRecordEntitySchema
,
BreedingRecordDetailEntitySchema
,
CattlePhotoEntitySchema
,
DictEntitySchema
,
],
inspector:
true
);
...
...
lib/generated/json/base/json_convert_content.dart
View file @
af5d64f6
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart' show debugPrint;
import
'package:anchor_collect_flutter/api/api_response.dart'
;
import
'package:anchor_collect_flutter/models/breeding_record_detail_entity.dart'
;
import
'package:anchor_collect_flutter/models/breeding_record_entity.dart'
;
import
'package:anchor_collect_flutter/models/cattle_photo_entity.dart'
;
import
'package:anchor_collect_flutter/models/cattle_resume_entity.dart'
;
import
'package:anchor_collect_flutter/models/dict_entity.dart'
;
import
'package:anchor_collect_flutter/models/immune_batch_detail_entity.dart'
;
...
...
@@ -148,6 +149,9 @@ class JsonConvert {
if
(<
BreedingRecordEntity
>[]
is
M
)
{
return
data
.
map
<
BreedingRecordEntity
>((
Map
<
String
,
dynamic
>
e
)
=>
BreedingRecordEntity
.
fromJson
(
e
)).
toList
()
as
M
;
}
if
(<
CattlePhotoEntity
>[]
is
M
)
{
return
data
.
map
<
CattlePhotoEntity
>((
Map
<
String
,
dynamic
>
e
)
=>
CattlePhotoEntity
.
fromJson
(
e
)).
toList
()
as
M
;
}
if
(<
CattleResumeEntity
>[]
is
M
)
{
return
data
.
map
<
CattleResumeEntity
>((
Map
<
String
,
dynamic
>
e
)
=>
CattleResumeEntity
.
fromJson
(
e
)).
toList
()
as
M
;
}
...
...
@@ -218,6 +222,7 @@ class JsonConvertClassCollection {
(
ApiResponseData
).
toString
():
ApiResponseData
.
fromJson
,
(
BreedingRecordDetailEntity
).
toString
():
BreedingRecordDetailEntity
.
fromJson
,
(
BreedingRecordEntity
).
toString
():
BreedingRecordEntity
.
fromJson
,
(
CattlePhotoEntity
).
toString
():
CattlePhotoEntity
.
fromJson
,
(
CattleResumeEntity
).
toString
():
CattleResumeEntity
.
fromJson
,
(
DictEntity
).
toString
():
DictEntity
.
fromJson
,
(
ImmuneBatchDetailEntity
).
toString
():
ImmuneBatchDetailEntity
.
fromJson
,
...
...
lib/generated/json/cattle_photo_entity.g.dart
0 → 100644
View file @
af5d64f6
import
'package:anchor_collect_flutter/generated/json/base/json_convert_content.dart'
;
import
'package:anchor_collect_flutter/models/cattle_photo_entity.dart'
;
import
'package:isar/isar.dart'
;
CattlePhotoEntity
$CattlePhotoEntityFromJson
(
Map
<
String
,
dynamic
>
json
)
{
final
CattlePhotoEntity
cattlePhotoEntity
=
CattlePhotoEntity
();
final
Id
?
id
=
jsonConvert
.
convert
<
Id
>(
json
[
'id'
]);
if
(
id
!=
null
)
{
cattlePhotoEntity
.
id
=
id
;
}
final
String
?
unid
=
jsonConvert
.
convert
<
String
>(
json
[
'unid'
]);
if
(
unid
!=
null
)
{
cattlePhotoEntity
.
unid
=
unid
;
}
final
String
?
cattleresumeId
=
jsonConvert
.
convert
<
String
>(
json
[
'cattleresumeId'
]);
if
(
cattleresumeId
!=
null
)
{
cattlePhotoEntity
.
cattleresumeId
=
cattleresumeId
;
}
final
String
?
registrationNo
=
jsonConvert
.
convert
<
String
>(
json
[
'registrationNo'
]);
if
(
registrationNo
!=
null
)
{
cattlePhotoEntity
.
registrationNo
=
registrationNo
;
}
final
String
?
individualNo
=
jsonConvert
.
convert
<
String
>(
json
[
'individualNo'
]);
if
(
individualNo
!=
null
)
{
cattlePhotoEntity
.
individualNo
=
individualNo
;
}
final
String
?
front
=
jsonConvert
.
convert
<
String
>(
json
[
'front'
]);
if
(
front
!=
null
)
{
cattlePhotoEntity
.
front
=
front
;
}
final
String
?
lateralBody
=
jsonConvert
.
convert
<
String
>(
json
[
'lateralBody'
]);
if
(
lateralBody
!=
null
)
{
cattlePhotoEntity
.
lateralBody
=
lateralBody
;
}
final
String
?
rear
=
jsonConvert
.
convert
<
String
>(
json
[
'rear'
]);
if
(
rear
!=
null
)
{
cattlePhotoEntity
.
rear
=
rear
;
}
final
String
?
uploadStatus
=
jsonConvert
.
convert
<
String
>(
json
[
'uploadStatus'
]);
if
(
uploadStatus
!=
null
)
{
cattlePhotoEntity
.
uploadStatus
=
uploadStatus
;
}
final
String
?
deptId
=
jsonConvert
.
convert
<
String
>(
json
[
'deptId'
]);
if
(
deptId
!=
null
)
{
cattlePhotoEntity
.
deptId
=
deptId
;
}
final
String
?
searchValue
=
jsonConvert
.
convert
<
String
>(
json
[
'searchValue'
]);
if
(
searchValue
!=
null
)
{
cattlePhotoEntity
.
searchValue
=
searchValue
;
}
final
String
?
createBy
=
jsonConvert
.
convert
<
String
>(
json
[
'createBy'
]);
if
(
createBy
!=
null
)
{
cattlePhotoEntity
.
createBy
=
createBy
;
}
final
String
?
createTime
=
jsonConvert
.
convert
<
String
>(
json
[
'createTime'
]);
if
(
createTime
!=
null
)
{
cattlePhotoEntity
.
createTime
=
createTime
;
}
final
String
?
updateBy
=
jsonConvert
.
convert
<
String
>(
json
[
'updateBy'
]);
if
(
updateBy
!=
null
)
{
cattlePhotoEntity
.
updateBy
=
updateBy
;
}
final
String
?
updateTime
=
jsonConvert
.
convert
<
String
>(
json
[
'updateTime'
]);
if
(
updateTime
!=
null
)
{
cattlePhotoEntity
.
updateTime
=
updateTime
;
}
final
String
?
remark
=
jsonConvert
.
convert
<
String
>(
json
[
'remark'
]);
if
(
remark
!=
null
)
{
cattlePhotoEntity
.
remark
=
remark
;
}
return
cattlePhotoEntity
;
}
Map
<
String
,
dynamic
>
$CattlePhotoEntityToJson
(
CattlePhotoEntity
entity
)
{
final
Map
<
String
,
dynamic
>
data
=
<
String
,
dynamic
>{};
data
[
'id'
]
=
entity
.
id
;
data
[
'unid'
]
=
entity
.
unid
;
data
[
'cattleresumeId'
]
=
entity
.
cattleresumeId
;
data
[
'registrationNo'
]
=
entity
.
registrationNo
;
data
[
'individualNo'
]
=
entity
.
individualNo
;
data
[
'front'
]
=
entity
.
front
;
data
[
'lateralBody'
]
=
entity
.
lateralBody
;
data
[
'rear'
]
=
entity
.
rear
;
data
[
'uploadStatus'
]
=
entity
.
uploadStatus
;
data
[
'deptId'
]
=
entity
.
deptId
;
data
[
'searchValue'
]
=
entity
.
searchValue
;
data
[
'createBy'
]
=
entity
.
createBy
;
data
[
'createTime'
]
=
entity
.
createTime
;
data
[
'updateBy'
]
=
entity
.
updateBy
;
data
[
'updateTime'
]
=
entity
.
updateTime
;
data
[
'remark'
]
=
entity
.
remark
;
return
data
;
}
extension
CattlePhotoEntityExtension
on
CattlePhotoEntity
{
CattlePhotoEntity
copyWith
({
Id
?
id
,
String
?
unid
,
String
?
cattleresumeId
,
String
?
registrationNo
,
String
?
individualNo
,
String
?
front
,
String
?
lateralBody
,
String
?
rear
,
String
?
uploadStatus
,
String
?
deptId
,
String
?
searchValue
,
String
?
createBy
,
String
?
createTime
,
String
?
updateBy
,
String
?
updateTime
,
String
?
remark
,
})
{
return
CattlePhotoEntity
()
..
id
=
id
??
this
.
id
..
unid
=
unid
??
this
.
unid
..
cattleresumeId
=
cattleresumeId
??
this
.
cattleresumeId
..
registrationNo
=
registrationNo
??
this
.
registrationNo
..
individualNo
=
individualNo
??
this
.
individualNo
..
front
=
front
??
this
.
front
..
lateralBody
=
lateralBody
??
this
.
lateralBody
..
rear
=
rear
??
this
.
rear
..
uploadStatus
=
uploadStatus
??
this
.
uploadStatus
..
deptId
=
deptId
??
this
.
deptId
..
searchValue
=
searchValue
??
this
.
searchValue
..
createBy
=
createBy
??
this
.
createBy
..
createTime
=
createTime
??
this
.
createTime
..
updateBy
=
updateBy
??
this
.
updateBy
..
updateTime
=
updateTime
??
this
.
updateTime
..
remark
=
remark
??
this
.
remark
;
}
}
\ No newline at end of file
lib/models/cattle_photo_entity.dart
0 → 100644
View file @
af5d64f6
import
'dart:convert'
;
import
'package:isar/isar.dart'
;
import
'../generated/json/base/json_field.dart'
;
import
'../generated/json/cattle_photo_entity.g.dart'
;
part
'cattle_photo_entity.g.dart'
;
@JsonSerializable
()
@collection
class
CattlePhotoEntity
{
Id
id
=
Isar
.
autoIncrement
;
/** unid主键 */
@Index
(
unique:
true
,
replace:
true
)
String
?
unid
;
/** 档案主键 */
String
?
cattleresumeId
;
/** 电子耳标 */
String
?
registrationNo
;
/** 可视耳标 */
String
?
individualNo
;
/** 正面 */
String
?
front
;
/** 侧身 */
String
?
lateralBody
;
/** 后部 */
String
?
rear
;
/** 是否上传 0未上传,1已上传 */
String
?
uploadStatus
;
/** 部门id */
String
?
deptId
;
/** 搜索值 */
String
?
searchValue
;
/** 创建者 */
String
?
createBy
;
/** 创建时间 */
String
?
createTime
;
/** 更新者 */
String
?
updateBy
;
/** 更新时间 */
String
?
updateTime
;
/** 备注 */
String
?
remark
;
CattlePhotoEntity
();
factory
CattlePhotoEntity
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
$CattlePhotoEntityFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
$CattlePhotoEntityToJson
(
this
);
@override
String
toString
()
{
return
jsonEncode
(
this
);
}
}
lib/models/cattle_photo_entity.g.dart
0 → 100644
View file @
af5d64f6
This diff is collapsed.
Click to expand it.
lib/pages/breeding_record/breeding_record_detail/breeding_record_detail_view.dart
View file @
af5d64f6
...
...
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import
'package:get/get.dart'
;
import
'package:intl/intl.dart'
;
import
'../../../models/dict_entity.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dialog_utils.dart'
;
import
'../../../utils/dict_utils.dart'
;
import
'breeding_record_detail_logic.dart'
;
...
...
@@ -16,10 +18,12 @@ class BreedingRecordDetailPage extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'配种详情'
,
title:
const
Text
(
'配种详情'
,
style:
TextStyle
(
color:
Colors
.
white
,
),),
),
),
backgroundColor:
Colors
.
blue
,
centerTitle:
true
,
),
...
...
@@ -89,38 +93,50 @@ class BreedingRecordDetailPage extends StatelessWidget {
// logic.update(),
// }),
// }),
getItemView
(
'冻精信息'
,
state
.
frozenSemenBatch
??
''
,
()
async
=>
{
DialogUtils
.
showSingleListDialog
(
await
DictUtils
.
getDictList
(
'zxgl_frozen_semen'
),
onPositive:
(
selectReslut
)
=>
{
state
.
frozenSemenBatch
=
selectReslut
.
key
,
state
.
entity
.
value
.
frozenSemenBatch
=
selectReslut
.
value
,
if
(
selectReslut
.
value
==
'1'
)
{
state
.
isOther
=
true
,
state
.
entity
.
value
.
cattleresumeId
=
''
,
}
else
{
state
.
isOther
=
false
,
state
.
entity
.
value
.
other
=
''
,
state
.
entity
.
value
.
cattleresumeId
=
selectReslut
.
key
.
substring
(
selectReslut
.
key
.
lastIndexOf
(
'/'
)+
1
,
selectReslut
.
key
.
length
),
},
logic
.
update
(),
}),
}),
getItemView
(
'冻精信息'
,
state
.
frozenSemenBatch
??
''
,
()
async
{
DictEntity
frozenSemenDictEntity
=
await
Get
.
toNamed
(
AppRoute
.
LIKE_SEARCH_DICT
,
arguments:
'zxgl_frozen_semen'
);
state
.
frozenSemenBatch
=
frozenSemenDictEntity
.
dictLabel
??
''
;
state
.
entity
.
value
.
frozenSemenBatch
=
frozenSemenDictEntity
.
dictValue
;
if
(
frozenSemenDictEntity
.
dictValue
==
'1'
)
{
state
.
isOther
=
true
;
state
.
entity
.
value
.
cattleresumeId
=
''
;
}
else
{
state
.
isOther
=
false
;
state
.
entity
.
value
.
other
=
''
;
state
.
entity
.
value
.
cattleresumeId
=
frozenSemenDictEntity
.
dictLabel
??
''
.
substring
((
frozenSemenDictEntity
.
dictLabel
??
''
).
lastIndexOf
(
'/'
)
+
1
,
(
frozenSemenDictEntity
.
dictLabel
??
''
).
length
);
}
logic
.
update
();
// DialogUtils.showSingleListDialog(await DictUtils.getDictList('zxgl_frozen_semen'),
// onPositive: (selectReslut) => {
// state.frozenSemenBatch = selectReslut.key,
// state.entity.value.frozenSemenBatch = selectReslut.value,
// if (selectReslut.value == '1')
// {
// state.isOther = true,
// state.entity.value.cattleresumeId = '',
// }
// else
// {
// state.isOther = false,
// state.entity.value.other = '',
// state.entity.value.cattleresumeId = selectReslut.key.substring(selectReslut.key.lastIndexOf('/')+1, selectReslut.key.length),
// },
// logic.update(),
// }),
}),
getItemView
(
'冻精注册号'
,
state
.
entity
.
value
.
cattleresumeId
??
''
,
()
=>
{
// DialogUtils.showInputDialog(
// hintText: '输入冻精注册号',
// onPositive: (text) => {
// state.entity.value.cattleresumeId = text ?? '',
// logic.update(),
// }),
// DialogUtils.showInputDialog(
// hintText: '输入冻精注册号',
// onPositive: (text) => {
// state.entity.value.cattleresumeId = text ?? '',
// logic.update(),
// }),
}),
],
),
...
...
@@ -149,17 +165,17 @@ class BreedingRecordDetailPage extends StatelessWidget {
getItemView
(
'配种日期'
,
state
.
entity
.
value
.
matingDate
??
''
,
()
=>
{
DialogUtils
.
showTimeDialog
(
Get
.
context
!,
isTime:
false
,
title:
'请选择配种日期'
,
onPositive:
(
date
)
=>
{
state
.
entity
.
value
.
matingDate
=
date
,
logic
.
calculateDueDate
(
date
),
},
),
}),
()
=>
{
DialogUtils
.
showTimeDialog
(
Get
.
context
!,
isTime:
false
,
title:
'请选择配种日期'
,
onPositive:
(
date
)
=>
{
state
.
entity
.
value
.
matingDate
=
date
,
logic
.
calculateDueDate
(
date
),
},
),
}),
],
),
),
...
...
@@ -187,14 +203,14 @@ class BreedingRecordDetailPage extends StatelessWidget {
getItemView
(
'备注'
,
state
.
entity
.
value
.
remark
??
''
,
()
=>
{
// DialogUtils.showInputDialog(
// hintText: '输入备注',
// onPositive: (text) => {
// itemDateList[i].remark = text ?? '',
// update(),
// }),
}),
()
=>
{
// DialogUtils.showInputDialog(
// hintText: '输入备注',
// onPositive: (text) => {
// itemDateList[i].remark = text ?? '',
// update(),
// }),
}),
],
),
),
...
...
lib/pages/breeding_record/breeding_record_list/breeding_record_list_logic.dart
View file @
af5d64f6
...
...
@@ -11,6 +11,7 @@ import '../../../controllers/global_service.dart';
import
'../../../models/cattle_resume_entity.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dialog_utils.dart'
;
import
'../../../utils/empty_utils.dart'
;
import
'../../../utils/sp_helper.dart'
;
import
'breeding_record_list_state.dart'
;
...
...
@@ -37,12 +38,18 @@ class BreedingRecordListLogic extends GetxController {
state
.
isFilter
=
false
;
}
else
{
state
.
isFilter
=
true
;
// CattleResumeEntity? cattleResumeEntity = await GlobalService.to.isar.cattleResumeEntitys
// .filter()
// .optional(state.cattleResumeEntity != null, (q) => q.unidEqualTo(state.cattleResumeEntity!.unid))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
// .findFirst();
var
filerCattle
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
findFirst
();
if
(
filerCattle
==
null
)
{
DialogUtils
.
showToast
(
'无此标签'
);
return
;
}
else
{
state
.
cattleResumeUnid
=
filerCattle
.
unid
??
''
;
}
}
isShow
=
false
;
queryFirstPage
();
...
...
@@ -60,8 +67,9 @@ class BreedingRecordListLogic extends GetxController {
.
unidIsNotEmpty
()
.
optional
(
state
.
cattleResumeEntity
!=
null
,
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeEntity
!.
unid
))
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleResumeUnid
),
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeUnid
))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
.
sortByCreateTimeDesc
()
.
offset
(
state
.
pageCount
*
(
state
.
pagination
-
1
))
.
limit
(
state
.
pageCount
)
...
...
@@ -77,7 +85,7 @@ class BreedingRecordListLogic extends GetxController {
.
unidEqualTo
(
pageData
[
i
].
cattleresumeId
)
.
findFirst
();
if
(
cre
!=
null
)
{
pageData
[
i
].
cattleresumeId
=
cre
.
unid
;
//
pageData[i].cattleresumeId = cre.unid;
pageData
[
i
].
registrationNo
=
cre
.
registrationNo
;
pageData
[
i
].
individualNo
=
cre
.
individualNo
;
pageData
[
i
].
breedingPlantId
=
await
DictUtils
.
getDictName
(
'zxgl_breeding_list'
,
cre
.
deptId
??
''
);
...
...
@@ -104,6 +112,7 @@ class BreedingRecordListLogic extends GetxController {
clean
()
{
state
.
filterHighNo
=
''
;
state
.
filterVisualNo
=
''
;
state
.
cattleResumeUnid
=
''
;
highController
.
text
=
''
;
update
();
}
...
...
lib/pages/breeding_record/breeding_record_list/breeding_record_list_state.dart
View file @
af5d64f6
...
...
@@ -16,6 +16,8 @@ class BreedingRecordListState {
String
filterHighNo
=
''
;
String
filterVisualNo
=
''
;
String
cattleResumeUnid
=
''
;
bool
isFilter
=
false
;
BreedingRecordListState
()
{
...
...
lib/pages/
like_search_farmer/like_search_farmer
_binding.dart
→
lib/pages/
cattle_photo/cattle_photo
_binding.dart
View file @
af5d64f6
import
'package:get/get.dart'
;
import
'
like_search_farmer
_logic.dart'
;
import
'
cattle_photo
_logic.dart'
;
class
LikeSearchFarmer
Binding
extends
Bindings
{
class
CattlePhoto
Binding
extends
Bindings
{
@override
void
dependencies
()
{
Get
.
lazyPut
(()
=>
LikeSearchFarmer
Logic
());
Get
.
lazyPut
(()
=>
CattlePhoto
Logic
());
}
}
lib/pages/cattle_photo/cattle_photo_list/cattle_photo_list_binding.dart
0 → 100644
View file @
af5d64f6
import
'package:get/get.dart'
;
import
'cattle_photo_list_logic.dart'
;
class
CattlePhotoListBinding
extends
Bindings
{
@override
void
dependencies
()
{
Get
.
lazyPut
(()
=>
CattlePhotoListLogic
());
}
}
lib/pages/cattle_photo/cattle_photo_list/cattle_photo_list_logic.dart
0 → 100644
View file @
af5d64f6
import
'package:anchor_collect_flutter/models/cattle_photo_entity.dart'
;
import
'package:anchor_collect_flutter/utils/dialog_utils.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:isar/isar.dart'
;
import
'../../../congifs.dart'
;
import
'../../../controllers/global_service.dart'
;
import
'../../../models/cattle_resume_entity.dart'
;
import
'../../../models/dict_entity.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dict_utils.dart'
;
import
'../../../utils/empty_utils.dart'
;
import
'../../../utils/sp_helper.dart'
;
import
'cattle_photo_list_state.dart'
;
class
CattlePhotoListLogic
extends
GetxController
{
final
CattlePhotoListState
state
=
CattlePhotoListState
();
bool
isShow
=
false
;
late
TextEditingController
highController
;
@override
void
onInit
()
{
highController
=
TextEditingController
();
Map
<
String
,
dynamic
>?
arguments
=
Get
.
arguments
;
if
(
arguments
!=
null
)
{
state
.
cattleResumeEntity
=
arguments
[
'cattleResumeEntity'
];
state
.
isFilter
=
state
.
cattleResumeEntity
!=
null
;
}
}
queryByFilter
()
async
{
state
.
dataList
.
clear
();
state
.
items
.
clear
();
state
.
cattleResumeEntity
=
null
;
if
(!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
)
&&
!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
))
{
state
.
isFilter
=
false
;
}
else
{
state
.
isFilter
=
true
;
var
filerCattle
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
findFirst
();
if
(
filerCattle
==
null
)
{
DialogUtils
.
showToast
(
'无此标签'
);
return
;
}
else
{
state
.
cattleResumeUnid
=
filerCattle
.
unid
??
''
;
}
}
isShow
=
false
;
queryFirstPage
();
}
queryFirstPage
()
{
state
.
dataList
.
clear
();
state
.
pagination
=
1
;
queryOnePage
();
}
queryOnePage
()
async
{
var
pageData
=
await
GlobalService
.
to
.
isar
.
cattlePhotoEntitys
.
filter
()
.
unidIsNotEmpty
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
state
.
cattleResumeEntity
!=
null
,
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeEntity
!.
unid
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleResumeUnid
),
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeUnid
))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
.
sortByCreateTimeDesc
()
.
offset
(
state
.
pageCount
*
(
state
.
pagination
-
1
))
.
limit
(
state
.
pageCount
)
.
findAll
();
if
(
pageData
.
isEmpty
)
{
state
.
pagination
--;
}
//查询出高频耳标和可视耳标
if
(
pageData
!=
null
)
{
for
(
int
i
=
0
;
i
<
pageData
!.
length
;
i
++)
{
CattleResumeEntity
?
cre
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
unidEqualTo
(
pageData
[
i
].
cattleresumeId
)
.
findFirst
();
if
(
cre
!=
null
)
{
pageData
[
i
].
registrationNo
=
cre
.
registrationNo
;
pageData
[
i
].
individualNo
=
cre
.
individualNo
;
}
}
}
state
.
dataList
.
addAll
(
pageData
);
if
(
kDebugMode
)
{
print
(
'CattlePhotoOnePage:
${pageData.toString()}
'
);
}
getItemList
(
state
.
dataList
);
}
onRefresh
()
{
state
.
isFilter
=
false
;
queryFirstPage
();
}
onLoad
()
{
if
(!
state
.
isFilter
)
{
state
.
pagination
++;
queryOnePage
();
}
}
clean
()
{
state
.
filterHighNo
=
''
;
state
.
filterVisualNo
=
''
;
state
.
cattleResumeUnid
=
''
;
highController
.
text
=
''
;
update
();
}
getItemList
(
List
<
CattlePhotoEntity
>
itemDateList
)
async
{
List
<
Widget
>
list
=
[];
if
(
kDebugMode
)
{
print
(
'基础信息数量:
${itemDateList.length}
'
);
}
for
(
int
i
=
0
;
i
<
itemDateList
.
length
;
i
++)
{
list
.
add
(
Padding
(
padding:
const
EdgeInsets
.
all
(
15.0
),
child:
InkWell
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
[
getCattleResumeItem
(
'电子耳标'
,
itemDateList
[
i
].
registrationNo
),
const
SizedBox
(
height:
5
,
),
getCattleResumeItem
(
'可视耳标'
,
itemDateList
[
i
].
individualNo
),
const
SizedBox
(
height:
5
,
),
],
),
onTap:
()
=>
itemOnClickListener
(
entity:
itemDateList
[
i
]),
),
));
}
state
.
items
=
list
;
update
();
}
getCattleResumeItem
(
String
title
,
String
?
context
)
{
// print('why:$title:$context');
return
Row
(
children:
[
Text
(
title
,
style:
const
TextStyle
(
color:
Colors
.
black
,
fontSize:
15
,
),
),
const
Expanded
(
child:
SizedBox
(
height:
1
,
),
),
Text
(
context
??
''
,
style:
const
TextStyle
(
color:
Colors
.
black45
,
fontSize:
15
,
),
),
],
);
}
Future
<
void
>
itemOnClickListener
({
CattlePhotoEntity
?
entity
})
async
{
Map
<
String
,
dynamic
>
params
=
{};
params
.
putIfAbsent
(
"entity"
,
()
=>
entity
);
params
.
putIfAbsent
(
"cattleResumeEntity"
,
()
=>
state
.
cattleResumeEntity
);
var
date
=
await
Get
.
toNamed
(
AppRoute
.
PERFORMANCE
,
arguments:
params
);
if
(
date
==
'refresh'
)
{
queryFirstPage
();
}
}
///扫描高频耳标
scanRfid
()
{
if
(!
Config
.
isConnect
)
{
Get
.
toNamed
(
AppRoute
.
SETTING
);
return
;
}
if
(!
RfidPlugin
.
isInventory
)
{
RfidPlugin
.
startInventory
((
epc
,
agrs1
)
{
RfidPlugin
.
stopInventory
();
print
(
'why:epc:
$epc
'
);
state
.
filterHighNo
=
epc
;
RfidPlugin
.
isInventory
=
false
;
highController
.
text
=
state
.
filterHighNo
;
update
();
});
}
}
}
lib/pages/cattle_photo/cattle_photo_list/cattle_photo_list_state.dart
0 → 100644
View file @
af5d64f6
import
'package:anchor_collect_flutter/models/cattle_photo_entity.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'../../../models/cattle_resume_entity.dart'
;
class
CattlePhotoListState
{
late
List
<
CattlePhotoEntity
>
dataList
;
late
List
<
Widget
>
items
;
CattleResumeEntity
?
cattleResumeEntity
;
int
pageCount
=
20
;
int
pagination
=
1
;
String
filterHighNo
=
''
;
String
filterVisualNo
=
''
;
String
cattleResumeUnid
=
''
;
bool
isFilter
=
false
;
CattlePhotoListState
()
{
items
=
[];
dataList
=
[];
}
}
lib/pages/cattle_photo/cattle_photo_list/cattle_photo_list_view.dart
0 → 100644
View file @
af5d64f6
import
'package:easy_refresh/easy_refresh.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'../../../congifs.dart'
;
import
'cattle_photo_list_logic.dart'
;
class
CattlePhotoListPage
extends
StatelessWidget
{
CattlePhotoListPage
({
Key
?
key
})
:
super
(
key:
key
);
final
logic
=
Get
.
find
<
CattlePhotoListLogic
>();
final
state
=
Get
.
find
<
CattlePhotoListLogic
>().
state
;
late
EasyRefreshController
_controller
;
@override
Widget
build
(
BuildContext
context
)
{
_controller
=
EasyRefreshController
();
logic
.
queryFirstPage
();
return
Scaffold
(
resizeToAvoidBottomInset:
false
,
appBar:
AppBar
(
title:
const
Text
(
'牛只图片列表'
,
style:
TextStyle
(
color:
Colors
.
white
,
),),
backgroundColor:
Colors
.
blue
,
centerTitle:
true
,
actions:
[
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
InkWell
(
child:
const
Icon
(
Icons
.
search
),
onTap:
()
{
logic
.
clean
();
logic
.
isShow
=
!
logic
.
isShow
;
logic
.
update
();
},
),
),
Config
.
isAdmin
?
Container
():
Padding
(
padding:
const
EdgeInsets
.
all
(
5.0
),
child:
InkWell
(
child:
const
Center
(
child:
Text
(
'新增'
),
),
onTap:
()=>{
logic
.
itemOnClickListener
(),},
),
),
],
),
body:
GetBuilder
<
CattlePhotoListLogic
>(
builder:
(
logic
)
{
return
Center
(
child:
Stack
(
children:
[
EasyRefresh
(
controller:
_controller
,
onLoad:
()
=>
logic
.
onLoad
(),
onRefresh:
()
=>
logic
.
onRefresh
(),
child:
ListView
.
separated
(
itemCount:
state
.
items
.
length
,
itemBuilder:
(
context
,
index
)
{
return
state
.
items
[
index
];
},
separatorBuilder:
(
context
,
index
)
{
return
Container
(
height:
3
,
color:
Colors
.
black12
,
);
},
),
),
logic
.
isShow
?
Row
(
children:
[
Expanded
(
child:
InkWell
(
child:
Container
(
height:
double
.
infinity
,
color:
Colors
.
black26
,
),
onTap:
()
=>
{
logic
.
isShow
=
false
,
logic
.
update
(),
},
),
),
Container
(
width:
280
,
color:
Colors
.
white
,
padding:
const
EdgeInsets
.
all
(
20
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
[
TextField
(
readOnly:
true
,
controller:
logic
.
highController
,
onChanged:
(
text
)
{
state
.
filterHighNo
=
text
;
},
decoration:
const
InputDecoration
(
prefixIcon:
Icon
(
Icons
.
search
),
border:
OutlineInputBorder
(),
hintText:
'电子耳标(点击扫描)'
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
8.0
),
),
onTap:
()
=>
{
logic
.
scanRfid
(),
},
),
const
SizedBox
(
height:
10
,
),
TextField
(
onChanged:
(
text
)
{
state
.
filterVisualNo
=
text
;
},
decoration:
const
InputDecoration
(
prefixIcon:
Icon
(
Icons
.
search
),
border:
OutlineInputBorder
(),
hintText:
'可视耳标'
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
8.0
),
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
Get
.
width
,
child:
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
blue
),
foregroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
padding:
MaterialStateProperty
.
all
(
const
EdgeInsets
.
all
(
10
)),
),
onPressed:
()
=>
{
logic
.
queryByFilter
(),
},
child:
const
Text
(
"查询"
),
),
),
const
SizedBox
(
height:
10
,
),
SizedBox
(
width:
Get
.
width
,
child:
TextButton
(
style:
ButtonStyle
(
backgroundColor:
MaterialStateProperty
.
all
(
Colors
.
white
),
foregroundColor:
MaterialStateProperty
.
all
(
Colors
.
blue
),
padding:
MaterialStateProperty
.
all
(
const
EdgeInsets
.
all
(
10
)),
shape:
MaterialStateProperty
.
all
<
RoundedRectangleBorder
>(
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
),
),
),
side:
MaterialStateProperty
.
all
<
BorderSide
>(
const
BorderSide
(
color:
Colors
.
black54
,
// 边框颜色
width:
1
,
// 边框宽度
)),
),
onPressed:
()
=>
logic
.
clean
(),
child:
const
Text
(
"重置"
),
),
),
],
),
),
],
)
:
Container
(),
]),
);
}),
);
}
}
lib/pages/cattle_photo/cattle_photo_logic.dart
0 → 100644
View file @
af5d64f6
import
'package:get/get.dart'
;
import
'cattle_photo_state.dart'
;
class
CattlePhotoLogic
extends
GetxController
{
final
CattlePhotoState
state
=
CattlePhotoState
();
}
lib/pages/
like_search_farmer/like_search_farmer
_state.dart
→
lib/pages/
cattle_photo/cattle_photo
_state.dart
View file @
af5d64f6
class
LikeSearchFarmer
State
{
LikeSearchFarmer
State
()
{
class
CattlePhoto
State
{
CattlePhoto
State
()
{
///Initialize variables
}
}
lib/pages/
like_search_farmer/like_search_farmer
_view.dart
→
lib/pages/
cattle_photo/cattle_photo
_view.dart
View file @
af5d64f6
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'
like_search_farmer
_logic.dart'
;
import
'
cattle_photo
_logic.dart'
;
class
LikeSearchFarmerPage
extends
StatelessWidget
{
LikeSearchFarmerPage
({
Key
?
key
})
:
super
(
key:
key
);
final
logic
=
Get
.
find
<
LikeSearchFarmerLogic
>();
final
state
=
Get
.
find
<
LikeSearchFarmerLogic
>().
state
;
class
CattlePhotoPage
extends
StatelessWidget
{
const
CattlePhotoPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
final
logic
=
Get
.
find
<
CattlePhotoLogic
>();
final
state
=
Get
.
find
<
CattlePhotoLogic
>().
state
;
return
Container
();
}
...
...
lib/pages/cattle_resume/cattle_resume_list/cattle_resume_list_logic.dart
View file @
af5d64f6
...
...
@@ -9,6 +9,7 @@ import 'package:isar/isar.dart';
import
'../../../congifs.dart'
;
import
'../../../controllers/global_service.dart'
;
import
'../../../models/dict_entity.dart'
;
import
'../../../models/value_model.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../utils/dict_utils.dart'
;
...
...
@@ -45,7 +46,8 @@ class CattleResumeListLogic extends GetxController {
.
filter
()
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
status
),
(
q
)
=>
q
.
statusEqualTo
(
state
.
status
))
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
Config
.
isAdmin
&&
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleManId
),
(
q
)
=>
q
.
deptIdEqualTo
(
state
.
cattleManId
))
.
optional
(
Config
.
isAdmin
&&
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleManId
),
(
q
)
=>
q
.
deptIdEqualTo
(
state
.
cattleManId
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterFatherNo
),
(
q
)
=>
q
.
fatherRegEqualTo
(
state
.
filterFatherNo
))
...
...
@@ -69,7 +71,8 @@ class CattleResumeListLogic extends GetxController {
.
unidIsNotEmpty
()
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
status
),
(
q
)
=>
q
.
statusEqualTo
(
state
.
status
))
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
Config
.
isAdmin
&&
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleManId
),
(
q
)
=>
q
.
deptIdEqualTo
(
state
.
cattleManId
))
.
optional
(
Config
.
isAdmin
&&
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleManId
),
(
q
)
=>
q
.
deptIdEqualTo
(
state
.
cattleManId
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterFatherNo
),
(
q
)
=>
q
.
fatherRegEqualTo
(
state
.
filterFatherNo
))
...
...
@@ -109,13 +112,19 @@ class CattleResumeListLogic extends GetxController {
///选择牧户
selectCattleMan
()
async
{
DialogUtils
.
showSingleListDialog
(
await
DictUtils
.
getDictList
(
'zxgl_breeding_list'
),
onPositive:
(
selectReslut
)
=>
{
state
.
cattleManName
=
selectReslut
.
key
,
state
.
cattleManId
=
selectReslut
.
value
,
personController
.
text
=
state
.
cattleManName
,
update
(),}
);
// DialogUtils.showSingleListDialog(await DictUtils.getDictList('zxgl_breeding_list'),
// onPositive: (selectReslut) => {
// state.cattleManName = selectReslut.key,
// state.cattleManId = selectReslut.value,
// personController.text=state.cattleManName,
// update(),}
// );
DictEntity
farmerDictEntity
=
await
Get
.
toNamed
(
AppRoute
.
LIKE_SEARCH_DICT
,
arguments:
'zxgl_breeding_list'
);
state
.
cattleManName
=
farmerDictEntity
.
dictLabel
??
''
;
state
.
cattleManId
=
farmerDictEntity
.
dictValue
??
''
;
personController
.
text
=
state
.
cattleManName
;
update
();
}
getItemList
(
List
<
CattleResumeEntity
>
itemDateList
)
async
{
...
...
lib/pages/home/home_logic.dart
View file @
af5d64f6
...
...
@@ -97,6 +97,9 @@ class HomeLogic extends GetxController {
case
'称重管理'
:
Get
.
toNamed
(
AppRoute
.
WEIGHT_MAN_LIST
);
break
;
case
'牛只照片'
:
Get
.
toNamed
(
AppRoute
.
CATTLE_PHOTO_LIST
);
break
;
}
}
...
...
lib/pages/home/home_view.dart
View file @
af5d64f6
...
...
@@ -13,18 +13,19 @@ class HomePage extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'首页'
,
title:
const
Text
(
'首页'
,
style:
TextStyle
(
color:
Colors
.
white
,
),),
),
),
backgroundColor:
Colors
.
blue
,
centerTitle:
true
,
elevation:
10
,
actions:
[
InkWell
(
child:
const
Icon
(
Icons
.
settings
),
onTap:
()
=>
{
onTap:
()
=>
{
Get
.
toNamed
(
AppRoute
.
SETTING
),
},
),
...
...
@@ -131,7 +132,31 @@ class HomePage extends StatelessWidget {
),
],
),
const
SizedBox
(
height:
10
,)
const
SizedBox
(
height:
8
,
),
Row
(
children:
[
const
SizedBox
(
width:
8
,
),
_getFunButton
(
'牛只照片'
,
IconFont
.
cattle_photo
,
const
Color
.
fromARGB
(
255
,
19
,
34
,
122
)),
const
SizedBox
(
width:
8
,
),
_getFunButton
(
'免疫记录'
,
IconFont
.
immune
,
const
Color
.
fromARGB
(
255
,
116
,
154
,
110
),
isEmpty:
true
),
const
SizedBox
(
width:
8
,
),
_getFunButton
(
'称重管理'
,
IconFont
.
weight
,
const
Color
.
fromARGB
(
255
,
150
,
114
,
89
),
isEmpty:
true
),
const
SizedBox
(
width:
8
,
),
],
),
const
SizedBox
(
height:
10
,
)
],
),
),
...
...
@@ -143,23 +168,22 @@ class HomePage extends StatelessWidget {
Expanded
_getCountItem
(
String
imagePath
,
String
title
,
int
count
,
IconData
iconData
)
{
String
statusType
=
''
;
switch
(
title
)
{
case
'养殖中'
:
case
'养殖中'
:
statusType
=
'1'
;
break
;
case
'已淘汰'
:
case
'已淘汰'
:
statusType
=
'2'
;
break
;
case
'已死亡'
:
case
'已死亡'
:
statusType
=
'3'
;
break
;
case
'已出售'
:
case
'已出售'
:
statusType
=
'4'
;
break
;
}
return
Expanded
(
child:
InkWell
(
onTap:
()
=>
{
onTap:
()
=>
{
Get
.
toNamed
(
AppRoute
.
CATTLE_RESUME_LIST
,
arguments:
statusType
),
},
child:
Container
(
...
...
@@ -200,8 +224,7 @@ class HomePage extends StatelessWidget {
left:
20
,
bottom:
10
,
child:
Text
(
'
${statusType == '1' ? logic.breedingCount : statusType == '2' ? logic.obsoleteCount : statusType ==
'3' ? logic.deadCount : statusType == '4' ? logic.sellCount:''}
'
,
'
${statusType == '1' ? logic.breedingCount : statusType == '2' ? logic.obsoleteCount : statusType == '3' ? logic.deadCount : statusType == '4' ? logic.sellCount : ''}
'
,
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
,
...
...
@@ -225,33 +248,35 @@ class HomePage extends StatelessWidget {
);
}
Expanded
_getFunButton
(
String
title
,
IconData
iconData
,
Color
iconColor
)
{
Expanded
_getFunButton
(
String
title
,
IconData
iconData
,
Color
iconColor
,
{
bool
isEmpty
=
false
}
)
{
return
Expanded
(
child:
InkWell
(
child:
Container
(
height:
80
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
black
.
withOpacity
(
0.1
),
blurRadius:
1
,
spreadRadius:
1
,
)
],
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
iconData
,
color:
iconColor
,
size:
30
,
child:
isEmpty
?
const
SizedBox
()
:
Container
(
height:
80
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
black
.
withOpacity
(
0.1
),
blurRadius:
1
,
spreadRadius:
1
,
)
],
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
iconData
,
color:
iconColor
,
size:
30
,
),
Text
(
title
),
],
),
),
Text
(
title
),
],
),
),
onTap:
()
=>
logic
.
forWard
(
title
),
),
);
...
...
lib/pages/like_search_dict/like_search_dict_binding.dart
0 → 100644
View file @
af5d64f6
import
'package:get/get.dart'
;
import
'like_search_dict_logic.dart'
;
class
LikeSearchDictBinding
extends
Bindings
{
@override
void
dependencies
()
{
Get
.
lazyPut
(()
=>
LikeSearchDictLogic
());
}
}
lib/pages/like_search_dict/like_search_dict_logic.dart
0 → 100644
View file @
af5d64f6
import
'package:anchor_collect_flutter/models/dict_entity.dart'
;
import
'package:anchor_collect_flutter/utils/empty_utils.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:isar/isar.dart'
;
import
'../../controllers/global_service.dart'
;
import
'like_search_dict_state.dart'
;
class
LikeSearchDictLogic
extends
GetxController
{
final
LikeSearchDictState
state
=
LikeSearchDictState
();
late
TextEditingController
dictNameController
;
@override
void
onInit
()
{
dictNameController
=
TextEditingController
();
state
.
dictType
=
Get
.
arguments
;
switch
(
state
.
dictType
){
case
'zxgl_breeding_list'
:
state
.
title
=
'牧户选择'
;
break
;
case
'zxgl_frozen_semen'
:
state
.
title
=
'冻精选择'
;
break
;
}
}
queryName
({
String
?
queryName
})
async
{
state
.
dataList
.
clear
();
state
.
items
.
clear
();
state
.
dataList
=
await
GlobalService
.
to
.
isar
.
dictEntitys
.
filter
()
.
dictTypeEqualTo
(
state
.
dictType
)
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
queryName
),
(
q
)
=>
q
.
dictLabelContains
(
queryName
??
''
))
.
findAll
();
getItemList
(
state
.
dataList
);
}
getItemList
(
List
<
DictEntity
>
itemDateList
)
{
List
<
Widget
>
list
=
[];
if
(
itemDateList
==
null
){
return
;
}
if
(
kDebugMode
)
{
print
(
'字典数量:
${itemDateList.length}
'
);
}
for
(
int
i
=
0
;
i
<
itemDateList
!.
length
;
i
++)
{
list
.
add
(
ListTile
(
title:
Text
(
itemDateList
[
i
].
dictLabel
??
''
),
subtitle:
Text
(
itemDateList
[
i
].
dictValue
??
''
),
onTap:
()=>{
Get
.
back
(
result:
itemDateList
[
i
]),
},
));
}
state
.
items
=
list
;
update
();
}
}
lib/pages/like_search_dict/like_search_dict_state.dart
0 → 100644
View file @
af5d64f6
import
'package:anchor_collect_flutter/models/dict_entity.dart'
;
import
'package:flutter/material.dart'
;
class
LikeSearchDictState
{
late
List
<
DictEntity
>
dataList
;
late
List
<
Widget
>
items
;
late
String
dictType
;
late
String
title
;
LikeSearchDictState
()
{
items
=
[];
dataList
=
[];
dictType
=
''
;
title
=
'模糊查询'
;
}
}
lib/pages/like_search_dict/like_search_dict_view.dart
0 → 100644
View file @
af5d64f6
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'like_search_dict_logic.dart'
;
class
LikeSearchDictPage
extends
StatelessWidget
{
LikeSearchDictPage
({
Key
?
key
})
:
super
(
key:
key
);
final
logic
=
Get
.
find
<
LikeSearchDictLogic
>();
final
state
=
Get
.
find
<
LikeSearchDictLogic
>()
.
state
;
@override
Widget
build
(
BuildContext
context
)
{
logic
.
queryName
();
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'选择牧户'
,
style:
TextStyle
(
color:
Colors
.
white
,
),
),
backgroundColor:
Colors
.
blue
,
centerTitle:
true
,
),
resizeToAvoidBottomInset:
false
,
body:
Container
(
padding:
const
EdgeInsets
.
all
(
10.0
),
child:
Column
(
children:
[
TextField
(
autofocus:
true
,
// textInputAction: TextInputAction.continueAction,//加上就不弹出软件盘了
// style: TextStyle(background: Paint().color),
onChanged:
(
text
)
{
logic
.
queryName
(
queryName:
text
);
},
decoration:
InputDecoration
(
filled:
true
,
border:
OutlineInputBorder
(),
hintText:
'请输入牧户名子'
,
fillColor:
Colors
.
white
,
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
15.0
),
suffixIcon:
IconButton
(
icon:
const
ImageIcon
(
AssetImage
(
'images/ic_delete.png'
)),
onPressed:
()
{
logic
.
dictNameController
.
text
=
''
;
logic
.
queryName
();
},
),
),
controller:
logic
.
dictNameController
,
),
Expanded
(
child:
GetBuilder
<
LikeSearchDictLogic
>(
builder:
(
logic
)
{
return
ListView
.
separated
(
shrinkWrap:
true
,
itemBuilder:
(
context
,
index
)
{
return
state
.
items
[
index
];
},
separatorBuilder:
(
context
,
index
)
{
return
Container
(
height:
1
,
color:
Colors
.
black12
,
);
},
itemCount:
state
.
items
.
length
);
}),
)
],
),
),
);
}
}
lib/pages/like_search_farmer/like_search_farmer_logic.dart
deleted
100644 → 0
View file @
733d7006
import
'package:get/get.dart'
;
import
'like_search_farmer_state.dart'
;
class
LikeSearchFarmerLogic
extends
GetxController
{
final
LikeSearchFarmerState
state
=
LikeSearchFarmerState
();
}
lib/pages/login/login_logic.dart
View file @
af5d64f6
...
...
@@ -33,7 +33,8 @@ class LoginLogic extends GetxController {
passwordController
.
text
=
SpHelper
.
getStorage
(
Config
.
SP_STR_PASSWORD
)??
''
;
// nameController.text = '13932316000';
// nameController.text = 'ewei';
nameController
.
text
=
'ewei'
;
passwordController
.
text
=
'1QAZ2wsx@@'
;
// passwordController.text = '123456';
// nameController.text = '13664793087';
...
...
lib/pages/medical_record/medical_record_list/medical_record_list_logic.dart
View file @
af5d64f6
...
...
@@ -11,6 +11,7 @@ import '../../../controllers/global_service.dart';
import
'../../../models/cattle_resume_entity.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dialog_utils.dart'
;
import
'../../../utils/empty_utils.dart'
;
import
'../../../utils/sp_helper.dart'
;
import
'medical_record_list_state.dart'
;
...
...
@@ -40,12 +41,18 @@ class MedicalRecordListLogic extends GetxController {
state
.
isFilter
=
false
;
}
else
{
state
.
isFilter
=
true
;
// state.cattleResumeEntity = await GlobalService.to.isar.cattleResumeEntitys
// .filter()
// .optional(!Config.isAdmin, (q) => q.deptIdEqualTo(SpHelper.getStorage(Config.SP_DEPT_ID)))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
// .findFirst();
var
filerCattle
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
findFirst
();
if
(
filerCattle
==
null
)
{
DialogUtils
.
showToast
(
'无此标签'
);
return
;
}
else
{
state
.
cattleResumeUnid
=
filerCattle
.
unid
??
''
;
}
}
isShow
=
false
;
queryFirstPage
();
...
...
@@ -63,8 +70,9 @@ class MedicalRecordListLogic extends GetxController {
.
unidIsNotEmpty
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
state
.
cattleResumeEntity
!=
null
,
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeEntity
!.
unid
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleResumeUnid
),
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeUnid
))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
.
sortByCreateTimeDesc
()
.
offset
(
state
.
pageCount
*
(
state
.
pagination
-
1
))
.
limit
(
state
.
pageCount
)
...
...
@@ -75,7 +83,10 @@ class MedicalRecordListLogic extends GetxController {
//查询出高频耳标和可视耳标
if
(
pageData
!=
null
)
{
for
(
int
i
=
0
;
i
<
pageData
!.
length
;
i
++)
{
CattleResumeEntity
?
cre
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
().
unidEqualTo
(
pageData
[
i
].
cattleresumeId
).
findFirst
();
CattleResumeEntity
?
cre
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
unidEqualTo
(
pageData
[
i
].
cattleresumeId
)
.
findFirst
();
if
(
cre
!=
null
){
pageData
[
i
].
registrationNo
=
cre
.
registrationNo
;
pageData
[
i
].
individualNo
=
cre
.
individualNo
;
...
...
@@ -101,6 +112,7 @@ class MedicalRecordListLogic extends GetxController {
clean
()
{
state
.
filterHighNo
=
''
;
state
.
filterVisualNo
=
''
;
state
.
cattleResumeUnid
=
''
;
highController
.
text
=
''
;
update
();
}
...
...
lib/pages/medical_record/medical_record_list/medical_record_list_state.dart
View file @
af5d64f6
...
...
@@ -16,6 +16,8 @@ class MedicalRecordListState {
String
filterHighNo
=
''
;
String
filterVisualNo
=
''
;
String
cattleResumeUnid
=
''
;
bool
isFilter
=
false
;
MedicalRecordListState
()
{
...
...
lib/pages/performance/performance_list/performance_list_logic.dart
View file @
af5d64f6
...
...
@@ -8,6 +8,7 @@ import 'package:isar/isar.dart';
import
'../../../congifs.dart'
;
import
'../../../controllers/global_service.dart'
;
import
'../../../models/dict_entity.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dialog_utils.dart'
;
...
...
@@ -40,20 +41,22 @@ class PerformanceListLogic extends GetxController {
state
.
items
.
clear
();
state
.
cattleResumeEntity
=
null
;
if
(!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
)
&&
!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
)
&&
!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterFatherNo
)
&&
!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterMotherNo
))
{
!
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
)
)
{
state
.
isFilter
=
false
;
}
else
{
state
.
isFilter
=
true
;
// state.cattleResumeEntity = await GlobalService.to.isar.cattleResumeEntitys
// .filter()
// .optional(!Config.isAdmin, (q) => q.deptIdEqualTo(SpHelper.getStorage(Config.SP_DEPT_ID)))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterFatherNo), (q) => q.fatherRegEqualTo(state.filterFatherNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterMotherNo), (q) => q.motherRegEqualTo(state.filterMotherNo))
// .findFirst();
var
filerCattle
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
findFirst
();
if
(
filerCattle
==
null
)
{
DialogUtils
.
showToast
(
'无此标签'
);
return
;
}
else
{
state
.
cattleResumeUnid
=
filerCattle
.
unid
??
''
;
}
}
isShow
=
false
;
queryFirstPage
();
...
...
@@ -72,11 +75,11 @@ class PerformanceListLogic extends GetxController {
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
state
.
cattleResumeEntity
!=
null
,
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeEntity
!.
unid
))
.
optional
(
Config
.
isAdmin
&&
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleManId
),
(
q
)
=>
q
.
deptIdEqualTo
(
state
.
cattleManId
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterFatherNo
),
(
q
)
=>
q
.
fatherRegEqualTo
(
state
.
filterFatherNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterMotherNo
),
(
q
)
=>
q
.
motherRegEqualTo
(
state
.
filterMotherNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleResumeUnid
),
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeUnid
))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
.
sortByCreateTimeDesc
()
.
offset
(
state
.
pageCount
*
(
state
.
pagination
-
1
))
.
limit
(
state
.
pageCount
)
.
findAll
();
...
...
@@ -119,21 +122,26 @@ class PerformanceListLogic extends GetxController {
clean
()
{
state
.
filterHighNo
=
''
;
state
.
filterVisualNo
=
''
;
state
.
filterFatherNo
=
''
;
state
.
filterMotherNo
=
''
;
state
.
cattleResumeUnid
=
''
;
highController
.
text
=
''
;
update
();
}
///选择牧户
selectCattleMan
()
async
{
DialogUtils
.
showSingleListDialog
(
await
DictUtils
.
getDictList
(
'zxgl_breeding_list'
),
onPositive:
(
selectReslut
)
=>
{
state
.
cattleManName
=
selectReslut
.
key
,
state
.
cattleManId
=
selectReslut
.
value
,
personController
.
text
=
state
.
cattleManName
,
update
(),}
);
// DialogUtils.showSingleListDialog(await DictUtils.getDictList('zxgl_breeding_list'),
// onPositive: (selectReslut) => {
// state.cattleManName = selectReslut.key,
// state.cattleManId = selectReslut.value,
// personController.text=state.cattleManName,
// update(),}
// );
DictEntity
farmerDictEntity
=
await
Get
.
toNamed
(
AppRoute
.
LIKE_SEARCH_DICT
);
state
.
cattleManName
=
farmerDictEntity
.
dictLabel
??
''
;
state
.
cattleManId
=
farmerDictEntity
.
dictValue
??
''
;
personController
.
text
=
state
.
cattleManName
;
update
();
}
getItemList
(
List
<
PerformanceEntity
>
itemDateList
)
async
{
...
...
lib/pages/performance/performance_list/performance_list_state.dart
View file @
af5d64f6
...
...
@@ -14,10 +14,9 @@ class PerformanceListState {
String
filterHighNo
=
''
;
String
filterVisualNo
=
''
;
String
filterFatherNo
=
''
;
String
filterMotherNo
=
''
;
String
cattleManId
=
''
;
String
cattleManName
=
''
;
String
cattleResumeUnid
=
''
;
bool
isFilter
=
false
;
...
...
lib/pages/performance/performance_list/performance_list_view.dart
View file @
af5d64f6
...
...
@@ -125,34 +125,6 @@ class PerformanceListPage extends StatelessWidget {
const
SizedBox
(
height:
10
,
),
TextField
(
onChanged:
(
text
)
{
state
.
filterFatherNo
=
text
;
},
decoration:
const
InputDecoration
(
prefixIcon:
Icon
(
Icons
.
search
),
border:
OutlineInputBorder
(),
hintText:
'父登记号'
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
8.0
),
),
),
const
SizedBox
(
height:
10
,
),
TextField
(
onChanged:
(
text
)
{
state
.
filterMotherNo
=
text
;
},
decoration:
const
InputDecoration
(
prefixIcon:
Icon
(
Icons
.
search
),
border:
OutlineInputBorder
(),
hintText:
'母登记号'
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10.0
,
vertical:
8.0
),
),
),
const
SizedBox
(
height:
10
,
),
Config
.
isAdmin
&&
state
.
cattleResumeEntity
==
null
?
TextField
(
readOnly:
true
,
...
...
lib/pages/weight_man/weight_man_list/weight_man_list_logic.dart
View file @
af5d64f6
...
...
@@ -9,6 +9,7 @@ import '../../../congifs.dart';
import
'../../../controllers/global_service.dart'
;
import
'../../../rfid/rfid_plugin.dart'
;
import
'../../../routes/routes.dart'
;
import
'../../../utils/dialog_utils.dart'
;
import
'../../../utils/empty_utils.dart'
;
import
'../../../utils/sp_helper.dart'
;
import
'weight_man_list_state.dart'
;
...
...
@@ -38,12 +39,18 @@ class WeightManListLogic extends GetxController {
state
.
isFilter
=
false
;
}
else
{
state
.
isFilter
=
true
;
// state.cattleResumeEntity = await GlobalService.to.isar.cattleResumeEntitys
// .filter()
// .optional(!Config.isAdmin, (q) => q.deptIdEqualTo(SpHelper.getStorage(Config.SP_DEPT_ID)))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
// .findFirst();
var
filerCattle
=
await
GlobalService
.
to
.
isar
.
cattleResumeEntitys
.
filter
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
findFirst
();
if
(
filerCattle
==
null
)
{
DialogUtils
.
showToast
(
'无此标签'
);
return
;
}
else
{
state
.
cattleResumeUnid
=
filerCattle
.
unid
??
''
;
}
}
isShow
=
false
;
queryFirstPage
();
...
...
@@ -61,8 +68,9 @@ class WeightManListLogic extends GetxController {
.
unidIsNotEmpty
()
.
optional
(!
Config
.
isAdmin
,
(
q
)
=>
q
.
deptIdEqualTo
(
SpHelper
.
getStorage
(
Config
.
SP_DEPT_ID
)))
.
optional
(
state
.
cattleResumeEntity
!=
null
,
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeEntity
!.
unid
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterHighNo
),
(
q
)
=>
q
.
registrationNoEqualTo
(
state
.
filterHighNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
filterVisualNo
),
(
q
)
=>
q
.
individualNoEqualTo
(
state
.
filterVisualNo
))
.
optional
(
EmptyUtils
.
isStrNotEmpty
(
state
.
cattleResumeUnid
),
(
q
)
=>
q
.
cattleresumeIdEqualTo
(
state
.
cattleResumeUnid
))
// .optional(EmptyUtils.isStrNotEmpty(state.filterHighNo), (q) => q.registrationNoEqualTo(state.filterHighNo))
// .optional(EmptyUtils.isStrNotEmpty(state.filterVisualNo), (q) => q.individualNoEqualTo(state.filterVisualNo))
.
sortByCreateTimeDesc
()
.
offset
(
state
.
pageCount
*
(
state
.
pagination
-
1
))
.
limit
(
state
.
pageCount
)
...
...
@@ -103,6 +111,7 @@ class WeightManListLogic extends GetxController {
clean
()
{
state
.
filterHighNo
=
''
;
state
.
filterVisualNo
=
''
;
state
.
cattleResumeUnid
=
''
;
highController
.
text
=
''
;
update
();
}
...
...
lib/pages/weight_man/weight_man_list/weight_man_list_state.dart
View file @
af5d64f6
...
...
@@ -16,6 +16,8 @@ class WeightManListState {
String
filterHighNo
=
''
;
String
filterVisualNo
=
''
;
String
cattleResumeUnid
=
''
;
bool
isFilter
=
false
;
WeightManListState
()
{
...
...
lib/routes/pages.dart
View file @
af5d64f6
...
...
@@ -5,12 +5,15 @@ import 'package:anchor_collect_flutter/pages/breeding_record/breeding_record_det
import
'package:anchor_collect_flutter/pages/breeding_record/breeding_record_list/breeding_record_list_binding.dart'
;
import
'package:anchor_collect_flutter/pages/breeding_record/breeding_record_list/breeding_record_list_view.dart'
;
import
'package:anchor_collect_flutter/pages/breeding_record/breeding_record_view.dart'
;
import
'package:anchor_collect_flutter/pages/cattle_photo/cattle_photo_binding.dart'
;
import
'package:anchor_collect_flutter/pages/cattle_photo/cattle_photo_list/cattle_photo_list_binding.dart'
;
import
'package:anchor_collect_flutter/pages/cattle_photo/cattle_photo_view.dart'
;
import
'package:anchor_collect_flutter/pages/immune_batch/immune_batch_binding.dart'
;
import
'package:anchor_collect_flutter/pages/immune_batch/immune_batch_list/immune_batch_list_binding.dart'
;
import
'package:anchor_collect_flutter/pages/immune_batch/immune_batch_list/immune_batch_list_view.dart'
;
import
'package:anchor_collect_flutter/pages/immune_batch/immune_batch_view.dart'
;
import
'package:anchor_collect_flutter/pages/like_search_
farmer/like_search_farmer
_binding.dart'
;
import
'package:anchor_collect_flutter/pages/like_search_
farmer/like_search_farmer
_view.dart'
;
import
'package:anchor_collect_flutter/pages/like_search_
dict/like_search_dict
_binding.dart'
;
import
'package:anchor_collect_flutter/pages/like_search_
dict/like_search_dict
_view.dart'
;
import
'package:anchor_collect_flutter/pages/main/main_binding.dart'
;
import
'package:anchor_collect_flutter/pages/main/main_view.dart'
;
import
'package:anchor_collect_flutter/pages/medical_record/medical_record_binding.dart'
;
...
...
@@ -34,6 +37,7 @@ import 'package:get/get.dart';
import
'../pages/begats_record/begats_record_binding.dart'
;
import
'../pages/camera/camera_binding.dart'
;
import
'../pages/camera/camera_view.dart'
;
import
'../pages/cattle_photo/cattle_photo_list/cattle_photo_list_view.dart'
;
import
'../pages/cattle_resume/cattle_resume_binding.dart'
;
import
'../pages/cattle_resume/cattle_resume_list/cattle_resume_list_binding.dart'
;
import
'../pages/cattle_resume/cattle_resume_list/cattle_resume_list_view.dart'
;
...
...
@@ -163,6 +167,16 @@ abstract class AppPages {
page:
()
=>
BreedingRecordDetailPage
(),
binding:
BreedingRecordDetailBinding
(),
),
GetPage
(
name:
AppRoute
.
CATTLE_PHOTO_LIST
,
page:
()
=>
CattlePhotoListPage
(),
binding:
CattlePhotoListBinding
(),
),
GetPage
(
name:
AppRoute
.
CATTLE_PHOTO
,
page:
()
=>
CattlePhotoPage
(),
binding:
CattlePhotoBinding
(),
),
GetPage
(
name:
AppRoute
.
CAMERA
,
page:
()
=>
CameraPage
(),
...
...
@@ -174,9 +188,9 @@ abstract class AppPages {
binding:
SettingBinding
(),
),
GetPage
(
name:
AppRoute
.
LIKE_SEARCH_
FARMER
,
page:
()
=>
LikeSearch
Farmer
Page
(),
binding:
LikeSearch
Farmer
Binding
(),
name:
AppRoute
.
LIKE_SEARCH_
DICT
,
page:
()
=>
LikeSearch
Dict
Page
(),
binding:
LikeSearch
Dict
Binding
(),
),
];
}
lib/routes/routes.dart
View file @
af5d64f6
...
...
@@ -44,6 +44,12 @@ abstract class AppRoute {
/// 称重
static
const
WEIGHT_MAN
=
'/weight/man'
;
/// 牛只照片列表
static
const
CATTLE_PHOTO_LIST
=
'/cattle/photo/list'
;
/// 牛只照片
static
const
CATTLE_PHOTO
=
'/cattle/photo'
;
/// 诊疗记录列表
static
const
MEDICAL_RECORD_LIST
=
'/medical/record/list'
;
...
...
@@ -68,8 +74,8 @@ abstract class AppRoute {
/// 照相机
static
const
CAMERA
=
'/camera'
;
/// 模糊查询
牧户
static
const
LIKE_SEARCH_
FARMER
=
'/like/search/farmer
'
;
/// 模糊查询
字典表
static
const
LIKE_SEARCH_
DICT
=
'/like/search/dict
'
;
/// 设置
static
const
SETTING
=
'/setting'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment