feat(shipping-notice): 实现滚动履约功能,优化发货通知流程与代码清理

清理废弃的ShippingCase相关代码与依赖,统一使用ShippingNotice直接关联客户数据。调整库存网关依赖规则,支持仅对库存满足或已人工放行的订单行生成发货Excel,实现滚动履约逻辑。
This commit is contained in:
hugo committed 2026-08-26 02:47:07 +08:00
1 parent 7cfd5d167e
commit 1e5aedb9ed
235 files changed
+11394 -9613

No files matched your search

@@ -33,7 +33,7 @@ export type ShippingProcessingWorkItemTypeArg = 'order_intake' | 'order_task';
*
* @param workItemType - order_intake | order_task
* @param workItemNo - Intake 编号或 OT 编号(MaybeRef)
* @param options.enabled - 是否启用;options.pollMs - 轮询间隔;
* @param options.enabled - 是否启用;options.pollMs - 轮询间隔;options.continuousPolling - 是否由本 composable 持续轮询;
* options.monotonicProgressVersion - 仅工作台:旧 progress_version 不覆盖本地
* @returns projection / loading / error / refresh / stop
*/
@@ -43,6 +43,8 @@ export function useShippingProcessingWorkItem(
options: {
enabled?: MaybeRefOrGetter<boolean>;
pollMs?: number;
/** false 时仅由调用方显式 refresh;用于已有页面级协调轮询的工作台。 */
continuousPolling?: boolean;
/** 仅订单处理工作台开启;任务中心保持默认 false。 */
monotonicProgressVersion?: boolean;
} = {},
@@ -61,6 +63,7 @@ export function useShippingProcessingWorkItem(
let stopped = false;
let refreshInFlight: { no: string; promise: Promise<void> } | null = null;
const pollMs = options.pollMs ?? DEFAULT_POLL_MS;
const continuousPolling = options.continuousPolling !== false;
const monotonic = Boolean(options.monotonicProgressVersion);
/**
@@ -112,7 +115,7 @@ export function useShippingProcessingWorkItem(
error.value = null;
clearTimer();
const next = projection.value;
if (next && !TERMINAL_STATUSES.has(next.status) && !stopped) {
if (continuousPolling && next && !TERMINAL_STATUSES.has(next.status) && !stopped) {
timer = window.setTimeout(() => {
void refresh();
}, pollMs);
@@ -128,7 +131,7 @@ export function useShippingProcessingWorkItem(
}
error.value = err instanceof BusinessError ? err.message : 'network_recoverable';
clearTimer();
if (!stopped) {
if (continuousPolling && !stopped) {
timer = window.setTimeout(() => {
void refresh();
}, pollMs);