feat(shipping-notice): 新增发货通知重复检测与处理接口,支持重复决策保存与重新执行检测
This commit is contained in:
1 parent
729546a7b7
commit
ceb49461e8
72 files changed
+14270
-460
No files matched your search
@@ -515,6 +515,31 @@ export const cancelShippingNoticeIntake = (intakeNo: string) =>
|
||||
{ method: 'DELETE' },
|
||||
);
|
||||
|
||||
export const resolveShippingNoticeDuplicate = (
|
||||
intakeNo: string,
|
||||
action: string,
|
||||
targetTaskNo?: string | null,
|
||||
reason?: string | null,
|
||||
) =>
|
||||
requestJson<ShippingNoticeIntakeResponse>(
|
||||
`/api/workspace/shipping-notice/intakes/${encodeURIComponent(intakeNo)}/duplicate-resolution`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
action,
|
||||
target_task_no: targetTaskNo || undefined,
|
||||
reason: reason || undefined,
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
||||
export const refreshShippingNoticeDuplicate = (intakeNo: string) =>
|
||||
requestJson<ShippingNoticeIntakeResponse>(
|
||||
`/api/workspace/shipping-notice/intakes/${encodeURIComponent(intakeNo)}/duplicate-refresh`,
|
||||
{ method: 'POST' },
|
||||
);
|
||||
|
||||
export const createWorkspaceShippingBatchFromIntakes = (
|
||||
intakeNos: string[],
|
||||
conversationId?: string | null,
|
||||
|
||||
@@ -20,7 +20,11 @@ import {
|
||||
Square,
|
||||
X,
|
||||
} from 'lucide-vue-next';
|
||||
import type { PendingAttachment } from '../types/shipping.types';
|
||||
import type { PendingAttachment, ShippingNoticePendingAttachment } from '../types/shipping.types';
|
||||
import {
|
||||
isBlockingWarning,
|
||||
isShippingNoticeAttachmentParseIncomplete,
|
||||
} from '../shipping/shippingNoticeAttachmentIntegrity';
|
||||
|
||||
export interface ChatInputAttachmentPolicy {
|
||||
anyEnabled: boolean;
|
||||
@@ -60,6 +64,7 @@ const emit = defineEmits<{
|
||||
'voice-click': [];
|
||||
'remove-attachment': [id: string];
|
||||
'retry-shipping-notice-attachment': [id: string];
|
||||
'resolve-shipping-notice-duplicate': [id: string];
|
||||
'local-files-selected': [event: Event];
|
||||
'add-remote-url': [url: string];
|
||||
'shipping-inventory-selected': [event: Event];
|
||||
@@ -79,6 +84,73 @@ const showAttachmentMenu = ref(false);
|
||||
const showAttachmentUrlPanel = ref(false);
|
||||
const showKbDropdown = ref(false);
|
||||
const attachmentUrlInput = ref('');
|
||||
|
||||
/**
|
||||
* 汇总 EML 附件解析进度,供输入栏徽标展示。
|
||||
* 核心逻辑:failed/empty/skipped/超限/文本预算耗尽计为问题;duplicate 单独提示,不记为失败。
|
||||
*/
|
||||
function shippingNoticeAttachmentHint(attachment: ShippingNoticePendingAttachment): string {
|
||||
const summary = attachment.parseSummary;
|
||||
const total = Number(summary?.attachment_count || 0);
|
||||
const rows = summary?.attachments || [];
|
||||
const warnings = summary?.warnings || [];
|
||||
const hasBlockingWarning = warnings.some((w) => isBlockingWarning(String(w || '')));
|
||||
if (!total && !hasBlockingWarning && !rows.length) return '';
|
||||
|
||||
const effectiveTotal = total || rows.length;
|
||||
const ok = rows.filter((item) => item.parse_status === 'parsed').length;
|
||||
const problematic = rows.filter((item) =>
|
||||
['failed', 'empty', 'skipped'].includes(String(item.parse_status || '')),
|
||||
).length;
|
||||
const duplicates = rows.filter((item) => item.parse_status === 'duplicate').length;
|
||||
const overflow = Math.max(0, effectiveTotal - rows.length);
|
||||
const issues = problematic + overflow + (hasBlockingWarning && problematic === 0 && overflow === 0 ? 1 : 0);
|
||||
|
||||
if (issues > 0) {
|
||||
return t('chat.shippingNoticeAttachmentHintPartial', {
|
||||
ok,
|
||||
total: effectiveTotal || Math.max(ok + issues, 1),
|
||||
failed: issues,
|
||||
});
|
||||
}
|
||||
if (duplicates > 0) {
|
||||
return t('chat.shippingNoticeAttachmentHintWithDup', { ok, total: effectiveTotal, duplicates });
|
||||
}
|
||||
if (!effectiveTotal) return '';
|
||||
return t('chat.shippingNoticeAttachmentHint', { ok, total: effectiveTotal });
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否展示「重试解析」:顶层失败,或已 parsed 但附件不完整。
|
||||
*/
|
||||
function canRetryShippingNoticeParse(attachment: ShippingNoticePendingAttachment): boolean {
|
||||
if (attachment.kind !== 'shipping_notice') return false;
|
||||
if (attachment.parseStatus === 'failed') return true;
|
||||
return (
|
||||
attachment.parseStatus === 'parsed'
|
||||
&& isShippingNoticeAttachmentParseIncomplete(attachment.parseSummary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成附件明细 title(文件名 + 状态 + 关键警告),便于悬停查看完整性。
|
||||
*/
|
||||
function shippingNoticeAttachmentTitle(attachment: ShippingNoticePendingAttachment): string {
|
||||
const rows = attachment.parseSummary?.attachments || [];
|
||||
const warnings = attachment.parseSummary?.warnings || [];
|
||||
const lines: string[] = [];
|
||||
for (const item of rows) {
|
||||
const name = item.filename || item.attachment_key || 'attachment';
|
||||
const status = item.parse_status || 'unknown';
|
||||
lines.push(`${name}: ${status}`);
|
||||
}
|
||||
for (const warning of warnings) {
|
||||
const text = String(warning || '').trim();
|
||||
if (text) lines.push(`warning: ${text}`);
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
const closeAttachmentMenu = () => {
|
||||
showAttachmentMenu.value = false;
|
||||
showAttachmentUrlPanel.value = false;
|
||||
@@ -246,7 +318,36 @@ watch(
|
||||
{{ a.originalFilename }}
|
||||
<span v-if="a.uploadStatus === 'uploading'" class="text-muted"> · {{ t('chat.shippingNoticeUploading') }}</span>
|
||||
<span v-else-if="a.parseStatus === 'queued' || a.parseStatus === 'parsing'" class="text-muted"> · {{ t('chat.shippingNoticeParsing') }}</span>
|
||||
<span v-else-if="a.parseStatus === 'parsed'" class="text-muted"> · {{ t('chat.shippingNoticeParsed') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed' && a.duplicate?.status === 'possible_duplicate' && !a.duplicateResolution?.action"
|
||||
class="font-medium text-amber-700"
|
||||
> · {{ t('chat.shippingNoticeDuplicatePossibleBadge') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed' && a.duplicate?.blocking && !a.duplicateResolution?.action"
|
||||
class="font-medium text-amber-700"
|
||||
> · {{ t('chat.shippingNoticeDuplicateBlockingBadge') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed' && a.duplicateResolution?.action === 'create_revision'"
|
||||
class="text-brand-700"
|
||||
> · {{ t('chat.shippingNoticeDuplicateRevisionChosen') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed' && a.duplicateResolution?.action === 'force_create'"
|
||||
class="text-amber-700"
|
||||
> · {{ t('chat.shippingNoticeDuplicateForceChosen') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed' && a.duplicateResolution?.action === 'open_existing'"
|
||||
class="text-muted"
|
||||
> · {{ t('chat.shippingNoticeDuplicateOpenChosen') }}</span>
|
||||
<span
|
||||
v-else-if="a.parseStatus === 'parsed'"
|
||||
class="text-muted"
|
||||
:title="shippingNoticeAttachmentTitle(a)"
|
||||
>
|
||||
· {{ t('chat.shippingNoticeParsed') }}
|
||||
<template v-if="shippingNoticeAttachmentHint(a)">
|
||||
· {{ shippingNoticeAttachmentHint(a) }}
|
||||
</template>
|
||||
</span>
|
||||
<span v-else-if="a.parseStatus === 'failed'" class="text-muted"> · {{ t('chat.shippingNoticeParseFailed') }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -254,7 +355,16 @@ watch(
|
||||
</template>
|
||||
</span>
|
||||
<button
|
||||
v-if="a.kind === 'shipping_notice' && a.parseStatus === 'failed'"
|
||||
v-if="a.kind === 'shipping_notice' && a.duplicate?.blocking && !a.duplicateResolution?.action"
|
||||
type="button"
|
||||
class="text-amber-700 hover:text-amber-800"
|
||||
:title="t('chat.shippingNoticeDuplicateHandle')"
|
||||
@click="emit('resolve-shipping-notice-duplicate', a.id)"
|
||||
>
|
||||
{{ t('chat.shippingNoticeDuplicateHandle') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="a.kind === 'shipping_notice' && canRetryShippingNoticeParse(a)"
|
||||
type="button"
|
||||
class="text-muted hover:text-primary"
|
||||
:title="t('chat.shippingNoticeRetryParse')"
|
||||
|
||||
@@ -287,6 +287,7 @@ watch(() => page.currentAgentId, () => {
|
||||
@voice-click="page.handleVoiceFeatureClick"
|
||||
@remove-attachment="page.removeAttachment"
|
||||
@retry-shipping-notice-attachment="page.retryShippingNoticeAttachment"
|
||||
@resolve-shipping-notice-duplicate="page.openShippingDuplicateDialog"
|
||||
@local-files-selected="page.handleLocalFilesSelected"
|
||||
@add-remote-url="page.addRemoteUrlAttachment"
|
||||
@shipping-inventory-selected="page.handleShippingInventorySelected"
|
||||
|
||||
@@ -10,6 +10,7 @@ import ChatQueryPreviewDialog from '@/features/chat/components/ChatQueryPreviewD
|
||||
import ChatLeaveAgentDialog from '@/features/chat/components/ChatLeaveAgentDialog.vue';
|
||||
import ChatOALoginDialog from '@/features/chat/components/ChatOALoginDialog.vue';
|
||||
import ChatGuideModal from '@/features/chat/components/ChatGuideModal.vue';
|
||||
import ShippingNoticeDuplicateDialog from '@/features/chat/components/ShippingNoticeDuplicateDialog.vue';
|
||||
import { Check, Loader2, X } from 'lucide-vue-next';
|
||||
import { nextTick } from 'vue';
|
||||
import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||||
@@ -145,4 +146,13 @@ async function handleQueryPreviewAssetImage(assetId: string, assetName: string)
|
||||
:guides="page.agentGuides"
|
||||
:active-guide="page.activeGuide"
|
||||
/>
|
||||
<ShippingNoticeDuplicateDialog
|
||||
:open="!!page.showShippingDuplicateDialog"
|
||||
:attachment="page.shippingDuplicateAttachment || null"
|
||||
:can-force-create="!!page.canForceCreateShippingDuplicate"
|
||||
@update:open="(v) => { if (!v) page.closeShippingDuplicateDialog?.(); }"
|
||||
@resolve="(payload) => void page.resolveShippingDuplicateDialog?.(payload)"
|
||||
@remove="() => void page.removeShippingDuplicateDialogAttachment?.()"
|
||||
@cancel="page.closeShippingDuplicateDialog?.()"
|
||||
/>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@
|
||||
* 用途:发货通知 Agent 的右侧批次工作台抽屉,承载多批次切换、任务筛选、步骤诊断与统一动作入口。
|
||||
* 依赖:shippingStepper、shippingMenu、shipping.api.types、vue-i18n、lucide-vue-next。
|
||||
* 逻辑:上游传入会话级 workspace 与当前批次任务;本组件只渲染后端 `ui_state.action_buttons` 和查看类辅助入口。
|
||||
* 「重试所有失败」仅 emit `retry-pending`,由父级打开确认弹窗后再调用 useChatShipping 执行。
|
||||
* 解析阶段诊断优先展示 `ui_state.summary.issues` 完整问题列表;「重试所有失败」仅 emit `retry-pending`,由父级打开确认弹窗后再调用 useChatShipping 执行。
|
||||
*/
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { RefreshCw, Target, X } from 'lucide-vue-next';
|
||||
@@ -247,12 +247,42 @@ const currentStepProgress = (task: ShippingTaskSummary | ShippingTaskDetail) =>
|
||||
const sanitizeDiagnosisCopy = (text: string | null | undefined) =>
|
||||
sanitizeShippingRuntimeStatusText(String(text || '').trim());
|
||||
|
||||
/**
|
||||
* 读取任务诊断卡要展示的全部问题列表。
|
||||
* 核心逻辑:优先消费后端 `ui_state.summary.issues`(解析阶段已汇总库存源+warnings);
|
||||
* 若缺失则回退到单一 error_message,保证旧数据仍有可读文案。
|
||||
*/
|
||||
const resolveTaskDiagnosisIssues = (task: ShippingTaskSummary | ShippingTaskDetail): string[] => {
|
||||
const uiIssues = task.ui_state?.summary?.issues;
|
||||
if (Array.isArray(uiIssues) && uiIssues.length) {
|
||||
return uiIssues
|
||||
.map((item) => sanitizeDiagnosisCopy(item))
|
||||
.filter(Boolean);
|
||||
}
|
||||
const fallback = sanitizeDiagnosisCopy(task.ui_state?.summary?.error_message || task.error_message);
|
||||
return fallback ? [fallback] : [];
|
||||
};
|
||||
|
||||
/**
|
||||
* 解析右侧工作台诊断标题/建议/问题列表。
|
||||
* 核心逻辑:解析阶段若 issues 多于 1 条,使用「发现问题」标题并列出全部条目,避免只显示库存源一条。
|
||||
*/
|
||||
const resolveTaskDiagnosis = (task: ShippingTaskSummary | ShippingTaskDetail) => {
|
||||
const uiSummary = task.ui_state?.summary;
|
||||
if (uiSummary?.title || uiSummary?.message || uiSummary?.error_message) {
|
||||
const issues = resolveTaskDiagnosisIssues(task);
|
||||
if (uiSummary?.title || uiSummary?.message || uiSummary?.error_message || issues.length) {
|
||||
const multiIssue = issues.length > 1;
|
||||
return {
|
||||
title: sanitizeDiagnosisCopy(uiSummary.error_message || uiSummary.title) || t('chat.shippingNoticeUi.diagnosisStepWaitingTitle', { step: taskStepNumber(task) }),
|
||||
advice: sanitizeDiagnosisCopy(uiSummary.message) || t('chat.shippingNoticeUi.diagnosisStepWaitingAdvice'),
|
||||
title: multiIssue
|
||||
? t('chat.shippingNoticeUi.diagnosisIssuesTitle', { count: issues.length })
|
||||
: (
|
||||
sanitizeDiagnosisCopy(issues[0] || uiSummary?.error_message || uiSummary?.title)
|
||||
|| t('chat.shippingNoticeUi.diagnosisStepWaitingTitle', { step: taskStepNumber(task) })
|
||||
),
|
||||
advice: multiIssue
|
||||
? t('chat.shippingNoticeUi.diagnosisIssuesAdvice')
|
||||
: (sanitizeDiagnosisCopy(uiSummary?.message) || t('chat.shippingNoticeUi.diagnosisStepWaitingAdvice')),
|
||||
issues: multiIssue ? issues : [],
|
||||
};
|
||||
}
|
||||
const reason = String(task.pending_human_reason || '').trim();
|
||||
@@ -577,11 +607,24 @@ const handleSwitchBatch = (batchNo: string) => {
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-for="diagnosis in [resolveTaskDiagnosis(task)]"
|
||||
:key="`${task.task_no}-diagnosis`"
|
||||
class="mb-2 rounded-lg border p-2.5 text-xs font-medium leading-5"
|
||||
:class="isFailedTask(task) ? 'border-rose-100 bg-rose-50 text-rose-700' : isAbnormalTask(task) ? 'border-amber-100 bg-amber-50 text-amber-700' : 'border-emerald-100 bg-emerald-50 text-emerald-700'"
|
||||
>
|
||||
<div class="font-semibold">{{ resolveTaskDiagnosis(task).title }}</div>
|
||||
<div class="mt-1 font-normal text-slate-600">{{ resolveTaskDiagnosis(task).advice }}</div>
|
||||
<div class="font-semibold">{{ diagnosis.title }}</div>
|
||||
<ul
|
||||
v-if="(diagnosis.issues || []).length"
|
||||
class="mt-1.5 list-disc space-y-1 pl-4 font-normal text-slate-700"
|
||||
>
|
||||
<li
|
||||
v-for="(issue, issueIndex) in diagnosis.issues"
|
||||
:key="`${task.task_no}-issue-${issueIndex}`"
|
||||
>
|
||||
{{ issue }}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="mt-1 font-normal text-slate-600">{{ diagnosis.advice }}</div>
|
||||
</div>
|
||||
<div v-if="!resolveWorkspaceActionButtons(task).length" class="mb-3 text-xs leading-5 text-muted">
|
||||
<span class="font-semibold text-secondary">{{ t('chat.shippingNoticeUi.suggestedAction') }}</span>
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
/**
|
||||
* features/chat/components/ShippingNoticeDuplicateDialog.vue
|
||||
* 用途:发货通知阻断型重复处理弹窗(打开已有 / 修订 / 强制新建)。
|
||||
* 依赖:shipping.types Duplicate 类型、vue-i18n。
|
||||
* 逻辑:ChatViewOverlays 展示;确认后回写 resolveDuplicateAttachment,再允许确认建单。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type {
|
||||
ShippingDuplicateAction,
|
||||
ShippingNoticePendingAttachment,
|
||||
} from '../types/shipping.types';
|
||||
|
||||
const props = defineProps<{
|
||||
open: boolean;
|
||||
attachment: ShippingNoticePendingAttachment | null;
|
||||
canForceCreate: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:open': [value: boolean];
|
||||
resolve: [payload: { action: ShippingDuplicateAction; targetTaskNo?: string; reason?: string }];
|
||||
remove: [];
|
||||
cancel: [];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const reason = ref('');
|
||||
const selectedAction = ref<ShippingDuplicateAction>('open_existing');
|
||||
const submitting = ref(false);
|
||||
const localError = ref('');
|
||||
|
||||
const match = computed(() => props.attachment?.duplicate?.matches?.[0] || null);
|
||||
const allowed = computed(() => new Set(props.attachment?.duplicate?.allowedActions || []));
|
||||
|
||||
watch(
|
||||
() => props.open,
|
||||
(open) => {
|
||||
if (!open) return;
|
||||
reason.value = '';
|
||||
localError.value = '';
|
||||
submitting.value = false;
|
||||
const actions = props.attachment?.duplicate?.allowedActions || [];
|
||||
selectedAction.value = (actions[0] as ShippingDuplicateAction) || 'open_existing';
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* 关闭弹窗。
|
||||
*/
|
||||
function close() {
|
||||
emit('update:open', false);
|
||||
emit('cancel');
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交所选重复处理动作。
|
||||
*/
|
||||
async function confirm() {
|
||||
if (!props.attachment?.duplicate || !match.value) return;
|
||||
const action = selectedAction.value;
|
||||
if (!allowed.value.has(action)) {
|
||||
localError.value = t('chat.shippingNoticeDuplicateActionUnavailable');
|
||||
return;
|
||||
}
|
||||
if (action === 'force_create') {
|
||||
if (!props.canForceCreate) {
|
||||
localError.value = t('chat.shippingNoticeDuplicateForceForbidden');
|
||||
return;
|
||||
}
|
||||
if (!reason.value.trim()) {
|
||||
localError.value = t('chat.shippingNoticeDuplicateReasonRequired');
|
||||
return;
|
||||
}
|
||||
}
|
||||
submitting.value = true;
|
||||
localError.value = '';
|
||||
try {
|
||||
emit('resolve', {
|
||||
action,
|
||||
targetTaskNo: match.value.taskNo,
|
||||
reason: action === 'force_create' ? reason.value.trim() : undefined,
|
||||
});
|
||||
emit('update:open', false);
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const statusLabel = computed(() => {
|
||||
const status = props.attachment?.duplicate?.status;
|
||||
if (status === 'exact_file') return t('chat.shippingNoticeDuplicateExactFile');
|
||||
if (status === 'same_active_task') return t('chat.shippingNoticeDuplicateSameActive');
|
||||
if (status === 'same_completed_task') return t('chat.shippingNoticeDuplicateSameCompleted');
|
||||
if (status === 'possible_duplicate') return t('chat.shippingNoticeDuplicatePossible');
|
||||
return t('chat.shippingNoticeDuplicateNeedsResolution');
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="open && attachment"
|
||||
class="fixed inset-0 z-[160] flex items-center justify-center bg-black/40 px-4"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
>
|
||||
<div class="w-full max-w-lg rounded-xl border border-default bg-surface p-5 shadow-xl">
|
||||
<h3 class="text-base font-semibold text-primary">
|
||||
{{ t('chat.shippingNoticeDuplicateTitle') }}
|
||||
</h3>
|
||||
<p class="mt-2 text-sm text-secondary">{{ statusLabel }}</p>
|
||||
<p class="mt-1 text-xs text-muted">
|
||||
{{ attachment.originalFilename }}
|
||||
</p>
|
||||
|
||||
<div
|
||||
v-if="match"
|
||||
class="mt-4 rounded-lg border border-default bg-surface-soft px-3 py-2 text-sm text-secondary"
|
||||
>
|
||||
<div>{{ t('chat.shippingNoticeDuplicateMatchTask', { taskNo: match.taskNo }) }}</div>
|
||||
<div class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingNoticeDuplicateMatchStatus', { status: match.processStatus }) }}
|
||||
· v{{ match.documentVersion }}
|
||||
</div>
|
||||
<div v-if="match.matchedFields?.length" class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingNoticeDuplicateMatchFields', { fields: match.matchedFields.join(', ') }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 space-y-2">
|
||||
<label
|
||||
v-if="allowed.has('open_existing')"
|
||||
class="flex cursor-pointer items-start gap-2 rounded-lg border border-default px-3 py-2 text-sm"
|
||||
:class="selectedAction === 'open_existing' ? 'border-brand-500 bg-brand-50/40' : ''"
|
||||
>
|
||||
<input v-model="selectedAction" type="radio" value="open_existing" class="mt-1" />
|
||||
<span>
|
||||
<span class="font-medium text-primary">{{ t('chat.shippingNoticeDuplicateOpenExisting') }}</span>
|
||||
<span class="mt-0.5 block text-xs text-muted">{{ t('chat.shippingNoticeDuplicateOpenExistingHint') }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
v-if="allowed.has('create_revision')"
|
||||
class="flex cursor-pointer items-start gap-2 rounded-lg border border-default px-3 py-2 text-sm"
|
||||
:class="selectedAction === 'create_revision' ? 'border-brand-500 bg-brand-50/40' : ''"
|
||||
>
|
||||
<input v-model="selectedAction" type="radio" value="create_revision" class="mt-1" />
|
||||
<span>
|
||||
<span class="font-medium text-primary">{{ t('chat.shippingNoticeDuplicateCreateRevision') }}</span>
|
||||
<span class="mt-0.5 block text-xs text-muted">{{ t('chat.shippingNoticeDuplicateCreateRevisionHint') }}</span>
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
v-if="allowed.has('force_create') && canForceCreate"
|
||||
class="flex cursor-pointer items-start gap-2 rounded-lg border border-default px-3 py-2 text-sm"
|
||||
:class="selectedAction === 'force_create' ? 'border-amber-500 bg-amber-50/50' : ''"
|
||||
>
|
||||
<input v-model="selectedAction" type="radio" value="force_create" class="mt-1" />
|
||||
<span>
|
||||
<span class="font-medium text-primary">{{ t('chat.shippingNoticeDuplicateForceCreate') }}</span>
|
||||
<span class="mt-0.5 block text-xs text-muted">{{ t('chat.shippingNoticeDuplicateForceCreateHint') }}</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="selectedAction === 'force_create'" class="mt-3">
|
||||
<label class="text-xs font-medium text-secondary">{{ t('chat.shippingNoticeDuplicateReasonLabel') }}</label>
|
||||
<textarea
|
||||
v-model="reason"
|
||||
rows="2"
|
||||
class="mt-1 w-full rounded-lg border border-default bg-surface px-3 py-2 text-sm"
|
||||
:placeholder="t('chat.shippingNoticeDuplicateReasonPlaceholder')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p v-if="localError" class="mt-2 text-xs text-red-600">{{ localError }}</p>
|
||||
|
||||
<div class="mt-5 flex flex-wrap justify-end gap-2">
|
||||
<button type="button" class="rounded-lg px-3 py-1.5 text-sm text-muted hover:text-primary" @click="close">
|
||||
{{ t('common.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg px-3 py-1.5 text-sm text-red-600 hover:bg-red-50"
|
||||
@click="emit('remove'); emit('update:open', false)"
|
||||
>
|
||||
{{ t('chat.shippingNoticeDuplicateRemoveFile') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-lg bg-brand-600 px-3 py-1.5 text-sm font-medium text-white disabled:opacity-50"
|
||||
:disabled="submitting || !match"
|
||||
@click="confirm"
|
||||
>
|
||||
{{ t('chat.shippingNoticeDuplicateConfirm') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -551,6 +551,13 @@ export function useChatPage() {
|
||||
attachmentApi.removeAttachment(id);
|
||||
},
|
||||
retryShippingNoticeAttachment: shipping.retryShippingNoticeAttachment,
|
||||
showShippingDuplicateDialog: shipping.showShippingDuplicateDialog,
|
||||
shippingDuplicateAttachment: shipping.shippingDuplicateAttachment,
|
||||
canForceCreateShippingDuplicate: shipping.canForceCreateShippingDuplicate,
|
||||
openShippingDuplicateDialog: shipping.openShippingDuplicateDialog,
|
||||
resolveShippingDuplicateDialog: shipping.resolveShippingDuplicateDialog,
|
||||
removeShippingDuplicateDialogAttachment: shipping.removeShippingDuplicateDialogAttachment,
|
||||
closeShippingDuplicateDialog: shipping.closeShippingDuplicateDialog,
|
||||
filePreviewVisible,
|
||||
previewFile,
|
||||
previewFiles,
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
type ComputedRef,
|
||||
type Ref,
|
||||
} from 'vue';
|
||||
import { useAuthStore } from '@/features/auth/stores/auth.store';
|
||||
import { agentUsesWorkspaceStepperProgress, isShippingNoticeAgent as resolveShippingNoticeAgent } from '@/shared/utils/agent-registry.utils';
|
||||
import type { AgentRegistryFields } from '@/shared/utils/agent-registry.utils';
|
||||
import { hasActiveRunningChatRun } from '../shipping/shippingActionBusy';
|
||||
@@ -667,6 +668,68 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
t,
|
||||
});
|
||||
|
||||
const showShippingDuplicateDialog = ref(false);
|
||||
const shippingDuplicateAttachmentId = ref<string | null>(null);
|
||||
const shippingDuplicateAttachment = computed(() => {
|
||||
const id = shippingDuplicateAttachmentId.value;
|
||||
if (!id) return null;
|
||||
return shippingIntakes.noticeAttachments.value.find((item) => item.id === id) || null;
|
||||
});
|
||||
const canForceCreateShippingDuplicate = computed(() => {
|
||||
const user = useAuthStore().user;
|
||||
if (!user) return false;
|
||||
if (String(user.role || '') === 'admin') return true;
|
||||
return Boolean(user.feature_permissions?.shipping_notice_force_create);
|
||||
});
|
||||
|
||||
/**
|
||||
* 打开首个(或指定)阻断型重复附件的处理弹窗。
|
||||
*/
|
||||
const openShippingDuplicateDialog = (attachmentId?: string) => {
|
||||
const targetId =
|
||||
attachmentId
|
||||
|| shippingIntakes.noticeAttachments.value.find(
|
||||
(item) => item.duplicate?.blocking && !item.duplicateResolution?.action,
|
||||
)?.id
|
||||
|| null;
|
||||
if (!targetId) {
|
||||
msg.warning(t('chat.shippingNoticeDuplicateNeedsResolution'));
|
||||
return;
|
||||
}
|
||||
shippingDuplicateAttachmentId.value = targetId;
|
||||
showShippingDuplicateDialog.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交重复决策并写回附件状态。
|
||||
*/
|
||||
const resolveShippingDuplicateDialog = async (payload: {
|
||||
action: import('../types/shipping.types').ShippingDuplicateAction;
|
||||
targetTaskNo?: string;
|
||||
reason?: string;
|
||||
}) => {
|
||||
const id = shippingDuplicateAttachmentId.value;
|
||||
if (!id) return;
|
||||
try {
|
||||
await shippingIntakes.resolveDuplicateAttachment(
|
||||
id,
|
||||
payload.action,
|
||||
payload.targetTaskNo,
|
||||
payload.reason,
|
||||
);
|
||||
msg.success(t('chat.shippingNoticeDuplicateResolved'));
|
||||
} catch (e: unknown) {
|
||||
msg.warning(e instanceof Error ? e.message : t('chat.shippingNoticeDuplicateResolveFailed'));
|
||||
}
|
||||
};
|
||||
|
||||
const removeShippingDuplicateDialogAttachment = async () => {
|
||||
const id = shippingDuplicateAttachmentId.value;
|
||||
if (!id) return;
|
||||
await shippingIntakes.removeNoticeAttachment(id);
|
||||
shippingDuplicateAttachmentId.value = null;
|
||||
};
|
||||
|
||||
const {
|
||||
handleShippingAutoUploadFile,
|
||||
handleShippingAutoUploadNoticeBatch,
|
||||
@@ -755,6 +818,8 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
isShippingNoticeBatchSubmitting,
|
||||
hasBlockingNoticeIntake: () => shippingIntakes.hasBlockingUploadOrParse.value,
|
||||
hasNoticeIntakeFailures: () => shippingIntakes.hasParseFailures.value,
|
||||
hasBlockingNoticeDuplicates: () => shippingIntakes.hasBlockingDuplicates.value,
|
||||
openShippingDuplicateDialog,
|
||||
getParsedIntakeNos: shippingIntakes.getParsedIntakeNos,
|
||||
refreshShippingActions,
|
||||
shippingSuggestedPrompt,
|
||||
@@ -1067,6 +1132,15 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
handleShippingLocalFilesSelected,
|
||||
removeShippingNoticeAttachment: shippingIntakes.removeNoticeAttachment,
|
||||
retryShippingNoticeAttachment: shippingIntakes.retryNoticeAttachment,
|
||||
showShippingDuplicateDialog,
|
||||
shippingDuplicateAttachment,
|
||||
canForceCreateShippingDuplicate,
|
||||
openShippingDuplicateDialog,
|
||||
resolveShippingDuplicateDialog,
|
||||
removeShippingDuplicateDialogAttachment,
|
||||
closeShippingDuplicateDialog: () => {
|
||||
showShippingDuplicateDialog.value = false;
|
||||
},
|
||||
tryHandleShippingAttachmentAutoFlow,
|
||||
tryHandleShippingSend,
|
||||
onConversationIdChanging,
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingNoticeAttachmentIntegrity.spec.ts
|
||||
* 用途:附件完整性门禁单测;阻断码与截断路径须能阻止建单判定。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
BLOCKING_WARNING_PREFIXES,
|
||||
isShippingNoticeAttachmentParseIncomplete,
|
||||
} from './shippingNoticeAttachmentIntegrity';
|
||||
|
||||
describe('shippingNoticeAttachmentIntegrity', () => {
|
||||
it('treats each blocking warning prefix as incomplete', () => {
|
||||
for (const prefix of BLOCKING_WARNING_PREFIXES) {
|
||||
expect(
|
||||
isShippingNoticeAttachmentParseIncomplete({
|
||||
warnings: [`${prefix}demo`],
|
||||
attachments: [],
|
||||
}),
|
||||
).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it('treats per-attachment text truncation as incomplete', () => {
|
||||
expect(
|
||||
isShippingNoticeAttachmentParseIncomplete({
|
||||
attachment_count: 1,
|
||||
attachments: [
|
||||
{
|
||||
parse_status: 'parsed',
|
||||
warnings: ['eml_attachment_text_truncated:10'],
|
||||
},
|
||||
],
|
||||
warnings: [],
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('treats notice_text_truncated as incomplete', () => {
|
||||
expect(
|
||||
isShippingNoticeAttachmentParseIncomplete({
|
||||
warnings: ['notice_text_truncated:200000'],
|
||||
attachments: [],
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('allows clean parsed summary', () => {
|
||||
expect(
|
||||
isShippingNoticeAttachmentParseIncomplete({
|
||||
attachment_count: 1,
|
||||
attachments: [{ parse_status: 'parsed', warnings: [] }],
|
||||
warnings: [],
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingNoticeAttachmentIntegrity.ts
|
||||
* 用途:发货通知附件完整性门禁契约(阻断 warning 前缀与 incomplete 判定)。
|
||||
* 依赖:shipping.types(ParseSummary 形状)。
|
||||
* 逻辑:与后端 attachment_integrity.BLOCKING_WARNING_PREFIXES /
|
||||
* is_attachment_parse_incomplete 保持一致;契约测试校验两端前缀集合。
|
||||
*/
|
||||
|
||||
import type { ShippingNoticeParseSummary } from '../types/shipping.types';
|
||||
|
||||
/** 阻断 warning 前缀;须与 backend BLOCKING_WARNING_PREFIXES 完全一致(顺序可不同)。 */
|
||||
export const BLOCKING_WARNING_PREFIXES = [
|
||||
'eml_nesting_depth_exceeded:',
|
||||
'eml_attachment_limit_exceeded:',
|
||||
'eml_total_attachment_size_exceeded:',
|
||||
'eml_nested_message_unreadable',
|
||||
'eml_attachment_text_budget_exhausted:',
|
||||
'eml_attachment_text_truncated:',
|
||||
'notice_text_truncated:',
|
||||
] as const;
|
||||
|
||||
const INCOMPLETE_ATTACHMENT_STATUSES = new Set(['failed', 'empty', 'skipped']);
|
||||
|
||||
/**
|
||||
* 判定单条 warning 是否为完整性阻断项。
|
||||
*/
|
||||
export function isBlockingWarning(text: string): boolean {
|
||||
const normalized = String(text || '');
|
||||
return BLOCKING_WARNING_PREFIXES.some((prefix) => normalized.startsWith(prefix));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定 EML 等 intake 是否存在未完整解析的附件(含超深/超限/截断警告)。
|
||||
* 核心逻辑:阻断警告、登记数少于发现数、或 failed/empty/skipped 均视为不完整;
|
||||
* duplicate 仅为去重,不阻断建单。
|
||||
*/
|
||||
export function isShippingNoticeAttachmentParseIncomplete(
|
||||
summary?: ShippingNoticeParseSummary | null,
|
||||
): boolean {
|
||||
if (!summary) return false;
|
||||
const warnings = summary.warnings || [];
|
||||
if (warnings.some((item) => isBlockingWarning(String(item || '')))) {
|
||||
return true;
|
||||
}
|
||||
const rows = summary.attachments || [];
|
||||
const total = Number(summary.attachment_count || 0);
|
||||
if (total > rows.length) return true;
|
||||
return rows.some((item) => {
|
||||
if (INCOMPLETE_ATTACHMENT_STATUSES.has(String(item.parse_status || ''))) {
|
||||
return true;
|
||||
}
|
||||
return (item.warnings || []).some((w) => isBlockingWarning(String(w || '')));
|
||||
});
|
||||
}
|
||||
@@ -64,6 +64,8 @@ export interface ShippingSendHandlerContext {
|
||||
isShippingNoticeBatchSubmitting?: () => boolean;
|
||||
hasBlockingNoticeIntake?: () => boolean;
|
||||
hasNoticeIntakeFailures?: () => boolean;
|
||||
hasBlockingNoticeDuplicates?: () => boolean;
|
||||
openShippingDuplicateDialog?: (attachmentId?: string) => void;
|
||||
getParsedIntakeNos?: () => string[];
|
||||
refreshShippingActions: () => Promise<void>;
|
||||
shippingSuggestedPrompt: ComputedRef<string>;
|
||||
@@ -201,6 +203,11 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeParseFailedHint'));
|
||||
return true;
|
||||
}
|
||||
if (ctx.hasBlockingNoticeDuplicates?.()) {
|
||||
ctx.openShippingDuplicateDialog?.();
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeDuplicateNeedsResolution'));
|
||||
return true;
|
||||
}
|
||||
const intakeNos = ctx.getParsedIntakeNos?.() || [];
|
||||
if (intakeNos.length && (!trimmed || ctx.shippingAutoFlowRequested.value)) {
|
||||
ctx.shippingAutoFlowRequested.value = false;
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
/**
|
||||
* features/chat/shipping/useShippingNoticeIntakes.ts
|
||||
* 用途:发货通知选择即上传、创建 intake 与批量状态轮询编排。
|
||||
* 依赖:file-assets.api、shipping.api、shipping.types。
|
||||
* 逻辑:useChatShipping / useChatAttachments 在货代 Agent 下委托本 composable 管理预解析附件。
|
||||
* 依赖:file-assets.api、shipping.api、shipping.types、shippingNoticeAttachmentIntegrity。
|
||||
* 逻辑:useChatShipping / useChatAttachments 在货代 Agent 下委托本 composable 管理预解析附件;
|
||||
* 完整性判定委托 shippingNoticeAttachmentIntegrity(与后端契约对齐)。
|
||||
*/
|
||||
import { computed, onBeforeUnmount, ref, type Ref } from 'vue';
|
||||
import { uploadFileAsset } from '@/shared/api/file-assets.api';
|
||||
import type {
|
||||
PendingAttachment,
|
||||
ShippingDuplicateAction,
|
||||
ShippingDuplicateResult,
|
||||
ShippingNoticeParseSummary,
|
||||
ShippingNoticePendingAttachment,
|
||||
} from '../types/shipping.types';
|
||||
import type { ShippingNoticeIntakeResponse } from '../types/shipping.api.types';
|
||||
import {
|
||||
cancelShippingNoticeIntake,
|
||||
createShippingNoticeIntake,
|
||||
getShippingNoticeIntakeStatuses,
|
||||
listActiveShippingNoticeIntakes,
|
||||
resolveShippingNoticeDuplicate,
|
||||
retryShippingNoticeIntake,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import type {
|
||||
PendingAttachment,
|
||||
ShippingNoticeParseSummary,
|
||||
ShippingNoticePendingAttachment,
|
||||
} from '../types/shipping.types';
|
||||
import { isShippingNoticeAttachmentParseIncomplete } from './shippingNoticeAttachmentIntegrity';
|
||||
|
||||
export { isShippingNoticeAttachmentParseIncomplete } from './shippingNoticeAttachmentIntegrity';
|
||||
|
||||
const TERMINAL_PARSE = new Set(['parsed', 'failed', 'parse_failed', 'consumed', 'cancelled', 'expired']);
|
||||
const ACTIVE_PARSE = new Set(['waiting', 'queued', 'parsing', 'created']);
|
||||
@@ -34,6 +42,46 @@ function mapServerParseStatus(status: string): ShippingNoticePendingAttachment['
|
||||
return 'waiting';
|
||||
}
|
||||
|
||||
/**
|
||||
* 将服务端 duplicate 结果映射为前端附件状态。
|
||||
*/
|
||||
function mapServerDuplicate(remote: ShippingNoticeIntakeResponse): {
|
||||
duplicate?: ShippingDuplicateResult;
|
||||
duplicateResolution?: ShippingNoticePendingAttachment['duplicateResolution'];
|
||||
} {
|
||||
const dup = remote.duplicate;
|
||||
if (!dup) return {};
|
||||
const duplicate: ShippingDuplicateResult = {
|
||||
status: dup.status,
|
||||
blocking: Boolean(dup.blocking),
|
||||
fingerprintStrength: dup.fingerprint_strength,
|
||||
matches: (dup.matches || []).map((item) => ({
|
||||
taskNo: item.task_no,
|
||||
processStatus: item.process_status,
|
||||
documentVersion: Number(item.document_version || 1),
|
||||
matchType: item.match_type,
|
||||
matchedFields: listSafe(item.matched_fields),
|
||||
createdAt: item.created_at,
|
||||
})),
|
||||
allowedActions: (dup.allowed_actions || []) as ShippingDuplicateAction[],
|
||||
};
|
||||
const resolution = remote.duplicate_resolution;
|
||||
return {
|
||||
duplicate,
|
||||
duplicateResolution: resolution
|
||||
? {
|
||||
action: resolution.action,
|
||||
targetTaskNo: resolution.target_task_no || undefined,
|
||||
reason: resolution.reason || undefined,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
function listSafe(value: unknown): string[] {
|
||||
return Array.isArray(value) ? value.map((item) => String(item)) : [];
|
||||
}
|
||||
|
||||
function createPendingAttachment(file: File): ShippingNoticePendingAttachment {
|
||||
return {
|
||||
id: `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
|
||||
@@ -76,12 +124,30 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
);
|
||||
|
||||
const hasParseFailures = computed(() =>
|
||||
noticeAttachments.value.some((item) => item.parseStatus === 'failed'),
|
||||
noticeAttachments.value.some(
|
||||
(item) =>
|
||||
item.parseStatus === 'failed'
|
||||
|| isShippingNoticeAttachmentParseIncomplete(item.parseSummary),
|
||||
),
|
||||
);
|
||||
|
||||
const allParsedReady = computed(() =>
|
||||
noticeAttachments.value.length > 0
|
||||
&& noticeAttachments.value.every((item) => item.parseStatus === 'parsed'),
|
||||
&& noticeAttachments.value.every(
|
||||
(item) =>
|
||||
item.parseStatus === 'parsed'
|
||||
&& !isShippingNoticeAttachmentParseIncomplete(item.parseSummary),
|
||||
),
|
||||
);
|
||||
|
||||
const hasBlockingDuplicates = computed(() =>
|
||||
noticeAttachments.value.some(
|
||||
(item) => item.duplicate?.blocking && !item.duplicateResolution?.action,
|
||||
),
|
||||
);
|
||||
|
||||
const allReadyForConfirmation = computed(() =>
|
||||
allParsedReady.value && !hasBlockingDuplicates.value && !hasParseFailures.value,
|
||||
);
|
||||
|
||||
const stopPolling = () => {
|
||||
@@ -137,6 +203,7 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
errorMessage: remote.error_message || undefined,
|
||||
expiresAt: remote.expires_at || undefined,
|
||||
assetNo: remote.asset_no || local.assetNo,
|
||||
...mapServerDuplicate(remote),
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -218,7 +285,12 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
|
||||
const getParsedIntakeNos = () =>
|
||||
noticeAttachments.value
|
||||
.filter((item) => item.parseStatus === 'parsed' && item.intakeNo)
|
||||
.filter(
|
||||
(item) =>
|
||||
item.parseStatus === 'parsed'
|
||||
&& item.intakeNo
|
||||
&& !isShippingNoticeAttachmentParseIncomplete(item.parseSummary),
|
||||
)
|
||||
.map((item) => String(item.intakeNo));
|
||||
|
||||
const clearConsumedAttachments = () => {
|
||||
@@ -233,11 +305,11 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
.filter((item) => item.parse_status !== 'consumed')
|
||||
.map((item) => ({
|
||||
id: `restored_${item.intake_no}`,
|
||||
kind: 'shipping_notice',
|
||||
type: 'document',
|
||||
kind: 'shipping_notice' as const,
|
||||
type: 'document' as const,
|
||||
assetNo: item.asset_no || undefined,
|
||||
intakeNo: item.intake_no,
|
||||
uploadStatus: 'uploaded',
|
||||
uploadStatus: 'uploaded' as const,
|
||||
parseStatus: mapServerParseStatus(item.parse_status),
|
||||
uploadProgress: 100,
|
||||
originalFilename: item.original_filename || item.intake_no,
|
||||
@@ -246,6 +318,7 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
errorCode: item.error_code || undefined,
|
||||
errorMessage: item.error_message || undefined,
|
||||
expiresAt: item.expires_at || undefined,
|
||||
...mapServerDuplicate(item),
|
||||
}));
|
||||
const nonNotice = options.attachments.value.filter((item) => item.kind !== 'shipping_notice');
|
||||
options.attachments.value = [...nonNotice, ...restored];
|
||||
@@ -254,6 +327,26 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
}
|
||||
};
|
||||
|
||||
const resolveDuplicateAttachment = async (
|
||||
id: string,
|
||||
action: ShippingDuplicateAction,
|
||||
targetTaskNo?: string,
|
||||
reason?: string,
|
||||
) => {
|
||||
const target = noticeAttachments.value.find((item) => item.id === id);
|
||||
if (!target?.intakeNo) return;
|
||||
const intake = await resolveShippingNoticeDuplicate(
|
||||
target.intakeNo,
|
||||
action,
|
||||
targetTaskNo,
|
||||
reason,
|
||||
);
|
||||
patchAttachment(target.id, {
|
||||
parseStatus: mapServerParseStatus(intake.parse_status),
|
||||
...mapServerDuplicate(intake),
|
||||
});
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
stopPolling();
|
||||
});
|
||||
@@ -263,9 +356,12 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
hasBlockingUploadOrParse,
|
||||
hasParseFailures,
|
||||
allParsedReady,
|
||||
hasBlockingDuplicates,
|
||||
allReadyForConfirmation,
|
||||
enqueueNoticeFiles,
|
||||
removeNoticeAttachment,
|
||||
retryNoticeAttachment,
|
||||
resolveDuplicateAttachment,
|
||||
getParsedIntakeNos,
|
||||
clearConsumedAttachments,
|
||||
restoreForConversation,
|
||||
|
||||
@@ -103,6 +103,15 @@ export interface ShippingTaskSummary {
|
||||
created_at?: string | null;
|
||||
updated_at?: string | null;
|
||||
ui_state?: ShippingTaskUiState;
|
||||
/** 业务版本号;修订建单时递增 */
|
||||
document_version?: number;
|
||||
supersedes_task_no?: string | null;
|
||||
superseded_by_task_no?: string | null;
|
||||
duplicate_source_task_no?: string | null;
|
||||
duplicate_resolution_type?: string | null;
|
||||
duplicate_override_reason?: string | null;
|
||||
business_fingerprint?: string | null;
|
||||
fingerprint_version?: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingTaskEvent {
|
||||
@@ -205,6 +214,8 @@ export interface ShippingTaskUiState {
|
||||
title?: string | null;
|
||||
message?: string | null;
|
||||
error_message?: string | null;
|
||||
/** 文件解析阶段汇总的全部待处理问题(库存源 + 解析 warnings 等) */
|
||||
issues?: string[] | null;
|
||||
};
|
||||
action_buttons: ShippingChatAction[];
|
||||
updated_at?: string | null;
|
||||
@@ -310,6 +321,18 @@ export interface ShippingNoticeIntakeResponse {
|
||||
parse_status: string;
|
||||
parser_version?: string;
|
||||
parse_summary?: Record<string, unknown> | null;
|
||||
business_summary?: Record<string, unknown> | null;
|
||||
business_fingerprint?: string | null;
|
||||
fingerprint_strength?: ShippingDuplicateFingerprintStrength | null;
|
||||
fingerprint_version?: string | null;
|
||||
duplicate?: ShippingDuplicateResult | null;
|
||||
duplicate_resolution?: {
|
||||
action: ShippingDuplicateAction;
|
||||
reason?: string | null;
|
||||
resolved_by_id?: number | null;
|
||||
resolved_at?: string | null;
|
||||
target_task_no?: string | null;
|
||||
} | null;
|
||||
warnings?: string[];
|
||||
error_code?: string | null;
|
||||
error_message?: string | null;
|
||||
@@ -322,6 +345,36 @@ export interface ShippingNoticeIntakeResponse {
|
||||
content_hash?: string;
|
||||
}
|
||||
|
||||
export type ShippingDuplicateStatus =
|
||||
| 'unchecked'
|
||||
| 'none'
|
||||
| 'exact_file'
|
||||
| 'same_active_task'
|
||||
| 'same_completed_task'
|
||||
| 'possible_duplicate';
|
||||
|
||||
export type ShippingDuplicateAction = 'open_existing' | 'create_revision' | 'force_create';
|
||||
|
||||
export type ShippingDuplicateFingerprintStrength = 'strong' | 'medium' | 'weak' | 'unavailable';
|
||||
|
||||
export interface ShippingDuplicateMatch {
|
||||
task_no: string;
|
||||
process_status: string;
|
||||
document_version: number;
|
||||
match_type: string;
|
||||
matched_fields: string[];
|
||||
lifecycle?: string;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export interface ShippingDuplicateResult {
|
||||
status: ShippingDuplicateStatus;
|
||||
blocking: boolean;
|
||||
fingerprint_strength: ShippingDuplicateFingerprintStrength;
|
||||
matches: ShippingDuplicateMatch[];
|
||||
allowed_actions: ShippingDuplicateAction[];
|
||||
}
|
||||
|
||||
export interface ShippingCreateBatchFromIntakesResponse extends ShippingNoticeUploadResponse {}
|
||||
|
||||
export interface ShippingDecisionResponse {
|
||||
|
||||
@@ -22,6 +22,69 @@ export type ShippingNoticeParseStatus =
|
||||
| 'cancelled'
|
||||
| 'expired';
|
||||
|
||||
export type ShippingDuplicateAction = 'open_existing' | 'create_revision' | 'force_create';
|
||||
|
||||
export type ShippingDuplicateFingerprintStrength = 'strong' | 'medium' | 'weak' | 'unavailable';
|
||||
|
||||
export type ShippingDuplicateStatus =
|
||||
| 'unchecked'
|
||||
| 'none'
|
||||
| 'exact_file'
|
||||
| 'same_active_task'
|
||||
| 'same_completed_task'
|
||||
| 'possible_duplicate';
|
||||
|
||||
export interface ShippingDuplicateMatch {
|
||||
taskNo: string;
|
||||
processStatus: string;
|
||||
documentVersion: number;
|
||||
matchType: string;
|
||||
matchedFields: string[];
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
export interface ShippingDuplicateResult {
|
||||
status: ShippingDuplicateStatus;
|
||||
blocking: boolean;
|
||||
fingerprintStrength: ShippingDuplicateFingerprintStrength;
|
||||
matches: ShippingDuplicateMatch[];
|
||||
allowedActions: ShippingDuplicateAction[];
|
||||
}
|
||||
|
||||
export interface ShippingDuplicateResolution {
|
||||
action: ShippingDuplicateAction;
|
||||
targetTaskNo?: string;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export interface ShippingNoticeParseAttachmentSummary {
|
||||
attachment_key?: string;
|
||||
filename?: string;
|
||||
mime_type?: string;
|
||||
size?: number;
|
||||
content_hash?: string;
|
||||
parse_status?: string;
|
||||
/** 详情接口才有;状态轮询为瘦身摘要不含全文 */
|
||||
extracted_text?: string;
|
||||
/** 原始解析文本长度 */
|
||||
text_length?: number;
|
||||
/** 落库/截断后长度 */
|
||||
stored_text_length?: number;
|
||||
warnings?: string[];
|
||||
}
|
||||
|
||||
export interface ShippingNoticeParseEmailMeta {
|
||||
message_id?: string;
|
||||
subject?: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
date?: string;
|
||||
/** 详情接口才有完整正文;状态轮询通常省略 */
|
||||
body_text?: string;
|
||||
body_text_length?: number;
|
||||
stored_body_text_length?: number;
|
||||
}
|
||||
|
||||
export interface ShippingNoticeParseSummary {
|
||||
filename?: string;
|
||||
source_type?: string;
|
||||
@@ -29,6 +92,12 @@ export interface ShippingNoticeParseSummary {
|
||||
line_count?: number;
|
||||
warnings?: string[];
|
||||
parser_version?: string;
|
||||
email?: ShippingNoticeParseEmailMeta;
|
||||
/** 发现的真实附件总数(含因上限未登记的) */
|
||||
attachment_count?: number;
|
||||
/** 实际登记到 attachments[] 的数量 */
|
||||
attachment_registered_count?: number;
|
||||
attachments?: ShippingNoticeParseAttachmentSummary[];
|
||||
}
|
||||
|
||||
export type ShippingNoticePendingAttachment = {
|
||||
@@ -47,6 +116,8 @@ export type ShippingNoticePendingAttachment = {
|
||||
errorCode?: string;
|
||||
errorMessage?: string;
|
||||
expiresAt?: string;
|
||||
duplicate?: ShippingDuplicateResult;
|
||||
duplicateResolution?: ShippingDuplicateResolution;
|
||||
};
|
||||
|
||||
/** 待发送附件(本地文件、远程 URL 或货代通知预解析) */
|
||||
|
||||
@@ -25,15 +25,49 @@
|
||||
"shippingNoticeUploadFailed": "Shipping notice upload failed.",
|
||||
"shippingNoticeBatchSubmitting": "Shipping notice submission is in progress. Please do not repeat the action.",
|
||||
"shippingNoticeWaitingForParse": "Shipping notices are still uploading or parsing. Please wait before confirming batch creation.",
|
||||
"shippingNoticeParseFailedHint": "Some shipping notices failed to parse. Retry or remove them before sending.",
|
||||
"shippingNoticeParseFailedHint": "Some shipping notices failed to parse or have incomplete attachments. Retry or remove them before sending.",
|
||||
"shippingNoticeUploading": "Uploading",
|
||||
"shippingNoticeParsing": "Parsing",
|
||||
"shippingNoticeParsed": "Parsed",
|
||||
"shippingNoticeAttachmentHint": "Attachments {ok}/{total}",
|
||||
"shippingNoticeAttachmentHintPartial": "Attachments {ok}/{total} ({failed} incomplete)",
|
||||
"shippingNoticeAttachmentHintWithDup": "Attachments {ok}/{total} ({duplicates} duplicates skipped)",
|
||||
"shippingNoticeAttachmentIncompleteWarn": "Attachment parse incomplete",
|
||||
"shippingNoticeParseFailed": "Parse failed",
|
||||
"shippingNoticeRetryParse": "Retry parse",
|
||||
"shippingNoticeConfirmBatchHint": "Send to confirm batch creation after parsing completes",
|
||||
"shippingNoticeBatchReplayed": "Restored the previously created batch.",
|
||||
"shippingNoticeDuplicatesRemoved": "Duplicate files were removed automatically.",
|
||||
"shippingNoticeDuplicateNeedsResolution": "A duplicate shipping notice was detected. Choose how to proceed.",
|
||||
"shippingNoticeDuplicateTitle": "Resolve duplicate shipping notice",
|
||||
"shippingNoticeDuplicateExactFile": "An identical file was already used by an existing task.",
|
||||
"shippingNoticeDuplicateSameActive": "An in-progress task already matches this business document.",
|
||||
"shippingNoticeDuplicateSameCompleted": "A completed task already matches this business document.",
|
||||
"shippingNoticeDuplicatePossible": "This notice may duplicate an existing task. Please confirm.",
|
||||
"shippingNoticeDuplicateMatchTask": "Matched task: {taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "Status: {status}",
|
||||
"shippingNoticeDuplicateMatchFields": "Matched fields: {fields}",
|
||||
"shippingNoticeDuplicateOpenExisting": "Open existing task",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "Do not create a new task; link this file to the existing one.",
|
||||
"shippingNoticeDuplicateCreateRevision": "Create as a revision",
|
||||
"shippingNoticeDuplicateCreateRevisionHint": "Create a new task version while keeping the original task and receipts.",
|
||||
"shippingNoticeDuplicateForceCreate": "Force create",
|
||||
"shippingNoticeDuplicateForceCreateHint": "Requires permission and a reason; the action is audited.",
|
||||
"shippingNoticeDuplicateReasonLabel": "Reason for force create",
|
||||
"shippingNoticeDuplicateReasonPlaceholder": "Explain why a separate task is required",
|
||||
"shippingNoticeDuplicateReasonRequired": "A reason is required for force create.",
|
||||
"shippingNoticeDuplicateForceForbidden": "You are not allowed to force-create duplicates.",
|
||||
"shippingNoticeDuplicateActionUnavailable": "This action is not available.",
|
||||
"shippingNoticeDuplicateRemoveFile": "Remove this file",
|
||||
"shippingNoticeDuplicateConfirm": "Confirm",
|
||||
"shippingNoticeDuplicateHandle": "Resolve",
|
||||
"shippingNoticeDuplicateBlockingBadge": "Duplicate detected",
|
||||
"shippingNoticeDuplicatePossibleBadge": "Possible duplicate",
|
||||
"shippingNoticeDuplicateRevisionChosen": "Will create a revision",
|
||||
"shippingNoticeDuplicateForceChosen": "Force create authorized",
|
||||
"shippingNoticeDuplicateOpenChosen": "Will open existing task",
|
||||
"shippingNoticeDuplicateResolved": "Duplicate resolution saved.",
|
||||
"shippingNoticeDuplicateResolveFailed": "Failed to save duplicate resolution.",
|
||||
"shippingInventoryUploadFailed": "Inventory upload failed.",
|
||||
"shippingNoticeRefreshDone": "Current task status refreshed.",
|
||||
"shippingNoticeRetryUploadAction": "Retry freight upload",
|
||||
@@ -185,6 +219,8 @@
|
||||
"diagnosisInventorySourceAdvice": "Pick a candidate source or type a destination/warehouse hint (e.g. AWSDU, Dublin), then confirm.",
|
||||
"diagnosisInventorySourceAmbiguousTitle": "Multiple inventory sources matched; auto-selection is not possible.",
|
||||
"diagnosisInventorySourceAmbiguousAdvice": "Choose the official source code explicitly; site and warehouse will be generated from config after confirmation.",
|
||||
"diagnosisIssuesTitle": "{count} issues found during notice parsing",
|
||||
"diagnosisIssuesAdvice": "Resolve each item below. If parsing looks wrong, confirm or re-parse first, then handle inventory source.",
|
||||
"blockedInventorySource": "Inventory source pending confirmation",
|
||||
"suggestConfirmInventorySource": "Select or enter inventory source, then confirm",
|
||||
"inventorySource": {
|
||||
|
||||
@@ -49,8 +49,18 @@
|
||||
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "Shipping notice intake not found.",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "Shipping notice is still parsing. Please wait before confirming the batch.",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "Shipping notice parse failed. Retry or remove and upload again.",
|
||||
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "Shipping notice attachments are incomplete. Retry parse or remove and upload again.",
|
||||
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "Shipping notice intake has already been consumed.",
|
||||
"SHIPPING_NOTICE_INTAKE_EXPIRED": "Shipping notice intake has expired.",
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "Current intake status does not allow this operation."
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "Current intake status does not allow this operation.",
|
||||
"SHIPPING_NOTICE_DUPLICATE_RESOLUTION_REQUIRED": "A duplicate shipping notice was detected. Choose how to proceed.",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_NOT_FOUND": "The duplicate target task was not found.",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_CHANGED": "The target task status changed. Please confirm again.",
|
||||
"SHIPPING_NOTICE_DUPLICATE_REASON_REQUIRED": "A reason is required to force-create a duplicate.",
|
||||
"SHIPPING_NOTICE_DUPLICATE_OVERRIDE_FORBIDDEN": "You are not allowed to force-create a duplicate shipping notice.",
|
||||
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "The revision target task is invalid.",
|
||||
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "A later revision of this task already exists.",
|
||||
"SHIPPING_NOTICE_REVISION_CONFLICT": "A revision of this task already exists. Open the existing revision or re-check.",
|
||||
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "A reliable business fingerprint could not be generated; only file-hash dedupe applies."
|
||||
}
|
||||
}
|
||||
@@ -25,15 +25,49 @@
|
||||
"shippingNoticeUploadFailed": "อัปโหลดใบแจ้งจัดส่งล้มเหลว",
|
||||
"shippingNoticeBatchSubmitting": "กำลังส่งใบแจ้งจัดส่ง โปรดอย่าทำซ้ำ",
|
||||
"shippingNoticeWaitingForParse": "ใบแจ้งจัดส่งกำลังอัปโหลดหรือแยกข้อความ โปรดรอก่อนยืนยันสร้างชุดงาน",
|
||||
"shippingNoticeParseFailedHint": "มีใบแจ้งจัดส่งที่แยกข้อความไม่สำเร็จ โปรดลองใหม่หรือลบออกก่อนส่ง",
|
||||
"shippingNoticeParseFailedHint": "มีใบแจ้งจัดส่งที่แยกข้อความไม่สำเร็จหรือไฟล์แนบไม่ครบ โปรดลองใหม่หรือลบออกก่อนส่ง",
|
||||
"shippingNoticeUploading": "กำลังอัปโหลด",
|
||||
"shippingNoticeParsing": "กำลังแยกข้อความ",
|
||||
"shippingNoticeParsed": "แยกข้อความเสร็จแล้ว",
|
||||
"shippingNoticeAttachmentHint": "ไฟล์แนบ {ok}/{total}",
|
||||
"shippingNoticeAttachmentHintPartial": "ไฟล์แนบ {ok}/{total} (ไม่ครบ {failed})",
|
||||
"shippingNoticeAttachmentHintWithDup": "ไฟล์แนบ {ok}/{total} (ซ้ำ {duplicates})",
|
||||
"shippingNoticeAttachmentIncompleteWarn": "แยกข้อความไฟล์แนบไม่ครบ",
|
||||
"shippingNoticeParseFailed": "แยกข้อความล้มเหลว",
|
||||
"shippingNoticeRetryParse": "ลองแยกข้อความอีกครั้ง",
|
||||
"shippingNoticeConfirmBatchHint": "กดส่งเพื่อยืนยันสร้างชุดงานหลังแยกข้อความเสร็จ",
|
||||
"shippingNoticeBatchReplayed": "กู้คืนแบตช์ที่สร้างไว้ก่อนหน้าแล้ว",
|
||||
"shippingNoticeDuplicatesRemoved": "ลบไฟล์ที่ซ้ำกันโดยอัตโนมัติแล้ว",
|
||||
"shippingNoticeDuplicateNeedsResolution": "พบใบแจ้งจัดส่งซ้ำ กรุณาเลือกวิธีดำเนินการก่อน",
|
||||
"shippingNoticeDuplicateTitle": "จัดการใบแจ้งจัดส่งที่ซ้ำ",
|
||||
"shippingNoticeDuplicateExactFile": "พบไฟล์ที่เหมือนกันกับงานที่มีอยู่แล้ว",
|
||||
"shippingNoticeDuplicateSameActive": "พบงานที่กำลังดำเนินการซึ่งตรงกับเอกสารธุรกิจนี้",
|
||||
"shippingNoticeDuplicateSameCompleted": "พบงานที่เสร็จแล้วซึ่งตรงกับเอกสารธุรกิจนี้",
|
||||
"shippingNoticeDuplicatePossible": "อาจซ้ำกับใบแจ้งจัดส่งที่มีอยู่ กรุณายืนยัน",
|
||||
"shippingNoticeDuplicateMatchTask": "งานที่ตรงกัน: {taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "สถานะ: {status}",
|
||||
"shippingNoticeDuplicateMatchFields": "ฟิลด์ที่ตรงกัน: {fields}",
|
||||
"shippingNoticeDuplicateOpenExisting": "เปิดงานที่มีอยู่",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "ไม่สร้างงานใหม่ แต่ผูกไฟล์นี้กับงานเดิม",
|
||||
"shippingNoticeDuplicateCreateRevision": "สร้างเป็นเวอร์ชันแก้ไข",
|
||||
"shippingNoticeDuplicateCreateRevisionHint": "สร้างงานใหม่เป็นสายเวอร์ชัน โดยเก็บงานเดิมและการตอบกลับไว้",
|
||||
"shippingNoticeDuplicateForceCreate": "บังคับสร้างใหม่",
|
||||
"shippingNoticeDuplicateForceCreateHint": "ต้องมีสิทธิ์และเหตุผล และจะถูกบันทึกการตรวจสอบ",
|
||||
"shippingNoticeDuplicateReasonLabel": "เหตุผลในการบังคับสร้าง",
|
||||
"shippingNoticeDuplicateReasonPlaceholder": "อธิบายว่าทำไมต้องสร้างงานแยก",
|
||||
"shippingNoticeDuplicateReasonRequired": "ต้องระบุเหตุผลเมื่อบังคับสร้าง",
|
||||
"shippingNoticeDuplicateForceForbidden": "คุณไม่มีสิทธิ์บังคับสร้างรายการซ้ำ",
|
||||
"shippingNoticeDuplicateActionUnavailable": "ไม่สามารถเลือกการดำเนินการนี้ได้",
|
||||
"shippingNoticeDuplicateRemoveFile": "ลบไฟล์นี้",
|
||||
"shippingNoticeDuplicateConfirm": "ยืนยัน",
|
||||
"shippingNoticeDuplicateHandle": "จัดการรายการซ้ำ",
|
||||
"shippingNoticeDuplicateBlockingBadge": "พบรายการซ้ำ",
|
||||
"shippingNoticeDuplicatePossibleBadge": "อาจซ้ำ",
|
||||
"shippingNoticeDuplicateRevisionChosen": "จะสร้างเวอร์ชันแก้ไข",
|
||||
"shippingNoticeDuplicateForceChosen": "อนุญาตบังคับสร้างแล้ว",
|
||||
"shippingNoticeDuplicateOpenChosen": "จะเปิดงานที่มีอยู่",
|
||||
"shippingNoticeDuplicateResolved": "บันทึกวิธีจัดการรายการซ้ำแล้ว",
|
||||
"shippingNoticeDuplicateResolveFailed": "บันทึกวิธีจัดการรายการซ้ำไม่สำเร็จ",
|
||||
"shippingInventoryUploadFailed": "อัปโหลดไฟล์สต็อกล้มเหลว",
|
||||
"shippingNoticeRefreshDone": "รีเฟรชสถานะงานปัจจุบันแล้ว",
|
||||
"shippingNoticeRetryUploadAction": "ลองอัปโหลดไปยังระบบขนส่งอีกครั้ง",
|
||||
@@ -185,6 +219,8 @@
|
||||
"diagnosisInventorySourceAdvice": "เลือกจากรายการตัวเลือก หรือพิมพ์คำใบ้ปลายทาง/คลัง (เช่น AWSDU, Dublin) แล้วยืนยัน",
|
||||
"diagnosisInventorySourceAmbiguousTitle": "พบหลายแหล่งสต็อกที่ตรงกัน ไม่สามารถเลือกอัตโนมัติได้",
|
||||
"diagnosisInventorySourceAmbiguousAdvice": "เลือกรหัสแหล่งสต็อกอย่างชัดเจน ระบบจะสร้าง site และ warehouse จาก config หลังยืนยัน",
|
||||
"diagnosisIssuesTitle": "พบปัญหา {count} รายการในช่วงถอดรหัสใบแจ้งขนส่ง",
|
||||
"diagnosisIssuesAdvice": "กรุณาจัดการทีละรายการ หากผลแยกวิเคราะห์ไม่ถูกต้อง ให้ยืนยันหรือแยกวิเคราะห์ใหม่ก่อน แล้วค่อยจัดการแหล่งสต็อก",
|
||||
"blockedInventorySource": "รอการยืนยันแหล่งสต็อก",
|
||||
"suggestConfirmInventorySource": "เลือกหรือป้อนแหล่งสต็อกแล้วยืนยัน",
|
||||
"inventorySource": {
|
||||
|
||||
@@ -49,8 +49,18 @@
|
||||
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "ไม่พบบันทึก intake ของใบแจ้งจัดส่ง",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "ใบแจ้งจัดส่งยังกำลังแยกข้อความ โปรดรอก่อนยืนยันสร้างชุดงาน",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "แยกข้อความใบแจ้งจัดส่งล้มเหลว โปรดลองใหม่หรือลบแล้วอัปโหลดใหม่",
|
||||
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "ไฟล์แนบใบแจ้งจัดส่งแยกข้อความไม่ครบ โปรดลองแยกใหม่หรือลบแล้วอัปโหลดใหม่",
|
||||
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "บันทึก intake ถูกใช้งานไปแล้ว",
|
||||
"SHIPPING_NOTICE_INTAKE_EXPIRED": "บันทึก intake หมดอายุแล้ว",
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "สถานะ intake ปัจจุบันไม่อนุญาตการดำเนินการนี้"
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "สถานะ intake ปัจจุบันไม่อนุญาตการดำเนินการนี้",
|
||||
"SHIPPING_NOTICE_DUPLICATE_RESOLUTION_REQUIRED": "พบใบแจ้งจัดส่งซ้ำ กรุณาเลือกวิธีดำเนินการก่อน",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_NOT_FOUND": "ไม่พบงานเป้าหมายของรายการซ้ำ",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_CHANGED": "สถานะงานเป้าหมายเปลี่ยนแล้ว กรุณายืนยันอีกครั้ง",
|
||||
"SHIPPING_NOTICE_DUPLICATE_REASON_REQUIRED": "ต้องระบุเหตุผลเมื่อบังคับสร้างใหม่",
|
||||
"SHIPPING_NOTICE_DUPLICATE_OVERRIDE_FORBIDDEN": "คุณไม่มีสิทธิ์บังคับสร้างใบแจ้งจัดส่งซ้ำ",
|
||||
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "งานเป้าหมายสำหรับการแก้ไขไม่ถูกต้อง",
|
||||
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "งานนี้มีเวอร์ชันแก้ไขถัดไปอยู่แล้ว",
|
||||
"SHIPPING_NOTICE_REVISION_CONFLICT": "งานเป้าหมายมีเวอร์ชันแก้ไขอยู่แล้ว กรุณาเปิดเวอร์ชันที่มีหรือตรวจสอบใหม่",
|
||||
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "สร้างลายนิ้วมือทางธุรกิจที่เชื่อถือได้ไม่ได้ จะใช้การตัดรายการซ้ำด้วยแฮชไฟล์เท่านั้น"
|
||||
}
|
||||
}
|
||||
@@ -25,15 +25,49 @@
|
||||
"shippingNoticeUploadFailed": "发货通知上传失败。",
|
||||
"shippingNoticeBatchSubmitting": "发货通知正在提交,请勿重复操作。",
|
||||
"shippingNoticeWaitingForParse": "发货通知正在上传或解析,请稍后再确认建单。",
|
||||
"shippingNoticeParseFailedHint": "存在解析失败的发货通知,请先重试或移除后再发送。",
|
||||
"shippingNoticeParseFailedHint": "存在解析失败或不完整的发货通知附件,请先重试或移除后再发送。",
|
||||
"shippingNoticeUploading": "上传中",
|
||||
"shippingNoticeParsing": "解析中",
|
||||
"shippingNoticeParsed": "解析完成",
|
||||
"shippingNoticeAttachmentHint": "附件 {ok}/{total}",
|
||||
"shippingNoticeAttachmentHintPartial": "附件 {ok}/{total}({failed} 未完整)",
|
||||
"shippingNoticeAttachmentHintWithDup": "附件 {ok}/{total}({duplicates} 重复已去重)",
|
||||
"shippingNoticeAttachmentIncompleteWarn": "附件解析不完整",
|
||||
"shippingNoticeParseFailed": "解析失败",
|
||||
"shippingNoticeRetryParse": "重试解析",
|
||||
"shippingNoticeConfirmBatchHint": "解析完成后点发送确认建单",
|
||||
"shippingNoticeBatchReplayed": "已恢复此前创建的批次。",
|
||||
"shippingNoticeDuplicatesRemoved": "已自动移除重复文件。",
|
||||
"shippingNoticeDuplicateNeedsResolution": "检测到重复发货通知,请先选择处理方式。",
|
||||
"shippingNoticeDuplicateTitle": "处理重复发货通知",
|
||||
"shippingNoticeDuplicateExactFile": "检测到与已有任务完全相同的文件内容。",
|
||||
"shippingNoticeDuplicateSameActive": "检测到已有进行中的相同业务发货通知。",
|
||||
"shippingNoticeDuplicateSameCompleted": "检测到已有已完成的相同业务发货通知。",
|
||||
"shippingNoticeDuplicatePossible": "疑似与已有发货通知重复,请确认。",
|
||||
"shippingNoticeDuplicateMatchTask": "命中任务:{taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "状态:{status}",
|
||||
"shippingNoticeDuplicateMatchFields": "匹配依据:{fields}",
|
||||
"shippingNoticeDuplicateOpenExisting": "打开已有任务",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "不创建新任务,将当前附件关联到已有任务。",
|
||||
"shippingNoticeDuplicateCreateRevision": "作为修订版本创建",
|
||||
"shippingNoticeDuplicateCreateRevisionHint": "新建任务并形成版本链,保留原任务与回执。",
|
||||
"shippingNoticeDuplicateForceCreate": "强制新建",
|
||||
"shippingNoticeDuplicateForceCreateHint": "需要权限与原因,将写入审计。",
|
||||
"shippingNoticeDuplicateReasonLabel": "强制新建原因",
|
||||
"shippingNoticeDuplicateReasonPlaceholder": "请说明为何必须新建独立任务",
|
||||
"shippingNoticeDuplicateReasonRequired": "强制新建必须填写原因。",
|
||||
"shippingNoticeDuplicateForceForbidden": "无权强制新建重复发货通知。",
|
||||
"shippingNoticeDuplicateActionUnavailable": "当前不可选择该处理方式。",
|
||||
"shippingNoticeDuplicateRemoveFile": "取消当前文件",
|
||||
"shippingNoticeDuplicateConfirm": "确认处理方式",
|
||||
"shippingNoticeDuplicateHandle": "处理重复",
|
||||
"shippingNoticeDuplicateBlockingBadge": "检测到重复",
|
||||
"shippingNoticeDuplicatePossibleBadge": "疑似重复",
|
||||
"shippingNoticeDuplicateRevisionChosen": "将创建修订版本",
|
||||
"shippingNoticeDuplicateForceChosen": "已授权强制新建",
|
||||
"shippingNoticeDuplicateOpenChosen": "将打开已有任务",
|
||||
"shippingNoticeDuplicateResolved": "重复处理方式已保存。",
|
||||
"shippingNoticeDuplicateResolveFailed": "保存重复处理方式失败。",
|
||||
"shippingInventoryUploadFailed": "库存文件上传失败。",
|
||||
"shippingNoticeRefreshDone": "已刷新当前任务状态。",
|
||||
"shippingNoticeRetryUploadAction": "重试上传货代",
|
||||
@@ -185,6 +219,8 @@
|
||||
"diagnosisInventorySourceAdvice": "请从候选列表选择库存源,或直接输入目的地/仓库线索(如 AWSDU、Dublin)后确认。",
|
||||
"diagnosisInventorySourceAmbiguousTitle": "匹配到多个候选库存源,无法自动判定。",
|
||||
"diagnosisInventorySourceAmbiguousAdvice": "请明确选择正式库存源编码;确认后系统将自动生成站点与仓库参数。",
|
||||
"diagnosisIssuesTitle": "文件解析阶段发现 {count} 个待处理问题",
|
||||
"diagnosisIssuesAdvice": "请按列表逐项处理;解析有误请先确认或重新解析,通过后再处理库存源。",
|
||||
"blockedInventorySource": "库存源待确认",
|
||||
"suggestConfirmInventorySource": "选择或输入库存源后确认",
|
||||
"inventorySource": {
|
||||
|
||||
@@ -49,8 +49,18 @@
|
||||
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "发货通知接入记录不存在。",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "发货通知仍在解析中,请稍后再确认建单。",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "发货通知解析失败,请重试或移除后重新上传。",
|
||||
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "发货通知附件解析不完整,请重试解析或移除后重新上传。",
|
||||
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "发货通知接入记录已被消费。",
|
||||
"SHIPPING_NOTICE_INTAKE_EXPIRED": "发货通知接入记录已过期。",
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "当前接入状态不允许该操作。"
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "当前接入状态不允许该操作。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_RESOLUTION_REQUIRED": "检测到重复发货通知,请先选择处理方式。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_NOT_FOUND": "重复目标任务不存在或不在命中列表中。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_CHANGED": "目标任务状态已变化,请重新确认。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_REASON_REQUIRED": "强制新建必须填写原因。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_OVERRIDE_FORBIDDEN": "无权强制新建重复发货通知。",
|
||||
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "修订目标任务无效。",
|
||||
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "该任务已有后续修订版本。",
|
||||
"SHIPPING_NOTICE_REVISION_CONFLICT": "目标任务已有修订版本,请打开已有修订或重新检测。",
|
||||
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "无法生成可靠业务指纹,将仅按文件去重。"
|
||||
}
|
||||
}
|
||||
@@ -25,15 +25,49 @@
|
||||
"shippingNoticeUploadFailed": "發貨通知上傳失敗。",
|
||||
"shippingNoticeBatchSubmitting": "發貨通知正在提交,請勿重複操作。",
|
||||
"shippingNoticeWaitingForParse": "發貨通知正在上傳或解析,請稍後再確認建單。",
|
||||
"shippingNoticeParseFailedHint": "存在解析失敗的發貨通知,請先重試或移除後再發送。",
|
||||
"shippingNoticeParseFailedHint": "存在解析失敗或不完整的發貨通知附件,請先重試或移除後再發送。",
|
||||
"shippingNoticeUploading": "上傳中",
|
||||
"shippingNoticeParsing": "解析中",
|
||||
"shippingNoticeParsed": "解析完成",
|
||||
"shippingNoticeAttachmentHint": "附件 {ok}/{total}",
|
||||
"shippingNoticeAttachmentHintPartial": "附件 {ok}/{total}({failed} 未完整)",
|
||||
"shippingNoticeAttachmentHintWithDup": "附件 {ok}/{total}({duplicates} 重複已去重)",
|
||||
"shippingNoticeAttachmentIncompleteWarn": "附件解析不完整",
|
||||
"shippingNoticeParseFailed": "解析失敗",
|
||||
"shippingNoticeRetryParse": "重試解析",
|
||||
"shippingNoticeConfirmBatchHint": "解析完成後點發送確認建單",
|
||||
"shippingNoticeBatchReplayed": "已恢復此前建立的批次。",
|
||||
"shippingNoticeDuplicatesRemoved": "已自動移除重複檔案。",
|
||||
"shippingNoticeDuplicateNeedsResolution": "偵測到重複發貨通知,請先選擇處理方式。",
|
||||
"shippingNoticeDuplicateTitle": "處理重複發貨通知",
|
||||
"shippingNoticeDuplicateExactFile": "偵測到與已有任務完全相同的檔案內容。",
|
||||
"shippingNoticeDuplicateSameActive": "偵測到已有進行中的相同業務發貨通知。",
|
||||
"shippingNoticeDuplicateSameCompleted": "偵測到已有已完成的相同業務發貨通知。",
|
||||
"shippingNoticeDuplicatePossible": "疑似與已有發貨通知重複,請確認。",
|
||||
"shippingNoticeDuplicateMatchTask": "命中任務:{taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "狀態:{status}",
|
||||
"shippingNoticeDuplicateMatchFields": "匹配依據:{fields}",
|
||||
"shippingNoticeDuplicateOpenExisting": "開啟已有任務",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "不建立新任務,將目前附件關聯到已有任務。",
|
||||
"shippingNoticeDuplicateCreateRevision": "作為修訂版本建立",
|
||||
"shippingNoticeDuplicateCreateRevisionHint": "建立新任務並形成版本鏈,保留原任務與回執。",
|
||||
"shippingNoticeDuplicateForceCreate": "強制新建",
|
||||
"shippingNoticeDuplicateForceCreateHint": "需要權限與原因,將寫入審計。",
|
||||
"shippingNoticeDuplicateReasonLabel": "強制新建原因",
|
||||
"shippingNoticeDuplicateReasonPlaceholder": "請說明為何必須新建獨立任務",
|
||||
"shippingNoticeDuplicateReasonRequired": "強制新建必須填寫原因。",
|
||||
"shippingNoticeDuplicateForceForbidden": "無權強制新建重複發貨通知。",
|
||||
"shippingNoticeDuplicateActionUnavailable": "目前不可選擇該處理方式。",
|
||||
"shippingNoticeDuplicateRemoveFile": "取消目前檔案",
|
||||
"shippingNoticeDuplicateConfirm": "確認處理方式",
|
||||
"shippingNoticeDuplicateHandle": "處理重複",
|
||||
"shippingNoticeDuplicateBlockingBadge": "偵測到重複",
|
||||
"shippingNoticeDuplicatePossibleBadge": "疑似重複",
|
||||
"shippingNoticeDuplicateRevisionChosen": "將建立修訂版本",
|
||||
"shippingNoticeDuplicateForceChosen": "已授權強制新建",
|
||||
"shippingNoticeDuplicateOpenChosen": "將開啟已有任務",
|
||||
"shippingNoticeDuplicateResolved": "重複處理方式已儲存。",
|
||||
"shippingNoticeDuplicateResolveFailed": "儲存重複處理方式失敗。",
|
||||
"shippingInventoryUploadFailed": "庫存檔案上傳失敗。",
|
||||
"shippingNoticeRefreshDone": "已重新整理目前任務狀態。",
|
||||
"shippingNoticeRetryUploadAction": "重試上傳貨代",
|
||||
@@ -185,6 +219,8 @@
|
||||
"diagnosisInventorySourceAdvice": "請從候選清單選擇庫存源,或直接輸入目的地/倉庫線索(如 AWSDU、Dublin)後確認。",
|
||||
"diagnosisInventorySourceAmbiguousTitle": "匹配到多個候選庫存源,無法自動判定。",
|
||||
"diagnosisInventorySourceAmbiguousAdvice": "請明確選擇正式庫存源編碼;確認後系統將自動產生站點與倉庫參數。",
|
||||
"diagnosisIssuesTitle": "文件解析階段發現 {count} 個待處理問題",
|
||||
"diagnosisIssuesAdvice": "請按列表逐項處理;解析有誤請先確認或重新解析,通過後再處理庫存源。",
|
||||
"blockedInventorySource": "庫存源待確認",
|
||||
"suggestConfirmInventorySource": "選擇或輸入庫存源後確認",
|
||||
"inventorySource": {
|
||||
|
||||
@@ -49,8 +49,18 @@
|
||||
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "發貨通知接入記錄不存在。",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "發貨通知仍在解析中,請稍後再確認建單。",
|
||||
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "發貨通知解析失敗,請重試或移除後重新上傳。",
|
||||
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "發貨通知附件解析不完整,請重試解析或移除後重新上傳。",
|
||||
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "發貨通知接入記錄已被消費。",
|
||||
"SHIPPING_NOTICE_INTAKE_EXPIRED": "發貨通知接入記錄已過期。",
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "目前接入狀態不允許此操作。"
|
||||
"SHIPPING_NOTICE_INTAKE_INVALID_STATUS": "目前接入狀態不允許此操作。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_RESOLUTION_REQUIRED": "偵測到重複發貨通知,請先選擇處理方式。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_NOT_FOUND": "重複目標任務不存在或不在命中列表中。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_TARGET_CHANGED": "目標任務狀態已變化,請重新確認。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_REASON_REQUIRED": "強制新建必須填寫原因。",
|
||||
"SHIPPING_NOTICE_DUPLICATE_OVERRIDE_FORBIDDEN": "無權強制新建重複發貨通知。",
|
||||
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "修訂目標任務無效。",
|
||||
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "該任務已有後續修訂版本。",
|
||||
"SHIPPING_NOTICE_REVISION_CONFLICT": "目標任務已有修訂版本,請打開已有修訂或重新檢測。",
|
||||
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "無法產生可靠業務指紋,將僅按檔案去重。"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user