diff --git a/docs/design/20261012-独立进货(自用哨兵客户).md b/docs/design/20261012-独立进货(自用哨兵客户).md index 498bbd3..f841dfd 100644 --- a/docs/design/20261012-独立进货(自用哨兵客户).md +++ b/docs/design/20261012-独立进货(自用哨兵客户).md @@ -77,6 +77,11 @@ 「订单金额、行销售额、返利、毛利」**所有**销售额公式天然算 0,不需要逐个改财务 SQL。 配套:分配口与结案口的「售价为 0 禁止提交/结案」闸门对哨兵单放行(成本价另有 >0 硬拦)。 +- **行级也豁免(2026-10-13 修误报)**:录单页每行的「零价创建阻断」**红框**同样对哨兵单豁免 + (`CustomerOrder.tsx` 传 `blockZeroSaleEnabled={blockZeroSaleEnabled && !isIndependentInboundCustomer(…)}`)。 + 此前只豁免了**提交口**(`validateOrder`)、**行级没豁免** ⇒ 选「独立进货」后**所有行标红** + (售价恒 0 被行组件 `OrderParsedItemRow.createBlocked` 误判为阻断);**提交不受影响,纯视觉误报**。 + **第二重(防御)**:统一排除谓词 `salesVisibleOrderSql()`,已加在以下面: 判据统一走新模块的谓词 `COALESCE(.customer_code,'') <> '__INDEPENDENT_INBOUND__'`: diff --git a/src/components/order/OrderParsedItemRow.independentInbound.test.ts b/src/components/order/OrderParsedItemRow.independentInbound.test.ts index 86585f2..507377c 100644 --- a/src/components/order/OrderParsedItemRow.independentInbound.test.ts +++ b/src/components/order/OrderParsedItemRow.independentInbound.test.ts @@ -27,4 +27,11 @@ describe('录单页:独立进货隐藏销售价输入框', () => { it('③ 录单页按"客户=独立进货"传开关', () => { expect(page).toContain('hidePriceInput={isIndependentInboundCustomer(selectedCustomer?.customer_code)}'); }); + + it('④ 零价「创建阻断」红框也对独立进货豁免(2026-10-13 修误报)', () => { + // 售价恒为 0 ⇒ 行组件的 createBlocked 会整片标红;提交口早已豁免,行级也要一起豁免 + expect(page).toContain( + 'blockZeroSaleEnabled && !isIndependentInboundCustomer(selectedCustomer?.customer_code)' + ); + }); }); diff --git a/src/pages/orders/CustomerOrder.tsx b/src/pages/orders/CustomerOrder.tsx index e4a12ac..dfcf5a6 100644 --- a/src/pages/orders/CustomerOrder.tsx +++ b/src/pages/orders/CustomerOrder.tsx @@ -2515,7 +2515,11 @@ export const CustomerOrder: React.FC = () => { index={index} variant="customer" highlighted={focusItemId === item.id} - blockZeroSaleEnabled={blockZeroSaleEnabled} + // 独立进货:销售价恒为 0(无销售)⇒ 行级「零价阻断」红框也要一起豁免, + // 否则整片标红(提交口早已豁免,见 validateOrder 的 independentInboundOrder) + blockZeroSaleEnabled={ + blockZeroSaleEnabled && !isIndependentInboundCustomer(selectedCustomer?.customer_code) + } showProcessingMethod catalogSkus={skuMappings} categoryOptions={categoryOptions}