|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import 'package:chicken_farm/core/config/app_config.dart';
|
|
|
import 'package:chicken_farm/core/utils/datetime_util.dart';
|
|
import 'package:chicken_farm/core/utils/datetime_util.dart';
|
|
|
import 'package:chicken_farm/apis/index.dart';
|
|
import 'package:chicken_farm/apis/index.dart';
|
|
|
import 'package:chicken_farm/components/vb_search_select.dart';
|
|
import 'package:chicken_farm/components/vb_search_select.dart';
|
|
@@ -31,10 +32,10 @@ class _BatchCreatePageWinState extends State<BatchCreatePageWin> {
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
children: [
|
|
|
// 批次选择
|
|
// 批次选择
|
|
|
- _buildBatchSearchSelect(),
|
|
|
|
|
|
|
+ _buildBatchInput(),
|
|
|
const SizedBox(height: 10),
|
|
const SizedBox(height: 10),
|
|
|
// 家系号选择
|
|
// 家系号选择
|
|
|
- _buildFamilySearchSelect(),
|
|
|
|
|
|
|
+ _buildFamilyInput(),
|
|
|
const SizedBox(height: 20),
|
|
const SizedBox(height: 20),
|
|
|
// 电子编号区域
|
|
// 电子编号区域
|
|
|
_buildElectronicIdSection(),
|
|
_buildElectronicIdSection(),
|
|
@@ -117,6 +118,74 @@ class _BatchCreatePageWinState extends State<BatchCreatePageWin> {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Widget _buildBatchInput() {
|
|
|
|
|
+ if (AppConfig.isOffline) {
|
|
|
|
|
+ // 离线模式下使用文本输入框
|
|
|
|
|
+ return Column(
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ const Text('批次号', style: TextStyle(fontWeight: FontWeight.bold)),
|
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ border: Border.all(color: Colors.grey),
|
|
|
|
|
+ borderRadius: BorderRadius.circular(8),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: TextField(
|
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
|
+ hintText: '请输入批次号',
|
|
|
|
|
+ border: InputBorder.none,
|
|
|
|
|
+ ),
|
|
|
|
|
+ onChanged: (value) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ _batchNum = value.isNotEmpty ? value : null;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 在线模式下使用原来的搜索选择器
|
|
|
|
|
+ return _buildBatchSearchSelect();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Widget _buildFamilyInput() {
|
|
|
|
|
+ if (AppConfig.isOffline) {
|
|
|
|
|
+ // 离线模式下使用文本输入框
|
|
|
|
|
+ return Column(
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ const Text('家系号', style: TextStyle(fontWeight: FontWeight.bold)),
|
|
|
|
|
+ const SizedBox(height: 10),
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: const EdgeInsets.fromLTRB(16, 2, 16, 2),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ border: Border.all(color: Colors.grey),
|
|
|
|
|
+ borderRadius: BorderRadius.circular(8),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: TextField(
|
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
|
+ hintText: '请输入家系号',
|
|
|
|
|
+ border: InputBorder.none,
|
|
|
|
|
+ ),
|
|
|
|
|
+ onChanged: (value) {
|
|
|
|
|
+ setState(() {
|
|
|
|
|
+ _familyNum = value.isNotEmpty ? value : null;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 在线模式下使用原来的搜索选择器
|
|
|
|
|
+ return _buildFamilySearchSelect();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
Widget _buildBatchSearchSelect() {
|
|
Widget _buildBatchSearchSelect() {
|
|
|
return Column(
|
|
return Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|