fix(订单): 已分拣出库后隐藏主系统单「缺货」按钮
- 主系统单「缺货」仅在 order_status < 50 时显示;≥50(已分拣出库/配送中/已完成)隐藏 - 避免把已履约的行报成主系统转自采,防止误操作影响主系统 - 加契约断言钉住该闸门 未动后端(服务端已有 验收入库/备货完成/采购完成 守卫)。
This commit is contained in:
@@ -967,7 +967,9 @@ export const OrderDetailDeliveryNotePanel: React.FC<OrderDetailDeliveryNotePanel
|
||||
/* 主系统分配过来的商品**不能删**,只能报「缺货」(2026-10-10)。
|
||||
报成功后该行会被**从本地清掉**(订单行/自采单/备货单一起),
|
||||
所以这里不需要"已缺货"标签;历史遗留的 is_stockout 行也照常给按钮,
|
||||
点一下即可完成清理(服务端对已报过的行只补做本地清理、不重复发 HTTP)。 */
|
||||
点一下即可完成清理(服务端对已报过的行只补做本地清理、不重复发 HTTP)。
|
||||
已分拣出库(order_status ≥ 50)后不再给「缺货」:货已出库/在途,
|
||||
再报缺货会让主系统把已履约的行改判转自采(开发者 2026-10-12 要求隐藏)。 */
|
||||
item.is_returned ? (
|
||||
<span
|
||||
className="inline-flex px-1 py-0.5 text-[11px] text-slate-500 whitespace-nowrap"
|
||||
@@ -975,7 +977,7 @@ export const OrderDetailDeliveryNotePanel: React.FC<OrderDetailDeliveryNotePanel
|
||||
>
|
||||
{t('orders.detail.returnedTag')}
|
||||
</span>
|
||||
) : (
|
||||
) : orderStatus != null && orderStatus >= 50 ? null : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => onReportStockout?.(item)}
|
||||
|
||||
@@ -55,6 +55,15 @@ describe('order items PATCH contract', () => {
|
||||
expect(panel).toContain('orderStatus < 90');
|
||||
expect(panel).not.toContain('ordered_quantity) !== Number(item.quantity');
|
||||
});
|
||||
it('主系统单「缺货」在已分拣出库后隐藏', () => {
|
||||
const panel = readFileSync(
|
||||
new URL('../../../components/order/OrderDetailDeliveryNotePanel.tsx', import.meta.url),
|
||||
'utf8'
|
||||
);
|
||||
// 分拣完毕(order_status ≥ 50)不再给「缺货」按钮,避免把已履约的行报成转自采
|
||||
expect(panel).toContain('orderStatus != null && orderStatus >= 50 ? null');
|
||||
expect(panel).toContain('onReportStockout');
|
||||
});
|
||||
it('录单改单同步 ordered_quantity 快照', () => {
|
||||
const service = readFileSync(
|
||||
new URL('../../../../server/src/services/orderManageItemsService.ts', import.meta.url),
|
||||
|
||||
Reference in New Issue
Block a user