feat(shipping-notice): 增强订单抽取功能,添加进度事件和诊断运行管理,优化数据模型和访问控制
This commit is contained in:
1 parent
ce26d6d0c4
commit
c4095b08da
175 files changed
+13064
-1814
No files matched your search
@@ -12,6 +12,7 @@ import ShippingTaskFieldConflictPanel from '@/features/chat/components/ShippingT
|
||||
import type {
|
||||
ShippingFieldConflict,
|
||||
ShippingNoticeLine,
|
||||
ShippingOrderDisplayField,
|
||||
ShippingParseIssue,
|
||||
ShippingParseValidation,
|
||||
ShippingProcessFieldGate,
|
||||
@@ -22,6 +23,9 @@ const props = defineProps<{
|
||||
taskNo?: string | null;
|
||||
poNumber?: string | null;
|
||||
lines?: ShippingNoticeLine[] | null;
|
||||
orderHeader?: Record<string, unknown> | null;
|
||||
orderHeaderFields?: ShippingOrderDisplayField[] | null;
|
||||
orderLineFields?: ShippingOrderDisplayField[] | null;
|
||||
parseValidation?: ShippingParseValidation | null;
|
||||
processFieldGate?: ShippingProcessFieldGate | null;
|
||||
sourceCandidate?: ShippingSourceCandidateProjection | null;
|
||||
@@ -48,6 +52,8 @@ watch(
|
||||
);
|
||||
|
||||
const orderLines = computed(() => (props.lines || []).filter((line) => line && typeof line === 'object'));
|
||||
const orderedHeaderFields = computed(() => [...(props.orderHeaderFields || [])].sort((a, b) => a.sequence - b.sequence));
|
||||
const orderedLineFields = computed(() => [...(props.orderLineFields || [])].sort((a, b) => a.sequence - b.sequence));
|
||||
|
||||
const gateIssues = computed(() => {
|
||||
const fromGate = Array.isArray(props.processFieldGate?.issues) ? props.processFieldGate?.issues : [];
|
||||
@@ -142,6 +148,16 @@ function issueReasonLabel(reason?: string | null): string {
|
||||
@refreshed="emit('refreshed')"
|
||||
/>
|
||||
|
||||
<div v-if="orderedHeaderFields.length" class="rounded-xl border border-default bg-white/90 p-2.5">
|
||||
<div class="mb-2 font-semibold text-slate-700">{{ t('chat.shippingParsedResult.orderInformation') }}</div>
|
||||
<dl class="grid gap-2 sm:grid-cols-2">
|
||||
<div v-for="field in orderedHeaderFields" :key="field.field_code" class="rounded-lg bg-slate-50 px-2.5 py-2">
|
||||
<dt class="text-[10px] text-muted">{{ field.display_name }}</dt>
|
||||
<dd class="mt-0.5 break-words text-xs text-slate-800">{{ displayValue(orderHeader?.[field.field_code]) }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div v-if="missingFields.length" class="space-y-1">
|
||||
<div class="font-semibold text-amber-800">{{ t('chat.shippingParsedResult.missingFields') }}</div>
|
||||
<div class="flex flex-wrap gap-1">
|
||||
@@ -182,12 +198,7 @@ function issueReasonLabel(reason?: string | null): string {
|
||||
<thead class="bg-surface text-left text-[11px] text-muted">
|
||||
<tr>
|
||||
<th class="px-2.5 py-2">#</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.partNumber') }}</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.customerPartNumber') }}</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.awsPartNumber') }}</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.qty') }}</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.reservationId') }}</th>
|
||||
<th class="px-2.5 py-2">{{ t('chat.shippingNoticeUi.inventorySourceHint') }}</th>
|
||||
<th v-for="field in orderedLineFields" :key="field.field_code" class="px-2.5 py-2">{{ field.display_name }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -197,12 +208,7 @@ function issueReasonLabel(reason?: string | null): string {
|
||||
class="border-t border-default/60 text-xs"
|
||||
>
|
||||
<td class="px-2.5 py-2 text-muted">{{ index + 1 }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ displayValue(line.part_number) }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ displayValue(line.customer_part_number) }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ displayValue(line.aws_part_number) }}</td>
|
||||
<td class="px-2.5 py-2">{{ displayValue(line.qty) }}</td>
|
||||
<td class="px-2.5 py-2 font-mono">{{ displayValue(line.reservation_id) }}</td>
|
||||
<td class="px-2.5 py-2">{{ displayValue(line.inventory_source_hint) }}</td>
|
||||
<td v-for="field in orderedLineFields" :key="field.field_code" class="px-2.5 py-2" :class="{ 'font-mono': field.value_type === 'string' }">{{ displayValue((line as unknown as Record<string, unknown>)[field.field_code]) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user