feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3a9fbac2fc
commit
d2b3d74def
571 files changed
+78064
-24681
No files matched your search
@@ -2,7 +2,8 @@
|
||||
features/chat/components/shipping-review/ReviewFieldConflictPanel.vue
|
||||
用途:复核工作台建单前字段冲突集中裁决区(采用候选值 / 手工值)。
|
||||
依赖:vue-i18n、shipping.api.resolveWorkspaceShippingOrderReviewFieldConflict、useMessage。
|
||||
逻辑:展示 Case.field_conflicts;裁决成功后 emit refreshed;可 emit focus-conflict 定位证据。
|
||||
逻辑:展示 Case.field_conflicts;选项标注 evidence_role(主 PDF / 辅助 / 正文);
|
||||
裁决成功后 emit refreshed;可 emit focus-conflict 定位证据。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
@@ -10,6 +11,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { BusinessError, resolveLocalizedErrorMessage } from '@/shared/api/client';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { resolveWorkspaceShippingOrderReviewFieldConflict } from '@/features/chat/api/shipping.api';
|
||||
import { showReviewResumeOutcome } from '@/features/chat/shipping-review/showReviewResumeOutcome';
|
||||
import type { ShippingOrderReviewFieldConflict } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -48,6 +50,16 @@ function reasonLabel(reason: string): string {
|
||||
return te(key) ? t(key) : reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 证据角色本地化(主 PDF / 辅助 / 邮件正文)。
|
||||
*/
|
||||
function evidenceRoleLabel(role: string | undefined | null): string {
|
||||
const code = String(role || '').trim();
|
||||
if (!code) return '';
|
||||
const key = `chat.shippingOrderReview.fieldConflict.evidenceRole.${code}`;
|
||||
return te(key) ? t(key) : code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定位冲突字段到草稿/证据区。
|
||||
*/
|
||||
@@ -66,13 +78,13 @@ async function adoptOption(conflict: ShippingOrderReviewFieldConflict, optionInd
|
||||
if (!props.editable || !props.caseNo || props.draftVersion == null || resolvingKey.value) return;
|
||||
resolvingKey.value = conflict.conflict_key;
|
||||
try {
|
||||
await resolveWorkspaceShippingOrderReviewFieldConflict(props.caseNo, conflict.conflict_key, {
|
||||
const result = await resolveWorkspaceShippingOrderReviewFieldConflict(props.caseNo, conflict.conflict_key, {
|
||||
resolution: 'adopt_option',
|
||||
option_index: optionIndex,
|
||||
expected_draft_version: props.draftVersion,
|
||||
reason: t('chat.shippingOrderReview.fieldConflict.resolveReason'),
|
||||
});
|
||||
msg.success(t('chat.shippingOrderReview.fieldConflict.resolveSuccess'));
|
||||
showReviewResumeOutcome(result.resume_outcome, msg, t, t('chat.shippingOrderReview.fieldConflict.resolveSuccess'));
|
||||
emit('refreshed');
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof BusinessError
|
||||
@@ -105,7 +117,7 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
if (!value || !props.editable || props.draftVersion == null || resolvingKey.value) return;
|
||||
resolvingKey.value = conflict.conflict_key;
|
||||
try {
|
||||
await resolveWorkspaceShippingOrderReviewFieldConflict(props.caseNo, conflict.conflict_key, {
|
||||
const result = await resolveWorkspaceShippingOrderReviewFieldConflict(props.caseNo, conflict.conflict_key, {
|
||||
resolution: 'custom',
|
||||
custom_value: value,
|
||||
expected_draft_version: props.draftVersion,
|
||||
@@ -113,7 +125,7 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
});
|
||||
customOpenKey.value = null;
|
||||
customValue.value = '';
|
||||
msg.success(t('chat.shippingOrderReview.fieldConflict.resolveSuccess'));
|
||||
showReviewResumeOutcome(result.resume_outcome, msg, t, t('chat.shippingOrderReview.fieldConflict.resolveSuccess'));
|
||||
emit('refreshed');
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof BusinessError
|
||||
@@ -172,9 +184,22 @@ async function submitCustom(conflict: ShippingOrderReviewFieldConflict) {
|
||||
:key="`${conflict.conflict_key}-${idx}`"
|
||||
class="rounded border border-default bg-surface-soft px-2 py-1.5"
|
||||
>
|
||||
<div class="text-muted">
|
||||
{{ t('chat.shippingOrderReview.fieldConflict.optionLabel', { index: idx + 1 }) }}
|
||||
<span v-if="option.sources?.length" class="ml-1">({{ option.sources.join(', ') }})</span>
|
||||
<div class="flex flex-wrap items-center gap-1 text-muted">
|
||||
<span>
|
||||
{{ t('chat.shippingOrderReview.fieldConflict.optionLabel', { index: idx + 1 }) }}
|
||||
<span v-if="option.sources?.length" class="ml-1">({{ option.sources.join(', ') }})</span>
|
||||
</span>
|
||||
<span
|
||||
v-if="evidenceRoleLabel(option.evidence_role)"
|
||||
class="rounded px-1 py-0.5 text-[10px] font-medium"
|
||||
:class="option.evidence_role === 'primary_pdf'
|
||||
? 'bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200'
|
||||
: 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200'"
|
||||
:data-testid="`review-field-conflict-evidence-role-${idx}`"
|
||||
:data-evidence-role="option.evidence_role"
|
||||
>
|
||||
{{ evidenceRoleLabel(option.evidence_role) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="mt-0.5 font-mono text-primary">{{ option.display_value || option.value_key || '—' }}</div>
|
||||
<button
|
||||
|
||||
Reference in new issue
Block a user