feat(shipping-notice): 增强订单文档 Profile 管理功能,新增复核与草稿管理
- 添加订单复核相关模型及 API,支持复核案例的创建、更新和确认 - 实现复核草稿的管理功能,允许用户对复核内容进行编辑和保存 - 引入复核事件审计,确保复核过程的可追溯性 - 更新数据库模型以支持复核和草稿的关系管理 - 完善相关服务逻辑,确保复核与草稿的状态管理和数据一致性 - 增强文档模板的管理能力,支持更复杂的业务场景
This commit is contained in:
1 parent
61ac6403c4
commit
b7307fc573
147 files changed
+15108
-1522
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* features/chat/components/shipping/ShippingOrderDocumentResultItem.vue
|
||||
* 用途:渲染单个 PDF 的订单抽取结果摘要,供详情抽屉按文档逐项展示。
|
||||
* 依赖:订单抽取文档 DTO、vue-i18n。
|
||||
* 逻辑:只显示用户可理解的业务字段;人工复核入口复用现有候选审核区,不直接暴露内部证据细节。
|
||||
* 逻辑:只显示用户可理解的业务字段;人工复核由上层统一跳转独立工作台。
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -12,14 +12,13 @@ import type { ShippingOrderExtractionDocumentResult } from '../../types/shipping
|
||||
|
||||
const props = defineProps<{
|
||||
document: ShippingOrderExtractionDocumentResult;
|
||||
hasReviewAttachments?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
enterManualReview: [];
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const { t, te, locale } = useI18n();
|
||||
|
||||
const statusTone = computed(() => {
|
||||
switch (props.document.status) {
|
||||
@@ -36,6 +35,23 @@ const statusTone = computed(() => {
|
||||
});
|
||||
|
||||
const statusLabel = computed(() => t(`chat.shippingOrderExtractionDocumentStatus.${props.document.status}`));
|
||||
const statusActivityLabel = computed(() => {
|
||||
const key = `chat.shippingOrderExtractionActivity.${props.document.activity_event_code || props.document.status}`;
|
||||
return te(key) ? t(key) : statusLabel.value;
|
||||
});
|
||||
const formatTime = (value: string | null | undefined): string => {
|
||||
const date = new Date(String(value || ''));
|
||||
if (Number.isNaN(date.getTime())) return '';
|
||||
return new Intl.DateTimeFormat(String(locale.value || 'zh-CN'), {
|
||||
hour: '2-digit', minute: '2-digit', hour12: false,
|
||||
}).format(date);
|
||||
};
|
||||
const activityTimeLabel = computed(() => {
|
||||
if (props.document.finished_at) return t('chat.shippingOrderExtractionDocumentTiming.finished', { time: formatTime(props.document.finished_at) });
|
||||
if (props.document.last_activity_at) return t('chat.shippingOrderExtractionDocumentTiming.updated', { time: formatTime(props.document.last_activity_at) });
|
||||
if (props.document.started_at) return t('chat.shippingOrderExtractionDocumentTiming.started', { time: formatTime(props.document.started_at) });
|
||||
return '';
|
||||
});
|
||||
const reasonLabel = computed(() => (
|
||||
props.document.reason_code
|
||||
? t(`chat.shippingOrderExtractionReason.${props.document.reason_code}`)
|
||||
@@ -81,13 +97,9 @@ const reviewFieldLabel = (fieldCode: string | null | undefined): string => {
|
||||
};
|
||||
|
||||
const canEnterManualReview = computed(() => (
|
||||
props.hasReviewAttachments
|
||||
&& props.document.available_actions.some((action) => action === 'review_candidate' || action === 'manual_review')
|
||||
));
|
||||
const canViewEvidence = computed(() => (
|
||||
props.hasReviewAttachments
|
||||
&& props.document.available_actions.includes('view_evidence')
|
||||
props.document.available_actions.some((action) => action === 'review_candidate' || action === 'manual_review')
|
||||
));
|
||||
const canViewEvidence = computed(() => props.document.available_actions.includes('view_evidence'));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -105,7 +117,11 @@ const canViewEvidence = computed(() => (
|
||||
<div class="truncate text-sm font-semibold">{{ document.file_name || t('chat.shippingOrderExtractionUnknownDocument') }}</div>
|
||||
<span class="rounded-full bg-black/10 px-2 py-0.5 text-[11px] dark:bg-white/10">{{ statusLabel }}</span>
|
||||
</div>
|
||||
<div v-if="['pending', 'routing', 'matching_profile', 'extracting', 'merging_supplement'].includes(document.status) || document.activity_event_code" class="mt-1 text-xs font-medium opacity-85">
|
||||
{{ statusActivityLabel }}
|
||||
</div>
|
||||
<div class="mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs opacity-85">
|
||||
<span v-if="activityTimeLabel">{{ activityTimeLabel }}</span>
|
||||
<span v-if="document.selection_batch">
|
||||
{{ t('chat.shippingOrderExtractionSelectionBatch', { batch: document.selection_batch }) }}
|
||||
</span>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { nextTick } from 'vue';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import { createMemoryHistory, createRouter } from 'vue-router';
|
||||
import chatZhCn from '@/locales/zh-CN/chat.json';
|
||||
import ShippingOrderDocumentResultItem from './ShippingOrderDocumentResultItem.vue';
|
||||
import ShippingOrderExtractionCard from './ShippingOrderExtractionCard.vue';
|
||||
@@ -43,6 +44,14 @@ const flushUi = async () => {
|
||||
await nextTick();
|
||||
};
|
||||
|
||||
const makeRouter = () => createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: [
|
||||
{ path: '/chat/:agentId', name: 'Chat', component: { template: '<div />' } },
|
||||
{ path: '/chat/:agentId/order-review/:runNo', name: 'ShippingOrderReview', component: { template: '<div />' } },
|
||||
],
|
||||
});
|
||||
|
||||
const buildState = (patch: Partial<ShippingOrderExtractionState> = {}): ShippingOrderExtractionState => ({
|
||||
status: 'processing',
|
||||
summary: {
|
||||
@@ -116,7 +125,7 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
document.body.innerHTML = '';
|
||||
});
|
||||
|
||||
it('loads documents once when opening details from server actions', async () => {
|
||||
it('refreshes documents whenever the details drawer is opened', async () => {
|
||||
api.listDocuments.mockResolvedValue({ items: [buildDocument()] });
|
||||
api.listProgressEvents.mockResolvedValue({ items: [buildProgressEvent()] });
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
@@ -189,21 +198,24 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
await detailButton!.trigger('click');
|
||||
await flushUi();
|
||||
|
||||
expect(api.listDocuments).toHaveBeenCalledTimes(1);
|
||||
expect(api.listProgressEvents).toHaveBeenCalledTimes(1);
|
||||
expect(api.listDocuments).toHaveBeenCalledTimes(2);
|
||||
expect(api.listProgressEvents).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
it('emits manual review directly when attachments are already available', async () => {
|
||||
it('routes manual review directly to the dedicated workspace', async () => {
|
||||
const router = makeRouter();
|
||||
await router.push({ name: 'Chat', params: { agentId: 'agent-1' } });
|
||||
await router.isReady();
|
||||
const pushSpy = vi.spyOn(router, 'push');
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
state: buildState({
|
||||
availableActions: ['enter_manual_review'],
|
||||
}),
|
||||
runNo: 'SNER-002',
|
||||
hasReviewAttachments: true,
|
||||
},
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
plugins: [i18n, router],
|
||||
stubs: {
|
||||
teleport: true,
|
||||
},
|
||||
@@ -215,10 +227,37 @@ describe('ShippingOrderExtractionCard', () => {
|
||||
|
||||
await reviewButton!.trigger('click');
|
||||
|
||||
expect(wrapper.emitted('enterManualReview')).toHaveLength(1);
|
||||
await vi.waitFor(() => expect(pushSpy).toHaveBeenCalled());
|
||||
expect(pushSpy).toHaveBeenCalledWith({
|
||||
name: 'Chat',
|
||||
params: { agentId: 'agent-1' },
|
||||
query: { mode: 'order-review', run_no: 'SNER-002' },
|
||||
});
|
||||
expect(api.listDocuments).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('preserves the originating conversation when entering manual review', async () => {
|
||||
const router = makeRouter();
|
||||
await router.push({ name: 'Chat', params: { agentId: 'agent-1' }, query: { conversation_id: 'conv-123' } });
|
||||
await router.isReady();
|
||||
const pushSpy = vi.spyOn(router, 'push');
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: { state: buildState({ availableActions: ['enter_manual_review'] }), runNo: 'SNER-003' },
|
||||
global: { plugins: [i18n, router], stubs: { teleport: true } },
|
||||
});
|
||||
|
||||
const reviewButton = wrapper.findAll('button').find((item) => item.text().includes('进入人工复核'));
|
||||
expect(reviewButton).toBeTruthy();
|
||||
await reviewButton!.trigger('click');
|
||||
|
||||
await vi.waitFor(() => expect(pushSpy).toHaveBeenCalled());
|
||||
expect(pushSpy).toHaveBeenCalledWith({
|
||||
name: 'Chat',
|
||||
params: { agentId: 'agent-1' },
|
||||
query: { conversation_id: 'conv-123', mode: 'order-review', run_no: 'SNER-003' },
|
||||
});
|
||||
});
|
||||
|
||||
it('emits retry for failed attachments without mutating state locally', async () => {
|
||||
const wrapper = mount(ShippingOrderExtractionCard, {
|
||||
props: {
|
||||
@@ -305,7 +344,6 @@ describe('ShippingOrderExtractionDetailsDrawer', () => {
|
||||
loadFailed: false,
|
||||
progressLoading: false,
|
||||
progressLoadFailed: false,
|
||||
hasReviewAttachments: true,
|
||||
},
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
@@ -369,7 +407,6 @@ describe('ShippingOrderDocumentResultItem', () => {
|
||||
},
|
||||
available_actions: ['view_evidence', 'manual_review'],
|
||||
}),
|
||||
hasReviewAttachments: true,
|
||||
},
|
||||
global: {
|
||||
plugins: [i18n],
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* 依赖:订单抽取 Run 状态卡 DTO、documents API、详情抽屉。
|
||||
* 逻辑:卡片只显示 Run 汇总、当前活动和下一步动作;逐 PDF 结果与 Run 事实时间线延迟到抽屉内按需加载。
|
||||
*/
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { computed, onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { CircleCheck, CircleX, LoaderCircle, TriangleAlert } from 'lucide-vue-next';
|
||||
import {
|
||||
@@ -22,7 +23,6 @@ import ShippingOrderExtractionDetailsDrawer from './ShippingOrderExtractionDetai
|
||||
const props = defineProps<{
|
||||
state: ShippingOrderExtractionState;
|
||||
runNo?: string;
|
||||
hasReviewAttachments?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -31,6 +31,8 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const detailsOpen = ref(false);
|
||||
const documents = ref<ShippingOrderExtractionDocumentResult[]>([]);
|
||||
@@ -41,6 +43,17 @@ const documentsLoadedForRun = ref('');
|
||||
const loadingProgressEvents = ref(false);
|
||||
const progressEventsLoadFailed = ref(false);
|
||||
const progressEventsLoadedForRun = ref('');
|
||||
let detailsRefreshTimer: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
const detailsFreshnessKey = computed(() => JSON.stringify({
|
||||
runNo: props.runNo || '',
|
||||
status: props.state.status,
|
||||
phase: props.state.currentActivity?.eventCode || '',
|
||||
total: props.state.summary.totalDocuments,
|
||||
completed: props.state.summary.completedDocuments,
|
||||
reviewRequired: props.state.summary.reviewRequiredDocuments,
|
||||
failed: props.state.summary.failedDocuments,
|
||||
}));
|
||||
|
||||
watch(
|
||||
() => props.runNo,
|
||||
@@ -152,11 +165,16 @@ const currentActivityContextSummary = computed(() => {
|
||||
return parts.join(' · ');
|
||||
});
|
||||
|
||||
const openDetails = async () => {
|
||||
/**
|
||||
* 刷新抽屉中的 Run 详情。
|
||||
*
|
||||
* 文档列表可能在布局 Job 完成后才落库;抽屉绝不能缓存首次打开时的空结果,
|
||||
* 否则聊天卡已显示新状态而详情仍停留在旧的“暂无结果”。
|
||||
*/
|
||||
const refreshDetails = async () => {
|
||||
if (!props.runNo) return;
|
||||
detailsOpen.value = true;
|
||||
const tasks: Promise<void>[] = [];
|
||||
if (documentsLoadedForRun.value !== props.runNo && !loadingDocuments.value) {
|
||||
if (!loadingDocuments.value) {
|
||||
loadingDocuments.value = true;
|
||||
documentsLoadFailed.value = false;
|
||||
tasks.push(
|
||||
@@ -173,7 +191,7 @@ const openDetails = async () => {
|
||||
}),
|
||||
);
|
||||
}
|
||||
if (progressEventsLoadedForRun.value !== props.runNo && !loadingProgressEvents.value) {
|
||||
if (!loadingProgressEvents.value) {
|
||||
loadingProgressEvents.value = true;
|
||||
progressEventsLoadFailed.value = false;
|
||||
tasks.push(
|
||||
@@ -195,17 +213,55 @@ const openDetails = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const openDetails = async () => {
|
||||
if (!props.runNo) return;
|
||||
detailsOpen.value = true;
|
||||
await refreshDetails();
|
||||
};
|
||||
|
||||
/** 详情打开期间独立刷新,避免长任务只在聊天卡状态变更时才显示新阶段。 */
|
||||
const stopDetailsRefresh = () => {
|
||||
if (detailsRefreshTimer) clearInterval(detailsRefreshTimer);
|
||||
detailsRefreshTimer = null;
|
||||
};
|
||||
|
||||
watch(detailsOpen, (open) => {
|
||||
stopDetailsRefresh();
|
||||
if (!open || !props.runNo || !['queued', 'processing'].includes(props.state.status)) return;
|
||||
detailsRefreshTimer = setInterval(() => void refreshDetails(), 2000);
|
||||
});
|
||||
|
||||
watch(() => props.state.status, (status) => {
|
||||
if (!['queued', 'processing'].includes(status)) stopDetailsRefresh();
|
||||
});
|
||||
|
||||
onBeforeUnmount(stopDetailsRefresh);
|
||||
|
||||
watch(detailsFreshnessKey, () => {
|
||||
if (detailsOpen.value) void refreshDetails();
|
||||
});
|
||||
|
||||
/** 新建单前复核统一进入独立工作台,不能再落入聊天内旧 Candidate 编辑区。 */
|
||||
const openReviewWorkspace = async () => {
|
||||
if (!props.runNo) return;
|
||||
await router.push({
|
||||
name: 'Chat',
|
||||
params: { agentId: String(route.params.agentId || '') },
|
||||
query: {
|
||||
...route.query,
|
||||
mode: 'order-review',
|
||||
run_no: props.runNo,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const handleActionClick = async (action: string) => {
|
||||
switch (action) {
|
||||
case 'view_details':
|
||||
await openDetails();
|
||||
return;
|
||||
case 'enter_manual_review':
|
||||
if (props.hasReviewAttachments) {
|
||||
emit('enterManualReview');
|
||||
} else {
|
||||
await openDetails();
|
||||
}
|
||||
await openReviewWorkspace();
|
||||
return;
|
||||
case 'retry_failed_attachments':
|
||||
emit('retry');
|
||||
@@ -235,7 +291,6 @@ const handleActionClick = async (action: string) => {
|
||||
<div class="mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs opacity-90">
|
||||
<span>{{ t('chat.shippingOrderExtractionSummary.total', { count: state.summary.totalDocuments }) }}</span>
|
||||
<span>{{ t('chat.shippingOrderExtractionSummary.completedProgress', { value: completedLabel }) }}</span>
|
||||
<span>{{ t('chat.shippingOrderExtractionSummary.candidates', { count: state.summary.candidateCount }) }}</span>
|
||||
<span>{{ t('chat.shippingOrderExtractionSummary.reviewRequired', { count: state.summary.reviewRequiredDocuments }) }}</span>
|
||||
<span v-if="state.summary.failedDocuments > 0">
|
||||
{{ t('chat.shippingOrderExtractionSummary.failed', { count: state.summary.failedDocuments }) }}
|
||||
@@ -294,9 +349,8 @@ const handleActionClick = async (action: string) => {
|
||||
:load-failed="documentsLoadFailed"
|
||||
:progress-loading="loadingProgressEvents"
|
||||
:progress-load-failed="progressEventsLoadFailed"
|
||||
:has-review-attachments="hasReviewAttachments"
|
||||
@close="detailsOpen = false"
|
||||
@enter-manual-review="emit('enterManualReview')"
|
||||
@enter-manual-review="openReviewWorkspace"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
+23
-49
@@ -5,7 +5,7 @@
|
||||
* 依赖:订单抽取状态卡、文档结果项、订单抽取 progress-events DTO、vue-i18n。
|
||||
* 逻辑:聊天摘要卡只显示概览;需要查看逐文档结果和每轮事件原因时由本抽屉承接新的 Run 级事实时间线。
|
||||
*/
|
||||
import { onBeforeUnmount, watch } from 'vue';
|
||||
import { onBeforeUnmount, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { X } from 'lucide-vue-next';
|
||||
import type { ShippingOrderExtractionState } from '../../types/chat.types';
|
||||
@@ -25,7 +25,6 @@ const props = defineProps<{
|
||||
loadFailed: boolean;
|
||||
progressLoading: boolean;
|
||||
progressLoadFailed: boolean;
|
||||
hasReviewAttachments?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -35,6 +34,7 @@ const emit = defineEmits<{
|
||||
|
||||
const { t, te, locale } = useI18n();
|
||||
let removeKeydownListener: (() => void) | null = null;
|
||||
const timelineOpen = ref(false);
|
||||
|
||||
const translateReasonCodes = (codes: string[] | undefined): string[] => (
|
||||
(codes || [])
|
||||
@@ -155,37 +155,27 @@ onBeforeUnmount(() => {
|
||||
</header>
|
||||
|
||||
<div class="flex-1 space-y-3 overflow-y-auto px-4 py-4">
|
||||
<div
|
||||
v-if="state.selectionPlan?.totalAttachmentCount || state.unitSummary?.technicalFailureReasonCodes?.length"
|
||||
class="rounded-lg border border-slate-200 bg-slate-50 px-3 py-3 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/60 dark:text-slate-200"
|
||||
>
|
||||
<div v-if="state.selectionPlan?.totalAttachmentCount">
|
||||
{{ t('chat.shippingOrderExtractionPlanSummary', {
|
||||
total: state.selectionPlan.totalAttachmentCount,
|
||||
groups: state.selectionPlan.groupCount || 0,
|
||||
attachments: state.selectionPlan.maxInitialAttachments || 0,
|
||||
concurrency: state.selectionPlan.maxInitialConcurrency || 0,
|
||||
}) }}
|
||||
</div>
|
||||
<div v-if="state.unitSummary?.reviewRequiredReasonCodes?.length" class="mt-1">
|
||||
{{ t('chat.shippingOrderExtractionReviewReasonCodes', {
|
||||
codes: translateReasonCodes(state.unitSummary.reviewRequiredReasonCodes).join(' / '),
|
||||
}) }}
|
||||
</div>
|
||||
<div v-if="state.unitSummary?.expansionTriggerReasonCodes?.length" class="mt-1">
|
||||
{{ t('chat.shippingOrderExtractionExpansionTriggerCodes', {
|
||||
codes: translateReasonCodes(state.unitSummary.expansionTriggerReasonCodes).join(' / '),
|
||||
}) }}
|
||||
</div>
|
||||
<div v-if="state.unitSummary?.technicalFailureReasonCodes?.length" class="mt-1">
|
||||
{{ t('chat.shippingOrderExtractionTechnicalFailureCodes', {
|
||||
codes: state.unitSummary.technicalFailureReasonCodes.join(', '),
|
||||
}) }}
|
||||
</div>
|
||||
<div v-if="loading" class="rounded-lg border border-dashed border-slate-300 px-3 py-4 text-sm text-slate-600 dark:border-slate-700 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderExtractionDocumentsLoading') }}
|
||||
</div>
|
||||
<div class="rounded-lg border border-slate-200 bg-white px-3 py-3 dark:border-slate-700 dark:bg-slate-950/40">
|
||||
<div class="text-xs font-semibold text-slate-900 dark:text-slate-100">
|
||||
{{ t('chat.shippingOrderExtractionTimelineTitle') }}
|
||||
<div v-else-if="loadFailed" class="rounded-lg border border-amber-300 bg-amber-50 px-3 py-4 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/30 dark:text-amber-100">
|
||||
{{ t('chat.shippingOrderExtractionDocumentsUnavailable') }}
|
||||
</div>
|
||||
<div v-else-if="documents.length === 0" class="rounded-lg border border-dashed border-slate-300 px-3 py-4 text-sm text-slate-600 dark:border-slate-700 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderExtractionNoDocuments') }}
|
||||
</div>
|
||||
<ShippingOrderDocumentResultItem
|
||||
v-for="document in documents"
|
||||
:key="document.unit_id"
|
||||
:document="document"
|
||||
@enter-manual-review="emit('enterManualReview')"
|
||||
/>
|
||||
<details :open="timelineOpen" class="rounded-lg border border-slate-200 bg-white px-3 py-3 dark:border-slate-700 dark:bg-slate-950/40" @toggle="timelineOpen = ($event.currentTarget as HTMLDetailsElement).open">
|
||||
<summary class="cursor-pointer text-xs font-semibold text-slate-900 dark:text-slate-100">{{ t('chat.shippingOrderExtractionTimelineTitle') }}</summary>
|
||||
<div v-if="state.selectionPlan?.totalAttachmentCount || state.unitSummary?.technicalFailureReasonCodes?.length" class="mt-3 rounded-lg bg-slate-50 px-3 py-3 text-xs text-slate-700 dark:bg-slate-900/60 dark:text-slate-200">
|
||||
<div v-if="state.selectionPlan?.totalAttachmentCount">{{ t('chat.shippingOrderExtractionPlanSummary', { total: state.selectionPlan.totalAttachmentCount, groups: state.selectionPlan.groupCount || 0, attachments: state.selectionPlan.maxInitialAttachments || 0, concurrency: state.selectionPlan.maxInitialConcurrency || 0 }) }}</div>
|
||||
<div v-if="state.unitSummary?.reviewRequiredReasonCodes?.length" class="mt-1">{{ t('chat.shippingOrderExtractionReviewReasonCodes', { codes: translateReasonCodes(state.unitSummary.reviewRequiredReasonCodes).join(' / ') }) }}</div>
|
||||
<div v-if="state.unitSummary?.technicalFailureReasonCodes?.length" class="mt-1">{{ t('chat.shippingOrderExtractionTechnicalFailureCodes', { codes: state.unitSummary.technicalFailureReasonCodes.join(', ') }) }}</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="progressLoading"
|
||||
@@ -227,23 +217,7 @@ onBeforeUnmount(() => {
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div v-if="loading" class="rounded-lg border border-dashed border-slate-300 px-3 py-4 text-sm text-slate-600 dark:border-slate-700 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderExtractionDocumentsLoading') }}
|
||||
</div>
|
||||
<div v-else-if="loadFailed" class="rounded-lg border border-amber-300 bg-amber-50 px-3 py-4 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/30 dark:text-amber-100">
|
||||
{{ t('chat.shippingOrderExtractionDocumentsUnavailable') }}
|
||||
</div>
|
||||
<div v-else-if="documents.length === 0" class="rounded-lg border border-dashed border-slate-300 px-3 py-4 text-sm text-slate-600 dark:border-slate-700 dark:text-slate-300">
|
||||
{{ t('chat.shippingOrderExtractionNoDocuments') }}
|
||||
</div>
|
||||
<ShippingOrderDocumentResultItem
|
||||
v-for="document in documents"
|
||||
:key="document.unit_id"
|
||||
:document="document"
|
||||
:has-review-attachments="hasReviewAttachments"
|
||||
@enter-manual-review="emit('enterManualReview')"
|
||||
/>
|
||||
</details>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user