feat(shipping-notice): 增强发货通知候选管理功能,支持候选选择、重复检测与业务摘要修订

This commit is contained in:
hugo committed 2026-07-15 11:57:04 +08:00
1 parent 70f684b94a
commit b595e157e9
83 files changed
+5857 -200

No files matched your search

@@ -540,10 +540,41 @@ export const refreshShippingNoticeDuplicate = (intakeNo: string) =>
{ method: 'POST' },
);
export const updateShippingNoticeCandidate = (
candidateNo: string,
patch: { selected?: boolean; business_summary?: Record<string, unknown> },
) => requestJson<import('../types/shipping.api.types').ShippingNoticeCandidateResponse>(
`/api/workspace/shipping-notice/candidates/${encodeURIComponent(candidateNo)}`,
{
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(patch),
},
);
export const resolveShippingNoticeCandidateDuplicate = (
candidateNo: string,
action: string,
targetTaskNo?: string | null,
reason?: string | null,
) => requestJson<import('../types/shipping.api.types').ShippingNoticeCandidateResponse>(
`/api/workspace/shipping-notice/candidates/${encodeURIComponent(candidateNo)}/duplicate-resolution`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
action,
target_task_no: targetTaskNo || undefined,
reason: reason || undefined,
}),
},
);
export const createWorkspaceShippingBatchFromIntakes = (
intakeNos: string[],
conversationId?: string | null,
idempotencyKey?: string,
candidateNos?: string[],
) =>
requestJson<ShippingCreateBatchFromIntakesResponse>('/api/workspace/shipping-batches/create-from-intakes', {
method: 'POST',
@@ -555,6 +586,7 @@ export const createWorkspaceShippingBatchFromIntakes = (
intake_nos: intakeNos,
conversation_id: conversationId || undefined,
idempotency_key: idempotencyKey,
candidate_nos: candidateNos,
}),
});
@@ -21,6 +21,7 @@ import {
X,
} from 'lucide-vue-next';
import type { PendingAttachment, ShippingNoticePendingAttachment } from '../types/shipping.types';
import ShippingNoticeCandidateReview from './ShippingNoticeCandidateReview.vue';
import {
isBlockingWarning,
isShippingNoticeAttachmentParseIncomplete,
@@ -49,6 +50,7 @@ const props = defineProps<{
isShippingNoticeAgent: boolean;
isMaintenanceAgent?: boolean;
canManageMaintenance?: boolean;
canForceCreateShippingDuplicate?: boolean;
shippingSuggestedPrompt: string;
shippingFocusTaskNo?: string;
shippingFocusReason?: string;
@@ -65,6 +67,9 @@ const emit = defineEmits<{
'remove-attachment': [id: string];
'retry-shipping-notice-attachment': [id: string];
'resolve-shipping-notice-duplicate': [id: string];
'select-shipping-candidate': [candidateNo: string, selected: boolean];
'update-shipping-candidate': [candidateNo: string, businessSummary: Record<string, unknown>, done: (success: boolean) => void];
'resolve-shipping-candidate-duplicate': [candidateNo: string, action: import('../types/shipping.types').ShippingDuplicateAction, targetTaskNo: string | undefined, reason: string | undefined, done: (success: boolean) => void];
'local-files-selected': [event: Event];
'add-remote-url': [url: string];
'shipping-inventory-selected': [event: Event];
@@ -276,6 +281,18 @@ watch(
<X class="h-3.5 w-3.5" />
</button>
</div>
<div v-if="isShippingNoticeAgent" class="space-y-2 px-3 pb-1">
<ShippingNoticeCandidateReview
v-for="a in attachments.filter((item): item is ShippingNoticePendingAttachment => item.kind === 'shipping_notice' && !!item.candidates?.length)"
:key="`candidate-${a.id}`"
:attachment="a"
:can-force-create="!!canForceCreateShippingDuplicate"
@select="(candidateNo, selected) => emit('select-shipping-candidate', candidateNo, selected)"
@update="(candidateNo, summary, done) => emit('update-shipping-candidate', candidateNo, summary, done)"
@resolve-duplicate="(candidateNo, action, targetTaskNo, reason, done) => emit('resolve-shipping-candidate-duplicate', candidateNo, action, targetTaskNo, reason, done)"
/>
</div>
<textarea
ref="textareaRef"
v-model="inputValue"
@@ -319,11 +336,11 @@ watch(
<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' && a.duplicate?.status === 'possible_duplicate' && !a.duplicateResolution?.action"
v-else-if="a.parseStatus === 'parsed' && !a.candidates?.length && 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"
v-else-if="a.parseStatus === 'parsed' && !a.candidates?.length && a.duplicate?.blocking && !a.duplicateResolution?.action"
class="font-medium text-amber-700"
> · {{ t('chat.shippingNoticeDuplicateBlockingBadge') }}</span>
<span
@@ -355,7 +372,7 @@ watch(
</template>
</span>
<button
v-if="a.kind === 'shipping_notice' && a.duplicate?.blocking && !a.duplicateResolution?.action"
v-if="a.kind === 'shipping_notice' && !a.candidates?.length && a.duplicate?.blocking && !a.duplicateResolution?.action"
type="button"
class="text-amber-700 hover:text-amber-800"
:title="t('chat.shippingNoticeDuplicateHandle')"
@@ -276,6 +276,7 @@ watch(() => page.currentAgentId, () => {
:is-shipping-notice-agent="page.isShippingNoticeAgent"
:is-maintenance-agent="isMaintenanceAgentPage"
:can-manage-maintenance="canManageMaintenance"
:can-force-create-shipping-duplicate="page.canForceCreateShippingDuplicate"
:shipping-suggested-prompt="page.shippingSuggestedPrompt"
:shipping-focus-task-no="page.focusedShippingTaskNo"
:shipping-focus-reason="page.shippingFocusReason"
@@ -288,6 +289,9 @@ watch(() => page.currentAgentId, () => {
@remove-attachment="page.removeAttachment"
@retry-shipping-notice-attachment="page.retryShippingNoticeAttachment"
@resolve-shipping-notice-duplicate="page.openShippingDuplicateDialog"
@select-shipping-candidate="page.setShippingCandidateSelected"
@update-shipping-candidate="page.updateShippingCandidateSummary"
@resolve-shipping-candidate-duplicate="page.resolveShippingCandidateDuplicate"
@local-files-selected="page.handleLocalFilesSelected"
@add-remote-url="page.addRemoteUrlAttachment"
@shipping-inventory-selected="page.handleShippingInventorySelected"
@@ -0,0 +1,218 @@
<!--
features/chat/components/ShippingNoticeCandidateReview.vue
用途:展示一封 EML 下的订单候选,并提供选择、结构化修订与重复决策入口。
依赖:shipping.types、Vue I18n。
逻辑:组件维护 PO 与订单行编辑草稿,持久化操作通过事件交给 useShippingNoticeIntakes。
-->
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingDuplicateAction, ShippingNoticePendingAttachment } from '../types/shipping.types';
interface EditableCandidateLine {
source: Record<string, unknown>;
sku: string;
qty: string;
reservation_id: string;
hub_code: string;
uom: string;
}
const props = defineProps<{
attachment: ShippingNoticePendingAttachment;
canForceCreate: boolean;
}>();
const emit = defineEmits<{
select: [candidateNo: string, selected: boolean];
update: [candidateNo: string, businessSummary: Record<string, unknown>, done: (success: boolean) => void];
resolveDuplicate: [candidateNo: string, action: ShippingDuplicateAction, targetTaskNo: string | undefined, reason: string | undefined, done: (success: boolean) => void];
}>();
const { t } = useI18n();
const editingCandidateNo = ref('');
const editError = ref('');
const editPoNumber = ref('');
const editLines = reactive<EditableCandidateLine[]>([]);
const forceReasonCandidateNo = ref('');
const forceReason = ref('');
const submittingCandidateNo = ref('');
const candidates = computed(() => props.attachment.candidates || []);
watch(() => props.attachment.candidates, () => {
if (editingCandidateNo.value && !candidates.value.some((item) => item.candidateNo === editingCandidateNo.value)) {
editingCandidateNo.value = '';
}
});
/** 将 Candidate 摘要投影为业务用户可编辑的 PO、SKU、Qty、Reservation 与 Hub 字段。 */
function startEdit(candidateNo: string): void {
const candidate = candidates.value.find((item) => item.candidateNo === candidateNo);
if (!candidate) return;
const sourceLines = Array.isArray(candidate.businessSummary.lines)
? candidate.businessSummary.lines.filter((item): item is Record<string, unknown> => !!item && typeof item === 'object')
: [];
editingCandidateNo.value = candidateNo;
editPoNumber.value = String(candidate.businessSummary.po_number || candidate.poNumber || '');
editLines.splice(0, editLines.length, ...sourceLines.map((line) => ({
source: { ...line },
sku: String(line.sku || ''),
qty: String(line.qty ?? ''),
reservation_id: String(line.reservation_id || ''),
hub_code: String(line.hub_code || ''),
uom: String(line.uom || 'EA'),
})));
if (!editLines.length) addLine();
editError.value = '';
}
/** 新增一条待修订订单行。 */
function addLine(): void {
editLines.push({ source: {}, sku: '', qty: '', reservation_id: '', hub_code: '', uom: 'EA' });
}
/** 校验所有订单行后提交,不允许空 SKU、非正数数量或空行静默通过。 */
function saveEdit(): void {
const candidate = candidates.value.find((item) => item.candidateNo === editingCandidateNo.value);
if (!candidate || !editLines.length) return;
const normalizedLines = editLines.map((line) => ({
...line.source,
sku: line.sku.trim(),
qty: Number(line.qty),
reservation_id: line.reservation_id.trim() || undefined,
hub_code: line.hub_code.trim() || undefined,
uom: line.uom.trim() || 'EA',
}));
if (normalizedLines.some((line) => !line.sku || !Number.isFinite(line.qty) || line.qty <= 0)) {
editError.value = t('chat.shippingCandidateInvalidLine');
return;
}
submittingCandidateNo.value = candidate.candidateNo;
emit('update', candidate.candidateNo, {
...candidate.businessSummary,
po_number: editPoNumber.value.trim() || null,
lines: normalizedLines,
}, (success) => {
submittingCandidateNo.value = '';
if (success) {
editingCandidateNo.value = '';
editError.value = '';
}
});
}
/** 对当前首个重复目标应用决策;强制新建时要求填写原因。 */
function resolveDuplicate(candidateNo: string, action: ShippingDuplicateAction): void {
const candidate = candidates.value.find((item) => item.candidateNo === candidateNo);
const target = candidate?.duplicate?.matches?.[0]?.taskNo;
if (action === 'force_create') {
forceReasonCandidateNo.value = candidateNo;
forceReason.value = '';
return;
}
submittingCandidateNo.value = candidateNo;
emit('resolveDuplicate', candidateNo, action, target, undefined, () => {
submittingCandidateNo.value = '';
});
}
/** 提交内联强制新建原因,避免浏览器 prompt 丢失上下文或不可访问。 */
function submitForceCreate(candidateNo: string): void {
const candidate = candidates.value.find((item) => item.candidateNo === candidateNo);
const reason = forceReason.value.trim();
if (!candidate || !reason) return;
submittingCandidateNo.value = candidateNo;
emit(
'resolveDuplicate',
candidateNo,
'force_create',
candidate.duplicate?.matches?.[0]?.taskNo,
reason,
(success) => {
submittingCandidateNo.value = '';
if (success) forceReasonCandidateNo.value = '';
},
);
}
</script>
<template>
<div v-if="candidates.length" class="w-full space-y-2 rounded-xl border border-default bg-surface px-3 py-2">
<div class="flex items-center justify-between text-xs">
<span class="font-semibold text-primary">{{ t('chat.shippingCandidateTitle') }}</span>
<span class="text-muted">{{ t('chat.shippingCandidateCount', { count: candidates.length }) }}</span>
</div>
<div v-for="candidate in candidates" :key="candidate.candidateNo" class="rounded-lg border border-default bg-surface-soft p-2 text-xs">
<div class="flex flex-wrap items-center gap-2">
<input
type="checkbox"
:checked="candidate.selected"
:disabled="!!candidate.consumedTaskId"
@change="emit('select', candidate.candidateNo, ($event.target as HTMLInputElement).checked)"
/>
<span class="font-mono text-primary">{{ candidate.candidateNo }}</span>
<span class="font-medium text-secondary">PO {{ candidate.poNumber || '-' }}</span>
<span v-if="candidate.documentFilename" class="max-w-40 truncate text-muted">{{ candidate.documentFilename }}</span>
<span :class="candidate.validationStatus === 'ready' ? 'text-emerald-700' : 'text-amber-700'">
{{ candidate.validationStatus === 'ready' ? t('chat.shippingCandidateReady') : t('chat.shippingCandidateNeedsReview') }}
</span>
<button type="button" class="ml-auto text-brand-700 hover:underline" @click="startEdit(candidate.candidateNo)">
{{ t('chat.shippingCandidateEdit') }}
</button>
</div>
<div v-if="candidate.conflicts.length" class="mt-1 text-amber-700">
{{ t('chat.shippingCandidateConflictCount', { count: candidate.conflicts.length }) }}
</div>
<div v-if="candidate.duplicate?.blocking && !candidate.duplicateResolution" class="mt-2 flex flex-wrap items-center gap-2 text-amber-700">
<span>{{ t('chat.shippingCandidateDuplicate', { task: candidate.duplicate.matches[0]?.taskNo || '-' }) }}</span>
<button
v-if="candidate.duplicate.allowedActions.includes('open_existing')"
type="button"
class="rounded border border-default bg-surface px-2 py-0.5"
@click="resolveDuplicate(candidate.candidateNo, 'open_existing')"
>{{ t('chat.shippingNoticeDuplicateOpenExisting') }}</button>
<button
v-if="candidate.duplicate.allowedActions.includes('create_revision')"
type="button"
class="rounded border border-default bg-surface px-2 py-0.5"
@click="resolveDuplicate(candidate.candidateNo, 'create_revision')"
>{{ t('chat.shippingNoticeDuplicateCreateRevision') }}</button>
<button
v-if="canForceCreate && candidate.duplicate.allowedActions.includes('force_create')"
type="button"
class="rounded border border-amber-300 bg-surface px-2 py-0.5"
@click="resolveDuplicate(candidate.candidateNo, 'force_create')"
>{{ t('chat.shippingNoticeDuplicateForceCreate') }}</button>
</div>
<div v-if="forceReasonCandidateNo === candidate.candidateNo" class="mt-2 flex gap-2">
<input v-model="forceReason" :placeholder="t('chat.shippingCandidateForceReasonPrompt')" class="min-w-0 flex-1 rounded border border-default bg-surface px-2 py-1" />
<button type="button" class="rounded bg-amber-600 px-2 py-1 text-white disabled:opacity-50" :disabled="!forceReason.trim() || submittingCandidateNo === candidate.candidateNo" @click="submitForceCreate(candidate.candidateNo)">{{ t('chat.shippingNoticeDuplicateConfirm') }}</button>
<button type="button" class="text-muted" @click="forceReasonCandidateNo = ''">{{ t('common.cancel') }}</button>
</div>
<div v-else-if="candidate.duplicateResolution" class="mt-1 text-muted">
{{ t('chat.shippingCandidateDuplicateResolved', { action: candidate.duplicateResolution.action }) }}
</div>
<div v-if="editingCandidateNo === candidate.candidateNo" class="mt-2 space-y-2">
<label class="block">
<span class="text-muted">{{ t('chat.shippingCandidatePoNumber') }}</span>
<input v-model="editPoNumber" class="mt-1 w-full rounded border border-default bg-surface px-2 py-1 text-primary" />
</label>
<div v-for="(line, index) in editLines" :key="index" class="grid grid-cols-2 gap-2 rounded border border-default bg-surface p-2 md:grid-cols-5">
<input v-model="line.sku" :placeholder="t('chat.shippingCandidateSku')" class="rounded border border-default px-2 py-1" />
<input v-model="line.qty" type="number" min="0.0001" step="any" :placeholder="t('chat.shippingCandidateQty')" class="rounded border border-default px-2 py-1" />
<input v-model="line.reservation_id" :placeholder="t('chat.shippingCandidateReservation')" class="rounded border border-default px-2 py-1" />
<input v-model="line.hub_code" :placeholder="t('chat.shippingCandidateHubCode')" class="rounded border border-default px-2 py-1" />
<div class="flex gap-1">
<input v-model="line.uom" :placeholder="t('chat.shippingCandidateUom')" class="min-w-0 flex-1 rounded border border-default px-2 py-1" />
<button v-if="editLines.length > 1" type="button" class="text-red-600" @click="editLines.splice(index, 1)">×</button>
</div>
</div>
<button type="button" class="text-brand-700 hover:underline" @click="addLine">{{ t('chat.shippingCandidateAddLine') }}</button>
<div v-if="editError" class="text-red-600">{{ editError }}</div>
<div class="flex justify-end gap-2">
<button type="button" class="rounded px-2 py-1 text-secondary" @click="editingCandidateNo = ''">{{ t('common.cancel') }}</button>
<button type="button" class="rounded bg-brand-600 px-2 py-1 text-white disabled:opacity-50" :disabled="submittingCandidateNo === candidate.candidateNo" @click="saveEdit">{{ t('chat.shippingCandidateSave') }}</button>
</div>
</div>
</div>
</div>
</template>
@@ -433,7 +433,7 @@ export function useChat() {
| { type: 'image' | 'document' | 'audio' | 'video' | 'custom'; transfer_method: 'local_file'; upload_file_id: string }
| { type: 'image' | 'document' | 'audio' | 'video' | 'custom'; transfer_method: 'remote_url'; url: string }
>,
context?: { task_id?: string; batch_no?: string; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
hooks?: SendMessageLifecycleHooks,
) => {
const displayQuery = String(context?.display_query || query || '').trim();
@@ -495,6 +495,7 @@ export function useChat() {
files: files && files.length > 0 ? files : undefined,
task_id: context?.task_id || undefined,
batch_no: context?.batch_no || undefined,
shipping_intake_nos: context?.shipping_intake_nos?.length ? context.shipping_intake_nos : undefined,
display_query: context?.display_query || undefined,
}),
});
@@ -551,6 +551,9 @@ export function useChatPage() {
attachmentApi.removeAttachment(id);
},
retryShippingNoticeAttachment: shipping.retryShippingNoticeAttachment,
setShippingCandidateSelected: shipping.setShippingCandidateSelected,
updateShippingCandidateSummary: shipping.updateShippingCandidateSummary,
resolveShippingCandidateDuplicate: shipping.resolveShippingCandidateDuplicate,
showShippingDuplicateDialog: shipping.showShippingDuplicateDialog,
shippingDuplicateAttachment: shipping.shippingDuplicateAttachment,
canForceCreateShippingDuplicate: shipping.canForceCreateShippingDuplicate,
@@ -93,7 +93,7 @@ export interface UseChatShippingOptions {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
hooks?: { onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void> },
) => Promise<void>;
startChatTurn: (options: import('../types/chat-turn.types').StartChatTurnOptions) => Promise<boolean>;
@@ -429,6 +429,7 @@ export function useChatShipping(options: UseChatShippingOptions) {
const getCurrentShippingChatContext = () => ({
task_id: getActiveBatchTaskId() || getActiveShippingTaskId(),
batch_no: getActiveShippingBatchNo(),
shipping_intake_nos: shippingIntakes.getParsedIntakeNos(),
});
const getCurrentShippingChatContextWithDisplay = (displayQuery: string) => ({
@@ -561,6 +562,8 @@ export function useChatShipping(options: UseChatShippingOptions) {
*/
const finalizeShippingAssistantMessage = async () => {
if (!isShippingNoticeAgent.value) return;
await shippingIntakes.refreshStatuses();
shippingIntakes.clearConsumedAttachments();
await refreshShippingActions();
};
@@ -730,6 +733,49 @@ export function useChatShipping(options: UseChatShippingOptions) {
shippingDuplicateAttachmentId.value = null;
};
/** 更新 Candidate 选择状态,并将 API 失败统一反馈给用户。 */
const setShippingCandidateSelected = async (candidateNo: string, selected: boolean) => {
try {
await shippingIntakes.setCandidateSelected(candidateNo, selected);
} catch (error: unknown) {
msg.warning(error instanceof Error ? error.message : t('chat.shippingCandidateUpdateFailed'));
}
};
/** 保存 Candidate 结构化修订,并保留服务端校验错误。 */
const updateShippingCandidateSummary = async (
candidateNo: string,
businessSummary: Record<string, unknown>,
done?: (success: boolean) => void,
) => {
try {
await shippingIntakes.updateCandidateSummary(candidateNo, businessSummary);
msg.success(t('chat.shippingCandidateUpdateDone'));
done?.(true);
} catch (error: unknown) {
msg.warning(error instanceof Error ? error.message : t('chat.shippingCandidateUpdateFailed'));
done?.(false);
}
};
/** 保存 Candidate 重复决策,并统一展示权限或目标漂移错误。 */
const resolveShippingCandidateDuplicate = async (
candidateNo: string,
action: import('../types/shipping.types').ShippingDuplicateAction,
targetTaskNo?: string,
reason?: string,
done?: (success: boolean) => void,
) => {
try {
await shippingIntakes.resolveCandidateDuplicate(candidateNo, action, targetTaskNo, reason);
msg.success(t('chat.shippingNoticeDuplicateResolved'));
done?.(true);
} catch (error: unknown) {
msg.warning(error instanceof Error ? error.message : t('chat.shippingNoticeDuplicateResolveFailed'));
done?.(false);
}
};
const {
handleShippingAutoUploadFile,
handleShippingAutoUploadNoticeBatch,
@@ -763,6 +809,7 @@ export function useChatShipping(options: UseChatShippingOptions) {
startChatTurn,
refreshShippingActions,
getParsedIntakeNos: shippingIntakes.getParsedIntakeNos,
getSelectedCandidateNos: shippingIntakes.getSelectedCandidateNos,
clearConsumedNoticeAttachments: shippingIntakes.clearConsumedAttachments,
msg,
t,
@@ -819,8 +866,12 @@ export function useChatShipping(options: UseChatShippingOptions) {
hasBlockingNoticeIntake: () => shippingIntakes.hasBlockingUploadOrParse.value,
hasNoticeIntakeFailures: () => shippingIntakes.hasParseFailures.value,
hasBlockingNoticeDuplicates: () => shippingIntakes.hasBlockingDuplicates.value,
hasCandidateReviewIssues: () => shippingIntakes.hasCandidateReviewIssues.value,
hasSelectedNoticeCandidates: () => shippingIntakes.getSelectedCandidateNos().length > 0,
openShippingDuplicateDialog,
getParsedIntakeNos: shippingIntakes.getParsedIntakeNos,
refreshNoticeIntakeStatuses: shippingIntakes.refreshStatuses,
clearConsumedNoticeAttachments: shippingIntakes.clearConsumedAttachments,
refreshShippingActions,
shippingSuggestedPrompt,
isShippingShortageQueryIntent,
@@ -1132,6 +1183,10 @@ export function useChatShipping(options: UseChatShippingOptions) {
handleShippingLocalFilesSelected,
removeShippingNoticeAttachment: shippingIntakes.removeNoticeAttachment,
retryShippingNoticeAttachment: shippingIntakes.retryNoticeAttachment,
shippingNoticeAllReadyForConfirmation: shippingIntakes.allReadyForConfirmation,
setShippingCandidateSelected,
updateShippingCandidateSummary,
resolveShippingCandidateDuplicate,
showShippingDuplicateDialog,
shippingDuplicateAttachment,
canForceCreateShippingDuplicate,
@@ -48,7 +48,7 @@ export interface ChatPageSendContext {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
hooks?: { onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void> },
) => Promise<void>;
refreshHistoryAfterSend: () => Promise<void>;
@@ -69,7 +69,7 @@ export interface ChatPageSendContext {
msg: { warning: (text: string) => void; info: (text: string) => void };
t: (key: string) => string;
copiedIndex: Ref<number | null>;
getChatContext?: () => { task_id?: string; batch_no?: string; display_query?: string };
getChatContext?: () => { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string };
onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void>;
}
@@ -3,7 +3,7 @@
* 用途:验证建批 Chat Turn payload 包含幂等键与会话映射。
*/
import { describe, expect, it } from 'vitest';
import { buildShippingCreateBatchTurn } from './shippingTurnActions';
import { buildShippingCreateBatchFromIntakesTurn, buildShippingCreateBatchTurn } from './shippingTurnActions';
describe('shippingTurnActions', () => {
it('buildShippingCreateBatchTurn includes idempotency_key in payload', () => {
@@ -19,4 +19,17 @@ describe('shippingTurnActions', () => {
expect(turn.payload.idempotency_key).toBe('idem-key-001');
expect(turn.files).toEqual(files);
});
it('buildShippingCreateBatchFromIntakesTurn includes selected candidate_nos', () => {
const turn = buildShippingCreateBatchFromIntakesTurn(
['SNI-001'],
'conv-001',
'idem-candidate-001',
['SNC-001', 'SNC-003'],
);
expect(turn.actionType).toBe('shipping.create_batch_from_intakes');
expect(turn.payload.intake_nos).toEqual(['SNI-001']);
expect(turn.payload.candidate_nos).toEqual(['SNC-001', 'SNC-003']);
});
});
@@ -103,6 +103,7 @@ export function buildShippingCreateBatchFromIntakesTurn(
intakeNos: string[],
conversationId?: string | null,
idempotencyKey?: string,
candidateNos?: string[],
): { actionType: string; displayText: string; payload: Record<string, unknown> } {
const count = intakeNos.length;
const displayText = count === 1
@@ -115,6 +116,7 @@ export function buildShippingCreateBatchFromIntakesTurn(
intake_nos: intakeNos,
conversation_id: conversationId || undefined,
idempotency_key: idempotencyKey,
candidate_nos: candidateNos,
},
};
}
@@ -1,6 +1,6 @@
/**
* features/chat/shipping/useChatShippingSendHandler.spec.ts
* 用途:验证建批提交中发送拦截不会回退到普通聊天发送。
* 用途:验证上传预处理与点击发送完整抽取链路,以及建批提交中的并发拦截。
*/
import { computed, ref } from 'vue';
import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -71,4 +71,80 @@ describe('useChatShippingSendHandler', () => {
expect(ctx.handleShippingAutoUploadNoticeBatch).not.toHaveBeenCalled();
expect(ctx.msg.info).toHaveBeenCalledWith('chat.shippingNoticeBatchSubmitting');
});
it('sends parsed intakes to the existing Chatflow without requiring upload-time candidates', async () => {
const attachment = {
id: 'notice-1',
kind: 'shipping_notice' as const,
type: 'document' as const,
uploadStatus: 'uploaded' as const,
parseStatus: 'parsed' as const,
uploadProgress: 100,
originalFilename: 'orders.eml',
fileSize: 100,
intakeNo: 'SNI-1',
};
const ctx = createContext({
attachments: ref([attachment]),
hasCandidateReviewIssues: () => true,
hasSelectedNoticeCandidates: () => true,
getParsedIntakeNos: () => ['SNI-1'],
refreshNoticeIntakeStatuses: vi.fn(async () => undefined),
clearConsumedNoticeAttachments: vi.fn(),
});
const { tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers(ctx);
const consumed = await tryHandleShippingAttachmentAutoFlow(undefined, '', '');
expect(consumed).toBe(true);
expect(ctx.handleShippingAutoUploadNoticeBatch).not.toHaveBeenCalled();
expect(ctx.sendMessage).toHaveBeenCalledWith(
'chat.shippingOrderExtractionDefaultPrompt',
1,
'',
[],
{
shipping_intake_nos: ['SNI-1'],
display_query: 'chat.shippingOrderExtractionDefaultPrompt',
},
expect.objectContaining({ onAssistantMessageFinished: expect.any(Function) }),
);
});
it('uses the user query for full extraction even when no candidate exists before send', async () => {
const attachment = {
id: 'notice-1',
kind: 'shipping_notice' as const,
type: 'document' as const,
uploadStatus: 'uploaded' as const,
parseStatus: 'parsed' as const,
uploadProgress: 100,
originalFilename: 'orders.eml',
fileSize: 100,
intakeNo: 'SNI-1',
};
const ctx = createContext({
attachments: ref([attachment]),
hasCandidateReviewIssues: () => false,
hasSelectedNoticeCandidates: () => false,
getParsedIntakeNos: () => ['SNI-1'],
});
const { tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers(ctx);
const consumed = await tryHandleShippingAttachmentAutoFlow(undefined, '请解析这些附件', '请解析这些附件');
expect(consumed).toBe(true);
expect(ctx.handleShippingAutoUploadNoticeBatch).not.toHaveBeenCalled();
expect(ctx.sendMessage).toHaveBeenCalledWith(
'请解析这些附件',
1,
'',
[],
{
shipping_intake_nos: ['SNI-1'],
display_query: '请解析这些附件',
},
expect.objectContaining({ onAssistantMessageFinished: expect.any(Function) }),
);
});
});
@@ -1,8 +1,8 @@
/**
* features/chat/shipping/useChatShippingSendHandler.ts
* 用途:在聊天发送前拦截发货通知专属意图,如切票、决策文本、列映射和附件自动流程。
* 用途:在聊天发送前拦截发货通知专属意图,如订单抽取、切票、决策文本、列映射和附件自动流程。
* 依赖:shipping.api、shippingIntents、shippingMenu、shippingMapping、shippingDownload、chat.types。
* 逻辑:业务动作经 Chat Turn / handleShippingMenuAction;纯 UI(下载/选文件/映射卡片)保留本地或客户端行为。
* 逻辑:已预处理 Intake 通过普通聊天接口进入现有 Dify Chatflow;其他业务动作经 Chat Turn / handleShippingMenuAction。
*/
import {
getWorkspaceShippingBatch,
@@ -50,6 +50,8 @@ export interface ShippingSendHandlerContext {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
hooks?: { onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void> },
) => Promise<void>;
buildFileSpecsForSend: () => Promise<ChatUploadFileSpec[]>;
loadHistory: () => Promise<void>;
@@ -65,8 +67,12 @@ export interface ShippingSendHandlerContext {
hasBlockingNoticeIntake?: () => boolean;
hasNoticeIntakeFailures?: () => boolean;
hasBlockingNoticeDuplicates?: () => boolean;
hasCandidateReviewIssues?: () => boolean;
hasSelectedNoticeCandidates?: () => boolean;
openShippingDuplicateDialog?: (attachmentId?: string) => void;
getParsedIntakeNos?: () => string[];
refreshNoticeIntakeStatuses?: () => Promise<void>;
clearConsumedNoticeAttachments?: () => void;
refreshShippingActions: () => Promise<void>;
shippingSuggestedPrompt: ComputedRef<string>;
isShippingShortageQueryIntent: (text: string) => boolean;
@@ -78,7 +84,7 @@ export interface ShippingSendHandlerContext {
/**
* 创建发货通知发送拦截器。
*
* 核心逻辑:识别切换任务、数字菜单、决策文本、映射文本、上传/导出意图,并在命中时直接走本地前后端流程。
* 核心逻辑:已预处理邮件固定 Intake 上下文后调用普通聊天;其余识别切换任务、数字菜单、决策文本、映射文本、上传/导出意图。
* @param ctx - 发送拦截上下文
* @returns 发送前文本与附件自动流程处理函数;返回 true 表示已消费本次发送
*/
@@ -203,17 +209,30 @@ 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)) {
if (intakeNos.length) {
const query = trimmed || ctx.t('chat.shippingOrderExtractionDefaultPrompt');
ctx.shippingAutoFlowRequested.value = false;
if (typeof textOrEvent !== 'string') ctx.input.value = '';
try {
await ctx.handleShippingAutoUploadNoticeBatch([]);
await ctx.sendMessage(
query,
ctx.currentAgentId.value,
ctx.selectedKb.value,
[],
{
shipping_intake_nos: intakeNos,
display_query: query,
},
{
onAssistantMessageFinished: async () => {
await ctx.refreshNoticeIntakeStatuses?.();
ctx.clearConsumedNoticeAttachments?.();
await ctx.refreshShippingActions();
},
},
);
await ctx.loadHistory();
} catch (e: unknown) {
const errorMessage = e instanceof Error ? e.message : '文件处理失败';
ctx.msg.warning(errorMessage);
@@ -120,6 +120,7 @@ export interface ShippingUploadHandlerContext {
msg: { warning: (text: string) => void };
t: (key: string, params?: Record<string, unknown>) => string;
getParsedIntakeNos?: () => string[];
getSelectedCandidateNos?: () => string[];
clearConsumedNoticeAttachments?: () => void;
}
@@ -310,14 +311,14 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
return ok;
};
const runNoticeBatchFromIntakes = async (intakeNos: string[]) => {
const runNoticeBatchFromIntakes = async (intakeNos: string[], candidateNos: string[]) => {
if (noticeBatchSubmitting) {
return true;
}
noticeBatchSubmitting = true;
try {
const conversationKey = normalizeConversationId(ctx.conversationId.value);
const intakeFingerprint = computeNoticeIntakeNosFingerprint(intakeNos);
const intakeFingerprint = computeNoticeIntakeNosFingerprint([...intakeNos, ...candidateNos]);
if (pendingNoticeBatchRetry) {
reconcilePendingNoticeBatchConversation(pendingNoticeBatchRetry, conversationKey);
}
@@ -337,7 +338,12 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
pendingNoticeBatchRetry.fileFingerprint = intakeFingerprint;
}
const idempotencyKey = pendingNoticeBatchRetry.idempotencyKey;
const turn = buildShippingCreateBatchFromIntakesTurn(intakeNos, ctx.conversationId.value, idempotencyKey);
const turn = buildShippingCreateBatchFromIntakesTurn(
intakeNos,
ctx.conversationId.value,
idempotencyKey,
candidateNos,
);
const ok = await ctx.startChatTurn({
agentId: ctx.currentAgentId.value,
inputType: 'upload_followup',
@@ -402,8 +408,9 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
const handleShippingAutoUploadNoticeBatch = async (files: File[]) => {
const noticeFiles = files.filter(Boolean);
const intakeNos = ctx.getParsedIntakeNos?.() || [];
const candidateNos = ctx.getSelectedCandidateNos?.() || [];
if (!noticeFiles.length && intakeNos.length) {
await runNoticeBatchFromIntakes(intakeNos);
await runNoticeBatchFromIntakes(intakeNos, candidateNos);
return;
}
if (!noticeFiles.length) return;
@@ -13,15 +13,18 @@ import type {
ShippingDuplicateResult,
ShippingNoticeParseSummary,
ShippingNoticePendingAttachment,
ShippingNoticeCandidate,
} from '../types/shipping.types';
import type { ShippingNoticeIntakeResponse } from '../types/shipping.api.types';
import type { ShippingNoticeCandidateResponse, ShippingNoticeIntakeResponse } from '../types/shipping.api.types';
import {
cancelShippingNoticeIntake,
createShippingNoticeIntake,
getShippingNoticeIntakeStatuses,
listActiveShippingNoticeIntakes,
resolveShippingNoticeDuplicate,
resolveShippingNoticeCandidateDuplicate,
retryShippingNoticeIntake,
updateShippingNoticeCandidate,
} from '@/features/chat/api/shipping.api';
import { isShippingNoticeAttachmentParseIncomplete } from './shippingNoticeAttachmentIntegrity';
@@ -82,6 +85,44 @@ function listSafe(value: unknown): string[] {
return Array.isArray(value) ? value.map((item) => String(item)) : [];
}
/** 将 Candidate API 契约映射为输入区可审核状态。 */
function mapServerCandidate(remote: ShippingNoticeCandidateResponse): ShippingNoticeCandidate {
const duplicate = remote.duplicate
? {
status: remote.duplicate.status,
blocking: Boolean(remote.duplicate.blocking),
fingerprintStrength: remote.duplicate.fingerprint_strength,
matches: (remote.duplicate.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: (remote.duplicate.allowed_actions || []) as ShippingDuplicateAction[],
}
: undefined;
return {
candidateNo: remote.candidate_no,
poNumber: remote.po_number || undefined,
documentFilename: remote.primary_document_filename || undefined,
validationStatus: remote.validation_status,
selected: Boolean(remote.selected),
conflicts: remote.conflicts || [],
businessSummary: remote.business_summary || {},
duplicate,
duplicateResolution: remote.duplicate_resolution
? {
action: remote.duplicate_resolution.action,
targetTaskNo: remote.duplicate_resolution.target_task_no || undefined,
reason: remote.duplicate_resolution.reason || undefined,
}
: undefined,
consumedTaskId: remote.consumed_task_id || undefined,
};
}
function createPendingAttachment(file: File): ShippingNoticePendingAttachment {
return {
id: `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
@@ -142,12 +183,28 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
const hasBlockingDuplicates = computed(() =>
noticeAttachments.value.some(
(item) => item.duplicate?.blocking && !item.duplicateResolution?.action,
(item) => (item.candidates?.length
? item.candidates.some((candidate) =>
candidate.selected && candidate.duplicate?.blocking && !candidate.duplicateResolution?.action,
)
: item.duplicate?.blocking && !item.duplicateResolution?.action),
),
);
const hasCandidateReviewIssues = computed(() =>
noticeAttachments.value.some((item) =>
(item.candidates || []).some((candidate) =>
candidate.selected && candidate.validationStatus !== 'ready',
),
),
);
const allReadyForConfirmation = computed(() =>
allParsedReady.value && !hasBlockingDuplicates.value && !hasParseFailures.value,
allParsedReady.value
&& !hasBlockingDuplicates.value
&& !hasCandidateReviewIssues.value
&& !hasParseFailures.value
&& noticeAttachments.value.some((item) => (item.candidates || []).some((candidate) => candidate.selected)),
);
const stopPolling = () => {
@@ -198,12 +255,15 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
if (!local) continue;
patchAttachment(local.id, {
parseStatus: mapServerParseStatus(remote.parse_status),
orderExtractionStatus: remote.order_extraction_status || undefined,
orderExtractionVersion: remote.order_extraction_version || undefined,
parseSummary: (remote.parse_summary || undefined) as ShippingNoticeParseSummary | undefined,
errorCode: remote.error_code || undefined,
errorMessage: remote.error_message || undefined,
errorCode: remote.order_extraction_error_code || remote.error_code || undefined,
errorMessage: remote.order_extraction_error_message || remote.error_message || undefined,
expiresAt: remote.expires_at || undefined,
assetNo: remote.asset_no || local.assetNo,
...mapServerDuplicate(remote),
candidates: (remote.candidates || []).map(mapServerCandidate),
});
}
};
@@ -226,10 +286,14 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
patchAttachment(attachment.id, {
intakeNo: intake.intake_no,
parseStatus: mapServerParseStatus(intake.parse_status),
orderExtractionStatus: intake.order_extraction_status || undefined,
orderExtractionVersion: intake.order_extraction_version || undefined,
parseSummary: (intake.parse_summary || undefined) as ShippingNoticeParseSummary | undefined,
errorCode: intake.error_code || undefined,
errorMessage: intake.error_message || undefined,
errorCode: intake.order_extraction_error_code || intake.error_code || undefined,
errorMessage: intake.order_extraction_error_message || intake.error_message || undefined,
expiresAt: intake.expires_at || undefined,
...mapServerDuplicate(intake),
candidates: (intake.candidates || []).map(mapServerCandidate),
});
schedulePoll();
} catch (error) {
@@ -294,8 +358,10 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
.map((item) => String(item.intakeNo));
const clearConsumedAttachments = () => {
options.attachments.value = options.attachments.value.filter((item) => item.kind !== 'shipping_notice');
stopPolling();
options.attachments.value = options.attachments.value.filter(
(item) => item.kind !== 'shipping_notice' || item.parseStatus !== 'consumed',
);
if (!noticeAttachments.value.length) stopPolling();
};
const restoreForConversation = async (conversationId?: string | null) => {
@@ -311,14 +377,17 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
intakeNo: item.intake_no,
uploadStatus: 'uploaded' as const,
parseStatus: mapServerParseStatus(item.parse_status),
orderExtractionStatus: item.order_extraction_status || undefined,
orderExtractionVersion: item.order_extraction_version || undefined,
uploadProgress: 100,
originalFilename: item.original_filename || item.intake_no,
fileSize: Number(item.file_size || 0),
parseSummary: (item.parse_summary || undefined) as ShippingNoticeParseSummary | undefined,
errorCode: item.error_code || undefined,
errorMessage: item.error_message || undefined,
errorCode: item.order_extraction_error_code || item.error_code || undefined,
errorMessage: item.order_extraction_error_message || item.error_message || undefined,
expiresAt: item.expires_at || undefined,
...mapServerDuplicate(item),
...mapServerDuplicate(item),
candidates: (item.candidates || []).map(mapServerCandidate),
}));
const nonNotice = options.attachments.value.filter((item) => item.kind !== 'shipping_notice');
options.attachments.value = [...nonNotice, ...restored];
@@ -347,6 +416,56 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
});
};
/** 切换 Candidate 是否参与本次建批。 */
const setCandidateSelected = async (candidateNo: string, selected: boolean) => {
const remote = await updateShippingNoticeCandidate(candidateNo, { selected });
for (const attachment of noticeAttachments.value) {
if (!(attachment.candidates || []).some((item) => item.candidateNo === candidateNo)) continue;
patchAttachment(attachment.id, {
candidates: (attachment.candidates || []).map((item) =>
item.candidateNo === candidateNo ? mapServerCandidate(remote) : item,
),
});
}
};
/** 保存 Candidate 人工修订后的订单摘要。 */
const updateCandidateSummary = async (candidateNo: string, businessSummary: Record<string, unknown>) => {
const remote = await updateShippingNoticeCandidate(candidateNo, { business_summary: businessSummary });
for (const attachment of noticeAttachments.value) {
if (!(attachment.candidates || []).some((item) => item.candidateNo === candidateNo)) continue;
patchAttachment(attachment.id, {
candidates: (attachment.candidates || []).map((item) =>
item.candidateNo === candidateNo ? mapServerCandidate(remote) : item,
),
});
}
};
/** 保存单个 Candidate 的重复处理决策。 */
const resolveCandidateDuplicate = async (
candidateNo: string,
action: ShippingDuplicateAction,
targetTaskNo?: string,
reason?: string,
) => {
const remote = await resolveShippingNoticeCandidateDuplicate(candidateNo, action, targetTaskNo, reason);
for (const attachment of noticeAttachments.value) {
if (!(attachment.candidates || []).some((item) => item.candidateNo === candidateNo)) continue;
patchAttachment(attachment.id, {
candidates: (attachment.candidates || []).map((item) =>
item.candidateNo === candidateNo ? mapServerCandidate(remote) : item,
),
});
}
};
const getSelectedCandidateNos = () => noticeAttachments.value.flatMap((item) =>
(item.candidates || [])
.filter((candidate) => candidate.selected)
.map((candidate) => candidate.candidateNo),
);
onBeforeUnmount(() => {
stopPolling();
});
@@ -357,12 +476,18 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
hasParseFailures,
allParsedReady,
hasBlockingDuplicates,
hasCandidateReviewIssues,
allReadyForConfirmation,
enqueueNoticeFiles,
removeNoticeAttachment,
retryNoticeAttachment,
resolveDuplicateAttachment,
resolveCandidateDuplicate,
setCandidateSelected,
updateCandidateSummary,
getParsedIntakeNos,
getSelectedCandidateNos,
refreshStatuses,
clearConsumedAttachments,
restoreForConversation,
stopPolling,
@@ -81,6 +81,7 @@ export interface ShippingTaskSummary {
line_results?: ShippingMatchLineResult[];
step_payload?: Record<string, unknown> & {
current_step_progress?: ShippingCurrentStepProgress;
parse_validation?: ShippingParseValidation;
};
rpa_runtime?: ShippingRpaRuntime | null;
rpa_inventory_source?: Record<string, unknown> | null;
@@ -138,6 +139,25 @@ export interface ShippingCurrentStepProgress {
extra?: Record<string, unknown>;
}
export interface ShippingParseIssue {
line_index?: number;
sku?: string | null;
field: string;
reason: 'missing' | 'invalid_format' | 'source_conflict' | 'value_corrected' | string;
severity: 'blocking' | 'info' | string;
raw_value?: string | null;
resolved_value?: string | null;
resolution_basis?: string | null;
evidence_values?: string[];
}
export interface ShippingParseValidation {
status: 'ready' | 'needs_review' | string;
issues: ShippingParseIssue[];
contract_version?: string;
resolution_source?: string;
}
export interface ShippingNoticeHeader {
customer_name?: string | null;
customer_code?: string | null;
@@ -320,6 +340,10 @@ export interface ShippingNoticeIntakeResponse {
conversation_id?: string | null;
parse_status: string;
parser_version?: string;
order_extraction_status?: string | null;
order_extraction_version?: string | null;
order_extraction_error_code?: string | null;
order_extraction_error_message?: string | null;
parse_summary?: Record<string, unknown> | null;
business_summary?: Record<string, unknown> | null;
business_fingerprint?: string | null;
@@ -343,6 +367,37 @@ export interface ShippingNoticeIntakeResponse {
original_filename?: string;
file_size?: number;
content_hash?: string;
documents?: ShippingNoticeDocumentResponse[];
candidates?: ShippingNoticeCandidateResponse[];
document_count?: number;
candidate_count?: number;
}
export interface ShippingNoticeDocumentResponse {
id: number;
document_type: string;
filename?: string | null;
classification: string;
parse_status: string;
warnings?: string[];
}
export interface ShippingNoticeCandidateResponse {
candidate_no: string;
primary_document_id?: number;
primary_document_filename?: string | null;
po_number?: string | null;
validation_status: string;
selected: boolean;
conflicts?: Array<Record<string, unknown>>;
business_summary?: Record<string, unknown> | null;
duplicate?: ShippingDuplicateResult | null;
duplicate_resolution?: {
action: ShippingDuplicateAction;
target_task_no?: string | null;
reason?: string | null;
} | null;
consumed_task_id?: number | null;
}
export type ShippingDuplicateStatus =
@@ -351,7 +406,10 @@ export type ShippingDuplicateStatus =
| 'exact_file'
| 'same_active_task'
| 'same_completed_task'
| 'possible_duplicate';
| 'possible_duplicate'
| 'same_business_content'
| 'possible_revision'
| 'partial_duplicate';
export type ShippingDuplicateAction = 'open_existing' | 'create_revision' | 'force_create';
@@ -32,7 +32,10 @@ export type ShippingDuplicateStatus =
| 'exact_file'
| 'same_active_task'
| 'same_completed_task'
| 'possible_duplicate';
| 'possible_duplicate'
| 'same_business_content'
| 'possible_revision'
| 'partial_duplicate';
export interface ShippingDuplicateMatch {
taskNo: string;
@@ -57,6 +60,19 @@ export interface ShippingDuplicateResolution {
reason?: string;
}
export interface ShippingNoticeCandidate {
candidateNo: string;
poNumber?: string;
documentFilename?: string;
validationStatus: string;
selected: boolean;
conflicts: Array<Record<string, unknown>>;
businessSummary: Record<string, unknown>;
duplicate?: ShippingDuplicateResult;
duplicateResolution?: ShippingDuplicateResolution;
consumedTaskId?: number;
}
export interface ShippingNoticeParseAttachmentSummary {
attachment_key?: string;
filename?: string;
@@ -113,11 +129,14 @@ export type ShippingNoticePendingAttachment = {
originalFilename: string;
fileSize: number;
parseSummary?: ShippingNoticeParseSummary;
orderExtractionStatus?: string;
orderExtractionVersion?: string;
errorCode?: string;
errorMessage?: string;
expiresAt?: string;
duplicate?: ShippingDuplicateResult;
duplicateResolution?: ShippingDuplicateResolution;
candidates?: ShippingNoticeCandidate[];
};
/** 待发送附件(本地文件、远程 URL 或货代通知预解析) */
@@ -130,6 +130,13 @@ const detailStepDetail = computed(() =>
const detailErrorMessage = computed(() =>
sanitizeShippingRuntimeStatusText(String(detail.value?.error_message || '').trim()),
);
const detailIssues = computed(() => (
Array.isArray(detail.value?.ui_state?.summary?.issues)
? detail.value.ui_state.summary.issues
.map((item) => sanitizeShippingRuntimeStatusText(String(item || '').trim()))
.filter(Boolean)
: []
));
const inventorySnapshotLabel = (triggerType?: string | null) => {
const key = String(triggerType || 'on_demand');
@@ -489,6 +496,10 @@ onMounted(async () => {
{{ detailErrorMessage }}
</div>
<div v-if="detailIssues.length" class="rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-800">
<div v-for="issue in detailIssues" :key="issue" class="py-0.5">{{ issue }}</div>
</div>
<ShippingMatchResultCard
v-if="hasMatchCard"
:task-id="detail.task_no"
+23
View File
@@ -68,6 +68,29 @@
"shippingNoticeDuplicateOpenChosen": "Will open existing task",
"shippingNoticeDuplicateResolved": "Duplicate resolution saved.",
"shippingNoticeDuplicateResolveFailed": "Failed to save duplicate resolution.",
"shippingCandidateTitle": "Order candidate review",
"shippingCandidateCount": "{count} orders",
"shippingCandidateReady": "Ready",
"shippingCandidateNeedsReview": "Needs review",
"shippingCandidateEdit": "Edit",
"shippingCandidateSave": "Save changes",
"shippingCandidateConflictCount": "{count} field conflicts must be corrected before task creation.",
"shippingCandidateDuplicate": "Matches existing task {task}",
"shippingCandidateDuplicateResolved": "Duplicate action selected: {action}",
"shippingCandidateForceReasonPrompt": "Enter the reason for force creation",
"shippingCandidateReviewRequired": "A selected order candidate still needs review. Correct its conflicting fields first.",
"shippingCandidateSelectRequired": "Select at least one order candidate before creating tasks.",
"shippingOrderExtractionDefaultPrompt": "Fully parse the shipping orders in the uploaded email and attachments, then create eligible tasks automatically.",
"shippingCandidateInvalidLine": "Every order line requires a SKU and a quantity greater than zero.",
"shippingCandidatePoNumber": "PO Number",
"shippingCandidateSku": "SKU",
"shippingCandidateQty": "Quantity",
"shippingCandidateReservation": "Reservation ID",
"shippingCandidateHubCode": "Hub Code",
"shippingCandidateUom": "UOM",
"shippingCandidateAddLine": "Add order line",
"shippingCandidateUpdateDone": "Order candidate changes were saved.",
"shippingCandidateUpdateFailed": "Failed to save the order candidate.",
"shippingInventoryUploadFailed": "Inventory upload failed.",
"shippingNoticeRefreshDone": "Current task status refreshed.",
"shippingNoticeRetryUploadAction": "Retry freight upload",
+14 -1
View File
@@ -49,6 +49,8 @@
"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_PARSE_TIMEOUT": "Shipping notice parsing timed out. Retry or remove and upload again.",
"SHIPPING_NOTICE_INTAKE_STAGE2_PERSIST_FAILED": "Saving preprocessed email or attachment documents failed. Retry parsing.",
"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.",
@@ -61,6 +63,17 @@
"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."
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "A reliable business fingerprint could not be generated; only file-hash dedupe applies.",
"SHIPPING_NOTICE_CANDIDATE_NOT_FOUND": "The order candidate was not found.",
"SHIPPING_NOTICE_CANDIDATE_ALREADY_CONSUMED": "The order candidate has already created a task and cannot be changed.",
"SHIPPING_NOTICE_CANDIDATE_NOT_SELECTED": "The order candidate is not selected.",
"SHIPPING_NOTICE_CANDIDATE_REVIEW_REQUIRED": "The order candidate still requires manual review.",
"SHIPPING_NOTICE_CANDIDATE_DOCUMENT_INVALID": "The order candidate's primary attachment is invalid.",
"SHIPPING_NOTICE_CANDIDATE_SELECTION_CHANGED": "The order candidate selection changed. Refresh and try again.",
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "This duplicate action is not allowed for the current state.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "The order extraction context is invalid. Send the current email again.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "Email preprocessing is incomplete or order extraction is still in progress.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "The extracted order result does not match the contract. Parse it again.",
"SHIPPING_NOTICE_CANDIDATE_SOURCE_CHANGED": "The email or attachment content changed. Send it again to re-extract orders."
}
}
+23
View File
@@ -68,6 +68,29 @@
"shippingNoticeDuplicateOpenChosen": "จะเปิดงานที่มีอยู่",
"shippingNoticeDuplicateResolved": "บันทึกวิธีจัดการรายการซ้ำแล้ว",
"shippingNoticeDuplicateResolveFailed": "บันทึกวิธีจัดการรายการซ้ำไม่สำเร็จ",
"shippingCandidateTitle": "ตรวจสอบรายการคำสั่งซื้อ",
"shippingCandidateCount": "คำสั่งซื้อ {count} รายการ",
"shippingCandidateReady": "พร้อมสร้างงาน",
"shippingCandidateNeedsReview": "ต้องตรวจสอบ",
"shippingCandidateEdit": "แก้ไข",
"shippingCandidateSave": "บันทึกการแก้ไข",
"shippingCandidateConflictCount": "มีข้อมูลขัดแย้ง {count} จุด โปรดแก้ไขก่อนสร้างงาน",
"shippingCandidateDuplicate": "ตรงกับงานเดิม {task}",
"shippingCandidateDuplicateResolved": "เลือกวิธีจัดการรายการซ้ำแล้ว: {action}",
"shippingCandidateForceReasonPrompt": "ระบุเหตุผลที่ต้องบังคับสร้างงานใหม่",
"shippingCandidateReviewRequired": "รายการคำสั่งซื้อที่เลือกยังต้องตรวจสอบ โปรดแก้ไขข้อมูลที่ขัดแย้งก่อน",
"shippingCandidateSelectRequired": "โปรดเลือกรายการคำสั่งซื้ออย่างน้อยหนึ่งรายการก่อนสร้างงาน",
"shippingOrderExtractionDefaultPrompt": "โปรดแยกวิเคราะห์คำสั่งซื้อจัดส่งจากอีเมลและไฟล์แนบที่อัปโหลดให้ครบถ้วน แล้วสร้างงานที่ผ่านเกณฑ์โดยอัตโนมัติ",
"shippingCandidateInvalidLine": "ทุกรายการต้องมี SKU และจำนวนมากกว่าศูนย์",
"shippingCandidatePoNumber": "PO Number",
"shippingCandidateSku": "SKU",
"shippingCandidateQty": "จำนวน",
"shippingCandidateReservation": "Reservation ID",
"shippingCandidateHubCode": "Hub Code",
"shippingCandidateUom": "หน่วย",
"shippingCandidateAddLine": "เพิ่มรายการคำสั่งซื้อ",
"shippingCandidateUpdateDone": "บันทึกการแก้ไขรายการคำสั่งซื้อแล้ว",
"shippingCandidateUpdateFailed": "บันทึกรายการคำสั่งซื้อไม่สำเร็จ",
"shippingInventoryUploadFailed": "อัปโหลดไฟล์สต็อกล้มเหลว",
"shippingNoticeRefreshDone": "รีเฟรชสถานะงานปัจจุบันแล้ว",
"shippingNoticeRetryUploadAction": "ลองอัปโหลดไปยังระบบขนส่งอีกครั้ง",
+14 -1
View File
@@ -49,6 +49,8 @@
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "ไม่พบบันทึก intake ของใบแจ้งจัดส่ง",
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "ใบแจ้งจัดส่งยังกำลังแยกข้อความ โปรดรอก่อนยืนยันสร้างชุดงาน",
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "แยกข้อความใบแจ้งจัดส่งล้มเหลว โปรดลองใหม่หรือลบแล้วอัปโหลดใหม่",
"SHIPPING_NOTICE_INTAKE_PARSE_TIMEOUT": "การแยกข้อความใบแจ้งจัดส่งหมดเวลา โปรดลองใหม่หรือลบแล้วอัปโหลดใหม่",
"SHIPPING_NOTICE_INTAKE_STAGE2_PERSIST_FAILED": "บันทึกอีเมลหรือไฟล์แนบที่ประมวลผลเบื้องต้นไม่สำเร็จ โปรดลองแยกข้อความใหม่",
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "ไฟล์แนบใบแจ้งจัดส่งแยกข้อความไม่ครบ โปรดลองแยกใหม่หรือลบแล้วอัปโหลดใหม่",
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "บันทึก intake ถูกใช้งานไปแล้ว",
"SHIPPING_NOTICE_INTAKE_EXPIRED": "บันทึก intake หมดอายุแล้ว",
@@ -61,6 +63,17 @@
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "งานเป้าหมายสำหรับการแก้ไขไม่ถูกต้อง",
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "งานนี้มีเวอร์ชันแก้ไขถัดไปอยู่แล้ว",
"SHIPPING_NOTICE_REVISION_CONFLICT": "งานเป้าหมายมีเวอร์ชันแก้ไขอยู่แล้ว กรุณาเปิดเวอร์ชันที่มีหรือตรวจสอบใหม่",
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "สร้างลายนิ้วมือทางธุรกิจที่เชื่อถือได้ไม่ได้ จะใช้การตัดรายการซ้ำด้วยแฮชไฟล์เท่านั้น"
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "สร้างลายนิ้วมือทางธุรกิจที่เชื่อถือได้ไม่ได้ จะใช้การตัดรายการซ้ำด้วยแฮชไฟล์เท่านั้น",
"SHIPPING_NOTICE_CANDIDATE_NOT_FOUND": "ไม่พบรายการคำสั่งซื้อ",
"SHIPPING_NOTICE_CANDIDATE_ALREADY_CONSUMED": "รายการคำสั่งซื้อนี้สร้างงานแล้วและไม่สามารถแก้ไขได้",
"SHIPPING_NOTICE_CANDIDATE_NOT_SELECTED": "ยังไม่ได้เลือกรายการคำสั่งซื้อ",
"SHIPPING_NOTICE_CANDIDATE_REVIEW_REQUIRED": "รายการคำสั่งซื้อยังต้องได้รับการตรวจสอบ",
"SHIPPING_NOTICE_CANDIDATE_DOCUMENT_INVALID": "ไฟล์แนบหลักของรายการคำสั่งซื้อไม่ถูกต้อง",
"SHIPPING_NOTICE_CANDIDATE_SELECTION_CHANGED": "สถานะการเลือกรายการคำสั่งซื้อเปลี่ยนแปลง โปรดรีเฟรชแล้วลองใหม่",
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "สถานะรายการซ้ำปัจจุบันไม่อนุญาตการดำเนินการนี้",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "บริบทการแยกคำสั่งซื้อไม่ถูกต้อง โปรดส่งอีเมลปัจจุบันอีกครั้ง",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "การประมวลผลอีเมลเบื้องต้นยังไม่เสร็จ หรือกำลังแยกคำสั่งซื้ออยู่",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "ผลการแยกคำสั่งซื้อไม่ตรงตามสัญญาข้อมูล โปรดลองแยกข้อความใหม่",
"SHIPPING_NOTICE_CANDIDATE_SOURCE_CHANGED": "เนื้อหาอีเมลหรือไฟล์แนบเปลี่ยนแปลง โปรดส่งอีกครั้งเพื่อแยกคำสั่งซื้อใหม่"
}
}
+23
View File
@@ -68,6 +68,29 @@
"shippingNoticeDuplicateOpenChosen": "将打开已有任务",
"shippingNoticeDuplicateResolved": "重复处理方式已保存。",
"shippingNoticeDuplicateResolveFailed": "保存重复处理方式失败。",
"shippingCandidateTitle": "订单候选审核",
"shippingCandidateCount": "共 {count} 个订单",
"shippingCandidateReady": "可建单",
"shippingCandidateNeedsReview": "需要审核",
"shippingCandidateEdit": "修订",
"shippingCandidateSave": "保存修订",
"shippingCandidateConflictCount": "存在 {count} 个字段冲突,请修订后再建单。",
"shippingCandidateDuplicate": "命中重复任务 {task}",
"shippingCandidateDuplicateResolved": "重复处理已选择:{action}",
"shippingCandidateForceReasonPrompt": "请输入强制新建原因",
"shippingCandidateReviewRequired": "仍有已选订单候选需要审核,请先修订冲突字段。",
"shippingCandidateSelectRequired": "请至少选择一个订单候选后再确认建单。",
"shippingOrderExtractionDefaultPrompt": "请完整解析已上传邮件及附件中的发货订单,并按规则自动建单。",
"shippingCandidateInvalidLine": "每条订单行都必须填写 SKU 和大于 0 的数量。",
"shippingCandidatePoNumber": "PO Number",
"shippingCandidateSku": "SKU",
"shippingCandidateQty": "数量",
"shippingCandidateReservation": "Reservation ID",
"shippingCandidateHubCode": "Hub Code",
"shippingCandidateUom": "单位",
"shippingCandidateAddLine": "新增订单行",
"shippingCandidateUpdateDone": "订单候选修订已保存。",
"shippingCandidateUpdateFailed": "保存订单候选失败。",
"shippingInventoryUploadFailed": "库存文件上传失败。",
"shippingNoticeRefreshDone": "已刷新当前任务状态。",
"shippingNoticeRetryUploadAction": "重试上传货代",
+14 -1
View File
@@ -49,6 +49,8 @@
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "发货通知接入记录不存在。",
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "发货通知仍在解析中,请稍后再确认建单。",
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "发货通知解析失败,请重试或移除后重新上传。",
"SHIPPING_NOTICE_INTAKE_PARSE_TIMEOUT": "发货通知解析超时,请重试或移除后重新上传。",
"SHIPPING_NOTICE_INTAKE_STAGE2_PERSIST_FAILED": "发货通知正文或附件预处理保存失败,请重试解析。",
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "发货通知附件解析不完整,请重试解析或移除后重新上传。",
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "发货通知接入记录已被消费。",
"SHIPPING_NOTICE_INTAKE_EXPIRED": "发货通知接入记录已过期。",
@@ -61,6 +63,17 @@
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "修订目标任务无效。",
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "该任务已有后续修订版本。",
"SHIPPING_NOTICE_REVISION_CONFLICT": "目标任务已有修订版本,请打开已有修订或重新检测。",
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "无法生成可靠业务指纹,将仅按文件去重。"
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "无法生成可靠业务指纹,将仅按文件去重。",
"SHIPPING_NOTICE_CANDIDATE_NOT_FOUND": "订单候选不存在。",
"SHIPPING_NOTICE_CANDIDATE_ALREADY_CONSUMED": "订单候选已被建单,无法修改。",
"SHIPPING_NOTICE_CANDIDATE_NOT_SELECTED": "订单候选未被选中。",
"SHIPPING_NOTICE_CANDIDATE_REVIEW_REQUIRED": "订单候选仍需人工审核。",
"SHIPPING_NOTICE_CANDIDATE_DOCUMENT_INVALID": "订单候选的主附件无效。",
"SHIPPING_NOTICE_CANDIDATE_SELECTION_CHANGED": "订单候选选择状态已变化,请刷新后重试。",
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "当前重复状态不允许该处理方式。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "订单识别上下文无效,请重新发送当前邮件。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "邮件预处理尚未完成,或本次订单识别仍在处理中。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "订单识别结果不符合协议,请重新解析。",
"SHIPPING_NOTICE_CANDIDATE_SOURCE_CHANGED": "邮件或附件内容已变化,请重新发送并识别订单。"
}
}
+23
View File
@@ -68,6 +68,29 @@
"shippingNoticeDuplicateOpenChosen": "將開啟已有任務",
"shippingNoticeDuplicateResolved": "重複處理方式已儲存。",
"shippingNoticeDuplicateResolveFailed": "儲存重複處理方式失敗。",
"shippingCandidateTitle": "訂單候選審核",
"shippingCandidateCount": "共 {count} 個訂單",
"shippingCandidateReady": "可建單",
"shippingCandidateNeedsReview": "需要審核",
"shippingCandidateEdit": "修訂",
"shippingCandidateSave": "儲存修訂",
"shippingCandidateConflictCount": "存在 {count} 個欄位衝突,請修訂後再建單。",
"shippingCandidateDuplicate": "命中重複任務 {task}",
"shippingCandidateDuplicateResolved": "重複處理已選擇:{action}",
"shippingCandidateForceReasonPrompt": "請輸入強制新建原因",
"shippingCandidateReviewRequired": "仍有已選訂單候選需要審核,請先修訂衝突欄位。",
"shippingCandidateSelectRequired": "請至少選擇一個訂單候選後再確認建單。",
"shippingOrderExtractionDefaultPrompt": "請完整解析已上傳郵件及附件中的發貨訂單,並依規則自動建單。",
"shippingCandidateInvalidLine": "每條訂單行都必須填寫 SKU 和大於 0 的數量。",
"shippingCandidatePoNumber": "PO Number",
"shippingCandidateSku": "SKU",
"shippingCandidateQty": "數量",
"shippingCandidateReservation": "Reservation ID",
"shippingCandidateHubCode": "Hub Code",
"shippingCandidateUom": "單位",
"shippingCandidateAddLine": "新增訂單行",
"shippingCandidateUpdateDone": "訂單候選修訂已儲存。",
"shippingCandidateUpdateFailed": "儲存訂單候選失敗。",
"shippingInventoryUploadFailed": "庫存檔案上傳失敗。",
"shippingNoticeRefreshDone": "已重新整理目前任務狀態。",
"shippingNoticeRetryUploadAction": "重試上傳貨代",
+14 -1
View File
@@ -49,6 +49,8 @@
"SHIPPING_NOTICE_INTAKE_NOT_FOUND": "發貨通知接入記錄不存在。",
"SHIPPING_NOTICE_INTAKE_PARSE_PENDING": "發貨通知仍在解析中,請稍後再確認建單。",
"SHIPPING_NOTICE_INTAKE_PARSE_FAILED": "發貨通知解析失敗,請重試或移除後重新上傳。",
"SHIPPING_NOTICE_INTAKE_PARSE_TIMEOUT": "發貨通知解析逾時,請重試或移除後重新上傳。",
"SHIPPING_NOTICE_INTAKE_STAGE2_PERSIST_FAILED": "發貨通知正文或附件預處理儲存失敗,請重試解析。",
"SHIPPING_NOTICE_INTAKE_ATTACHMENTS_INCOMPLETE": "發貨通知附件解析不完整,請重試解析或移除後重新上傳。",
"SHIPPING_NOTICE_INTAKE_ALREADY_CONSUMED": "發貨通知接入記錄已被消費。",
"SHIPPING_NOTICE_INTAKE_EXPIRED": "發貨通知接入記錄已過期。",
@@ -61,6 +63,17 @@
"SHIPPING_NOTICE_REVISION_TARGET_INVALID": "修訂目標任務無效。",
"SHIPPING_NOTICE_REVISION_ALREADY_EXISTS": "該任務已有後續修訂版本。",
"SHIPPING_NOTICE_REVISION_CONFLICT": "目標任務已有修訂版本,請打開已有修訂或重新檢測。",
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "無法產生可靠業務指紋,將僅按檔案去重。"
"SHIPPING_NOTICE_FINGERPRINT_UNAVAILABLE": "無法產生可靠業務指紋,將僅按檔案去重。",
"SHIPPING_NOTICE_CANDIDATE_NOT_FOUND": "訂單候選不存在。",
"SHIPPING_NOTICE_CANDIDATE_ALREADY_CONSUMED": "訂單候選已被建單,無法修改。",
"SHIPPING_NOTICE_CANDIDATE_NOT_SELECTED": "訂單候選未被選中。",
"SHIPPING_NOTICE_CANDIDATE_REVIEW_REQUIRED": "訂單候選仍需人工審核。",
"SHIPPING_NOTICE_CANDIDATE_DOCUMENT_INVALID": "訂單候選的主附件無效。",
"SHIPPING_NOTICE_CANDIDATE_SELECTION_CHANGED": "訂單候選選擇狀態已變化,請重新整理後再試。",
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "目前重複狀態不允許此處理方式。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "訂單識別上下文無效,請重新傳送目前郵件。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "郵件預處理尚未完成,或本次訂單識別仍在處理中。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "訂單識別結果不符合協議,請重新解析。",
"SHIPPING_NOTICE_CANDIDATE_SOURCE_CHANGED": "郵件或附件內容已變更,請重新傳送並識別訂單。"
}
}