diff --git a/client/lib/screens/stock_in/stock_in_form_screen.dart b/client/lib/screens/stock_in/stock_in_form_screen.dart index d49192e..7ec7c5b 100644 --- a/client/lib/screens/stock_in/stock_in_form_screen.dart +++ b/client/lib/screens/stock_in/stock_in_form_screen.dart @@ -868,11 +868,8 @@ class _StockInFormScreenState extends ConsumerState { FilteringTextInputFormatter.allow(RegExp(r'^\d+\.?\d{0,2}')) ], onChanged: (_) => setState(() {}), - validator: (v) { - if (v == null || v.isEmpty) return '不能为空'; - if ((double.tryParse(v) ?? 0) <= 0) return '>0'; - return null; - }, + // 单价允许为空或 0:表示「待定价」,入库审核后可在单据详情「确认进价」补填真实进价 + validator: (_) => null, ); } @@ -976,15 +973,6 @@ class _StockInFormScreenState extends ConsumerState { ); } - String _productCodeOf(_ItemRow item) => - ref - .read(productNameListProvider) - .valueOrNull - ?.where((o) => o.id == item.selectedNameId) - .firstOrNull - ?.code ?? - ''; - // ── 桌面表格:表头行 ────────────────────────────────────────────────────── Widget _buildItemTableHeader() { Widget th(String s) => Padding( @@ -1019,7 +1007,6 @@ class _StockInFormScreenState extends ConsumerState { final qty = double.tryParse(item.qtyCtrl.text) ?? 0; final price = double.tryParse(item.priceCtrl.text) ?? 0; final amount = qty * price; - final productCode = _productCodeOf(item); Widget tc(String s, {Color? color, FontWeight? weight}) => Padding( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), @@ -1166,7 +1153,6 @@ class _StockInFormScreenState extends ConsumerState { final qty = double.tryParse(item.qtyCtrl.text) ?? 0; final price = double.tryParse(item.priceCtrl.text) ?? 0; final amount = qty * price; - final productCode = _productCodeOf(item); return MobileListCard( title: Text('商品 ${index + 1}'),