feat: 4项需求实现

1. 供应商/客户编码自动生成(S001/C001...),新建表单隐藏编码字段,编辑保留
2. 财务管理"全部记录"移为第一个 tab
3. 入库单列表 tab 排除 pending 单据,提交后自动移入审核 tab
4. 出库单列表同上;出库表单按仓库+商品自动填最大可用库存数量

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-04-10 22:37:19 +08:00
parent 66e54af8c6
commit 53a60d230f
6 changed files with 72 additions and 29 deletions
@@ -51,7 +51,7 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
],
tabViews: [
_buildListTab(filterStatus: 'pending', showNewButton: true),
_buildListTab(filterStatus: null, showNewButton: false),
_buildListTab(filterStatus: 'exclude_pending', showNewButton: false),
],
);
}
@@ -76,16 +76,19 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
),
),
data: (result) {
final orders = filterStatus != null
? result.data
.where((o) => o.status == filterStatus)
.toList()
: result.data;
final List<StockInOrder> orders;
if (filterStatus == 'pending') {
orders = result.data.where((o) => o.status == 'pending').toList();
} else if (filterStatus == 'exclude_pending') {
orders = result.data.where((o) => o.status != 'pending').toList();
} else {
orders = result.data;
}
return _buildOrderTable(
orders: orders,
totalCount: filterStatus != null ? orders.length : result.total,
totalCount: orders.length,
page: result.page,
showStatusFilter: filterStatus == null,
showStatusFilter: filterStatus == 'exclude_pending',
showNewButton: showNewButton,
);
},
@@ -611,7 +614,6 @@ class _StatusFilterDropdown extends StatelessWidget {
items: [
const DropdownMenuItem(value: '', child: Text('全部状态', style: TextStyle(fontSize: 13))),
const DropdownMenuItem(value: 'draft', child: Text('草稿', style: TextStyle(fontSize: 13))),
const DropdownMenuItem(value: 'pending', child: Text('待审核', style: TextStyle(fontSize: 13))),
const DropdownMenuItem(value: 'approved', child: Text('已审核', style: TextStyle(fontSize: 13))),
const DropdownMenuItem(value: 'rejected', child: Text('已拒绝', style: TextStyle(fontSize: 13))),
],